]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/adminpanelaction.php
Merge branch 'master' into social-master
[quix0rs-gnu-social.git] / lib / adminpanelaction.php
index 5e7e284b5cc52b18bac0d2e7ec8579b92b7a9444..af6e11a511487805f7c5aaf337c584f2d270fcd4 100644 (file)
@@ -60,16 +60,15 @@ class AdminPanelAction extends Action
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
         // User must be logged in.
 
         if (!common_logged_in()) {
-            // TRANS: Client error message thrown when trying to access the admin panel while not logged in.
+            // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
             $this->clientError(_('Not logged in.'));
-            return false;
         }
 
         $user = common_current_user();
@@ -94,7 +93,6 @@ class AdminPanelAction extends Action
         if (!$user->hasRight(Right::CONFIGURESITE)) {
             // TRANS: Client error message thrown when a user tries to change admin settings but has no access rights.
             $this->clientError(_('You cannot make changes to this site.'));
-            return false;
         }
 
         // This panel must be enabled
@@ -106,7 +104,6 @@ class AdminPanelAction extends Action
         if (!self::canAdmin($name)) {
             // TRANS: Client error message throw when a certain panel's settings cannot be changed.
             $this->clientError(_('Changes to that panel are not allowed.'), 403);
-            return false;
         }
 
         return true;
@@ -122,7 +119,7 @@ class AdminPanelAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $this->checkSessionToken();
@@ -220,7 +217,6 @@ class AdminPanelAction extends Action
     {
         // TRANS: Client error message.
         $this->clientError(_('showForm() not implemented.'));
-        return;
     }
 
     /**
@@ -248,36 +244,6 @@ class AdminPanelAction extends Action
     {
         // TRANS: Client error message
         $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__);
-                // TRANS: Client error message thrown if design settings could not be deleted in
-                // TRANS: the admin panel Design.
-                $this->clientError(_("Unable to delete design setting."));
-                return null;
-            }
-            return $result;
-        }
-
-        return null;
     }
 
     function canAdmin($name)