|
@@ -1914,7 +1914,7 @@ function MaintainMassMoveTopics()
|
|
{
|
|
{
|
|
$conditions .= '
|
|
$conditions .= '
|
|
AND t.locked = {int:locked}';
|
|
AND t.locked = {int:locked}';
|
|
- $params['locked'] = 1;
|
|
+ $params['locked'] = 1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2175,7 +2175,7 @@ function MaintainRecountPosts()
|
|
|
|
|
|
* Generates a list of integration hooks for display
|
|
* Generates a list of integration hooks for display
|
|
* Accessed through ?action=admin;area=maintain;sa=hooks;
|
|
* Accessed through ?action=admin;area=maintain;sa=hooks;
|
|
- * Allows for removal or disabing of selected hooks
|
|
+ * Allows for removal or disabling of selected hooks
|
|
*/
|
|
*/
|
|
function list_integration_hooks()
|
|
function list_integration_hooks()
|
|
{
|
|
{
|
|
@@ -2254,7 +2254,7 @@ function list_integration_hooks()
|
|
global $txt;
|
|
global $txt;
|
|
|
|
|
|
if (!empty($data[\'included_file\']))
|
|
if (!empty($data[\'included_file\']))
|
|
- return $txt[\'hooks_field_function\'] . \': \' . $data[\'real_function\'] . \'<br />\' . $txt[\'hooks_field_included_file\'] . \': \' . $data[\'included_file\'];
|
|
+ return $txt[\'hooks_field_function\'] . \': \' . $data[\'real_function\'] . \'<br />\' . $txt[\'hooks_field_included_file\'] . \': \' . $data[\'included_file\'] . (!empty($data[\'instance\']) ? \'<br>\'. $txt[\'hooks_field_function_method\'] : \'\');
|
|
else
|
|
else
|
|
return $data[\'real_function\'];
|
|
return $data[\'real_function\'];
|
|
'),
|
|
'),
|
|
@@ -2350,7 +2350,7 @@ function list_integration_hooks()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- * Gets all of the files in a directory and its chidren directories
|
|
+ * Gets all of the files in a directory and its children directories
|
|
*
|
|
*
|
|
* @param type $dir_path
|
|
* @param type $dir_path
|
|
* @return array
|
|
* @return array
|
|
@@ -2409,6 +2409,14 @@ function get_integration_hooks_data($start, $per_page, $sort)
|
|
{
|
|
{
|
|
foreach ($functions as $function_o)
|
|
foreach ($functions as $function_o)
|
|
{
|
|
{
|
|
|
|
+ $object = false;
|
|
|
|
+
|
|
|
|
+ if (strpos($function_o, '#') !== false)
|
|
|
|
+ {
|
|
|
|
+ $function_o = str_replace('#', '', $function_o);
|
|
|
|
+ $object = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
$hook_name = str_replace(']', '', $function_o);
|
|
$hook_name = str_replace(']', '', $function_o);
|
|
if (strpos($hook_name, '::') !== false)
|
|
if (strpos($hook_name, '::') !== false)
|
|
{
|
|
{
|
|
@@ -2417,6 +2425,7 @@ function get_integration_hooks_data($start, $per_page, $sort)
|
|
}
|
|
}
|
|
else
|
|
else
|
|
$function = $hook_name;
|
|
$function = $hook_name;
|
|
|
|
+
|
|
$function = explode(':', $function);
|
|
$function = explode(':', $function);
|
|
$function = $function[0];
|
|
$function = $function[0];
|
|
|
|
|
|
@@ -2429,8 +2438,10 @@ function get_integration_hooks_data($start, $per_page, $sort)
|
|
}
|
|
}
|
|
elseif (strpos(str_replace(' (', '(', $fc), 'function ' . trim($function) . '(') !== false)
|
|
elseif (strpos(str_replace(' (', '(', $fc), 'function ' . trim($function) . '(') !== false)
|
|
{
|
|
{
|
|
- $hook_status[$hook][$hook_name]['exists'] = true;
|
|
+ $hook_status[$hook][$function]['exists'] = true;
|
|
- $hook_status[$hook][$hook_name]['in_file'] = $file['name'];
|
|
+ $hook_status[$hook][$function]['in_file'] = $file['name'];
|
|
|
|
+ $hook_status[$hook][$function]['instance'] = $object;
|
|
|
|
+
|
|
|
|
|
|
$temp_data['function'][$file['name']][] = $function_o;
|
|
$temp_data['function'][$file['name']][] = $function_o;
|
|
unset($temp_hooks[$hook][$function_o]);
|
|
unset($temp_hooks[$hook][$function_o]);
|
|
@@ -2497,11 +2508,12 @@ function get_integration_hooks_data($start, $per_page, $sort)
|
|
{
|
|
{
|
|
foreach ($functions as $function)
|
|
foreach ($functions as $function)
|
|
{
|
|
{
|
|
|
|
+
|
|
|
|
+ if (strpos($function, '#') !== false)
|
|
|
|
+ $function = str_replace('#', '', $function);
|
|
|
|
+
|
|
$enabled = strstr($function, ']') === false;
|
|
$enabled = strstr($function, ']') === false;
|
|
$function = str_replace(']', '', $function);
|
|
$function = str_replace(']', '', $function);
|
|
- $hook_exists = !empty($hook_status[$hook][$function]['exists']);
|
|
|
|
- $file_name = isset($hook_status[$hook][$function]['in_file']) ? $hook_status[$hook][$function]['in_file'] : ((substr($hook, -8) === '_include') ? 'zzzzzzzzz' : 'zzzzzzzza');
|
|
|
|
- $sort[] = $$sort_options[0];
|
|
|
|
|
|
|
|
if (strpos($function, '::') !== false)
|
|
if (strpos($function, '::') !== false)
|
|
{
|
|
{
|
|
@@ -2510,13 +2522,18 @@ function get_integration_hooks_data($start, $per_page, $sort)
|
|
}
|
|
}
|
|
$exploded = explode(':', $function);
|
|
$exploded = explode(':', $function);
|
|
|
|
|
|
|
|
+ $hook_exists = !empty($hook_status[$hook][$exploded[0]]['exists']);
|
|
|
|
+ $file_name = isset($hook_status[$hook][$exploded[0]]['in_file']) ? $hook_status[$hook][$exploded[0]]['in_file'] : ((substr($hook, -8) === '_include') ? 'zzzzzzzzz' : 'zzzzzzzza');
|
|
|
|
+ $sort[] = $$sort_options[0];
|
|
|
|
+
|
|
$temp_data[] = array(
|
|
$temp_data[] = array(
|
|
'id' => 'hookid_' . $id++,
|
|
'id' => 'hookid_' . $id++,
|
|
'hook_name' => $hook,
|
|
'hook_name' => $hook,
|
|
'function_name' => $function,
|
|
'function_name' => $function,
|
|
'real_function' => $exploded[0],
|
|
'real_function' => $exploded[0],
|
|
'included_file' => isset($exploded[1]) ? strtr(trim($exploded[1]), array('$boarddir' => $boarddir, '$sourcedir' => $sourcedir, '$themedir' => $settings['theme_dir'])) : '',
|
|
'included_file' => isset($exploded[1]) ? strtr(trim($exploded[1]), array('$boarddir' => $boarddir, '$sourcedir' => $sourcedir, '$themedir' => $settings['theme_dir'])) : '',
|
|
- 'file_name' => (isset($hook_status[$hook][$function]['in_file']) ? $hook_status[$hook][$function]['in_file'] : ''),
|
|
+ 'file_name' => (isset($hook_status[$hook][$exploded[0]]['in_file']) ? $hook_status[$hook][$exploded[0]]['in_file'] : ''),
|
|
|
|
+ 'instance' => (isset($hook_status[$hook][$exploded[0]]['instance']) ? $hook_status[$hook][$exploded[0]]['instance'] : ''),
|
|
'hook_exists' => $hook_exists,
|
|
'hook_exists' => $hook_exists,
|
|
'status' => $hook_exists ? ($enabled ? 'allow' : 'moderate') : 'deny',
|
|
'status' => $hook_exists ? ($enabled ? 'allow' : 'moderate') : 'deny',
|
|
'img_text' => $txt['hooks_' . ($hook_exists ? ($enabled ? 'active' : 'disabled') : 'missing')],
|
|
'img_text' => $txt['hooks_' . ($hook_exists ? ($enabled ? 'active' : 'disabled') : 'missing')],
|
|
@@ -2546,8 +2563,8 @@ function get_integration_hooks_data($start, $per_page, $sort)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- * Simply returns the total count of integraion hooks
|
|
+ * Simply returns the total count of integration hooks
|
|
- * Used but the intergation hooks list function (list_integration_hooks)
|
|
+ * Used by the integration hooks list function (list_integration_hooks)
|
|
*
|
|
*
|
|
* @global type $context
|
|
* @global type $context
|
|
* @return int
|
|
* @return int
|