streams/Zotlabs/Widget/Admin.php

73 lines
2.5 KiB
PHP
Raw Normal View History

2017-03-16 04:26:28 +00:00
<?php
namespace Zotlabs\Widget;
2021-12-02 22:33:36 +00:00
use App;
2021-12-02 23:02:31 +00:00
class Admin
{
2017-03-16 04:26:28 +00:00
2021-12-02 23:02:31 +00:00
public function widget($arr)
{
2017-03-16 04:26:28 +00:00
2021-12-02 23:02:31 +00:00
/*
* Side bar links
*/
2017-03-16 04:26:28 +00:00
2021-12-02 23:02:31 +00:00
if (!is_site_admin()) {
return '';
}
2017-03-16 04:26:28 +00:00
2021-12-02 23:02:31 +00:00
$o = '';
2017-03-16 04:26:28 +00:00
2021-12-02 23:02:31 +00:00
// array( url, name, extra css classes )
2017-03-16 04:26:28 +00:00
2021-12-02 23:02:31 +00:00
$aside = [
'site' => array(z_root() . '/admin/site/', t('Site'), 'site'),
2021-12-03 03:01:39 +00:00
// 'profile_photo' => array(z_root() . '/admin/profile_photo', t('Site icon/logo'), 'profile_photo'),
// 'cover_photo' => array(z_root() . '/admin/cover_photo', t('Site photo'), 'cover_photo'),
2021-12-02 23:02:31 +00:00
'accounts' => array(z_root() . '/admin/accounts/', t('Accounts'), 'accounts', 'pending-update', t('Member registrations waiting for confirmation')),
'channels' => array(z_root() . '/admin/channels/', t('Channels'), 'channels'),
'security' => array(z_root() . '/admin/security/', t('Security'), 'security'),
2021-12-03 03:01:39 +00:00
// 'features' => array(z_root() . '/admin/features/', t('Features'), 'features'),
2021-12-02 23:02:31 +00:00
'addons' => array(z_root() . '/admin/addons/', t('Addons'), 'addons'),
'themes' => array(z_root() . '/admin/themes/', t('Themes'), 'themes'),
'queue' => array(z_root() . '/admin/queue', t('Inspect queue'), 'queue'),
2021-12-03 03:01:39 +00:00
// 'profs' => array(z_root() . '/admin/profs', t('Profile Fields'), 'profs'),
2021-12-02 23:02:31 +00:00
'dbsync' => array(z_root() . '/admin/dbsync/', t('DB updates'), 'dbsync')
];
/* get plugins admin page */
$r = q("SELECT * FROM addon WHERE plugin_admin = 1");
$plugins = [];
if ($r) {
foreach ($r as $h) {
$plugin = $h['aname'];
$plugins[] = array(z_root() . '/admin/addons/' . $plugin, $plugin, 'plugin');
// temp plugins with admin
App::$plugins_admin[] = $plugin;
}
}
$logs = array(z_root() . '/admin/logs/', t('Logs'), 'logs');
$arr = array('links' => $aside, 'plugins' => $plugins, 'logs' => $logs);
call_hooks('admin_aside', $arr);
$o .= replace_macros(get_markup_template('admin_aside.tpl'), array(
'$admin' => $aside,
'$admtxt' => t('Admin'),
'$plugadmtxt' => t('Addon Features'),
'$plugins' => $plugins,
'$logtxt' => t('Logs'),
'$logs' => $logs,
'$h_pending' => t('Member registrations waiting for confirmation'),
'$admurl' => z_root() . '/admin/'
));
return $o;
}
2017-03-16 04:26:28 +00:00
}