X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fadminpanelaction.php;h=7997eb2b1f4b13a7db84f7c78fd3af07d0c44527;hb=69ac99ff949ab0118ff25a62471980ad0ec7a52b;hp=fa3272f8aad9656159e422e03a2bad95239b4ff3;hpb=691beefd0f3755bab195279b1c0d7cc583942b72;p=quix0rs-gnu-social.git diff --git a/lib/adminpanelaction.php b/lib/adminpanelaction.php index fa3272f8aa..7997eb2b1f 100644 --- a/lib/adminpanelaction.php +++ b/lib/adminpanelaction.php @@ -132,6 +132,21 @@ class AdminPanelAction extends Action $this->showPage(); } + /** + * Show tabset for this page + * + * Uses the AdminPanelNav widget + * + * @return void + * @see AdminPanelNav + */ + + function showLocalNav() + { + $nav = new AdminPanelNav($this); + $nav->show(); + } + /** * Show the content section of the page * @@ -209,4 +224,92 @@ class AdminPanelAction extends Action $this->clientError(_('saveSettings() not implemented.')); return; } + + /** + * Delete a design setting + * + * // XXX: Maybe this should go in Design? --Z + * + * @return mixed $result false if something didn't work + */ + + function deleteSetting($section, $setting) + { + $config = new Config(); + + $config->section = $section; + $config->setting = $setting; + + if ($config->find(true)) { + $result = $config->delete(); + if (!$result) { + common_log_db_error($config, 'DELETE', __FILE__); + $this->clientError(_("Unable to delete design setting.")); + return null; + } + } + + return $result; + } +} + +/** + * Menu for public group of actions + * + * @category Output + * @package StatusNet + * @author Evan Prodromou + * @author Sarven Capadisli + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + * + * @see Widget + */ + +class AdminPanelNav extends Widget +{ + var $action = null; + + /** + * Construction + * + * @param Action $action current action, used for output + */ + + function __construct($action=null) + { + parent::__construct($action); + $this->action = $action; + } + + /** + * Show the menu + * + * @return void + */ + + function show() + { + $action_name = $this->action->trimmed('action'); + + $this->action->elementStart('ul', array('class' => 'nav')); + + if (Event::handle('StartAdminPanelNav', array($this))) { + + $this->out->menuItem(common_local_url('siteadminpanel'), _('Site'), + _('Basic site configuration'), $action_name == 'siteadminpanel', 'nav_site_admin_panel'); + + $this->out->menuItem(common_local_url('designadminpanel'), _('Design'), + _('Design configuration'), $action_name == 'designadminpanel', 'nav_design_admin_panel'); + + $this->out->menuItem(common_local_url('useradminpanel'), _('User'), + _('Paths configuration'), $action_name == 'useradminpanel', 'nav_design_admin_panel'); + + $this->out->menuItem(common_local_url('pathsadminpanel'), _('Paths'), + _('Paths configuration'), $action_name == 'pathsadminpanel', 'nav_design_admin_panel'); + + Event::handle('EndAdminPanelNav', array($this)); + } + $this->action->elementEnd('ul'); + } }