/
settings_theme.php
296 lines (255 loc) · 14 KB
/
settings_theme.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<?php
//////////////////////////////////////////////////////////////
//===========================================================
// settings_theme.php
//===========================================================
// SOFTACULOUS
// Version : 1.1
// Inspired by the DESIRE to be the BEST OF ALL
// ----------------------------------------------------------
// Started by: Alons
// Date: 10th Jan 2009
// Time: 21:00 hrs
// Site: http://www.softaculous.com/ (SOFTACULOUS)
// ----------------------------------------------------------
// Please Read the Terms of use at http://www.softaculous.com
// ----------------------------------------------------------
//===========================================================
// (c)Softaculous Inc.
//===========================================================
//////////////////////////////////////////////////////////////
if(!defined('SOFTACULOUS')){
die('Hacking Attempt');
}
function settings_theme(){
global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error;
global $installations, $langs, $saved;
softheader($l['<title>']);
echo '
<link rel="stylesheet" type="text/css" href="'.$theme['url'].'/spectrum.css?'.$GLOBALS['globals']['version'].'" />
<form accept-charset="'.$globals['charset'].'" name="editsettings" method="post" action="" id="editsettings" class="form-horizontal">
<div class="bg"><br />
<div class="row sai_main_head" style="width:100%;" align="center">
<div class="col-sm-6 col-xs-6" style="padding:0px 10px 0 0; text-align:right;">
<i class="fa sai-settings fa-2x" style="color:#00A0D2;"></i>
</div>
<div class="col-sm-6 col-xs-6" style="padding-top:5px; padding-left:0; text-align:left;">'.$l['settings'].'</div>
</div><hr>';
error_handle($error, '100%');
if(!empty($saved)){
echo '<div class="alert alert-success" style="padding:10px;font-size:15px;"><center><img src="'.$theme['images'].'message_success.gif"> '.$l['settings_saved'].'</div></center>';
}
echo'
<div class="row">
<div class="col-sm-5">
<label for="choose_lang" class="sai_head">'.$l['choose_lang'].'</label>
<span class="sai_exp">'.$l['exp_lang'].'</span>
</div>
<div class="col-sm-7">
<select name="language" id="choose_lang" class="form-control">';
foreach($langs as $k => $v){
echo '<option value="'.$v.'" '.(empty($_POST['language']) && (empty($user['language']) ? $globals['language'] : $user['language']) == $v ? 'selected="selected"' : (trim($_POST['language']) == $v ? 'selected="selected"' : '') ).'>'._ucfirst($v).'</option>';
}
echo '</select>
</div>
</div><br /><!---row end--->
<div class="row">
<div class="col-sm-5">
<label for="timezone" class="sai_head">'.$l['timezone'].'</label>
</div>
<div class="col-sm-7">
<select name="timezone" id="timezone" class="form-control">
<option value="-12" '.(($user['timezone'] == -12) ? 'selected="selected"' : '').'>(GMT -12:00) Eniwetok, Kwajalein</option>
<option value="-11" '.(($user['timezone'] == -11) ? 'selected="selected"' : '').'>(GMT -11:00) Midway Island, Samoa</option>
<option value="-10" '.(($user['timezone'] == -10) ? 'selected="selected"' : '').'>(GMT -10:00) Hawaii</option>
<option value="-9" '.(($user['timezone'] == -9) ? 'selected="selected"' : '').'>(GMT -9:00) Alaska</option>
<option value="-8" '.(($user['timezone'] == -8) ? 'selected="selected"' : '').'>(GMT -8:00) Pacific Time (US & Canada)</option>
<option value="-7" '.(($user['timezone'] == -7) ? 'selected="selected"' : '').'>(GMT -7:00) Mountain Time (US & Canada)</option>
<option value="-6" '.(($user['timezone'] == -6) ? 'selected="selected"' : '').'>(GMT -6:00) Central Time (US & Canada), Mexico City</option>
<option value="-5" '.(($user['timezone'] == -5) ? 'selected="selected"' : '').'>(GMT -5:00) Eastern Time (US & Canada), Bogota, Lima</option>
<option value="-4" '.(($user['timezone'] == -4) ? 'selected="selected"' : '').'>(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz</option>
<option value="-3.5" '.(($user['timezone'] == -3.5) ? 'selected="selected"' : '').'>(GMT -3:30) Newfoundland</option>
<option value="-3" '.(($user['timezone'] == -3) ? 'selected="selected"' : '').'>(GMT -3:00) Brazil, Buenos Aires, Georgetown</option>
<option value="-2" '.(($user['timezone'] == -2) ? 'selected="selected"' : '').'>(GMT -2:00) Mid-Atlantic</option>
<option value="-1" '.(($user['timezone'] == -1) ? 'selected="selected"' : '').'>(GMT -1:00 hour) Azores, Cape Verde Islands</option>
<option value="+0" '.(($user['timezone'] == '+0') ? 'selected="selected"' : '').'>(GMT) Western Europe Time, London, Lisbon, Casablanca</option>
<option value="1" '.(($user['timezone'] == 1) ? 'selected="selected"' : '').'>(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris</option>
<option value="2" '.(($user['timezone'] == 2) ? 'selected="selected"' : '').'>(GMT +2:00) Kaliningrad, South Africa</option>
<option value="3" '.(($user['timezone'] == 3) ? 'selected="selected"' : '').'>(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg</option>
<option value="3.5" '.(($user['timezone'] == 3.5) ? 'selected="selected"' : '').'>(GMT +3:30) Tehran</option>
<option value="4" '.(($user['timezone'] == 4) ? 'selected="selected"' : '').'>(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi</option>
<option value="4.5" '.(($user['timezone'] == 4.5) ? 'selected="selected"' : '').'>(GMT +4:30) Kabul</option>
<option value="5" '.(($user['timezone'] == 5) ? 'selected="selected"' : '').'>(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent</option>
<option value="5.5" '.(($user['timezone'] == 5.5) ? 'selected="selected"' : '').'>(GMT +5:30) Bombay, Calcutta, Madras, New Delhi</option>
<option value="6" '.(($user['timezone'] == 6) ? 'selected="selected"' : '').'>(GMT +6:00) Almaty, Dhaka, Colombo</option>
<option value="6.5" '.(($user['timezone'] == 6.5) ? 'selected="selected"' : '').'>(GMT +6:30) Yangon, Myanmar</option>
<option value="7" '.(($user['timezone'] == 7) ? 'selected="selected"' : '').'>(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
<option value="8" '.(($user['timezone'] == 8) ? 'selected="selected"' : '').'>(GMT +8:00) Beijing, Perth, Singapore, Hong Kong, Taiwan</option>
<option value="9" '.(($user['timezone'] == 9) ? 'selected="selected"' : '').'>(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk</option>
<option value="9.5" '.(($user['timezone'] == 9.5) ? 'selected="selected"' : '').'>(GMT +9:30) Adelaide, Darwin</option>
<option value="10" '.(($user['timezone'] == 10) ? 'selected="selected"' : '').'>(GMT +10:00) Eastern Australia, Guam, Vladivostok</option>
<option value="11" '.(($user['timezone'] == 11) ? 'selected="selected"' : '').'>(GMT +11:00) Magadan, Solomon Islands, New Caledonia</option>
<option value="12" '.(($user['timezone'] == 12) ? 'selected="selected"' : '').'>(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka</option>
<option value="0" '.(empty($user['timezone']) ? 'selected="selected"' : '').'>'.$l['default_timezone'].'</option>
</select>
</div>
</div><br />
<div class="row">
<div class="col-sm-5">
<label class="sai_head">'.$l['arrange_domain'].'</label>
<span class="sai_exp">'.$l['exp_arrange_domain'].'</span>
</div>
<div class="col-sm-7">
<input type="checkbox" name="arrange_domain" id="arrange_domain" '.POSTchecked('arrange_domain', $user['arrange_domain']).' />
</div>
</div><br />';
if($theme['this_theme'] == 'modern' && empty($globals['off_customize_theme'])){
echo'
<div class="row">
<div class="col-sm-5">
<label class="sai_head">'.$l['use_custom_color'].'</label>
<span class="sai_exp">'.$l['exp_use_custom_color'].'</span>
</div>
<div class="col-sm-7">
<input type="checkbox" name="user_defined_color" id="user_defined_color" '.POSTchecked('user_defined_color', $user['user_defined_color']).' onchange="change_div(this.id);" />
</div>
</div><br />
<div id="show_color_option" '.(!empty($user['user_defined_color']) ? '' : 'style="display:none;"').'>
<div class="row">
<div class="col-sm-5">
<label class="sai_head">'.$l['left_panel_bg'].'</label>
<span class="sai_exp">'.$l['left_panel_bg_exp'].'</span>
</div>
<div class="col-sm-7">
<input type="color" name="color" id="left_panel_bg" class="changecolor"/>
<input type="hidden" name="left_panel_bg" value="'.aPOSTval('left_panel_bg', $user['color_theme']['left_panel_bg']).'" id="hidden_left_panel_bg">
<input type="color" name="color" id="left_panel_cathead_hover" class="changecolor" />
<input type="hidden" name="left_panel_cathead_hover" value="'.aPOSTval('left_panel_cathead_hover', $user['color_theme']['left_panel_cathead_hover']).'" id="hidden_left_panel_cathead_hover">
</div>
</div><br />
<div class="row">
<div class="col-sm-5">
<label class="sai_head">'.$l['text_color'].'</label>
<span class="sai_exp">'.$l['text_color_exp'].'</span>
</div>
<div class="col-sm-7">
<input type="color" name="color" id="left_panel_cathead" class="changecolor"/>
<input type="hidden" name="left_panel_cathead" value="'.aPOSTval('left_panel_cathead', $user['color_theme']['left_panel_cathead']).'" id="hidden_left_panel_cathead">
<input type="color" name="color" id="left_panel_scriptname" class="changecolor"/>
<input type="hidden" name="left_panel_scriptname" value="'.aPOSTval('left_panel_scriptname', $user['color_theme']['left_panel_scriptname']).'" id="hidden_left_panel_scriptname">
</div>
</div><br />
</div></br>';
}
echo'
<p align="center">
<input type="submit" class="flat-butt" name="editsettings" value="'.$l['edit_settings'].'" /><br /><img id="waiting" src="'.$theme['images'].'progress.gif" style="display:none">
</p><br />
</div><br /><!--end of bg class-->
</form>';
if($theme['this_theme'] == 'modern'){
echo '
<script src="'.$theme['url'].'/js/spectrum.js" type="text/javascript"></script>
<script type="text/javascript">
function change_div(id){
//alert($_(id).checked);
if($_(id).checked == true){
$("#show_color_option").show();
}else{
$("#show_color_option").hide();
}
}
function reset_theme(){
$("#user_defined_color").val("0");
$("#editsettings").submit();
}
function updateColor(color, id) {
var hexColor = "transparent";
if(color) {
hexColor = color.toHexString();
}
if(hexColor == "transparent") return;
// Set the hidden value so that we can save the settings of user
$("#user_defined_color").val("1");
// For changing text colors of category heading
if(id == "left_panel_cathead"){
$(".soft_cathead a").css("color", hexColor);
$(".soft_nav a").css("color", hexColor);
$(".fa").css("color", hexColor);
// set the hidden value so that it can be saved
$("#hidden_left_panel_cathead").val(hexColor);
}
// For changing text colors of category heading hover color
if(id == "left_panel_cathead_hover"){
try{
$(".soft_cathead:hover, .soft_cathead_slide:hover").css("background-color", hexColor);
//$(".soft_cathead_slide:hover").css("background-color", hexColor);
// set the hidden value so that it can be saved
$("#hidden_left_panel_cathead_hover").val(hexColor);
}catch(e){
// do nothing
}
}
// For changing text colors of script names
if(id == "left_panel_scriptname"){
$(".softlinks li a").css("color", hexColor);
// set the hidden value so that it can be saved
$("#hidden_left_panel_scriptname").val(hexColor);
}
// For changing background color
if(id == "left_panel_bg"){
$(".left_panel").css("background-image", "none");
$(".left_panel").css("background-color", hexColor);
$(".soft_nav").css("background", hexColor);
// set the hidden value so that it can be saved
$("#hidden_left_panel_bg").val(hexColor);
}
}
var pallete_array = [
["rgb(0, 0, 0)", "rgb(67, 67, 67)", "rgb(102, 102, 102)", /*"rgb(153, 153, 153)","rgb(183, 183, 183)",*/
"rgb(204, 204, 204)", "rgb(217, 217, 217)", /*"rgb(239, 239, 239)", "rgb(243, 243, 243)",*/ "rgb(255, 255, 255)"],
["rgb(152, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 153, 0)", "rgb(255, 255, 0)", "rgb(0, 255, 0)",
"rgb(0, 255, 255)", "rgb(74, 134, 232)", "rgb(0, 0, 255)", "rgb(153, 0, 255)", "rgb(255, 0, 255)"],
["rgb(230, 184, 175)", "rgb(244, 204, 204)", "rgb(252, 229, 205)", "rgb(255, 242, 204)", "rgb(217, 234, 211)",
"rgb(208, 224, 227)", "rgb(201, 218, 248)", "rgb(207, 226, 243)", "rgb(217, 210, 233)", "rgb(234, 209, 220)",
"rgb(221, 126, 107)", "rgb(234, 153, 153)", "rgb(249, 203, 156)", "rgb(255, 229, 153)", "rgb(182, 215, 168)",
"rgb(162, 196, 201)", "rgb(164, 194, 244)", "rgb(159, 197, 232)", "rgb(180, 167, 214)", "rgb(213, 166, 189)",
"rgb(204, 65, 37)", "rgb(224, 102, 102)", "rgb(246, 178, 107)", "rgb(255, 217, 102)", "rgb(147, 196, 125)",
"rgb(118, 165, 175)", "rgb(109, 158, 235)", "rgb(111, 168, 220)", "rgb(142, 124, 195)", "rgb(194, 123, 160)",
"rgb(166, 28, 0)", "rgb(204, 0, 0)", "rgb(230, 145, 56)", "rgb(241, 194, 50)", "rgb(106, 168, 79)",
"rgb(69, 129, 142)", "rgb(60, 120, 216)", "rgb(61, 133, 198)", "rgb(103, 78, 167)", "rgb(166, 77, 121)",
/*"rgb(133, 32, 12)", "rgb(153, 0, 0)", "rgb(180, 95, 6)", "rgb(191, 144, 0)", "rgb(56, 118, 29)",
"rgb(19, 79, 92)", "rgb(17, 85, 204)", "rgb(11, 83, 148)", "rgb(53, 28, 117)", "rgb(116, 27, 71)",*/
"rgb(91, 15, 0)", "rgb(102, 0, 0)", "rgb(120, 63, 4)", "rgb(127, 96, 0)", "rgb(39, 78, 19)",
"rgb(12, 52, 61)", "rgb(28, 69, 135)", "rgb(7, 55, 99)", "rgb(32, 18, 77)", "rgb(76, 17, 48)"]
];
';
foreach($user['color_theme'] as $kc => $vc){
echo '$(function() {
$("#'.$kc.'").spectrum({
allowEmpty:true,
color : "'.$vc.'",
showInput: true,
className: "full-spectrum",
showInitial: true,
showPalette: true,
showSelectionPalette: true,
maxPaletteSize: 10,
preferredFormat: "hex",
localStorageKey: "soft.demo",
move: function (color) {
updateColor(color, this.id);
},
hide: function (color) {
updateColor(color, this.id);
},
palette: pallete_array
});
});';
}
echo '
</script>';
}// END OF "if($theme['this_theme'] == 'modern'){"
softfooter();
}
?>