Merge branch 'dev' into gnusoc

This commit is contained in:
zotlabs 2017-01-06 12:24:26 -08:00
commit ba2d0fae0e
15 changed files with 3928 additions and 3741 deletions

View File

@ -78,6 +78,7 @@ class Editpost extends \Zotlabs\Web\Controller {
$x = array( $x = array(
'nickname' => $channel['channel_address'], 'nickname' => $channel['channel_address'],
'item' => $itm[0],
'editor_autocomplete'=> true, 'editor_autocomplete'=> true,
'bbco_autocomplete'=> 'bbcode', 'bbco_autocomplete'=> 'bbcode',
'return_path' => $_SESSION['return_url'], 'return_path' => $_SESSION['return_url'],

View File

@ -496,6 +496,11 @@ class Setup extends \Zotlabs\Web\Controller {
function check_funcs(&$checks) { function check_funcs(&$checks) {
$ck_funcs = array(); $ck_funcs = array();
$disabled = explode(',',ini_get('disable_functions'));
if($disabled)
array_walk($disabled,'array_trim');
// add check metadata, the real check is done bit later and return values set // add check metadata, the real check is done bit later and return values set
$this->check_add($ck_funcs, t('libCurl PHP module'), true, true); $this->check_add($ck_funcs, t('libCurl PHP module'), true, true);
$this->check_add($ck_funcs, t('GD graphics PHP module'), true, true); $this->check_add($ck_funcs, t('GD graphics PHP module'), true, true);
@ -511,13 +516,13 @@ class Setup extends \Zotlabs\Web\Controller {
$this->check_add($ck_funcs, t('Apache mod_rewrite module'), true, true); $this->check_add($ck_funcs, t('Apache mod_rewrite module'), true, true);
} }
} }
if((! function_exists('exec')) || strstr(ini_get('disable_functions'),'exec')) { if((! function_exists('exec')) || in_array('exec',$disabled)) {
$this->check_add($ck_funcs, t('exec'), false, true, t('Error: exec is required but is either not installed or has been disabled in php.ini')); $this->check_add($ck_funcs, t('exec'), false, true, t('Error: exec is required but is either not installed or has been disabled in php.ini'));
} }
else { else {
$this->check_add($ck_funcs, t('exec'), true, true); $this->check_add($ck_funcs, t('exec'), true, true);
} }
if((! function_exists('shell_exec')) || strstr(ini_get('disable_functions'),'shell_exec')) { if((! function_exists('shell_exec')) || in_array('shell_exec',$disabled)) {
$this->check_add($ck_funcs, t('shell_exec'), false, true, t('Error: shell_exec is required but is either not installed or has been disabled in php.ini')); $this->check_add($ck_funcs, t('shell_exec'), false, true, t('Error: shell_exec is required but is either not installed or has been disabled in php.ini'));
} }
else { else {

View File

@ -1396,11 +1396,11 @@ function status_editor($a, $x, $popup = false) {
'$setloc' => $setloc, '$setloc' => $setloc,
'$voting' => t('Toggle voting'), '$voting' => t('Toggle voting'),
'$feature_voting' => $feature_voting, '$feature_voting' => $feature_voting,
'$consensus' => 0, '$consensus' => ((array_key_exists('item',$x)) ? $x['item']['item_consensus'] : 0),
'$nocommenttitle' => t('Disable comments'), '$nocommenttitle' => t('Disable comments'),
'$nocommenttitlesub' => t('Toggle comments'), '$nocommenttitlesub' => t('Toggle comments'),
'$feature_nocomment' => $feature_nocomment, '$feature_nocomment' => $feature_nocomment,
'$nocomment' => 0, '$nocomment' => ((array_key_exists('item',$x)) ? $x['item']['item_nocomment'] : 0),
'$clearloc' => $clearloc, '$clearloc' => $clearloc,
'$title' => ((x($x, 'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''), '$title' => ((x($x, 'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''),
'$placeholdertitle' => ((x($x, 'placeholdertitle')) ? $x['placeholdertitle'] : t('Title (optional)')), '$placeholdertitle' => ((x($x, 'placeholdertitle')) ? $x['placeholdertitle'] : t('Title (optional)')),

View File

@ -127,12 +127,18 @@ function format_event_ical($ev) {
$o .= "\r\nDTSTART:" . datetime_convert('UTC','UTC', $ev['dtstart'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); $o .= "\r\nDTSTART:" . datetime_convert('UTC','UTC', $ev['dtstart'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : ''));
if($ev['dtend'] && ! $ev['nofinish']) if($ev['dtend'] && ! $ev['nofinish'])
$o .= "\r\nDTEND:" . datetime_convert('UTC','UTC', $ev['dtend'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); $o .= "\r\nDTEND:" . datetime_convert('UTC','UTC', $ev['dtend'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : ''));
if($ev['summary']) if($ev['summary']) {
$o .= "\r\nSUMMARY:" . format_ical_text($ev['summary']); $o .= "\r\nSUMMARY:" . format_ical_text($ev['summary']);
if($ev['location']) $o .= "\r\nX-ZOT-SUMMARY:" . format_ical_sourcetext($ev['summary']);
}
if($ev['location']) {
$o .= "\r\nLOCATION:" . format_ical_text($ev['location']); $o .= "\r\nLOCATION:" . format_ical_text($ev['location']);
if($ev['description']) $o .= "\r\nX-ZOT-LOCATION:" . format_ical_sourcetext($ev['location']);
}
if($ev['description']) {
$o .= "\r\nDESCRIPTION:" . format_ical_text($ev['description']); $o .= "\r\nDESCRIPTION:" . format_ical_text($ev['description']);
$o .= "\r\nX-ZOT-DESCRIPTION:" . format_ical_sourcetext($ev['description']);
}
if($ev['event_priority']) if($ev['event_priority'])
$o .= "\r\nPRIORITY:" . intval($ev['event_priority']); $o .= "\r\nPRIORITY:" . intval($ev['event_priority']);
$o .= "\r\nUID:" . $ev['event_hash'] ; $o .= "\r\nUID:" . $ev['event_hash'] ;
@ -154,8 +160,10 @@ function format_todo_ical($ev) {
$o .= "\r\nDTSTART:" . datetime_convert('UTC','UTC', $ev['dtstart'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); $o .= "\r\nDTSTART:" . datetime_convert('UTC','UTC', $ev['dtstart'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : ''));
if($ev['dtend'] && ! $ev['nofinish']) if($ev['dtend'] && ! $ev['nofinish'])
$o .= "\r\nDUE:" . datetime_convert('UTC','UTC', $ev['dtend'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); $o .= "\r\nDUE:" . datetime_convert('UTC','UTC', $ev['dtend'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : ''));
if($ev['summary']) if($ev['summary']) {
$o .= "\r\nSUMMARY:" . format_ical_text($ev['summary']); $o .= "\r\nSUMMARY:" . format_ical_text($ev['summary']);
$o .= "\r\nX-ZOT-SUMMARY:" . format_ical_sourcetext($ev['summary']);
}
if($ev['event_status']) { if($ev['event_status']) {
$o .= "\r\nSTATUS:" . $ev['event_status']; $o .= "\r\nSTATUS:" . $ev['event_status'];
if($ev['event_status'] === 'COMPLETED') if($ev['event_status'] === 'COMPLETED')
@ -165,10 +173,14 @@ function format_todo_ical($ev) {
$o .= "\r\nPERCENT-COMPLETE:" . $ev['event_percent']; $o .= "\r\nPERCENT-COMPLETE:" . $ev['event_percent'];
if(intval($ev['event_sequence'])) if(intval($ev['event_sequence']))
$o .= "\r\nSEQUENCE:" . $ev['event_sequence']; $o .= "\r\nSEQUENCE:" . $ev['event_sequence'];
if($ev['location']) if($ev['location']) {
$o .= "\r\nLOCATION:" . format_ical_text($ev['location']); $o .= "\r\nLOCATION:" . format_ical_text($ev['location']);
if($ev['description']) $o .= "\r\nX-ZOT-LOCATION:" . format_ical_sourcetext($ev['location']);
}
if($ev['description']) {
$o .= "\r\nDESCRIPTION:" . format_ical_text($ev['description']); $o .= "\r\nDESCRIPTION:" . format_ical_text($ev['description']);
$o .= "\r\nX-ZOT-DESCRIPTION:" . format_ical_sourcetext($ev['description']);
}
$o .= "\r\nUID:" . $ev['event_hash'] ; $o .= "\r\nUID:" . $ev['event_hash'] ;
if($ev['event_priority']) if($ev['event_priority'])
$o .= "\r\nPRIORITY:" . intval($ev['event_priority']); $o .= "\r\nPRIORITY:" . intval($ev['event_priority']);
@ -178,7 +190,6 @@ function format_todo_ical($ev) {
} }
function format_ical_text($s) { function format_ical_text($s) {
require_once('include/bbcode.php'); require_once('include/bbcode.php');
require_once('include/html2plain.php'); require_once('include/html2plain.php');
@ -186,6 +197,12 @@ function format_ical_text($s) {
$s = html2plain(bbcode($s)); $s = html2plain(bbcode($s));
$s = str_replace(["\r\n","\n"],["",""],$s); $s = str_replace(["\r\n","\n"],["",""],$s);
return(wordwrap(str_replace(['\\',',',';'],['\\\\','\\,','\\;'],$s),72,"\r\n ",true)); return(wordwrap(str_replace(['\\',',',';'],['\\\\','\\,','\\;'],$s),72,"\r\n ",true));
}
function format_ical_sourcetext($s) {
$s = base64_encode($s);
return(wordwrap(str_replace(['\\',',',';'],['\\\\','\\,','\\;'],$s),72,"\r\n ",true));
} }
@ -623,12 +640,21 @@ function event_import_ical($ical, $uid) {
$ev['edited'] = datetime_convert('UTC','UTC',$edited->format(\DateTime::W3C)); $ev['edited'] = datetime_convert('UTC','UTC',$edited->format(\DateTime::W3C));
} }
if(isset($ical->LOCATION)) if(isset($ical->{'X-ZOT-LOCATION'}))
$ev['location'] = event_ical_get_sourcetext( (string) $ical->{'X-ZOT-LOCATION'});
elseif(isset($ical->LOCATION))
$ev['location'] = (string) $ical->LOCATION; $ev['location'] = (string) $ical->LOCATION;
if(isset($ical->DESCRIPTION))
if(isset($ical->{'X-ZOT-DESCRIPTION'}))
$ev['description'] = event_ical_get_sourcetext( (string) $ical->{'X-ZOT-DESCRIPTION'});
elseif(isset($ical->DESCRIPTION))
$ev['description'] = (string) $ical->DESCRIPTION; $ev['description'] = (string) $ical->DESCRIPTION;
if(isset($ical->SUMMARY))
if(isset($ical->{'X-ZOT-SUMMARY'}))
$ev['summary'] = event_ical_get_sourcetext( (string) $ical->{'X-ZOT-SUMMARY'});
elseif(isset($ical->SUMMARY))
$ev['summary'] = (string) $ical->SUMMARY; $ev['summary'] = (string) $ical->SUMMARY;
if(isset($ical->PRIORITY)) if(isset($ical->PRIORITY))
$ev['event_priority'] = intval((string) $ical->PRIORITY); $ev['event_priority'] = intval((string) $ical->PRIORITY);
@ -663,6 +689,10 @@ function event_import_ical($ical, $uid) {
} }
function event_ical_get_sourcetext($s) {
return base64_decode($s);
}
function event_import_ical_task($ical, $uid) { function event_import_ical_task($ical, $uid) {
$c = q("select * from channel where channel_id = %d limit 1", $c = q("select * from channel where channel_id = %d limit 1",
@ -718,12 +748,21 @@ function event_import_ical_task($ical, $uid) {
$ev['edited'] = datetime_convert('UTC','UTC',$edited->format(\DateTime::W3C)); $ev['edited'] = datetime_convert('UTC','UTC',$edited->format(\DateTime::W3C));
} }
if(isset($ical->LOCATION)) if(isset($ical->{'X-ZOT-LOCATION'}))
$ev['location'] = event_ical_get_sourcetext( (string) $ical->{'X-ZOT-LOCATION'});
elseif(isset($ical->LOCATION))
$ev['location'] = (string) $ical->LOCATION; $ev['location'] = (string) $ical->LOCATION;
if(isset($ical->DESCRIPTION))
if(isset($ical->{'X-ZOT-DESCRIPTION'}))
$ev['description'] = event_ical_get_sourcetext( (string) $ical->{'X-ZOT-DESCRIPTION'});
elseif(isset($ical->DESCRIPTION))
$ev['description'] = (string) $ical->DESCRIPTION; $ev['description'] = (string) $ical->DESCRIPTION;
if(isset($ical->SUMMARY))
if(isset($ical->{'X-ZOT-SUMMARY'}))
$ev['summary'] = event_ical_get_sourcetext( (string) $ical->{'X-ZOT-SUMMARY'});
elseif(isset($ical->SUMMARY))
$ev['summary'] = (string) $ical->SUMMARY; $ev['summary'] = (string) $ical->SUMMARY;
if(isset($ical->PRIORITY)) if(isset($ical->PRIORITY))
$ev['event_priority'] = intval((string) $ical->PRIORITY); $ev['event_priority'] = intval((string) $ical->PRIORITY);

View File

@ -3120,3 +3120,9 @@ function cleanup_bbcode($body) {
return $body; return $body;
} }
// callback for array_walk
function array_trim(&$v,$k) {
$v = trim($v);
}

File diff suppressed because it is too large Load Diff

View File

@ -64,8 +64,9 @@ li:hover .widget-nav-pills-icons {
#note-text { #note-text {
padding: 5px; padding: 5px;
width: 100%; width: 100%;
resize: vertical; resize: none;
min-height: 250px; min-height: 250px;
overflow: hidden;
} }
/* saved searches */ /* saved searches */

View File

@ -10,7 +10,7 @@
<header><?php if(x($page,'header')) echo $page['header']; ?></header> <header><?php if(x($page,'header')) echo $page['header']; ?></header>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"><?php if(x($page,'nav')) echo $page['nav']; ?></nav> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"><?php if(x($page,'nav')) echo $page['nav']; ?></nav>
<main> <main>
<aside id="region_1"><div id="left_aside_wrapper"><?php if(x($page,'aside')) echo $page['aside']; ?></div></aside> <aside id="region_1"><div id="left_aside_spacer"><div id="left_aside_wrapper"><?php if(x($page,'aside')) echo $page['aside']; ?></div></div></aside>
<section id="region_2"><?php if(x($page,'content')) echo $page['content']; ?> <section id="region_2"><?php if(x($page,'content')) echo $page['content']; ?>
<div id="page-footer"></div> <div id="page-footer"></div>
<div id="pause"></div> <div id="pause"></div>

View File

@ -1669,8 +1669,8 @@ nav .dropdown-menu {
main.fullscreen { main.fullscreen {
left: 0px; left: 0px;
width: 100%; width: 100vw;
height: 100%; height: 100vh;
max-width: none; max-width: none;
} }

View File

@ -18,7 +18,9 @@ $(document).ready(function() {
if($(window).width() > 767) { if($(window).width() > 767) {
$('#left_aside_wrapper').stick_in_parent({ $('#left_aside_wrapper').stick_in_parent({
offset_top: $('nav').outerHeight(true) offset_top: $('nav').outerHeight(true),
parent: '#region_1',
spacer: '#left_aside_spacer'
}); });
} }
@ -30,6 +32,15 @@ $(document).ready(function() {
} }
}); });
var left_aside_height = $('#left_aside_wrapper').height();
$('#left_aside_wrapper').on('click', function() {
if(left_aside_height != $('#left_aside_wrapper').height()) {
$(document.body).trigger("sticky_kit:recalc");
left_aside_height = $('#left_aside_wrapper').height();
}
});
if($('#left_aside_wrapper').length && $('#left_aside_wrapper').html().length === 0) { if($('#left_aside_wrapper').length && $('#left_aside_wrapper').html().length === 0) {
$('#expand-aside').hide(); $('#expand-aside').hide();
} }
@ -96,7 +107,9 @@ function toggleAside() {
$('main').addClass('region_1-on') $('main').addClass('region_1-on')
$('<div id="overlay"></div>').appendTo('section'); $('<div id="overlay"></div>').appendTo('section');
$('#left_aside_wrapper').stick_in_parent({ $('#left_aside_wrapper').stick_in_parent({
offset_top: $('nav').outerHeight(true) offset_top: $('nav').outerHeight(true) - 10,
parent: '#region_1',
spacer: '#left_aside_spacer'
}); });
} }
} }

View File

@ -433,3 +433,26 @@ pre {
.contextual-help-tool i { .contextual-help-tool i {
color: $link_colour; color: $link_colour;
} }
.profile-match-wrapper {
width: 150px;
height: 120px;
border: none;
}
.profile-match-name {
width: 144px;
white-space: nowrap;
text-overflow: ellipsis;
}
.widget-nav-pills-icons:hover + a {
background-color: #222;
}
.widget-nav-pills-checkbox:hover + a {
background-color: #222;
}

View File

@ -297,3 +297,24 @@ pre {
top: 50px; top: 50px;
} }
.profile-match-wrapper {
width: 150px;
height: 120px;
border: none;
}
.profile-match-name {
width: 144px;
white-space: nowrap;
text-overflow: ellipsis;
}
.widget-nav-pills-icons:hover + a {
background-color: #F5F5F5;
}
.widget-nav-pills-checkbox:hover + a {
background-color: #F5F5F5;
}

View File

@ -383,3 +383,23 @@ pre {
.contextual-help-tool i { .contextual-help-tool i {
color: $link_colour; color: $link_colour;
} }
.profile-match-wrapper {
width: 150px;
height: 120px;
border: none;
}
.profile-match-name {
width: 144px;
white-space: nowrap;
text-overflow: ellipsis;
}
.widget-nav-pills-icons:hover + a {
background-color: #143D12;
}
.widget-nav-pills-checkbox:hover + a {
background-color: #143D12;
}

View File

@ -356,3 +356,24 @@ pre {
.contextual-help-tool i { .contextual-help-tool i {
color: $link_colour; color: $link_colour;
} }
.profile-match-wrapper {
width: 150px;
height: 120px;
border: none;
}
.profile-match-name {
width: 144px;
white-space: nowrap;
text-overflow: ellipsis;
}
.widget-nav-pills-icons:hover + a {
background-color: #030303;
}
.widget-nav-pills-checkbox:hover + a {
background-color: #030303;
}

View File

@ -5,9 +5,10 @@
var noteSaveTimer = null; var noteSaveTimer = null;
var noteText = $('#note-text'); var noteText = $('#note-text');
$(document).ready(function(){ noteText.on('change keyup keydown paste cut', function () {
noteText.height(noteText[0].scrollHeight); $(this).height(0).height(this.scrollHeight);
}); $(document.body).trigger("sticky_kit:recalc");
}).change();
$(document).on('focusout',"#note-text",function(e){ $(document).on('focusout',"#note-text",function(e){
if(noteSaveTimer) if(noteSaveTimer)