]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/UserFlag/clearflag.php
don't show empty tag links for bookmarks
[quix0rs-gnu-social.git] / plugins / UserFlag / clearflag.php
index 58151d33ce34d778588ea92aade3a4aa276e1273..feda29f1b7e564dc19c0c6ab76ea717992c07478 100644 (file)
@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-
 class ClearflagAction extends ProfileFormAction
 {
     /**
@@ -75,13 +74,12 @@ class ClearflagAction extends ProfileFormAction
      *
      * @return void
      */
-
     function handle($args)
     {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $this->handlePost();
             if (!$this->boolean('ajax')) {
-                $this->returnToArgs();
+                $this->returnToPrevious();
             }
         }
     }
@@ -89,9 +87,10 @@ class ClearflagAction extends ProfileFormAction
     /**
      * Handle POST
      *
+     * Executes the actions; deletes all flags
+     *
      * @return void
      */
-
     function handlePost()
     {
         $ufp = new User_flag_profile();
@@ -102,8 +101,10 @@ class ClearflagAction extends ProfileFormAction
                               'AND profile_id = ' . $this->profile->id);
 
         if ($result == false) {
-            throw new ServerException(sprintf(_("Couldn't clear flags for profile '%s'."),
-                                              $this->profile->nickname));
+            // TRANS: Server exception given when flags could not be cleared.
+            $msg = sprintf(_m('Couldn\'t clear flags for profile "%s".'),
+                           $this->profile->nickname);
+            throw new ServerException($msg);
         }
 
         $ufp->free();
@@ -113,17 +114,24 @@ class ClearflagAction extends ProfileFormAction
         }
     }
 
-    function ajaxResults() {
+    /**
+     * Return results in ajax form
+     *
+     * @return void
+     */
+    function ajaxResults()
+    {
         header('Content-Type: text/xml;charset=utf-8');
         $this->xw->startDocument('1.0', 'UTF-8');
         $this->elementStart('html');
         $this->elementStart('head');
-        $this->element('title', null, _('Flags cleared'));
+        // TRANS: Title for AJAX form to indicated that flags were removed.
+        $this->element('title', null, _m('Flags cleared'));
         $this->elementEnd('head');
         $this->elementStart('body');
-        $this->element('p', 'cleared', _('Cleared'));
+        // TRANS: Body element for "flags cleared" form.
+        $this->element('p', 'cleared', _m('Cleared'));
         $this->elementEnd('body');
         $this->elementEnd('html');
     }
 }
-