]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/leaveform.php
Use ToSelector choice again.
[quix0rs-gnu-social.git] / lib / leaveform.php
index 5469b5704c0afcad57095b5b9bf52f38a786e6d6..9a4dc33f8e32066c03384012d63731e772c55b50 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/form.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Form for leaving a group
@@ -46,7 +42,6 @@ require_once INSTALLDIR.'/lib/form.php';
  *
  * @see      UnsubscribeForm
  */
-
 class LeaveForm extends Form
 {
     /**
@@ -59,10 +54,9 @@ class LeaveForm extends Form
      * Constructor
      *
      * @param HTMLOutputter $out   output channel
-     * @param group         $group group to leave
+     * @param User_group    $group group to leave
      */
-
-    function __construct($out=null, $group=null)
+    function __construct(HTMLOutputter $out=null, User_group $group=null)
     {
         parent::__construct($out);
 
@@ -74,10 +68,9 @@ class LeaveForm extends Form
      *
      * @return string ID of the form
      */
-
     function id()
     {
-        return 'group-leave-' . $this->group->id;
+        return 'group-leave-' . $this->group->getID();
     }
 
     /**
@@ -85,10 +78,9 @@ class LeaveForm extends Form
      *
      * @return string of the form class
      */
-
     function formClass()
     {
-        return 'form_group_leave';
+        return 'form_group_leave ajax';
     }
 
     /**
@@ -96,11 +88,9 @@ class LeaveForm extends Form
      *
      * @return string URL of the action
      */
-
     function action()
     {
-        return common_local_url('leavegroup',
-                                array('id' => $this->group->id));
+        return common_local_url('leavegroup', array('id' => $this->group->getID()));
     }
 
     /**
@@ -108,9 +98,9 @@ class LeaveForm extends Form
      *
      * @return void
      */
-
     function formActions()
     {
-        $this->out->submit('submit', _('Leave'));
+        // TRANS: Button text on form to leave a group.
+        $this->out->submit('submit', _m('BUTTON','Leave'));
     }
 }