Explorar o código

! core features images set in ManageSettings instead of template, added check if images exist in custom theme folder and if not uses the default one

emanuele %!s(int64=12) %!d(string=hai) anos
pai
achega
5661b3b6cc
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      Sources/ManageSettings.php
  2. 1 1
      Themes/default/Admin.template.php

+ 1 - 1
Sources/ManageSettings.php

@@ -175,7 +175,6 @@ function ModifyCoreFeatures($return_config = false)
 	/* This is an array of all the features that can be enabled/disabled - each option can have the following:
 		title		- Text title of this item (If standard string does not exist).
 		desc		- Description of this feature (If standard string does not exist).
-		image		- Custom image to show next to feature.
 		settings	- Array of settings to change (For each name => value) on enable - reverse is done for disable. If > 1 will not change value if set.
 		setting_callback- Function that returns an array of settings to save - takes one parameter which is value for this feature.
 		save_callback	- Function called on save, takes state as parameter.
@@ -411,6 +410,7 @@ function ModifyCoreFeatures($return_config = false)
 			'enabled' => in_array($id, $context['admin_features']),
 			'state' => in_array($id, $context['admin_features']) ? 'on' : 'off',
 			'url' => !empty($feature['url']) ? $scripturl . '?' . $feature['url'] . ';' . $context['session_var'] . '=' . $context['session_id'] : '',
+			'image' => (file_exists($settings['theme_dir'] . '/images/admin/feature_' . $id . '.png') ? $settings['images_url'] : $settings['default_images_url']) . '/admin/feature_' . $id . '.png',
 		);
 
 	// Are they a new user?

+ 1 - 1
Themes/default/Admin.template.php

@@ -1402,7 +1402,7 @@ function template_core_features()
 			<div class="windowbg', $alternate ? '2' : '', '">
 				<span class="topslice"><span></span></span>
 				<div class="content features">
-					<img class="features_image png_fix" src="', $settings['default_images_url'], '/admin/feature_', $id, '.png" alt="', $feature['title'], '" />
+					<img class="features_image" src="', $feature['image'], '" alt="', $feature['title'], '" />
 					<div class="features_switch" id="js_feature_', $id, '">
 							<label class="core_features_hide" for="feature_', $id, '">', $txt['core_settings_enabled'], '<input class="core_features_status_box" type="checkbox" name="feature_', $id, '" id="feature_', $id, '"', $feature['enabled'] ? ' checked="checked"' : '', ' /></label>
 							<img class="core_features_img ', $feature['state'], '" src="', $settings['images_url'], '/admin/switch_', $feature['state'], '.png" id="switch_', $id, '" style="margin-top: 1.3em;display:none" alt="', $txt['core_settings_switch_' . $feature['state']], '" title="', $txt['core_settings_switch_' . $feature['state']], '" />