* @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
/**
* 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);
*/
function id()
{
- return 'group-cancel-' . $this->group->id;
+ return 'group-cancel-' . $this->group->getID();
}
/**
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);
}
/**
$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.
$this->clientError(_('No such group.'), 404);
}