1 | <?php |
||
2 | /* Copyright (C) 2006-2012 Laurent Destailleur <[email protected]> |
||
3 | * Copyright (C) 2010-2017 Regis Houssin <[email protected]> |
||
4 | * Copyright (C) 2015 Alexandre Spangaro <[email protected]> |
||
5 | * Copyright (C) 2018 Ferran Marcet <[email protected]> |
||
6 | * |
||
7 | * This program is free software; you can redistribute it and/or modify |
||
8 | * it under the terms of the GNU General Public License as published by |
||
9 | * the Free Software Foundation; either version 3 of the License, or |
||
10 | * (at your option) any later version. |
||
11 | * |
||
12 | * This program is distributed in the hope that it will be useful, |
||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
15 | * GNU General Public License for more details. |
||
16 | * |
||
17 | * You should have received a copy of the GNU General Public License |
||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
||
19 | * or see http://www.gnu.org/ |
||
20 | */ |
||
21 | |||
22 | |||
23 | /** |
||
24 | * \file htdocs/core/lib/usergroups.lib.php |
||
25 | * \brief Ensemble de fonctions de base pour la gestion des utilisaterus et groupes |
||
26 | */ |
||
27 | |||
28 | /** |
||
29 | * Prepare array with list of tabs |
||
30 | * |
||
31 | * @param Object $object Object related to tabs |
||
32 | * @return array Array of tabs to show |
||
33 | */ |
||
34 | function user_prepare_head($object) |
||
35 | { |
||
36 | global $langs, $conf, $user, $db; |
||
37 | |||
38 | $langs->load("users"); |
||
39 | |||
40 | $canreadperms=true; |
||
41 | if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS)) |
||
42 | { |
||
43 | $canreadperms=($user->admin || ($user->id != $object->id && $user->rights->user->user_advance->readperms) || ($user->id == $object->id && $user->rights->user->self_advance->readperms)); |
||
44 | } |
||
45 | |||
46 | $h = 0; |
||
47 | $head = array(); |
||
48 | |||
49 | $head[$h][0] = DOL_URL_ROOT.'/user/card.php?id='.$object->id; |
||
50 | $head[$h][1] = $langs->trans("UserCard"); |
||
51 | $head[$h][2] = 'user'; |
||
52 | $h++; |
||
53 | |||
54 | if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE)) |
||
55 | && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin))) |
||
56 | { |
||
57 | $langs->load("ldap"); |
||
58 | $head[$h][0] = DOL_URL_ROOT.'/user/ldap.php?id='.$object->id; |
||
59 | $head[$h][1] = $langs->trans("LDAPCard"); |
||
60 | $head[$h][2] = 'ldap'; |
||
61 | $h++; |
||
62 | } |
||
63 | |||
64 | if ($canreadperms) |
||
65 | { |
||
66 | $head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$object->id; |
||
67 | $head[$h][1] = $langs->trans("Rights"). ' <span class="badge">'.($object->nb_rights).'</span>'; |
||
68 | $head[$h][2] = 'rights'; |
||
69 | $h++; |
||
70 | } |
||
71 | |||
72 | $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; |
||
73 | $head[$h][1] = $langs->trans("UserGUISetup"); |
||
74 | $head[$h][2] = 'guisetup'; |
||
75 | $h++; |
||
76 | |||
77 | if (! empty($conf->agenda->enabled)) |
||
78 | { |
||
79 | if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; |
||
80 | $MAXAGENDA=$conf->global->AGENDA_EXT_NB; |
||
81 | |||
82 | $i=1; |
||
83 | $nbagenda = 0; |
||
84 | while ($i <= $MAXAGENDA) |
||
85 | { |
||
86 | $key=$i; |
||
87 | $name='AGENDA_EXT_NAME_'.$object->id.'_'.$key; |
||
88 | $src='AGENDA_EXT_SRC_'.$object->id.'_'.$key; |
||
89 | $offsettz='AGENDA_EXT_OFFSETTZ_'.$object->id.'_'.$key; |
||
90 | $color='AGENDA_EXT_COLOR_'.$object->id.'_'.$key; |
||
91 | $i++; |
||
92 | |||
93 | if (! empty($object->conf->$name)) $nbagenda++; |
||
94 | } |
||
95 | |||
96 | $head[$h][0] = DOL_URL_ROOT.'/user/agenda_extsites.php?id='.$object->id; |
||
97 | $head[$h][1] = $langs->trans("ExtSites").($nbagenda ? ' <span class="badge">'.$nbagenda.'</span>' : ''); |
||
98 | $head[$h][2] = 'extsites'; |
||
99 | $h++; |
||
100 | } |
||
101 | |||
102 | if (! empty($conf->clicktodial->enabled)) |
||
103 | { |
||
104 | $head[$h][0] = DOL_URL_ROOT.'/user/clicktodial.php?id='.$object->id; |
||
105 | $head[$h][1] = $langs->trans("ClickToDial"); |
||
106 | $head[$h][2] = 'clicktodial'; |
||
107 | $h++; |
||
108 | } |
||
109 | |||
110 | // Notifications |
||
111 | if ($user->societe_id == 0 && ! empty($conf->notification->enabled)) |
||
112 | { |
||
113 | $nbNote = 0; |
||
114 | $sql = "SELECT COUNT(n.rowid) as nb"; |
||
115 | $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n"; |
||
116 | $sql.= " WHERE fk_user = ".$object->id; |
||
117 | $resql=$db->query($sql); |
||
118 | if ($resql) |
||
119 | { |
||
120 | $num = $db->num_rows($resql); |
||
121 | $i = 0; |
||
122 | while ($i < $num) |
||
123 | { |
||
124 | $obj = $db->fetch_object($resql); |
||
125 | $nbNote=$obj->nb; |
||
126 | $i++; |
||
127 | } |
||
128 | } |
||
129 | else { |
||
130 | dol_print_error($db); |
||
131 | } |
||
132 | |||
133 | $head[$h][0] = DOL_URL_ROOT.'/user/notify/card.php?id='.$object->id; |
||
134 | $head[$h][1] = $langs->trans("Notifications"); |
||
135 | if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
||
136 | $head[$h][2] = 'notify'; |
||
137 | $h++; |
||
138 | } |
||
139 | |||
140 | // Show more tabs from modules |
||
141 | // Entries must be declared in modules descriptor with line |
||
142 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
||
143 | // $this->tabs = array('entity:-tabname); to remove a tab |
||
144 | complete_head_from_modules($conf,$langs,$object,$head,$h,'user'); |
||
145 | |||
146 | if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) |
||
147 | || (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read)) |
||
148 | || (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && $user->id == $object->id) |
||
149 | || (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && $user->id == $object->id ) |
||
150 | ) |
||
151 | { |
||
152 | // Bank |
||
153 | $head[$h][0] = DOL_URL_ROOT.'/user/bank.php?id='.$object->id; |
||
154 | $head[$h][1] = $langs->trans("HRAndBank"); |
||
155 | $head[$h][2] = 'bank'; |
||
156 | $h++; |
||
157 | } |
||
158 | |||
159 | // Such info on users is visible only by internal user |
||
160 | if (empty($user->societe_id)) |
||
161 | { |
||
162 | // Notes |
||
163 | $nbNote = 0; |
||
164 | if(!empty($object->note)) $nbNote++; |
||
165 | $head[$h][0] = DOL_URL_ROOT.'/user/note.php?id='.$object->id; |
||
166 | $head[$h][1] = $langs->trans("Note"); |
||
167 | if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
||
168 | $head[$h][2] = 'note'; |
||
169 | $h++; |
||
170 | |||
171 | // Attached files |
||
172 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
||
173 | require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
||
174 | $upload_dir = $conf->user->dir_output . "/" . $object->id; |
||
175 | $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
||
176 | $nbLinks=Link::count($db, $object->element, $object->id); |
||
177 | $head[$h][0] = DOL_URL_ROOT.'/user/document.php?userid='.$object->id; |
||
178 | $head[$h][1] = $langs->trans("Documents"); |
||
179 | if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
||
180 | $head[$h][2] = 'document'; |
||
181 | $h++; |
||
182 | |||
183 | $head[$h][0] = DOL_URL_ROOT.'/user/info.php?id='.$object->id; |
||
184 | $head[$h][1] = $langs->trans("Info"); |
||
185 | $head[$h][2] = 'info'; |
||
186 | $h++; |
||
187 | } |
||
188 | |||
189 | complete_head_from_modules($conf,$langs,$object,$head,$h,'user','remove'); |
||
190 | |||
191 | return $head; |
||
192 | } |
||
193 | |||
194 | /** |
||
195 | * Prepare array with list of tabs |
||
196 | * |
||
197 | * @param Group $object Object group |
||
198 | * @return array Array of tabs |
||
199 | */ |
||
200 | function group_prepare_head($object) |
||
201 | { |
||
202 | global $langs, $conf, $user; |
||
203 | |||
204 | $canreadperms=true; |
||
205 | if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS)) |
||
206 | { |
||
207 | $canreadperms=($user->admin || $user->rights->user->group_advance->readperms); |
||
208 | } |
||
209 | |||
210 | $h = 0; |
||
211 | $head = array(); |
||
212 | |||
213 | $head[$h][0] = DOL_URL_ROOT.'/user/group/card.php?id='.$object->id; |
||
214 | $head[$h][1] = $langs->trans("GroupCard"); |
||
215 | $head[$h][2] = 'group'; |
||
216 | $h++; |
||
217 | |||
218 | if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE)) |
||
219 | && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin))) |
||
220 | { |
||
221 | $langs->load("ldap"); |
||
222 | $head[$h][0] = DOL_URL_ROOT.'/user/group/ldap.php?id='.$object->id; |
||
223 | $head[$h][1] = $langs->trans("LDAPCard"); |
||
224 | $head[$h][2] = 'ldap'; |
||
225 | $h++; |
||
226 | } |
||
227 | |||
228 | if ($canreadperms) |
||
229 | { |
||
230 | $head[$h][0] = DOL_URL_ROOT.'/user/group/perms.php?id='.$object->id; |
||
231 | $head[$h][1] = $langs->trans("GroupRights"). ' <span class="badge">'.($object->nb_rights).'</span>'; |
||
232 | $head[$h][2] = 'rights'; |
||
233 | $h++; |
||
234 | } |
||
235 | |||
236 | // Show more tabs from modules |
||
237 | // Entries must be declared in modules descriptor with line |
||
238 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
||
239 | // $this->tabs = array('entity:-tabname); to remove a tab |
||
240 | complete_head_from_modules($conf,$langs,$object,$head,$h,'group'); |
||
241 | |||
242 | complete_head_from_modules($conf,$langs,$object,$head,$h,'group','remove'); |
||
243 | |||
244 | return $head; |
||
245 | } |
||
246 | |||
247 | /** |
||
248 | * Prepare array with list of tabs |
||
249 | * |
||
250 | * @return array Array of tabs to show |
||
251 | */ |
||
252 | function user_admin_prepare_head() |
||
253 | { |
||
254 | global $langs, $conf, $user; |
||
255 | |||
256 | $langs->load("users"); |
||
257 | $h=0; |
||
258 | |||
259 | $head[$h][0] = DOL_URL_ROOT.'/admin/user.php'; |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
Loading history...
|
|||
260 | $head[$h][1] = $langs->trans("Parameters"); |
||
261 | $head[$h][2] = 'card'; |
||
262 | $h++; |
||
263 | |||
264 | $head[$h][0] = DOL_URL_ROOT.'/admin/usergroup.php'; |
||
265 | $head[$h][1] = $langs->trans("Group"); |
||
266 | $head[$h][2] = 'usergroupcard'; |
||
267 | $h++; |
||
268 | |||
269 | $head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php'; |
||
270 | $head[$h][1] = $langs->trans("ExtraFields"); |
||
271 | $head[$h][2] = 'attributes'; |
||
272 | $h++; |
||
273 | |||
274 | $head[$h][0] = DOL_URL_ROOT.'/user/admin/group_extrafields.php'; |
||
275 | $head[$h][1] = $langs->trans("ExtraFields")." ".$langs->trans("Groups"); |
||
276 | $head[$h][2] = 'attributes_group'; |
||
277 | $h++; |
||
278 | |||
279 | // Show more tabs from modules |
||
280 | // Entries must be declared in modules descriptor with line |
||
281 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
||
282 | // $this->tabs = array('entity:-tabname); to remove a tab |
||
283 | complete_head_from_modules($conf,$langs,null,$head,$h,'useradmin'); |
||
284 | |||
285 | complete_head_from_modules($conf,$langs,null,$head,$h,'useradmin','remove'); |
||
286 | |||
287 | return $head; |
||
288 | } |
||
289 | |||
290 | /** |
||
291 | * Show list of themes. Show all thumbs of themes |
||
292 | * |
||
293 | * @param User|null $fuser User concerned or null for global theme |
||
294 | * @param int $edit 1 to add edit form |
||
295 | * @param boolean $foruserprofile Show for user profile view |
||
296 | * @return void |
||
297 | */ |
||
298 | function show_theme($fuser,$edit=0,$foruserprofile=false) |
||
299 | { |
||
300 | global $conf,$langs,$db,$form; |
||
301 | global $bc; |
||
302 | |||
303 | require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
||
304 | |||
305 | $formother = new FormOther($db); |
||
306 | |||
307 | $dirthemes=array('/theme'); |
||
308 | if (! empty($conf->modules_parts['theme'])) // Using this feature slow down application |
||
309 | { |
||
310 | foreach($conf->modules_parts['theme'] as $reldir) |
||
311 | { |
||
312 | $dirthemes=array_merge($dirthemes,(array) ($reldir.'theme')); |
||
313 | } |
||
314 | } |
||
315 | $dirthemes=array_unique($dirthemes); |
||
316 | // Now dir_themes=array('/themes') or dir_themes=array('/theme','/mymodule/theme') |
||
317 | |||
318 | $selected_theme=''; |
||
319 | if (empty($foruserprofile)) $selected_theme=$conf->global->MAIN_THEME; |
||
320 | else $selected_theme=((is_object($fuser) && ! empty($fuser->conf->MAIN_THEME))?$fuser->conf->MAIN_THEME:''); |
||
321 | |||
322 | $hoverdisabled=''; |
||
323 | if (empty($foruserprofile)) $hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0'); |
||
324 | else $hoverdisabled=(is_object($fuser)?(empty($fuser->conf->THEME_ELDY_USE_HOVER) || $fuser->conf->THEME_ELDY_USE_HOVER == '0'):''); |
||
325 | |||
326 | $checkeddisabled=''; |
||
327 | if (empty($foruserprofile)) $checkeddisabled=(isset($conf->global->THEME_ELDY_USE_CHECKED) && $conf->global->THEME_ELDY_USE_CHECKED == '0'); |
||
328 | else $checkeddisabled=(is_object($fuser)?(empty($fuser->conf->THEME_ELDY_USE_CHECKED) || $fuser->conf->THEME_ELDY_USE_CHECKED == '0'):''); |
||
329 | |||
330 | $colspan=2; |
||
331 | if ($foruserprofile) $colspan=4; |
||
332 | |||
333 | $thumbsbyrow=6; |
||
334 | print '<table class="noborder" width="100%">'; |
||
335 | |||
336 | // Title |
||
337 | if ($foruserprofile) |
||
338 | { |
||
339 | print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("Parameter").'</th><th>'.$langs->trans("DefaultValue").'</th>'; |
||
340 | print '<th colspan="2"> </th>'; |
||
341 | print '</tr>'; |
||
342 | |||
343 | print '<tr>'; |
||
344 | print '<td>'.$langs->trans("DefaultSkin").'</td>'; |
||
345 | print '<td>'.$conf->global->MAIN_THEME.'</td>'; |
||
346 | print '<td align="left" class="nowrap" width="20%"><input id="check_MAIN_THEME" name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>'; |
||
347 | print '<td> </td>'; |
||
348 | print '</tr>'; |
||
349 | } |
||
350 | else |
||
351 | { |
||
352 | print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("DefaultSkin").'</th>'; |
||
353 | print '<th align="right">'; |
||
354 | $url='https://www.dolistore.com/lang-en/4-skins'; |
||
355 | if (preg_match('/fr/i',$langs->defaultlang)) $url='https://www.dolistore.com/fr/4-themes'; |
||
356 | //if (preg_match('/es/i',$langs->defaultlang)) $url='http://www.dolistore.com/lang-es/4-themes'; |
||
357 | print '<a href="'.$url.'" target="_blank">'; |
||
358 | print $langs->trans('DownloadMoreSkins'); |
||
359 | print '</a>'; |
||
360 | print '</th></tr>'; |
||
361 | |||
362 | print '<tr>'; |
||
363 | print '<td>'.$langs->trans("ThemeDir").'</td>'; |
||
364 | print '<td>'; |
||
365 | foreach($dirthemes as $dirtheme) |
||
366 | { |
||
367 | echo '"'.$dirtheme.'" '; |
||
368 | } |
||
369 | print '</td>'; |
||
370 | print '</tr>'; |
||
371 | } |
||
372 | |||
373 | print '<tr><td colspan="'.$colspan.'">'; |
||
374 | |||
375 | print '<table class="nobordernopadding" width="100%"><tr><td><div align="center">'; |
||
376 | |||
377 | $i=0; |
||
378 | foreach($dirthemes as $dir) |
||
379 | { |
||
380 | //print $dirroot.$dir;exit; |
||
381 | $dirtheme=dol_buildpath($dir,0); // This include loop on $conf->file->dol_document_root |
||
382 | $urltheme=dol_buildpath($dir,1); |
||
383 | |||
384 | if (is_dir($dirtheme)) |
||
385 | { |
||
386 | $handle=opendir($dirtheme); |
||
387 | if (is_resource($handle)) |
||
388 | { |
||
389 | while (($subdir = readdir($handle))!==false) |
||
390 | { |
||
391 | if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' |
||
392 | && substr($subdir, 0, 3) <> 'CVS' && ! preg_match('/common|phones/i',$subdir)) |
||
393 | { |
||
394 | // Disable not stable themes (dir ends with _exp or _dev) |
||
395 | if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i',$subdir)) continue; |
||
396 | if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i',$subdir)) continue; |
||
397 | |||
398 | print '<div class="inline-block" style="margin-top: 10px; margin-bottom: 10px; margin-right: 20px; margin-left: 20px;">'; |
||
399 | $file=$dirtheme."/".$subdir."/thumb.png"; |
||
400 | $url=$urltheme."/".$subdir."/thumb.png"; |
||
401 | if (! file_exists($file)) $url=DOL_URL_ROOT.'/public/theme/common/nophoto.png'; |
||
402 | print '<a href="'.$_SERVER["PHP_SELF"].($edit?'?action=edit&theme=':'?theme=').$subdir.(GETPOST('optioncss','alpha',1)?'&optioncss='.GETPOST('optioncss','alpha',1):'').($fuser?'&id='.$fuser->id:'').'" style="font-weight: normal;" alt="'.$langs->trans("Preview").'">'; |
||
403 | if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive"); |
||
404 | else $title=$langs->trans("ShowPreview"); |
||
405 | print '<img src="'.$url.'" border="0" width="80" height="60" alt="'.$title.'" title="'.$title.'" style="margin-bottom: 5px;">'; |
||
406 | print '</a><br>'; |
||
407 | if ($subdir == $selected_theme) |
||
408 | { |
||
409 | print '<input '.($edit?'':'disabled').' type="radio" class="themethumbs" style="border: 0px;" checked name="main_theme" value="'.$subdir.'"> <b>'.$subdir.'</b>'; |
||
410 | } |
||
411 | else |
||
412 | { |
||
413 | print '<input '.($edit?'':'disabled').' type="radio" class="themethumbs" style="border: 0px;" name="main_theme" value="'.$subdir.'"> '.$subdir; |
||
414 | } |
||
415 | print '</div>'; |
||
416 | |||
417 | $i++; |
||
418 | } |
||
419 | } |
||
420 | } |
||
421 | } |
||
422 | } |
||
423 | |||
424 | print '</div></td></tr></table>'; |
||
425 | |||
426 | print '</td></tr>'; |
||
427 | |||
428 | // TopMenuDisableImages |
||
429 | if ($foruserprofile) |
||
430 | { |
||
431 | /* |
||
432 | print '<tr class="oddeven">'; |
||
433 | print '<td>'.$langs->trans("TopMenuDisableImages").'</td>'; |
||
434 | print '<td>'.($conf->global->THEME_TOPMENU_DISABLE_IMAGE?$conf->global->THEME_TOPMENU_DISABLE_IMAGE:$langs->trans("Default")).'</td>'; |
||
435 | print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_TOPMENU_DISABLE_IMAGE" id="check_THEME_TOPMENU_DISABLE_IMAGE" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TEXTLINK)?" checked":""); |
||
436 | print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo |
||
437 | print '> '.$langs->trans("UsePersonalValue").'</td>'; |
||
438 | print '<td>'; |
||
439 | if ($edit) |
||
440 | { |
||
441 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_TOPMENU_DISABLE_IMAGE,array()),''),'THEME_TOPMENU_DISABLE_IMAGE','formcolor',1).' '; |
||
442 | } |
||
443 | else |
||
444 | { |
||
445 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_TOPMENU_DISABLE_IMAGE,array()),''); |
||
446 | if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
447 | else print ''; |
||
448 | } |
||
449 | if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
||
450 | print '</td>';*/ |
||
451 | } |
||
452 | else |
||
453 | { |
||
454 | $default=$langs->trans('No'); |
||
455 | print '<tr class="oddeven">'; |
||
456 | print '<td>'.$langs->trans("TopMenuDisableImages").'</td>'; |
||
457 | print '<td colspan="'.($colspan-1).'">'; |
||
458 | if ($edit) |
||
459 | { |
||
460 | print $form->selectyesno('THEME_TOPMENU_DISABLE_IMAGE', $conf->global->THEME_TOPMENU_DISABLE_IMAGE, 1); |
||
461 | } |
||
462 | else |
||
463 | { |
||
464 | print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE); |
||
465 | } |
||
466 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>'.$default.'</strong>) '; |
||
467 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
468 | print '</span>'; |
||
469 | print '</td>'; |
||
470 | } |
||
471 | |||
472 | // Background color THEME_ELDY_BACKBODY |
||
473 | if ($foruserprofile) |
||
474 | { |
||
475 | /* |
||
476 | print '<tr class="oddeven">'; |
||
477 | print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>'; |
||
478 | print '<td>'.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'</td>'; |
||
479 | print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_ELDY_TOPMENU_BACK1" id="check_THEME_ELDY_TOPMENU_BACK1" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); |
||
480 | print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo |
||
481 | print '> '.$langs->trans("UsePersonalValue").'</td>'; |
||
482 | print '<td>'; |
||
483 | if ($edit) |
||
484 | { |
||
485 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' '; |
||
486 | } |
||
487 | else |
||
488 | { |
||
489 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); |
||
490 | if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
491 | else print ''; |
||
492 | } |
||
493 | if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
||
494 | print '</td>';*/ |
||
495 | } |
||
496 | else |
||
497 | { |
||
498 | print '<tr class="oddeven">'; |
||
499 | print '<td>'.$langs->trans("BackgroundColor").'</td>'; |
||
500 | print '<td colspan="'.($colspan-1).'">'; |
||
501 | //var_dump($conf->global->THEME_ELDY_BACKBODY); |
||
502 | if ($edit) |
||
503 | { |
||
504 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY,array()),''),'THEME_ELDY_BACKBODY','formcolor',1).' '; |
||
505 | } |
||
506 | else |
||
507 | { |
||
508 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY,array()),''); |
||
509 | if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
510 | else print $langs->trans("Default"); |
||
511 | } |
||
512 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>ffffff</strong>) '; |
||
513 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
514 | print '</span>'; |
||
515 | print '</td>'; |
||
516 | } |
||
517 | |||
518 | // TopMenuBackgroundColor |
||
519 | if ($foruserprofile) |
||
520 | { |
||
521 | /* |
||
522 | print '<tr class="oddeven">'; |
||
523 | print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>'; |
||
524 | print '<td>'.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'</td>'; |
||
525 | print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_ELDY_TOPMENU_BACK1" id="check_THEME_ELDY_TOPMENU_BACK1" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); |
||
526 | print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo |
||
527 | print '> '.$langs->trans("UsePersonalValue").'</td>'; |
||
528 | print '<td>'; |
||
529 | if ($edit) |
||
530 | { |
||
531 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' '; |
||
532 | } |
||
533 | else |
||
534 | { |
||
535 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); |
||
536 | if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
537 | else print ''; |
||
538 | } |
||
539 | if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
||
540 | print '</td>';*/ |
||
541 | } |
||
542 | else |
||
543 | { |
||
544 | $default='5a6482'; |
||
545 | if ($conf->theme == 'md') $default='5a3278'; |
||
546 | |||
547 | print '<tr class="oddeven">'; |
||
548 | print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>'; |
||
549 | print '<td colspan="'.($colspan-1).'">'; |
||
550 | if ($edit) |
||
551 | { |
||
552 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' '; |
||
553 | } |
||
554 | else |
||
555 | { |
||
556 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); |
||
557 | if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
558 | else print $langs->trans("Default"); |
||
559 | } |
||
560 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>'.$default.'</strong>) '; |
||
561 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
562 | print '</span>'; |
||
563 | print '</td>'; |
||
564 | } |
||
565 | |||
566 | // LeftMenuBackgroundColor |
||
567 | if ($foruserprofile) |
||
568 | { |
||
569 | /* |
||
570 | print '<tr class="oddeven">'; |
||
571 | print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>'; |
||
572 | print '<td>'.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_VERMENU_BACK1:$langs->trans("Default")).'</td>'; |
||
573 | print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_ELDY_VERMENU_BACK1" id="check_THEME_ELDY_VERMENU_BACK1" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); |
||
574 | print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo |
||
575 | print '> '.$langs->trans("UsePersonalValue").'</td>'; |
||
576 | print '<td>'; |
||
577 | if ($edit) |
||
578 | { |
||
579 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1,array()),''),'THEME_ELDY_VERMENU_BACK1','formcolor',1).' '; |
||
580 | } |
||
581 | else |
||
582 | { |
||
583 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1,array()),''); |
||
584 | if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
585 | else print ''; |
||
586 | } |
||
587 | if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
||
588 | print '</td>';*/ |
||
589 | } |
||
590 | else |
||
591 | { |
||
592 | $default='f0f0f0'; |
||
593 | if ($conf->theme == 'md') $default='ffffff'; |
||
594 | |||
595 | print '<tr class="oddeven">'; |
||
596 | print '<td>'.$langs->trans("LeftMenuBackgroundColor").'</td>'; |
||
597 | print '<td colspan="'.($colspan-1).'">'; |
||
598 | if ($edit) |
||
599 | { |
||
600 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1,array()),''),'THEME_ELDY_VERMENU_BACK1','formcolor',1).' '; |
||
601 | } |
||
602 | else |
||
603 | { |
||
604 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1,array()),''); |
||
605 | if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
606 | else print $langs->trans("Default"); |
||
607 | } |
||
608 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>'.$default.'</strong>) '; |
||
609 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
610 | print '</span>'; |
||
611 | print '</td>'; |
||
612 | } |
||
613 | |||
614 | // TextTitleColor for title of Pages |
||
615 | if ($foruserprofile) |
||
616 | { |
||
617 | |||
618 | |||
619 | } |
||
620 | else |
||
621 | { |
||
622 | print '<tr class="oddeven">'; |
||
623 | print '<td>'.$langs->trans("TextTitleColor").'</td>'; |
||
624 | print '<td colspan="'.($colspan-1).'">'; |
||
625 | if ($edit) |
||
626 | { |
||
627 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLENOTAB,array()),''),'THEME_ELDY_TEXTTITLENOTAB','formcolor',1).' '; |
||
628 | } |
||
629 | else |
||
630 | { |
||
631 | print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLENOTAB, $langs->trans("Default")); |
||
632 | } |
||
633 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong><span style="color: #643c14">643c14</span></strong>) '; |
||
634 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
635 | print '</span>'; |
||
636 | print '</td>'; |
||
637 | |||
638 | print '</tr>'; |
||
639 | } |
||
640 | |||
641 | // BackgroundTableTitleColor |
||
642 | if ($foruserprofile) |
||
643 | { |
||
644 | |||
645 | |||
646 | } |
||
647 | else |
||
648 | { |
||
649 | print '<tr class="oddeven">'; |
||
650 | print '<td>'.$langs->trans("BackgroundTableTitleColor").'</td>'; |
||
651 | print '<td colspan="'.($colspan-1).'">'; |
||
652 | if ($edit) |
||
653 | { |
||
654 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1,array()),''),'THEME_ELDY_BACKTITLE1','formcolor',1).' '; |
||
655 | } |
||
656 | else |
||
657 | { |
||
658 | print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default")); |
||
659 | } |
||
660 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>f0f0f0</strong>) '; // $colorbacktitle1 in CSS |
||
661 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
662 | print '</span>'; |
||
663 | print '</td>'; |
||
664 | |||
665 | print '</tr>'; |
||
666 | } |
||
667 | |||
668 | // TextTitleColor |
||
669 | if ($foruserprofile) |
||
670 | { |
||
671 | |||
672 | |||
673 | } |
||
674 | else |
||
675 | { |
||
676 | print '<tr class="oddeven">'; |
||
677 | print '<td>'.$langs->trans("BackgroundTableTitleTextColor").'</td>'; |
||
678 | print '<td colspan="'.($colspan-1).'">'; |
||
679 | if ($edit) |
||
680 | { |
||
681 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLE,array()),''),'THEME_ELDY_TEXTTITLE','formcolor',1).' '; |
||
682 | } |
||
683 | else |
||
684 | { |
||
685 | print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLE, $langs->trans("Default")); |
||
686 | } |
||
687 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong><span style="color: #000000">000000</span></strong>) '; |
||
688 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
689 | print '</span>'; |
||
690 | print '</td>'; |
||
691 | |||
692 | print '</tr>'; |
||
693 | } |
||
694 | |||
695 | // BackgroundTableLineOddColor |
||
696 | if ($foruserprofile) |
||
697 | { |
||
698 | |||
699 | } |
||
700 | else |
||
701 | { |
||
702 | $default='ffffff'; |
||
703 | if ($conf->theme == 'md') $default='ffffff'; |
||
704 | |||
705 | print '<tr class="oddeven">'; |
||
706 | print '<td>'.$langs->trans("BackgroundTableLineOddColor").'</td>'; |
||
707 | print '<td colspan="'.($colspan-1).'">'; |
||
708 | if ($edit) |
||
709 | { |
||
710 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1,array()),''),'THEME_ELDY_LINEIMPAIR1','formcolor',1).' '; |
||
711 | } |
||
712 | else |
||
713 | { |
||
714 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1,array()),''); |
||
715 | if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
716 | else print $langs->trans("Default"); |
||
717 | } |
||
718 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>'.$default.'</strong>) '; |
||
719 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
720 | print '</span>'; |
||
721 | print '</td>'; |
||
722 | } |
||
723 | |||
724 | // BackgroundTableLineEvenColor |
||
725 | if ($foruserprofile) |
||
726 | { |
||
727 | |||
728 | } |
||
729 | else |
||
730 | { |
||
731 | $default='f8f8f8'; |
||
732 | if ($conf->theme == 'md') $default='f8f8f8'; |
||
733 | |||
734 | print '<tr class="oddeven">'; |
||
735 | print '<td>'.$langs->trans("BackgroundTableLineEvenColor").'</td>'; |
||
736 | print '<td colspan="'.($colspan-1).'">'; |
||
737 | if ($edit) |
||
738 | { |
||
739 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1,array()),''),'THEME_ELDY_LINEPAIR1','formcolor',1).' '; |
||
740 | } |
||
741 | else |
||
742 | { |
||
743 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1,array()),''); |
||
744 | if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
745 | else print $langs->trans("Default"); |
||
746 | } |
||
747 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>'.$default.'</strong>) '; |
||
748 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
749 | print '</span>'; |
||
750 | print '</td>'; |
||
751 | } |
||
752 | |||
753 | // Text LinkColor |
||
754 | if ($foruserprofile) |
||
755 | { |
||
756 | /* |
||
757 | print '<tr class="oddeven">'; |
||
758 | print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>'; |
||
759 | print '<td>'.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TEXTLINK:$langs->trans("Default")).'</td>'; |
||
760 | print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_ELDY_TEXTLINK" id="check_THEME_ELDY_TEXTLINK" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TEXTLINK)?" checked":""); |
||
761 | print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo |
||
762 | print '> '.$langs->trans("UsePersonalValue").'</td>'; |
||
763 | print '<td>'; |
||
764 | if ($edit) |
||
765 | { |
||
766 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),''),'THEME_ELDY_TEXTLINK','formcolor',1).' '; |
||
767 | } |
||
768 | else |
||
769 | { |
||
770 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),''); |
||
771 | if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
772 | else print ''; |
||
773 | } |
||
774 | if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
||
775 | print '</td>';*/ |
||
776 | } |
||
777 | else |
||
778 | { |
||
779 | print '<tr class="oddeven">'; |
||
780 | print '<td>'.$langs->trans("LinkColor").'</td>'; |
||
781 | print '<td colspan="'.($colspan-1).'">'; |
||
782 | if ($edit) |
||
783 | { |
||
784 | print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),''),'THEME_ELDY_TEXTLINK','formcolor',1).' '; |
||
785 | } |
||
786 | else |
||
787 | { |
||
788 | $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),''); |
||
789 | if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
790 | else |
||
791 | { |
||
792 | //print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$defaultcolor.'" value="'.$langs->trans("Default").'">'; |
||
793 | //print '<span style="color: #000078">'.$langs->trans("Default").'</span>'; |
||
794 | print $langs->trans("Default"); |
||
795 | } |
||
796 | } |
||
797 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong><span style="color: #000078">000078</span></strong>) '; |
||
798 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
799 | print '</span>'; |
||
800 | print '</td>'; |
||
801 | } |
||
802 | |||
803 | // Use Hover |
||
804 | if ($foruserprofile) |
||
805 | { |
||
806 | /* Must first change option to choose color of highlight instead of yes or no. |
||
807 | print '<tr class="oddeven">'; |
||
808 | print '<td>'.$langs->trans("HighlightLinesOnMouseHover").'</td>'; |
||
809 | print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER" disabled="disabled" type="checkbox" '.($conf->global->THEME_ELDY_USE_HOVER?" checked":"").'></td>'; |
||
810 | print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>'; |
||
811 | print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled="disabled"').' type="checkbox" '.($hoverdisabled?"":" checked").'>'; |
||
812 | print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
||
813 | print '</td>'; |
||
814 | print '</tr>'; |
||
815 | */ |
||
816 | } |
||
817 | else { |
||
818 | print '<tr class="oddeven">'; |
||
819 | print '<td>'.$langs->trans("HighlightLinesColor").'</td>'; |
||
820 | print '<td colspan="'.($colspan-1).'">'; |
||
821 | //print '<input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>'; |
||
822 | //print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
||
823 | if ($edit) |
||
824 | { |
||
825 | if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color='e6edf0'; |
||
826 | else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),''); |
||
827 | print $formother->selectColor($color,'THEME_ELDY_USE_HOVER','formcolor',1).' '; |
||
828 | } |
||
829 | else |
||
830 | { |
||
831 | if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color='e6edf0'; |
||
832 | else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),''); |
||
833 | if ($color) |
||
834 | { |
||
835 | if ($color != 'e6edf0') print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
836 | else print $langs->trans("Default"); |
||
837 | } |
||
838 | else print $langs->trans("None"); |
||
839 | } |
||
840 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>e6edf0</strong>) '; |
||
841 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
842 | print '</span>'; |
||
843 | print '</td>'; |
||
844 | } |
||
845 | |||
846 | // Use Checked |
||
847 | if ($foruserprofile) |
||
848 | { |
||
849 | /* Must first change option to choose color of highlight instead of yes or no. |
||
850 | print '<tr class="oddeven">'; |
||
851 | print '<td>'.$langs->trans("HighlightLinesOnMouseHover").'</td>'; |
||
852 | print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER" disabled="disabled" type="checkbox" '.($conf->global->THEME_ELDY_USE_HOVER?" checked":"").'></td>'; |
||
853 | print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>'; |
||
854 | print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled="disabled"').' type="checkbox" '.($hoverdisabled?"":" checked").'>'; |
||
855 | print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
||
856 | print '</td>'; |
||
857 | print '</tr>'; |
||
858 | */ |
||
859 | } |
||
860 | else |
||
861 | { |
||
862 | print '<tr class="oddeven">'; |
||
863 | print '<td>'.$langs->trans("HighlightLinesChecked").'</td>'; |
||
864 | print '<td colspan="'.($colspan-1).'">'; |
||
865 | //print '<input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>'; |
||
866 | //print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; |
||
867 | if ($edit) |
||
868 | { |
||
869 | if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color='e6edf0'; |
||
870 | else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED,array()),''); |
||
871 | print $formother->selectColor($color,'THEME_ELDY_USE_CHECKED','formcolor',1).' '; |
||
872 | } |
||
873 | else |
||
874 | { |
||
875 | if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color='e6edf0'; |
||
876 | else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED,array()),''); |
||
877 | if ($color) |
||
878 | { |
||
879 | if ($color != 'e6edf0') print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; |
||
880 | else print $langs->trans("Default"); |
||
881 | } |
||
882 | else print $langs->trans("None"); |
||
883 | } |
||
884 | print ' <span class="nowraponall">('.$langs->trans("Default").': <strong>e6edf0</strong>) '; |
||
885 | print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); |
||
886 | print '</span>'; |
||
887 | print '</td>'; |
||
888 | print '</tr>'; |
||
889 | } |
||
890 | |||
891 | print '</table>'; |
||
892 | } |
||
893 |