- added getter getGroup() for https://bugz.foocorp.net/T44
- added type-hints in method signatures
---------------------------------------------------------
WARNING: Some plugins attempt to get a property 'group' from (basicly) a Menu
class which does NOT have such property. This badly needs fixing.
---------------------------------------------------------
Signed-off-by: Roland Haeder <roland@mxchange.org>
+
+ function getGroup()
+ {
+ return $this->group;
+ }
}
class GroupAdminSection extends ProfileSection
}
class GroupAdminSection extends ProfileSection
*
* @param Action $action current action, used for output
*/
*
* @param Action $action current action, used for output
*/
- function __construct($action=null)
+ function __construct(Action $action=null)
{
parent::__construct($action);
{
parent::__construct($action);
- function item($actionName, $args, $label, $description, $id=null, $cls=null)
+ function item($actionName, array $args, $label, $description, $id=null, $cls=null)
{
if (empty($id)) {
$id = $this->menuItemID($actionName, $args);
{
if (empty($id)) {
$id = $this->menuItemID($actionName, $args);
- function isCurrent($actionName, $args)
+ function isCurrent($actionName, array $args)
{
if ($actionName != $this->actionName) {
return false;
{
if ($actionName != $this->actionName) {
return false;
*
* @param Action $action current action, used for output
*/
*
* @param Action $action current action, used for output
*/
- function __construct($action=null)
+ function __construct(Action $action=null)
{
parent::__construct($action);
$this->action = $action;
{
parent::__construct($action);
$this->action = $action;
*
* @param Action $action current action, used for output
*/
*
* @param Action $action current action, used for output
*/
- function __construct($action=null, $q = null)
+ function __construct(Action $action=null, $q = null)
{
parent::__construct($action);
$this->q = $q;
{
parent::__construct($action);
$this->q = $q;
* Construction
*
* @param Action $action current action, used for output
* Construction
*
* @param Action $action current action, used for output
+ * @param User $user Current user or NULL if "guest"
- function __construct($action=null, $user=null)
+ function __construct(Action $action=null, User $user=null)
{
parent::__construct($action);
$this->user = $user;
{
parent::__construct($action);
$this->user = $user;
* @param Net_URL_Mapper $m path-to-action mapper
* @return boolean hook return
*/
* @param Net_URL_Mapper $m path-to-action mapper
* @return boolean hook return
*/
- function onRouterInitialized($m)
+ function onRouterInitialized(Net_URL_Mapper $m)
{
$m->connect('group/:nickname/favorited',
array('action' => 'groupfavorited'),
{
$m->connect('group/:nickname/favorited',
array('action' => 'groupfavorited'),
- function onEndGroupGroupNav(GroupNav $nav)
+ function onEndGroupGroupNav(Menu $nav)
{
$action_name = $nav->action->trimmed('action');
$nickname = $nav->group->nickname;
{
$action_name = $nav->action->trimmed('action');
$nickname = $nav->group->nickname;
*
* @return boolean hook value
*/
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:GroupFavorited';
{
$url = 'http://status.net/wiki/Plugin:GroupFavorited';
- function onEndGroupGroupNav($groupnav)
+ function onEndGroupGroupNav(Menu $groupnav)
{
$action = $groupnav->action;
$group = $groupnav->group;
{
$action = $groupnav->action;
$group = $groupnav->group;
*
* @param GroupEditForm $form form being shown
*/
*
* @param GroupEditForm $form form being shown
*/
- function onEndGroupEditFormData($form)
+ function onEndGroupEditFormData(GroupEditForm $form)
- function onEndGroupSaveForm($action)
+ function onEndGroupSaveForm(GroupAction $action)
- if (!empty($action->group)) {
- $gps = Group_privacy_settings::getKV('group_id', $action->group->id);
+ if (!empty($action->getGroup())) {
+ $gps = Group_privacy_settings::getKV('group_id', $action->getGroup()->id);
}
$orig = null;
if (empty($gps)) {
$gps = new Group_privacy_settings();
}
$orig = null;
if (empty($gps)) {
$gps = new Group_privacy_settings();
- $gps->group_id = $action->group->id;
+ $gps->group_id = $action->getGroup()->id;
} else {
$orig = clone($gps);
}
} else {
$orig = clone($gps);
}
*
* @return boolean hook value
*/
*
* @return boolean hook value
*/
- function onStartInterpretCommand($cmd, $arg, $user, &$result)
+ function onStartInterpretCommand($cmd, $arg, User $user, &$result)
{
if ($cmd == 'd' || $cmd == 'dm') {
{
if ($cmd == 'd' || $cmd == 'dm') {
*
* @return boolean hook value
*/
*
* @return boolean hook value
*/
- function onEndGroupActionsList($widget, $group)
+ function onEndGroupActionsList(Widget $widget, User_group $group)
{
$cur = common_current_user();
$action = $widget->out;
{
$cur = common_current_user();
$action = $widget->out;
- function onStartNoticeSave(&$notice) {
+ function onStartNoticeSave(Notice &$notice) {
// Look for group tags
// FIXME: won't work for remote groups
// @fixme if Notice::saveNew is refactored so we can just pull its list
// Look for group tags
// FIXME: won't work for remote groups
// @fixme if Notice::saveNew is refactored so we can just pull its list
*
* @return boolean hook value
*/
*
* @return boolean hook value
*/
- function onEndGroupProfileElements($action, $group)
+ function onEndGroupProfileElements(Action $action, User_group $group)
{
$gps = Group_privacy_settings::forGroup($group);
{
$gps = Group_privacy_settings::forGroup($group);
- function onStartShowExportData($action)
+ function onStartShowExportData(GroupAction $action)
{
if ($action instanceof ShowgroupAction) {
{
if ($action instanceof ShowgroupAction) {
- $gps = Group_privacy_settings::forGroup($action->group);
+ $gps = Group_privacy_settings::forGroup($action->getGroup());
if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) {
return false;
if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) {
return false;