Fixed Pluginsystem and Front Page Plugin
wintstar

wintstar commited on 2015-12-14 01:26:35
Showing 6 changed files, with 35 additions and 23 deletions.


is no longer needed for SDPluginFrontPage.template.php
helpdesk.css
/* Half rounded headers */
div.grid_header
{
height: 28px;
margin-bottom: -1px;
}

/* You no left float, Core! */
div.grid_header img
{
float: none;
}

plugin status no fixed, make seperate.
... ...
@@ -2,19 +2,6 @@
2 2
 * General stuff used all around the helpdesk 	*
3 3
 ***********************************/
4 4
 
5
-/* Half rounded headers */
6
-div.grid_header
7
-{
8
-	height: 28px;
9
-	margin-bottom: -1px;
10
-}
11
-
12
-/* You no left float, Core! */
13
-div.grid_header img
14
-{
15
-	float: none;
16
-}
17
-
18 5
 /* SimpleDesk icons */
19 6
 .shd_smallicon
20 7
 {
... ...
@@ -296,3 +296,11 @@ h3 a.permcollapse img
296 296
 	padding: 12px 9px 8px 9px;
297 297
 	box-sizing: border-box;
298 298
 }
299
+
300
+ /* Plugin switch inmage */
301
+
302
++features_switch
303
++{
304
+	float: right;
305
+	margin: 0.2em 1em 1em;
306
+}
299 307
\ No newline at end of file
... ...
@@ -513,6 +513,8 @@ $txt['shd_admin_plugins_wrong_version'] = 'Not supported by this version!';
513 513
 $txt['shd_admin_plugins_versions_avail'] = 'Supported by the plugin';
514 514
 $txt['shd_admin_plugins_on'] = 'On';
515 515
 $txt['shd_admin_plugins_off'] = 'Off';
516
+ $txt['shd_admin_plugins_enabled'] = 'Enabled';
517
+$txt['shd_admin_plugins_disabled'] = 'Disabled';
516 518
 $txt['shd_admin_plugins_languages'] = 'Available languages';
517 519
 $txt['shd_admin_plugins_lang_albanian'] = 'Albanian';
518 520
 $txt['shd_admin_plugins_lang_arabic'] = 'Arabic';
... ...
@@ -53,9 +53,9 @@ function shdplugin_front_page()
53 53
 			'description' => 'shdp_frontpage_desc',
54 54
 			'author' => 'SimpleDesk Team',
55 55
 			'website' => 'http://www.simpledesk.net/',
56
-			'version' => '1.0',
56
+			'version' => '1.0.1',
57 57
 			'compatibility' => array(
58
-				'SimpleDesk 2.0 Anatidae', // should tie up with the SHD_VERSION constants
58
+				'SimpleDesk 2.1 Beta 1', // should tie up with the SHD_VERSION constants
59 59
 			),
60 60
 			'acp_url' => 'action=admin;area=helpdesk_options;sa=frontpage',
61 61
 		),
... ...
@@ -48,7 +48,7 @@ function template_shd_frontpage_admin()
48 48
 	<div id="admincenter">
49 49
 		<form name="adminform" action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>
50 50
 		<div class="tborder">
51
-			<div class="cat_bar grid_header">
51
+			<div class="cat_bar">
52 52
 				<h3 class="catbg">
53 53
 					<img src="', shd_image_url('frontpage.png'), '" class="icon" alt="*"/> ', $txt['shdp_frontpage'], '
54 54
 				</h3>
... ...
@@ -97,15 +97,30 @@ function template_shd_frontpage_admin()
97 97
 						</dl>
98 98
 						<hr class="hrcolor" />
99 99
 						<div class="righttext">
100
-							<input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['save'], '" tabindex="', $context['tabindex']++, '" accesskey="s" class="button_submit" />
100
+							<input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled="disabled"' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button_submit" />
101 101
 						</div>
102
+
102 103
 					</div>
103 104
 				<span class="botslice"><span></span></span>
