Merge branch 'develop' into 'master'

merge again upstream/master for 3.8.7

See merge request harukin/core!26
This commit is contained in:
harukin 2018-12-15 17:20:18 +09:00
commit bcb258bcbb
7 changed files with 108 additions and 49 deletions

View File

@ -1,3 +1,15 @@
Hubzilla 3.8.7 (2018-12-14)
- Fix issue with linkdropper in comment area
- Fix regression wit app ordering
- Fix return if readImnageBlob() throws an exception
- Introduce photo_view_filter hook
- Fix home notifications not expanding in certain situations
- Fix for dark schema
- Fix total identities restriction
- Fix article page title not updating if article has no title
- Gallery: the gallery app will now act as the full-size photo viewer in /photos if installed
Hubzilla 3.8.6 (2018-12-03) Hubzilla 3.8.6 (2018-12-03)
- Prevent incompatible export files (osada/zap) from being imported - Prevent incompatible export files (osada/zap) from being imported
- Catch exception if readImageBlob() receives bogus data - Catch exception if readImageBlob() receives bogus data

View File

@ -808,12 +808,14 @@ class Apps {
return($r); return($r);
} }
static public function app_order($uid,$apps) { static public function app_order($uid,$apps,$menu) {
if(! $apps) if(! $apps)
return $apps; return $apps;
$x = (($uid) ? get_pconfig($uid,'system','app_order') : get_config('system','app_order')); $conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order');
$x = (($uid) ? get_pconfig($uid,'system',$conf) : get_config('system',$conf));
if(($x) && (! is_array($x))) { if(($x) && (! is_array($x))) {
$y = explode(',',$x); $y = explode(',',$x);
$y = array_map('trim',$y); $y = array_map('trim',$y);
@ -850,19 +852,25 @@ class Apps {
return false; return false;
} }
static function moveup($uid,$guid) { static function moveup($uid,$guid,$menu) {
$syslist = array(); $syslist = array();
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
$conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order');
$list = self::app_list($uid, false, [ $menu ]);
if($list) { if($list) {
foreach($list as $li) { foreach($list as $li) {
$syslist[] = self::app_encode($li); $papp = self::app_encode($li);
if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false)
continue;
$syslist[] = $papp;
} }
} }
self::translate_system_apps($syslist); self::translate_system_apps($syslist);
usort($syslist,'self::app_name_compare'); usort($syslist,'self::app_name_compare');
$syslist = self::app_order($uid,$syslist); $syslist = self::app_order($uid,$syslist,$menu);
if(! $syslist) if(! $syslist)
return; return;
@ -887,23 +895,29 @@ class Apps {
$narr[] = $x['name']; $narr[] = $x['name'];
} }
set_pconfig($uid,'system','app_order',implode(',',$narr)); set_pconfig($uid,'system',$conf,implode(',',$narr));
} }
static function movedown($uid,$guid) { static function movedown($uid,$guid,$menu) {
$syslist = array(); $syslist = array();
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
$conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order');
$list = self::app_list($uid, false, [ $menu ]);
if($list) { if($list) {
foreach($list as $li) { foreach($list as $li) {
$syslist[] = self::app_encode($li); $papp = self::app_encode($li);
if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false)
continue;
$syslist[] = $papp;
} }
} }
self::translate_system_apps($syslist); self::translate_system_apps($syslist);
usort($syslist,'self::app_name_compare'); usort($syslist,'self::app_name_compare');
$syslist = self::app_order($uid,$syslist); $syslist = self::app_order($uid,$syslist,$menu);
if(! $syslist) if(! $syslist)
return; return;
@ -928,7 +942,7 @@ class Apps {
$narr[] = $x['name']; $narr[] = $x['name'];
} }
set_pconfig($uid,'system','app_order',implode(',',$narr)); set_pconfig($uid,'system',$conf,implode(',',$narr));
} }

View File

