code optimisation

This commit is contained in:
redmatrix
2016-06-20 20:34:19 -07:00
parent 9c9d6363af
commit ed16660867
4 changed files with 13 additions and 30 deletions

View File

@@ -27,27 +27,11 @@ class Siteinfo extends \Zotlabs\Web\Controller {
else {
$version = $commit = '';
}
$visible_plugins = array();
if(is_array(\App::$plugins) && count(\App::$plugins)) {
$r = q("select * from addon where hidden = 0");
if(count($r))
foreach($r as $rr)
$visible_plugins[] = $rr['aname'];
}
$plugins_list = '';
if(count($visible_plugins)) {
$plugins_text = t('Installed plugins/addons/apps:');
$sorted = $visible_plugins;
$s = '';
sort($sorted);
foreach($sorted as $p) {
if(strlen($p)) {
if(strlen($s)) $s .= ', ';
$s .= $p;
}
}
$plugins_list .= $s;
}
$plugins_list = implode(', ',visible_plugin_list());
if($plugins_list)
$plugins_text = t('Installed plugins/addons/apps:');
else
$plugins_text = t('No installed plugins/addons/apps');