Browse Source

Removed a couple of unsed things in the hooks report

Signed-off-by: emanuele <[email protected]>
emanuele 12 years ago
parent
commit
5e349de793
3 changed files with 12 additions and 40 deletions
  1. 9 1
      Sources/Admin.php
  2. 3 2
      Sources/ManageSettings.php
  3. 0 37
      Themes/default/Admin.template.php

+ 9 - 1
Sources/Admin.php

@@ -39,6 +39,14 @@ function AdminMain()
 
 	// Some preferences.
 	$context['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();
+	$context['hooks_exist'] = false;
+	foreach ($modSettings as $key => $setting)
+	if (strpos($key, 'integrate') === 0)
+		if (!empty($setting))
+		{
+			$context['hooks_exist'] = true;
+			break;
+		}
 
 	// Define all the menu structure - see Subs-Menu.php for details!
 	$admin_areas = array(
@@ -181,7 +189,7 @@ function AdminMain()
 					'function' => 'ModifyModSettings',
 					'icon' => 'modifications.png',
 					'subsections' => array(
-						'hooks' => array($txt['hooks_title_list']),
+						'hooks' => array($txt['hooks_title_list'], 'enabled' => $context['hooks_exist']),
 						'general' => array($txt['mods_cat_modifications_misc']),
 						// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:
 						// 'shout' => array($txt['shout']),

+ 3 - 2
Sources/ManageSettings.php

@@ -159,7 +159,7 @@ function ModifyModSettings()
 	// Make it easier for mods to add new areas.
 	call_integration_hook('integrate_modify_modifications', array(&$subActions));
 
-	loadGeneralSettingParameters($subActions, 'general');
+	loadGeneralSettingParameters($subActions, $context['hooks_exist'] ? 'hooks' : 'general');
 
 	// Load up all the tabs...
 	$context[$context['admin_menu_name']]['tab_data'] = array(
@@ -167,6 +167,8 @@ function ModifyModSettings()
 		'help' => 'modsettings',
 		'description' => $txt['modification_settings_desc'],
 		'tabs' => array(
+			'hooks' => array(
+			),
 			'general' => array(
 			),
 		),
@@ -2311,7 +2313,6 @@ function list_integration_hooks()
 
 	$context['page_title'] = $txt['hooks_title_list'];
 	$context['sub_template'] = 'show_list';
-	$context['template_layers'][] = 'integrationHooks';
 	$context['default_list'] = 'list_integration_hooks';
 }
 

+ 0 - 37
Themes/default/Admin.template.php

@@ -1714,41 +1714,4 @@ function template_clean_cache_button_below()
 	</div>';
 }
 
-
-function template_integrationHooks_above()
-{
-}
-function template_integrationHooks_below()
-{
-	global $context;
-
-	if (empty($context['hooks_filters']))
-		return;
-
-	echo '
-	<script type="text/javascript"><!-- // --><![CDATA[
-		var tblHeader = document.getElementById(\'' . $context['default_list'] . '\').getElementsByTagName(\'th\')[0];
-		tblHeader.innerHTML += ' . JavaScriptEscape($context['hooks_filters']) . ';
-
-		function integrationHooks_switchstatus(id)
-		{
-			var elem = document.getElementById(\'input_\'+id);
-			if (elem.value == \'enable\')
-				elem.value = \'disable\';
-			else if (elem.value == \'disable\')
-				elem.value = \'enable\';
-
-			document.forms["' . $context['default_list'] . '"].submit();
-		}
-
-		function integrationHooks_remove(id)
-		{
-			var elem = document.getElementById(\'input_\'+id);
-			elem.value = \'remove\';
-
-			document.forms["' . $context['default_list'] . '"].submit();
-		}
-	// ]]></script>';
-}
-
 ?>