CancelGroupForm gets same typing as Join and Leave
This commit is contained in:
parent
fbec7c4e75
commit
55aa68b941
@ -28,11 +28,7 @@
|
|||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('STATUSNET') && !defined('LACONICA')) {
|
if (!defined('GNUSOCIAL')) { exit(1); }
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once INSTALLDIR.'/lib/form.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form for leaving a group
|
* Form for leaving a group
|
||||||
@ -58,10 +54,11 @@ class CancelGroupForm extends Form
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param HTMLOutputter $out output channel
|
* @param HTMLOutputter $out output channel
|
||||||
* @param group $group group to leave
|
* @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);
|
parent::__construct($out);
|
||||||
|
|
||||||
@ -76,7 +73,7 @@ class CancelGroupForm extends Form
|
|||||||
*/
|
*/
|
||||||
function id()
|
function id()
|
||||||
{
|
{
|
||||||
return 'group-cancel-' . $this->group->id;
|
return 'group-cancel-' . $this->group->getID();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -97,11 +94,10 @@ class CancelGroupForm extends Form
|
|||||||
function action()
|
function action()
|
||||||
{
|
{
|
||||||
$params = array();
|
$params = array();
|
||||||
if ($this->profile) {
|
if ($this->profile instanceof Profile) {
|
||||||
$params['profile_id'] = $this->profile->id;
|
$params['profile_id'] = $this->profile->getID();
|
||||||
}
|
}
|
||||||
return common_local_url('cancelgroup',
|
return common_local_url('cancelgroup', array('id' => $this->group->getID()), $params);
|
||||||
array('id' => $this->group->id), $params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,7 +85,7 @@ class GroupAction extends Action
|
|||||||
|
|
||||||
$this->group = User_group::getKV('id', $local->group_id);
|
$this->group = User_group::getKV('id', $local->group_id);
|
||||||
|
|
||||||
if (!$this->group) {
|
if (!$this->group instanceof User_group) {
|
||||||
// TRANS: Client error displayed if no local group with a given name was found requesting group page.
|
// TRANS: Client error displayed if no local group with a given name was found requesting group page.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user