*
* @see UnsubscribeForm
*/
-
class CancelGroupForm extends Form
{
/**
*/
var $group = null;
+ var $profile = null;
/**
* Constructor
* @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;
}
/**
*
* @return string ID of the form
*/
-
function id()
{
return 'group-cancel-' . $this->group->id;
*
* @return string of the form class
*/
-
function formClass()
{
return 'form_group_leave ajax';
*
* @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);
}
/**
*
* @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'));
}
}