Cleanup stray PHP 4-style references in hook calls for navigation bars. We can't replace the live action from here, and don't need a reference to keep the object mutable. Dumping the references helps ensure we don't end up getting errors when things calling the hooks might forget to use the reference and the PHP error reporting settings expose this fact at us.
This commit is contained in:
parent
d0d1257d99
commit
56e2bc10d9
|
@ -96,7 +96,7 @@ class AccountSettingsNav extends Widget
|
||||||
$action_name = $this->action->trimmed('action');
|
$action_name = $this->action->trimmed('action');
|
||||||
$this->action->elementStart('ul', array('class' => 'nav'));
|
$this->action->elementStart('ul', array('class' => 'nav'));
|
||||||
|
|
||||||
if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
|
if (Event::handle('StartAccountSettingsNav', array($this->action))) {
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
if(Event::handle('StartAccountSettingsProfileMenuItem', array($this, &$menu))){
|
if(Event::handle('StartAccountSettingsProfileMenuItem', array($this, &$menu))){
|
||||||
|
@ -142,7 +142,7 @@ class AccountSettingsNav extends Widget
|
||||||
Event::handle('EndAccountSettingsOtherMenuItem', array($this, &$menu));
|
Event::handle('EndAccountSettingsOtherMenuItem', array($this, &$menu));
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::handle('EndAccountSettingsNav', array(&$this->action));
|
Event::handle('EndAccountSettingsNav', array($this->action));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->action->elementEnd('ul');
|
$this->action->elementEnd('ul');
|
||||||
|
|
|
@ -96,7 +96,7 @@ class ConnectSettingsNav extends Widget
|
||||||
$action_name = $this->action->trimmed('action');
|
$action_name = $this->action->trimmed('action');
|
||||||
$this->action->elementStart('ul', array('class' => 'nav'));
|
$this->action->elementStart('ul', array('class' => 'nav'));
|
||||||
|
|
||||||
if (Event::handle('StartConnectSettingsNav', array(&$this->action))) {
|
if (Event::handle('StartConnectSettingsNav', array($this->action))) {
|
||||||
|
|
||||||
# action => array('prompt', 'title')
|
# action => array('prompt', 'title')
|
||||||
$menu = array();
|
$menu = array();
|
||||||
|
@ -129,7 +129,7 @@ class ConnectSettingsNav extends Widget
|
||||||
$action_name === $menuaction);
|
$action_name === $menuaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::handle('EndConnectSettingsNav', array(&$this->action));
|
Event::handle('EndConnectSettingsNav', array($this->action));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->action->elementEnd('ul');
|
$this->action->elementEnd('ul');
|
||||||
|
|
|
@ -73,7 +73,7 @@ class LoginGroupNav extends Widget
|
||||||
|
|
||||||
$this->action->elementStart('ul', array('class' => 'nav'));
|
$this->action->elementStart('ul', array('class' => 'nav'));
|
||||||
|
|
||||||
if (Event::handle('StartLoginGroupNav', array(&$this->action))) {
|
if (Event::handle('StartLoginGroupNav', array($this->action))) {
|
||||||
|
|
||||||
$this->action->menuItem(common_local_url('login'),
|
$this->action->menuItem(common_local_url('login'),
|
||||||
_('Login'),
|
_('Login'),
|
||||||
|
@ -87,7 +87,7 @@ class LoginGroupNav extends Widget
|
||||||
$action_name === 'register');
|
$action_name === 'register');
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::handle('EndLoginGroupNav', array(&$this->action));
|
Event::handle('EndLoginGroupNav', array($this->action));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->action->elementEnd('ul');
|
$this->action->elementEnd('ul');
|
||||||
|
|
|
@ -242,7 +242,7 @@ class UserProfile extends Widget
|
||||||
$this->out->elementEnd('div');
|
$this->out->elementEnd('div');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Event::handle('StartProfilePageActionsSection', array(&$this->out, $this->profile))) {
|
if (Event::handle('StartProfilePageActionsSection', array($this->out, $this->profile))) {
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
|
|
||||||
|
@ -250,13 +250,13 @@ class UserProfile extends Widget
|
||||||
$this->out->element('h2', null, _('User actions'));
|
$this->out->element('h2', null, _('User actions'));
|
||||||
$this->out->elementStart('ul');
|
$this->out->elementStart('ul');
|
||||||
|
|
||||||
if (Event::handle('StartProfilePageActionsElements', array(&$this->out, $this->profile))) {
|
if (Event::handle('StartProfilePageActionsElements', array($this->out, $this->profile))) {
|
||||||
if (empty($cur)) { // not logged in
|
if (empty($cur)) { // not logged in
|
||||||
if (Event::handle('StartProfileRemoteSubscribe', array(&$this->out, $this->profile))) {
|
if (Event::handle('StartProfileRemoteSubscribe', array($this->out, $this->profile))) {
|
||||||
$this->out->elementStart('li', 'entity_subscribe');
|
$this->out->elementStart('li', 'entity_subscribe');
|
||||||
$this->showRemoteSubscribeLink();
|
$this->showRemoteSubscribeLink();
|
||||||
$this->out->elementEnd('li');
|
$this->out->elementEnd('li');
|
||||||
Event::handle('EndProfileRemoteSubscribe', array(&$this->out, $this->profile));
|
Event::handle('EndProfileRemoteSubscribe', array($this->out, $this->profile));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($cur->id == $this->profile->id) { // your own page
|
if ($cur->id == $this->profile->id) { // your own page
|
||||||
|
@ -376,13 +376,13 @@ class UserProfile extends Widget
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::handle('EndProfilePageActionsElements', array(&$this->out, $this->profile));
|
Event::handle('EndProfilePageActionsElements', array($this->out, $this->profile));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->out->elementEnd('ul');
|
$this->out->elementEnd('ul');
|
||||||
$this->out->elementEnd('div');
|
$this->out->elementEnd('div');
|
||||||
|
|
||||||
Event::handle('EndProfilePageActionsSection', array(&$this->out, $this->profile));
|
Event::handle('EndProfilePageActionsSection', array($this->out, $this->profile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEndLoginGroupNav(&$action)
|
function onEndLoginGroupNav($action)
|
||||||
{
|
{
|
||||||
$action_name = $action->trimmed('action');
|
$action_name = $action->trimmed('action');
|
||||||
|
|
||||||
|
|
|
@ -446,11 +446,11 @@ class FacebookPlugin extends Plugin
|
||||||
/*
|
/*
|
||||||
* Add a login tab for Facebook Connect
|
* Add a login tab for Facebook Connect
|
||||||
*
|
*
|
||||||
* @param Action &action the current action
|
* @param Action $action the current action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function onEndLoginGroupNav(&$action)
|
function onEndLoginGroupNav($action)
|
||||||
{
|
{
|
||||||
if (self::hasKeys()) {
|
if (self::hasKeys()) {
|
||||||
$action_name = $action->trimmed('action');
|
$action_name = $action->trimmed('action');
|
||||||
|
@ -470,11 +470,11 @@ class FacebookPlugin extends Plugin
|
||||||
/*
|
/*
|
||||||
* Add a tab for managing Facebook Connect settings
|
* Add a tab for managing Facebook Connect settings
|
||||||
*
|
*
|
||||||
* @param Action &action the current action
|
* @param Action $action the current action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function onEndConnectSettingsNav(&$action)
|
function onEndConnectSettingsNav($action)
|
||||||
{
|
{
|
||||||
if (self::hasKeys()) {
|
if (self::hasKeys()) {
|
||||||
$action_name = $action->trimmed('action');
|
$action_name = $action->trimmed('action');
|
||||||
|
|
|
@ -186,11 +186,11 @@ class FacebookBridgePlugin extends Plugin
|
||||||
* Add a login tab for Facebook, but only if there's a Facebook
|
* Add a login tab for Facebook, but only if there's a Facebook
|
||||||
* application defined for the plugin to use.
|
* application defined for the plugin to use.
|
||||||
*
|
*
|
||||||
* @param Action &action the current action
|
* @param Action $action the current action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function onEndLoginGroupNav(&$action)
|
function onEndLoginGroupNav($action)
|
||||||
{
|
{
|
||||||
$action_name = $action->trimmed('action');
|
$action_name = $action->trimmed('action');
|
||||||
|
|
||||||
|
@ -252,11 +252,11 @@ class FacebookBridgePlugin extends Plugin
|
||||||
* Add a tab for user-level Facebook settings if the user
|
* Add a tab for user-level Facebook settings if the user
|
||||||
* has a link to Facebook
|
* has a link to Facebook
|
||||||
*
|
*
|
||||||
* @param Action &action the current action
|
* @param Action $action the current action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function onEndConnectSettingsNav(&$action)
|
function onEndConnectSettingsNav($action)
|
||||||
{
|
{
|
||||||
if ($this->hasApplication()) {
|
if ($this->hasApplication()) {
|
||||||
$action_name = $action->trimmed('action');
|
$action_name = $action->trimmed('action');
|
||||||
|
|
|
@ -279,19 +279,19 @@ class NewMenuPlugin extends Plugin
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onStartAccountSettingsNav(&$action)
|
function onStartAccountSettingsNav($action)
|
||||||
{
|
{
|
||||||
$this->_settingsMenu($action);
|
$this->_settingsMenu($action);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onStartConnectSettingsNav(&$action)
|
function onStartConnectSettingsNav($action)
|
||||||
{
|
{
|
||||||
$this->_settingsMenu($action);
|
$this->_settingsMenu($action);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _settingsMenu(&$action)
|
private function _settingsMenu($action)
|
||||||
{
|
{
|
||||||
$actionName = $action->trimmed('action');
|
$actionName = $action->trimmed('action');
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ class NewMenuPlugin extends Plugin
|
||||||
_('Other options'),
|
_('Other options'),
|
||||||
$actionName == 'othersettings');
|
$actionName == 'othersettings');
|
||||||
|
|
||||||
Event::handle('EndAccountSettingsNav', array(&$action));
|
Event::handle('EndAccountSettingsNav', array($action));
|
||||||
|
|
||||||
if (common_config('xmpp', 'enabled')) {
|
if (common_config('xmpp', 'enabled')) {
|
||||||
$action->menuItem(common_local_url('imsettings'),
|
$action->menuItem(common_local_url('imsettings'),
|
||||||
|
@ -346,7 +346,7 @@ class NewMenuPlugin extends Plugin
|
||||||
_('Authorized connected applications'),
|
_('Authorized connected applications'),
|
||||||
$actionName == 'oauthconnectionsettings');
|
$actionName == 'oauthconnectionsettings');
|
||||||
|
|
||||||
Event::handle('EndConnectSettingsNav', array(&$action));
|
Event::handle('EndConnectSettingsNav', array($action));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEndShowStyles($action)
|
function onEndShowStyles($action)
|
||||||
|
|
|
@ -248,11 +248,11 @@ class OpenIDPlugin extends Plugin
|
||||||
*
|
*
|
||||||
* If we're in openidOnly mode, we disable the menu for all other login.
|
* If we're in openidOnly mode, we disable the menu for all other login.
|
||||||
*
|
*
|
||||||
* @param Action &$action Action being executed
|
* @param Action $action Action being executed
|
||||||
*
|
*
|
||||||
* @return boolean hook return
|
* @return boolean hook return
|
||||||
*/
|
*/
|
||||||
function onStartLoginGroupNav(&$action)
|
function onStartLoginGroupNav($action)
|
||||||
{
|
{
|
||||||
if (common_config('site', 'openidonly')) {
|
if (common_config('site', 'openidonly')) {
|
||||||
$this->showOpenIDLoginTab($action);
|
$this->showOpenIDLoginTab($action);
|
||||||
|
@ -268,11 +268,11 @@ class OpenIDPlugin extends Plugin
|
||||||
/**
|
/**
|
||||||
* Menu item for login
|
* Menu item for login
|
||||||
*
|
*
|
||||||
* @param Action &$action Action being executed
|
* @param Action $action Action being executed
|
||||||
*
|
*
|
||||||
* @return boolean hook return
|
* @return boolean hook return
|
||||||
*/
|
*/
|
||||||
function onEndLoginGroupNav(&$action)
|
function onEndLoginGroupNav($action)
|
||||||
{
|
{
|
||||||
$this->showOpenIDLoginTab($action);
|
$this->showOpenIDLoginTab($action);
|
||||||
|
|
||||||
|
@ -318,11 +318,11 @@ class OpenIDPlugin extends Plugin
|
||||||
/**
|
/**
|
||||||
* Menu item for OpenID settings
|
* Menu item for OpenID settings
|
||||||
*
|
*
|
||||||
* @param Action &$action Action being executed
|
* @param Action $action Action being executed
|
||||||
*
|
*
|
||||||
* @return boolean hook return
|
* @return boolean hook return
|
||||||
*/
|
*/
|
||||||
function onEndAccountSettingsNav(&$action)
|
function onEndAccountSettingsNav($action)
|
||||||
{
|
{
|
||||||
$action_name = $action->trimmed('action');
|
$action_name = $action->trimmed('action');
|
||||||
|
|
||||||
|
|
|
@ -137,11 +137,11 @@ class TwitterBridgePlugin extends Plugin
|
||||||
/*
|
/*
|
||||||
* Add a login tab for 'Sign in with Twitter'
|
* Add a login tab for 'Sign in with Twitter'
|
||||||
*
|
*
|
||||||
* @param Action &action the current action
|
* @param Action $action the current action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function onEndLoginGroupNav(&$action)
|
function onEndLoginGroupNav($action)
|
||||||
{
|
{
|
||||||
$action_name = $action->trimmed('action');
|
$action_name = $action->trimmed('action');
|
||||||
|
|
||||||
|
@ -160,11 +160,11 @@ class TwitterBridgePlugin extends Plugin
|
||||||
/**
|
/**
|
||||||
* Add the Twitter Settings page to the Connect Settings menu
|
* Add the Twitter Settings page to the Connect Settings menu
|
||||||
*
|
*
|
||||||
* @param Action &$action The calling page
|
* @param Action $action The calling page
|
||||||
*
|
*
|
||||||
* @return boolean hook return
|
* @return boolean hook return
|
||||||
*/
|
*/
|
||||||
function onEndConnectSettingsNav(&$action)
|
function onEndConnectSettingsNav($action)
|
||||||
{
|
{
|
||||||
if (self::hasKeys()) {
|
if (self::hasKeys()) {
|
||||||
$action_name = $action->trimmed('action');
|
$action_name = $action->trimmed('action');
|
||||||
|
|
|
@ -121,12 +121,12 @@ class UserFlagPlugin extends Plugin
|
||||||
/**
|
/**
|
||||||
* Add a 'flag' button to profile page
|
* Add a 'flag' button to profile page
|
||||||
*
|
*
|
||||||
* @param Action &$action The action being called
|
* @param Action $action The action being called
|
||||||
* @param Profile $profile Profile being shown
|
* @param Profile $profile Profile being shown
|
||||||
*
|
*
|
||||||
* @return boolean hook result
|
* @return boolean hook result
|
||||||
*/
|
*/
|
||||||
function onEndProfilePageActionsElements(&$action, $profile)
|
function onEndProfilePageActionsElements($action, $profile)
|
||||||
{
|
{
|
||||||
$this->showFlagButton($action, $profile,
|
$this->showFlagButton($action, $profile,
|
||||||
array('action' => 'showstream',
|
array('action' => 'showstream',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user