104 105
 			</div>
105
-			</div>
106
+			</div>';
107
+	if (isset($context['admin-dbsc_token']))
108
+		echo '
109
+		<input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '" />';
110
+	echo '
106 111
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
107 112
 		</form>
108 113
 	</div>
114
+	<br class="clear" />';
115
+	if (!empty($context['settings_post_javascript']))
116
+		echo '
117
+	<script type="text/javascript"><!-- // --><![CDATA[
118
+	', $context['settings_post_javascript'], '
119
+	// ]]></script>';
120
+	if (!empty($context['settings_insert_below']))
121
+		echo $context['settings_insert_below'];
122
+
123
+	echo '
109 124
 	<script type="text/javascript"><!-- // --><![CDATA[
110 125
 	function invertBBC()
111 126
 	{
... ...
@@ -26,9 +26,9 @@ function template_shd_plugin_listing()
26 26
 			itemValueHandle.value = itemValueHandle.value == 1 ? 0 : 1;
27 27
 
28 28
 			// Change the image, alternative text and the title.
29
-			document.getElementById("switch_" + itemID).src = \'', $settings['images_url'], '/admin/switch_\' + (itemValueHandle.value == 1 ? \'on\' : \'off\') + \'.png\';
30
-			document.getElementById("switch_" + itemID).alt = itemValueHandle.value == 1 ? \'', $txt['core_settings_switch_off'], '\' : \'', $txt['core_settings_switch_on'], '\';
31
-			document.getElementById("switch_" + itemID).title = itemValueHandle.value == 1 ? \'', $txt['core_settings_switch_off'], '\' : \'', $txt['core_settings_switch_on'], '\';
29
+			document.getElementById("switch_" + itemID).src = \'', $settings['images_url'], '/simpledesk/switch_\' + (itemValueHandle.value == 1 ? \'on\' : \'off\') + \'.png\';
30
+			document.getElementById("switch_" + itemID).alt = itemValueHandle.value == 1 ? \'', $txt['shd_admin_plugins_off'], '\' : \'', $txt['shd_admin_plugins_on'], '\';
31
+			document.getElementById("switch_" + itemID).title = itemValueHandle.value == 1 ? \'', $txt['shd_admin_plugins_off'], '\' : \'', $txt['shd_admin_plugins_on'], '\';
32 32
 
33 33
 			// Don\'t reload.
34 34
 			return false;
... ...
@@ -104,8 +104,8 @@ function template_shd_plugin_listing()
104 104
 		if (!empty($plugin['installable']))
105 105
 			echo '
106 106
 					<div id="plain_feature_', $id, '">
107
-						<label for="plain_feature_', $id, '_radio_on"><input type="radio" name="feature_plain_', $id, '" id="plain_feature_', $id, '_radio_on" value="1"', $plugin['enabled'] ? ' checked="checked"' : '', ' class="input_radio" />', $txt['core_settings_enabled'], '</label>
108
-						<label for="plain_feature_', $id, '_radio_off"><input type="radio" name="feature_plain_', $id, '" id="plain_feature_', $id, '_radio_off" value="0"', !$plugin['enabled'] ? ' checked="checked"' : '', ' class="input_radio" />', $txt['core_settings_disabled'], '</label>
107
+						<label for="plain_feature_', $id, '_radio_on"><input type="radio" name="feature_plain_', $id, '" id="plain_feature_', $id, '_radio_on" value="1"', $plugin['enabled'] ? ' checked="checked"' : '', ' class="input_radio" />', $txt['shd_admin_plugins_enabled'], '</label>
108
+						<label for="plain_feature_', $id, '_radio_off"><input type="radio" name="feature_plain_', $id, '" id="plain_feature_', $id, '_radio_off" value="0"', !$plugin['enabled'] ? ' checked="checked"' : '', ' class="input_radio" />', $txt['shd_admin_plugins_disabled'], '</label>
109 109
 					</div>';
110 110
 
111 111
 		echo '
112 112