]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/groupdesignsettings.php
Fix help text for getvaliddaemons.php
[quix0rs-gnu-social.git] / actions / groupdesignsettings.php
index 7270bc8f7ecf7023c3accff952548953f3b3a61d..bb01243c6e7e8eb599563153a0a06a765d7c078c 100644 (file)
@@ -34,19 +34,37 @@ if (!defined('LACONICA')) {
 
 require_once INSTALLDIR . '/lib/designsettings.php';
 
+/**
+ * Set a group's design
+ *
+ * Saves a design for a given group
+ *
+ * @category Settings
+ * @package  Laconica
+ * @author   Zach Copley <zach@controlyourself.ca>
+ * @author   Sarven Capadisli <csarven@controlyourself.ca>
+ * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link     http://laconi.ca/
+ */
+
 class GroupDesignSettingsAction extends DesignSettingsAction
 {
     var $group = null;
 
     /**
-     * Prepare to run
+     * Sets the right action for the form, and passes request args into
+     * the base action
+     *
+     * @param array $args misc. arguments
+     *
+     * @return boolean true
      */
 
     function prepare($args)
     {
         parent::prepare($args);
 
-        if (!common_config('inboxes','enabled')) {
+        if (!common_config('inboxes', 'enabled')) {
             $this->serverError(_('Inboxes must be enabled for groups to work'));
             return false;
         }
@@ -57,7 +75,7 @@ class GroupDesignSettingsAction extends DesignSettingsAction
         }
 
         $nickname_arg = $this->trimmed('nickname');
-        $nickname = common_canonical_nickname($nickname_arg);
+        $nickname     = common_canonical_nickname($nickname_arg);
 
         // Permanent redirect on non-canonical nickname
 
@@ -158,7 +176,8 @@ class GroupDesignSettingsAction extends DesignSettingsAction
      * @return Design
      */
 
-    function getWorkingDesign() {
+    function getWorkingDesign()
+    {
 
         $design = null;
 
@@ -238,7 +257,6 @@ class GroupDesignSettingsAction extends DesignSettingsAction
             $design->sidebarcolor    = $sbcolor->intValue();
             $design->textcolor       = $tcolor->intValue();
             $design->linkcolor       = $lcolor->intValue();
-            $design->backgroundimage = $filepath;
 
             $design->setDisposition($on, $off, $tile);
 
@@ -263,7 +281,6 @@ class GroupDesignSettingsAction extends DesignSettingsAction
             $design->sidebarcolor    = $sbcolor->intValue();
             $design->textcolor       = $tcolor->intValue();
             $design->linkcolor       = $lcolor->intValue();
-            $design->backgroundimage = $filepath;
 
             $design->setDisposition($on, $off, $tile);
 
@@ -275,9 +292,9 @@ class GroupDesignSettingsAction extends DesignSettingsAction
                 return;
             }
 
-            $original = clone($this->group);
+            $original               = clone($this->group);
             $this->group->design_id = $id;
-            $result = $this->group->update($original);
+            $result                 = $this->group->update($original);
 
             if (empty($result)) {
                 common_log_db_error($original, 'UPDATE', __FILE__);
@@ -295,36 +312,4 @@ class GroupDesignSettingsAction extends DesignSettingsAction
         $this->showForm(_('Design preferences saved.'), true);
     }
 
-    /**
-     * Handle input and output a page (overrided)
-     *
-     * @param array $args $_REQUEST arguments
-     *
-     * @return void
-     */
-
-    function handle($args)
-    {
-        parent::handle($args);
-        if (!common_logged_in()) {
-            $this->clientError(_('Not logged in.'));
-            return;
-        } else if (!common_is_real_login()) {
-            // Cookie theft means that automatic logins can't
-            // change important settings or see private info, and
-            // _all_ our settings are important
-            common_set_returnto($this->selfUrl());
-            $user = common_current_user();
-            if ($user->hasOpenID()) {
-                common_redirect(common_local_url('openidlogin'), 303);
-            } else {
-                common_redirect(common_local_url('login'), 303);
-            }
-        } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
-            $this->handlePost();
-        } else {
-            $this->showForm();
-        }
-    }
-
 }