]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/UserFlag/flagprofileform.php
Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x
[quix0rs-gnu-social.git] / plugins / UserFlag / flagprofileform.php
index a8396e2d573dc6414fd3a581e2288b16e6dd4e39..acb47629e27bf892676d47b7e8a127d5bf1cad77 100644 (file)
@@ -44,109 +44,48 @@ require_once INSTALLDIR.'/lib/form.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
-
-class FlagProfileForm extends Form
+class FlagProfileForm extends ProfileActionForm
 {
-    /**
-     * Profile of profile to flag
-     */
-
-    var $profile = null;
-
-    /**
-     * Return-to args
-     */
-
-    var $args = null;
-
-    /**
-     * Constructor
-     *
-     * @param HTMLOutputter $out     output channel
-     * @param Profile       $profile profile of user to flag
-     * @param array         $args    return-to args
-     */
-
-    function __construct($out=null, $profile=null, $args=null)
-    {
-        parent::__construct($out);
-
-        $this->profile = $profile;
-        $this->args    = $args;
-    }
-
-    /**
-     * ID of the form
-     *
-     * @return int ID of the form
-     */
-
-    function id()
-    {
-        return 'flagprofile-' . $this->profile->id;
-    }
-
     /**
      * class of the form
+     * Action this form provides
      *
      * @return string class of the form
      */
-
     function formClass()
     {
-        return 'form_entity_flag';
-    }
-
-    /**
-     * Action of the form
-     *
-     * @return string URL of the action
-     */
-
-    function action()
-    {
-        return common_local_url('flagprofile');
+        return 'form_entity_flag ajax';
     }
 
     /**
-     * Legend of the Form
+     * Action this form provides
      *
-     * @return void
+     * @return string Name of the action, lowercased.
      */
-    function formLegend()
+    function target()
     {
-        $this->out->element('legend', null, _('Flag profile for review'));
+        return 'flagprofile';
     }
 
     /**
-     * Data elements of the form
+     * Title of the form
      *
-     * @return void
+     * @return string Title of the form, internationalized
      */
-
-    function formData()
+    function title()
     {
-        // TODO: let the user choose a flag
-
-        $this->out->hidden('flagprofileto-' . $this->profile->id,
-                           $this->profile->id,
-                           'flagprofileto');
-
-        if ($this->args) {
-            foreach ($this->args as $k => $v) {
-                $this->out->hidden('returnto-' . $k, $v);
-            }
-        }
+        // TRANS: Form title for flagging a profile for review.
+        return _m('Flag');
     }
 
     /**
-     * Action elements
+     * Description of the form
      *
-     * @return void
+     * @return string description of the form, internationalized
      */
-
-    function formActions()
+    function description()
     {
-        $this->out->submit('submit', _('Flag'), 'submit', null, _('Flag profile for review'));
+        // TRANS: Form description.
+        return _m('Flag profile for review.');
     }
 }