]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/cancelgroupform.php
Merge branch 'master' into social-master
[quix0rs-gnu-social.git] / lib / cancelgroupform.php
index e71144f0edfcf9d9e06c5922ce7a758e5232b763..f4a44b5b5b029b2b3a1e23d26c7c82ab23adf965 100644 (file)
@@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/form.php';
  *
  * @see      UnsubscribeForm
  */
-
 class CancelGroupForm extends Form
 {
     /**
@@ -54,6 +53,7 @@ class CancelGroupForm extends Form
      */
 
     var $group = null;
+    var $profile = null;
 
     /**
      * Constructor
@@ -61,12 +61,12 @@ class CancelGroupForm extends Form
      * @param HTMLOutputter $out   output channel
      * @param group         $group group to leave
      */
-
-    function __construct($out=null, $group=null)
+    function __construct($out=null, $group=null, $profile=null)
     {
         parent::__construct($out);
 
         $this->group = $group;
+        $this->profile = $profile;
     }
 
     /**
@@ -74,7 +74,6 @@ class CancelGroupForm extends Form
      *
      * @return string ID of the form
      */
-
     function id()
     {
         return 'group-cancel-' . $this->group->id;
@@ -85,7 +84,6 @@ class CancelGroupForm extends Form
      *
      * @return string of the form class
      */
-
     function formClass()
     {
         return 'form_group_leave ajax';
@@ -96,11 +94,14 @@ class CancelGroupForm extends Form
      *
      * @return string URL of the action
      */
-
     function action()
     {
+        $params = array();
+        if ($this->profile) {
+            $params['profile_id'] = $this->profile->id;
+        }
         return common_local_url('cancelgroup',
-                                array('id' => $this->group->id));
+                                array('id' => $this->group->id), $params);
     }
 
     /**
@@ -108,9 +109,9 @@ class CancelGroupForm extends Form
      *
      * @return void
      */
-
     function formActions()
     {
-        $this->out->submit('submit', _('Cancel join request'));
+        // TRANS: Submit button text on form to cancel group join request.
+        $this->out->submit('submit', _m('BUTTON','Cancel join request'));
     }
 }