]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/blockform.php
If there's no Happening, we can't use the RSVP.
[quix0rs-gnu-social.git] / lib / blockform.php
index cfec321a18732a39dbd55c61359c1721435507cc..1af5e8cfd0e400c4a3ea9b3ce9078087f8401941 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/lib/form.php';
-
 /**
  * Form for blocking a user
  *
@@ -46,110 +44,38 @@ require_once INSTALLDIR.'/lib/form.php';
  *
  * @see      UnblockForm
  */
-
-class BlockForm extends Form
+class BlockForm extends ProfileActionForm
 {
     /**
-     * Profile of user to block
-     */
-
-    var $profile = null;
-
-    /**
-     * Return-to args
-     */
-
-    var $args = null;
-
-    /**
-     * Constructor
-     *
-     * @param HTMLOutputter $out     output channel
-     * @param Profile       $profile profile of user to block
-     * @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 'block-' . $this->profile->id;
-    }
-
-
-    /**
-     * class of the form
-     *
-     * @return string class of the form
-     */
-
-    function formClass()
-    {
-        return 'form_user_block';
-    }
-
-
-    /**
-     * 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('block');
+        return 'block';
     }
 
-
     /**
-     * Legend of the Form
+     * Title of the form
      *
-     * @return void
+     * @return string Title of the form, internationalized
      */
-    function formLegend()
+    function title()
     {
-        $this->out->element('legend', null, _('Block this user'));
+        // TRANS: Title for the form to block a user.
+        return _('Block');
     }
 
-
     /**
-     * Data elements of the form
+     * Description of the form
      *
-     * @return void
+     * @return string description of the form, internationalized
      */
-
-    function formData()
-    {
-        $this->out->hidden('blockto-' . $this->profile->id,
-                           $this->profile->id,
-                           'blockto');
-        if ($this->args) {
-            foreach ($this->args as $k => $v) {
-                $this->out->hidden('returnto-' . $k, $v);
-            }
-        }
-    }
-
-    /**
-     * Action elements
-     *
-     * @return void
-     */
-
-    function formActions()
+    function description()
     {
-        $this->out->submit('submit', _('Block'), 'submit', null, _('Block this user'));
+        // TRANS: Description of the form to block a user.
+        return _('Block this user');
     }
 }