]> 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 b7790681d82c14041cb72cc611678347eb391309..1af5e8cfd0e400c4a3ea9b3ce9078087f8401941 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
  *
  * Form for blocking a user
  *
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * @category  Form
- * @package   Laconica
- * @author    Evan Prodromou <evan@controlyourself.ca>
- * @author    Sarven Capadisli <csarven@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @author    Sarven Capadisli <csarven@status.net>
+ * @copyright 2009 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link      http://laconi.ca/
+ * @link      http://status.net/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/lib/form.php';
-
 /**
  * Form for blocking a user
  *
  * @category Form
- * @package  Laconica
- * @author   Evan Prodromou <evan@controlyourself.ca>
- * @author   Sarven Capadisli <csarven@controlyourself.ca>
+ * @package  StatusNet
+ * @author   Evan Prodromou <evan@status.net>
+ * @author   Sarven Capadisli <csarven@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link     http://laconi.ca/
+ * @link     http://status.net/
  *
  * @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
+     * Action this form provides
      *
-     * @return int ID of the form
+     * @return string Name of the action, lowercased.
      */
 
-    function id()
+    function target()
     {
-        return 'block-' . $this->profile->id;
+        return 'block';
     }
 
-
-    /**
-     * class of the form
-     *
-     * @return string class of the form
-     */
-
-    function formClass()
-    {
-        return 'form_user_block';
-    }
-
-
     /**
-     * Action of the form
+     * Title of the form
      *
-     * @return string URL of the action
+     * @return string Title of the form, internationalized
      */
-
-    function action()
+    function title()
     {
-        return common_local_url('block');
+        // 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'));
+        // TRANS: Description of the form to block a user.
+        return _('Block this user');
     }
 }