]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/cancelgroupform.php
Merged stuff from upstream/master
[quix0rs-gnu-social.git] / lib / cancelgroupform.php
index c328f358c80db91549cba1e2528aa0c9ee52e12b..cfab7550c0b5a0d8698565c07f5aad24c46a8c18 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
@@ -58,10 +54,11 @@ class CancelGroupForm extends Form
     /**
      * Constructor
      *
-     * @param HTMLOutputter $out   output channel
-     * @param group         $group group to leave
+     * @param HTMLOutputter $out        output channel
+     * @param User_group    $group      group to leave
+     * @param Profile       $profile    User profile this is meant for
      */
-    function __construct($out=null, $group=null, $profile=null)
+    function __construct(HTMLOutputter $out=null, User_group $group=null, Profile $profile=null)
     {
         parent::__construct($out);
 
@@ -76,7 +73,7 @@ class CancelGroupForm extends Form
      */
     function id()
     {
-        return 'group-cancel-' . $this->group->id;
+        return 'group-cancel-' . $this->group->getID();
     }
 
     /**
@@ -97,11 +94,10 @@ class CancelGroupForm extends Form
     function action()
     {
         $params = array();
-        if ($this->profile) {
-            $params['profile_id'] = $this->profile->id;
+        if ($this->profile instanceof Profile) {
+            $params['profile_id'] = $this->profile->getID();
         }
-        return common_local_url('cancelgroup',
-                                array('id' => $this->group->id), $params);
+        return common_local_url('cancelgroup', array('id' => $this->group->getID()), $params);
     }
 
     /**
@@ -112,6 +108,6 @@ class CancelGroupForm extends Form
     function formActions()
     {
         // TRANS: Submit button text on form to cancel group join request.
-        $this->out->submit('submit', _('BUTTON','Cancel join request'));
+        $this->out->submit('submit', _m('BUTTON','Cancel join request'));
     }
 }