X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fcancelgroupform.php;h=cfab7550c0b5a0d8698565c07f5aad24c46a8c18;hb=d1fc7c0774b4b8883f90c0202c67285ef34be322;hp=f945a847f79b58ea5dcafe9fe522b14009fbb8bc;hpb=942887ca8ce29f2cbb487d884a328d7fbbba2566;p=quix0rs-gnu-social.git diff --git a/lib/cancelgroupform.php b/lib/cancelgroupform.php index f945a847f7..cfab7550c0 100644 --- a/lib/cancelgroupform.php +++ b/lib/cancelgroupform.php @@ -28,11 +28,7 @@ * @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 CancelGroupForm extends Form { /** @@ -59,11 +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,10 +71,9 @@ class CancelGroupForm extends Form * * @return string ID of the form */ - function id() { - return 'group-cancel-' . $this->group->id; + return 'group-cancel-' . $this->group->getID(); } /** @@ -87,7 +81,6 @@ class CancelGroupForm extends Form * * @return string of the form class */ - function formClass() { return 'form_group_leave ajax'; @@ -98,15 +91,13 @@ class CancelGroupForm extends Form * * @return string URL of the action */ - 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); } /** @@ -114,9 +105,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')); } }