@ -90,12 +90,12 @@ class Appman extends \Zotlabs\Web\Controller {
$channel = \App::get_channel(); $channel = \App::get_channel();
if(argc() > 2) { if(argc() > 3) {
if(argv(2) === 'moveup') { if(argv(2) === 'moveup') {
Zlib\Apps::moveup(local_channel(),argv(1)); Zlib\Apps::moveup(local_channel(),argv(1),argv(3));
} }
if(argv(2) === 'movedown') { if(argv(2) === 'movedown') {
Zlib\Apps::movedown(local_channel(),argv(1)); Zlib\Apps::movedown(local_channel(),argv(1),argv(3));
} }
goaway(z_root() . '/apporder'); goaway(z_root() . '/apporder');
} }

View File

@ -17,27 +17,30 @@ class Apporder extends \Zotlabs\Web\Controller {
nav_set_selected('Order Apps'); nav_set_selected('Order Apps');
$syslist = array(); foreach( [ 'nav_featured_app', 'nav_pinned_app' ] as $l ) {
$list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']); $syslist = [];
$list = Zlib\Apps::app_list(local_channel(), false, [ $l ]);
if($list) { if($list) {
foreach($list as $li) { foreach($list as $li) {
$syslist[] = Zlib\Apps::app_encode($li); $syslist[] = Zlib\Apps::app_encode($li);
} }
} }
Zlib\Apps::translate_system_apps($syslist); Zlib\Apps::translate_system_apps($syslist);
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare'); usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
$syslist = Zlib\Apps::app_order(local_channel(),$syslist); $syslist = Zlib\Apps::app_order(local_channel(),$syslist, $l);
foreach($syslist as $app) { foreach($syslist as $app) {
if(strpos($app['categories'],'nav_pinned_app') !== false) { if($l === 'nav_pinned_app') {
$navbar_apps[] = Zlib\Apps::app_render($app,'nav-order'); $navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
} }
else { elseif(strpos($app['categories'],'nav_pinned_app') === false) {
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order'); $nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
} }
} }
}
return replace_macros(get_markup_template('apporder.tpl'), return replace_macros(get_markup_template('apporder.tpl'),
[ [

View File

@ -222,6 +222,9 @@ function nav($template = 'default') {
if(! $settings_url && isset(App::$nav_sel['settings_url'])) if(! $settings_url && isset(App::$nav_sel['settings_url']))
$settings_url = App::$nav_sel['settings_url']; $settings_url = App::$nav_sel['settings_url'];
$pinned_list = [];
$syslist = [];
//app bin //app bin
if($is_owner) { if($is_owner) {
if(get_pconfig(local_channel(), 'system','import_system_apps') !== datetime_convert('UTC','UTC','now','Y-m-d')) { if(get_pconfig(local_channel(), 'system','import_system_apps') !== datetime_convert('UTC','UTC','now','Y-m-d')) {
@ -234,14 +237,29 @@ function nav($template = 'default') {
set_pconfig(local_channel(), 'system','force_import_system_apps', STD_VERSION); set_pconfig(local_channel(), 'system','force_import_system_apps', STD_VERSION);
} }
$syslist = array(); $list = Apps::app_list(local_channel(), false, [ 'nav_pinned_app' ]);
$list = Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']); if($list) {
foreach($list as $li) {
$pinned_list[] = Apps::app_encode($li);
}
}
Apps::translate_system_apps($pinned_list);
usort($pinned_list,'Zotlabs\\Lib\\Apps::app_name_compare');
$pinned_list = Apps::app_order(local_channel(),$pinned_list, 'nav_pinned_app');
$syslist = [];
$list = Apps::app_list(local_channel(), false, [ 'nav_featured_app' ]);
if($list) { if($list) {
foreach($list as $li) { foreach($list as $li) {
$syslist[] = Apps::app_encode($li); $syslist[] = Apps::app_encode($li);
} }
} }
Apps::translate_system_apps($syslist); Apps::translate_system_apps($syslist);
} }
else { else {
$syslist = Apps::get_system_apps(true); $syslist = Apps::get_system_apps(true);
@ -249,29 +267,41 @@ function nav($template = 'default') {
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare'); usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
$syslist = Apps::app_order(local_channel(),$syslist); $syslist = Apps::app_order(local_channel(),$syslist, 'nav_featured_app');
if($pinned_list) {
foreach($pinned_list as $app) {
if(\App::$nav_sel['name'] == $app['name'])
$app['active'] = true;
if($is_owner) {
$navbar_apps[] = Apps::app_render($app,'navbar');
}
elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) {
$navbar_apps[] = Apps::app_render($app,'navbar');
}
}
}
if($syslist) {
foreach($syslist as $app) { foreach($syslist as $app) {
if(\App::$nav_sel['name'] == $app['name']) if(\App::$nav_sel['name'] == $app['name'])
$app['active'] = true; $app['active'] = true;
if($is_owner) { if($is_owner) {
if(strpos($app['categories'],'nav_pinned_app') !== false) { if(strpos($app['categories'],'nav_pinned_app') === false) {
$navbar_apps[] = Apps::app_render($app,'navbar');
}
else {
$nav_apps[] = Apps::app_render($app,'nav'); $nav_apps[] = Apps::app_render($app,'nav');
} }
} }
elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) { elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) {
if(strpos($app['categories'],'nav_pinned_app') !== false) { if(strpos($app['categories'],'nav_pinned_app') === false) {
$navbar_apps[] = Apps::app_render($app,'navbar');
}
else {
$nav_apps[] = Apps::app_render($app,'nav'); $nav_apps[] = Apps::app_render($app,'nav');
} }
} }
} }
}
$c = theme_include('navbar_' . purify_filename($template) . '.css'); $c = theme_include('navbar_' . purify_filename($template) . '.css');
$tpl = get_markup_template('navbar_' . purify_filename($template) . '.tpl'); $tpl = get_markup_template('navbar_' . purify_filename($template) . '.tpl');

View File

@ -31,8 +31,8 @@
<a class="dropdown-item{{if $app.active}} active{{/if}}" href="{{$app.url}}">{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}</a> <a class="dropdown-item{{if $app.active}} active{{/if}}" href="{{$app.url}}">{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}</a>
{{/if}} {{/if}}
{{if $order}} {{if $order}}
<a href="{{$hosturl}}appman/{{$app.guid}}/moveup" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-up"></i></a> <a href="{{$hosturl}}appman/{{$app.guid}}/moveup{{if $pinned}}/nav_pinned_app{{else}}/nav_featured_app{{/if}}" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-up"></i></a>
<a href="{{$hosturl}}appman/{{$app.guid}}/movedown" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-down"></i></a> <a href="{{$hosturl}}appman/{{$app.guid}}/movedown{{if $pinned}}/nav_pinned_app{{else}}/nav_featured_app{{/if}}" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-down"></i></a>
{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}<br> {{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}<br>
{{/if}} {{/if}}

View File

@ -219,7 +219,7 @@ var activeCommentText = '';
} }
function linkdropper(event) { function linkdropper(event) {
var linkFound = event.dataTransfer.types.contains("text/uri-list"); var linkFound = ((event.dataTransfer.types.indexOf("text/uri-list") > -1) ? true : false);
if(linkFound) { if(linkFound) {
event.preventDefault(); event.preventDefault();
var editwin = '#' + event.target.id; var editwin = '#' + event.target.id;
@ -256,7 +256,7 @@ var activeCommentText = '';
commentwin = ((editwin.indexOf('comment') >= 0) ? true : false); commentwin = ((editwin.indexOf('comment') >= 0) ? true : false);
if(commentwin) { if(commentwin) {
var commentid = editwin.substring(editwin.lastIndexOf('-') + 1); var commentid = editwin.substring(editwin.lastIndexOf('-') + 1);
commentOpen(document.getElementById(event.target.id),commentid); $("#comment-edit-text-" + commentid).addClass("expanded");
} }
} }