]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/UserFlag/flagprofileform.php
Merge branch 'master' of git@gitorious.org:statusnet/mainline
[quix0rs-gnu-social.git] / plugins / UserFlag / flagprofileform.php
index d9f116e7f4d67b7acc818a167381a653a5beb088..c20929a20c8ca2d13d5421bc2cd5fd10136f7571 100644 (file)
@@ -45,107 +45,50 @@ require_once INSTALLDIR.'/lib/form.php';
  * @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_profile_flag';
+        return 'form_entity_flag';
     }
 
     /**
-     * Action of the form
+     * Action this form provides
      *
-     * @return string URL of the action
+     * @return string Name of the action, lowercased.
      */
 
-    function action()
+    function target()
     {
-        return common_local_url('flagprofile');
+        return 'flagprofile';
     }
 
     /**
-     * Legend of the Form
+     * Title of the form
      *
-     * @return void
+     * @return string Title of the form, internationalized
      */
-    function formLegend()
-    {
-        $this->out->element('legend', null, _('Flag this profile'));
-    }
 
-    /**
-     * Data elements of the form
-     *
-     * @return void
-     */
-
-    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);
-            }
-        }
+        return _('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 this profile'));
+        return _('Flag profile for review');
     }
 }