Permalink
Browse files

Revert "All the hooks instroduced in 2.1 don't pass variables by ref …

…any more, while hooks already present in 2.0 will still pass by-ref [Issue #54]"

This reverts commit 99797a9.

Conflicts:

	Sources/Load.php
	Sources/ManageLanguages.php
	Sources/ManageSearch.php
  • Loading branch information...
1 parent f1a6c8e commit 8a78516ebc7dedb59dcbece4e32075e3d2fe3ef1 @emanuele45 emanuele45 committed Feb 23, 2013
View
@@ -760,7 +760,7 @@ function AdminSearchInternal()
array('ModifyPruningSettings', 'area=logs;sa=pruning'),
);
- call_integration_hook('integrate_admin_search', array($language_files, $include_files, $settings_search));
+ call_integration_hook('integrate_admin_search', array(&$language_files, &$include_files, &$settings_search));
loadLanguage(implode('+', $language_files));
@@ -938,7 +938,7 @@ function AdminLogs()
'pruning' => array('ManageSettings.php', 'ModifyPruningSettings'),
);
- call_integration_hook('integrate_manage_logs', array($log_functions));
+ call_integration_hook('integrate_manage_logs', array(&$log_functions));
$sub_action = isset($_REQUEST['sa']) && isset($log_functions[$_REQUEST['sa']]) && empty($log_functions[$_REQUEST['sa']]['disabled']) ? $_REQUEST['sa'] : 'errorlog';
// If it's not got a sa set it must have come here for first time, pretend error log should be reversed.
@@ -996,4 +996,4 @@ function AdminEndSession()
redirectexit('action=admin');
}
-?>
+?>
View
@@ -150,7 +150,7 @@ function Display()
);
$topic_selects = array();
$topic_tables = array();
- call_integration_hook('integrate_display_topic', array($topic_selects, $topic_tables, $topic_parameters));
+ call_integration_hook('integrate_display_topic', array(&$topic_selects, &$topic_tables, &$topic_parameters));
// @todo Why isn't this cached?
// @todo if we get id_board in this query and cache it, we can save a query on posting
@@ -979,7 +979,7 @@ function Display()
);
$msg_selects = array();
$msg_tables = array();
- call_integration_hook('integrate_query_message', array($msg_selects, $msg_tables, $msg_parameters));
+ call_integration_hook('integrate_query_message', array(&$msg_selects, &$msg_tables, &$msg_parameters));
// What? It's not like it *couldn't* be only guests in this topic...
if (!empty($posters))
@@ -1164,10 +1164,7 @@ function Display()
$context['mod_buttons'][] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
// Allow adding new mod buttons easily.
- // Note: $context['normal_buttons'] and $context['mod_buttons'] are added for backward compatibility with 2.0, but are deprecated and should not be used
- call_integration_hook('integrate_display_buttons', array($context['normal_buttons']));
- // Note: integrate_mod_buttons is no more necessary and deprecated, but is kept for backward compatibility with 2.0
- call_integration_hook('integrate_mod_buttons', array($context['mod_buttons']));
+ call_integration_hook('integrate_display_buttons');
}
/**
@@ -1295,7 +1292,7 @@ function prepareDisplayContext($reset = false)
if (!empty($output['modified']['name']))
$output['modified']['last_edit_text'] = sprintf($txt['last_edit_by'], $output['modified']['time'], $output['modified']['name']);
- call_integration_hook('integrate_prepare_display_context', array($output, $message));
+ call_integration_hook('integrate_prepare_display_context', array(&$output, &$message));
if (empty($options['view_newest_first']))
$counter++;
View
@@ -88,7 +88,7 @@ function log_error($error_message, $error_type = 'general', $file = null, $line
if (empty($tried_hook))
{
$tried_hook = true;
- call_integration_hook('integrate_error_types', array($other_error_types));
+ call_integration_hook('integrate_error_types', array(&$other_error_types));
$known_error_types += $other_error_types;
}
// Make sure the category that was specified is a valid one
View
@@ -944,7 +944,7 @@ function loadMemberData($users, $is_name = false, $set = 'normal')
}
// Allow mods to easily add to the selected member data
- call_integration_hook('integrate_load_member_data', array($select_columns, $select_tables, $set));
+ call_integration_hook('integrate_load_member_data', array(&$select_columns, &$select_tables, &$set));
if (!empty($users))
{
@@ -1238,7 +1238,7 @@ function loadMemberContext($user, $display_custom_fields = false)
}
}
- call_integration_hook('integrate_member_context', array($user, $display_custom_fields));
+ call_integration_hook('integrate_member_context', array(&$user, $display_custom_fields));
return true;
}
@@ -2586,7 +2586,7 @@ function cache_quick_get($key, $file, $function, $params, $level = 1)
// @todo Why are we doing this if caching is disabled?
if (function_exists('call_integration_hook'))
- call_integration_hook('pre_cache_quick_get', array($key, $file, $function, $params, $level));
+ call_integration_hook('pre_cache_quick_get', array(&$key, &$file, &$function, &$params, &$level));
/* Refresh the cache if either:
1. Caching is disabled.
@@ -2609,7 +2609,7 @@ function cache_quick_get($key, $file, $function, $params, $level = 1)
eval($cache_block['post_retri_eval']);
if (function_exists('call_integration_hook'))
- call_integration_hook('post_cache_quick_get', array($cache_block));
+ call_integration_hook('post_cache_quick_get', array(&$cache_block));
return $cache_block['data'];
}
@@ -2740,7 +2740,7 @@ function cache_put_data($key, $value, $ttl = 120)
}
if (function_exists('call_integration_hook'))
- call_integration_hook('cache_put_data', array($key, $value, $ttl));
+ call_integration_hook('cache_put_data', array(&$key, &$value, &$ttl));
if (isset($db_show_debug) && $db_show_debug === true)
$cache_hits[$cache_count]['t'] = array_sum(explode(' ', microtime())) - array_sum(explode(' ', $st));
@@ -2836,7 +2836,7 @@ function cache_get_data($key, $ttl = 120)
}
if (function_exists('call_integration_hook') && isset($value))
- call_integration_hook('cache_get_data', array($key, $ttl, $value));
+ call_integration_hook('cache_get_data', array(&$key, &$ttl, &$value));
return empty($value) ? null : @unserialize($value);
}
@@ -54,7 +54,7 @@ function ManageAttachments()
'transfer' => 'TransferAttachments',
);
- call_integration_hook('integrate_manage_attachments', array($subActions));
+ call_integration_hook('integrate_manage_attachments', array(&$subActions));
// Pick the correct sub-action.
if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]))
@@ -189,7 +189,7 @@ function ManageAttachmentSettings($return_config = false)
base_dir.addEventListener("change", toggleSubDir, false);
toggleSubDir();';
- call_integration_hook('integrate_modify_attachment_settings', array($config_vars));
+ call_integration_hook('integrate_modify_attachment_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
@@ -319,7 +319,7 @@ function ManageAvatarSettings($return_config = false)
array('text', 'custom_avatar_url', 40),
);
- call_integration_hook('integrate_modify_avatar_settings', array($config_vars));
+ call_integration_hook('integrate_modify_avatar_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
View
@@ -44,7 +44,7 @@ function Ban()
'log' => 'BanLog',
);
- call_integration_hook('integrate_manage_bans', array($subActions));
+ call_integration_hook('integrate_manage_bans', array(&$subActions));
// Default the sub-action to 'view ban list'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'list';
View
@@ -44,7 +44,7 @@ function ManageBoards()
'settings' => array('EditBoardSettings', 'admin_forum'),
);
- call_integration_hook('integrate_manage_boards', array($subActions));
+ call_integration_hook('integrate_manage_boards', array(&$subActions));
// Default to sub action 'main' or 'settings' depending on permissions.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('manage_boards') ? 'main' : 'settings');
@@ -804,7 +804,7 @@ function EditBoardSettings($return_config = false)
array('check', 'deny_boards_access'),
);
- call_integration_hook('integrate_modify_board_settings', array($config_vars));
+ call_integration_hook('integrate_modify_board_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
@@ -848,4 +848,4 @@ function EditBoardSettings($return_config = false)
prepareDBSettingContext($config_vars);
}
-?>
+?>
@@ -41,7 +41,7 @@ function ManageCalendar()
'settings' => 'ModifyCalendarSettings'
);
- call_integration_hook('integrate_manage_calendar', array($subActions));
+ call_integration_hook('integrate_manage_calendar', array(&$subActions));
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'holidays';
@@ -335,7 +335,7 @@ function ModifyCalendarSettings($return_config = false)
array('int', 'cal_maxspan', 6, 'postinput' => $txt['days_word']),
);
- call_integration_hook('integrate_modify_calendar_settings', array($config_vars));
+ call_integration_hook('integrate_modify_calendar_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
@@ -43,7 +43,7 @@ function ManageLanguages()
'editlang' => 'ModifyLanguage',
);
- call_integration_hook('integrate_manage_languages', array($subActions));
+ call_integration_hook('integrate_manage_languages', array(&$subActions));
// By default we're managing languages.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'edit';
@@ -807,7 +807,7 @@ function ModifyLanguageSettings($return_config = false)
array('userLanguage', $txt['userLanguage'], 'db', 'check', null, 'userLanguage'),
);
- call_integration_hook('integrate_language_settings', array($config_vars));
+ call_integration_hook('integrate_language_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
View
@@ -43,7 +43,7 @@ function ManageMail()
'settings' => 'ModifyMailSettings',
);
- call_integration_hook('integrate_manage_mail', array($subActions));
+ call_integration_hook('integrate_manage_mail', array(&$subActions));
// By default we want to browse
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'browse';
@@ -314,7 +314,7 @@ function ModifyMailSettings($return_config = false)
'birthday_body' => array('var_message', 'birthday_body', 'var_message' => nl2br($body), 'disabled' => true, 'size' => ceil(strlen($body) / 25)),
);
- call_integration_hook('integrate_modify_mail_settings', array($config_vars));
+ call_integration_hook('integrate_modify_mail_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
@@ -91,7 +91,7 @@ function ManageMaintenance()
),
);
- call_integration_hook('integrate_manage_maintenance', array($subActions));
+ call_integration_hook('integrate_manage_maintenance', array(&$subActions));
// Yep, sub-action time!
if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]))
@@ -40,7 +40,7 @@ function ModifyMembergroups()
'settings' => array('ModifyMembergroupsettings', 'admin_forum'),
);
- call_integration_hook('integrate_manage_membergroups', array($subActions));
+ call_integration_hook('integrate_manage_membergroups', array(&$subActions));
// Default to sub action 'index' or 'settings' depending on permissions.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('manage_membergroups') ? 'index' : 'settings');
@@ -1135,7 +1135,7 @@ function ModifyMembergroupsettings()
array('permissions', 'manage_membergroups'),
);
- call_integration_hook('integrate_modify_membergroup_settings', array($config_vars));
+ call_integration_hook('integrate_modify_membergroup_settings', array(&$config_vars));
if (isset($_REQUEST['save']))
{
@@ -37,7 +37,7 @@ function ViewMembers()
'query' => array('ViewMemberlist', 'moderate_forum'),
);
- call_integration_hook('integrate_manage_members', array($subActions));
+ call_integration_hook('integrate_manage_members', array(&$subActions));
// Default to sub action 'index' or 'settings' depending on permissions.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'all';
@@ -278,7 +278,7 @@ function ViewMemberlist()
'++' => '>'
);
- call_integration_hook('integrate_view_members_params', array($params));
+ call_integration_hook('integrate_view_members_params', array(&$params));
$search_params = array();
if ($context['sub_action'] == 'query' && !empty($_REQUEST['params']) && empty($_POST['types']))
View
@@ -41,7 +41,7 @@ function ManageNews()
'settings' => array('ModifyNewsSettings', 'admin_forum'),
);
- call_integration_hook('integrate_manage_news', array($subActions));
+ call_integration_hook('integrate_manage_news', array(&$subActions));
// Default to sub action 'main' or 'settings' depending on permissions.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('edit_news') ? 'editnews' : (allowedTo('send_mail') ? 'mailingmembers' : 'settings'));
@@ -1048,7 +1048,7 @@ function ModifyNewsSettings($return_config = false)
array('text', 'xmlnews_maxlen', 'subtext' => $txt['xmlnews_maxlen_note'], 10),
);
- call_integration_hook('integrate_modify_news_settings', array($config_vars));
+ call_integration_hook('integrate_modify_news_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
@@ -1086,4 +1086,4 @@ function ModifyNewsSettings($return_config = false)
prepareDBSettingContext($config_vars);
}
-?>
+?>
View
@@ -40,7 +40,7 @@ function ManagePaidSubscriptions()
'viewsub' => array('ViewSubscribedUsers', 'admin_forum'),
);
- call_integration_hook('integrate_manage_subscriptions', array($subActions));
+ call_integration_hook('integrate_manage_subscriptions', array(&$subActions));
// Default the sub-action to 'view subscriptions', but only if they have already set things up..
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (!empty($modSettings['paid_currency_symbol']) ? 'view' : 'settings');
@@ -44,7 +44,7 @@ function ModifyPermissions()
'settings' => array('GeneralPermissionSettings', 'admin_forum'),
);
- call_integration_hook('integrate_manage_permissions', array($subActions));
+ call_integration_hook('integrate_manage_permissions', array(&$subActions));
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) && empty($subActions[$_REQUEST['sa']]['disabled']) ? $_REQUEST['sa'] : (allowedTo('manage_permissions') ? 'index' : 'settings');
isAllowedTo($subActions[$_REQUEST['sa']][1]);
@@ -978,7 +978,7 @@ function GeneralPermissionSettings($return_config = false)
array('check', 'permission_enable_postgroups', 0, $txt['permission_settings_enable_postgroups'], 'help' => 'permissions_postgroups'),
);
- call_integration_hook('integrate_modify_permission_settings', array($config_vars));
+ call_integration_hook('integrate_modify_permission_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
@@ -2288,7 +2288,7 @@ function ModifyPostModeration()
'attachment' => array('post_attachment', 'post_unapproved_attachments'),
);
- call_integration_hook('integrate_post_moderation_mapping', array($mappings));
+ call_integration_hook('integrate_post_moderation_mapping', array(&$mappings));
// Start this with the guests/members.
$context['profile_groups'] = array(
View
@@ -38,7 +38,7 @@ function ManagePostSettings()
'topics' => 'ModifyTopicSettings',
);
- call_integration_hook('integrate_manage_posts', array($subActions));
+ call_integration_hook('integrate_manage_posts', array(&$subActions));
// Default the sub-action to 'posts'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'posts';
@@ -128,7 +128,7 @@ function SetCensor()
'censorIgnoreCase' => empty($_POST['censorIgnoreCase']) ? '0' : '1',
);
- call_integration_hook('integrate_save_censors', array($updates));
+ call_integration_hook('integrate_save_censors', array(&$updates));
updateSettings($updates);
}
@@ -200,7 +200,7 @@ function ModifyPostSettings($return_config = false)
array('int', 'preview_characters', 'subtext' => $txt['preview_characters_zero'], 'postinput' => $txt['preview_characters_units']),
);
- call_integration_hook('integrate_modify_post_settings', array($config_vars));
+ call_integration_hook('integrate_modify_post_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
@@ -275,7 +275,7 @@ function ModifyBBCSettings($return_config = false)
$context['settings_post_javascript'] = '
toggleBBCDisabled(\'disabledBBC\', ' . (empty($modSettings['enableBBC']) ? 'true' : 'false') . ');';
- call_integration_hook('integrate_modify_bbc_settings', array($config_vars));
+ call_integration_hook('integrate_modify_bbc_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
@@ -352,7 +352,7 @@ function ModifyTopicSettings($return_config = false)
);
- call_integration_hook('integrate_modify_topic_settings', array($config_vars));
+ call_integration_hook('integrate_modify_topic_settings', array(&$config_vars));
if ($return_config)
return $config_vars;
Oops, something went wrong.

0 comments on commit 8a78516

Please sign in to comment.