38 'MENU1-SELECTED' =>
'#506cb8',
41 'INNER-BOX'=>
'#DCE1EF',
42 'INNER-BOX-TITLE'=>
'#023575',
43 'FONT-MENU1' =>
'#ffffff',
44 'FONT-MENU2' =>
'#ffffff',
45 'FONT-TABLE' =>
'#222bd0',
46 'FONT-DEFAULT' =>
'#000074',
47 'FOLDER' =>
'#ffffff',
48 'FONT-TABLE-HEADER' =>
'#0C106D',
49 'FONT-FOLDER' =>
'#000074'];
55 self::$aCSSColorName = [
'H2' => _(
"Titre"),
59 'MENU1-SELECTED' => _(
"Fond item choisi"),
60 'TR-ODD'=>_(
"Ligne impaire"),
61 'TR-EVEN'=>_(
"Ligne paire"),
62 'INNER-BOX'=>_(
"Fond Boîte dialogue"),
63 'INNER-BOX-TITLE'=>_(
"Fond titre dialogue"),
64 'FOLDER' => _(
"Fond "),
65 'FONT-MENU1' => _(
"Caractère"),
66 'FONT-MENU2' => _(
"Caractère"),
67 'FONT-TABLE' => _(
"Caractère"),
68 'FONT-DEFAULT' => _(
"Caractère par défaut"),
69 'FONT-TABLE-HEADER' => _(
"Caractère en-tête"),
70 'FONT-FOLDER' => _(
"Caractère")];
77 $aColor =
$cn->get_array(
"select a_code,a_value from parm_appearance");
87 foreach ($this->aColor as $key =>
$value) {
88 $cn->exec_sql(
"insert into parm_appearance values ($1,$2)
89 on conflict (a_code) do update set a_value =excluded.a_value", [$key,
$value]);
98 if (isset($this->aColor[$p_code])) {
99 return $this->aColor[$p_code];
101 throw new Exception(
'NAP100: INVALID CODE');
105 $aKey = array_keys($this->aColor);
106 if (!in_array($p_code, $aKey)) {
107 throw new \Exception(
"NA63: Code invalide ");
109 if (!preg_match(
'/^#[a-f0-9]{6}$/i', $p_value))
111 throw new \Exception(
"NA67: Couleur invalide ");
113 $this->aColor[$p_code] = $p_value;
119 $body = $this->aColor[
'BODY'];
120 $h2 = $this->aColor[
'H2'];
121 $menu1 = $this->aColor[
'MENU1'];
122 $menu2 = $this->aColor[
'MENU2'];
123 $menu1_selected = $this->aColor[
'MENU1-SELECTED'];
124 $menu1_font = $this->aColor[
'FONT-MENU1'];
125 $menu2_font = $this->aColor[
'FONT-MENU2'];
126 $font_table = $this->aColor[
'FONT-TABLE'];
127 $font_default = $this->aColor[
'FONT-DEFAULT'];
128 $font_table_header = $this->aColor[
'FONT-TABLE-HEADER'];
129 $folder_font = $this->aColor[
'FONT-FOLDER'];
130 $folder = $this->aColor[
'FOLDER'];
131 $tr_odd=$this->aColor[
'TR-ODD'];
132 $tr_even=$this->aColor[
'TR-EVEN'];
133 $inner_box=$this->aColor[
'INNER-BOX'];
134 $inner_box_title=$this->aColor[
'INNER-BOX-TITLE'];
139 color:{$folder_font};
140 background-color: transparent;
143 color:{$folder_font};
144 background-color: {$folder};
147 background-color: {$body} !important;
148 color:{$font_default} !important;
151 background-color: {$h2} ;
154 background-color: {$inner_box_title} ;
156 .nav-fill .nav-item {
157 background: {$menu1};
158 color: {$menu1_font};
161 background-color: {$menu2};
164 .nav-pills .nav-link.active {
165 background-color: {$menu1_selected} !important;
168 color:{$font_table} !important;
171 color:{$font_table_header};
173 tr.odd,div.inner_box
tr.odd,div.box
tr.odd {
174 background-color: {$tr_odd};
176 #calc1 , div.inner_box , div.box, #add_todo_list , div.add_todo_list,body.op_detail_frame, div.op_detail_frame {
177 background-color:{$inner_box};
180 background-color: {$tr_even} ;
191 $label=_(
"Cocher pour remettre les couleurs d'origine");
194 $str_reset=
$chk->input();
196<div
class=
"form-group">
197 <
label for=
"reset_color">
214 $value = $this->aColor[$p_key];
216 $label = self::$aCSSColorName[$p_key];
217 $str_icolor = $icolor->input();
220<div
class=
"form-group">
221 <
label for=
"{$p_key}">
231 return '<h3 class="">'.h($p_string).
'</h3>';
241 $str .= $this->build_input_row(
'BODY');
242 $str .= $this->build_input_row(
'FONT-DEFAULT');
244 $str.=$this->
title(_(
"(2) En-tête dossier"));
245 $str .= $this->build_input_row(
'FOLDER');
246 $str .= $this->build_input_row(
'FONT-FOLDER');
249 $str .= $this->build_input_row(
'H2');
251 $str.=$this->
title(
'(4)'._(
"Menu principal"));
252 $str .= $this->build_input_row(
'MENU1');
253 $str .= $this->build_input_row(
'FONT-MENU1');
254 $str .= $this->build_input_row(
'MENU1-SELECTED');
256 $str.=$this->
title(
'(5)'._(
"Sous-Menu"));
257 $str .= $this->build_input_row(
'MENU2');
258 $str .= $this->build_input_row(
'FONT-MENU2');
261 $str .= $this->build_input_row(
'FONT-TABLE');
262 $str .= $this->build_input_row(
'TR-ODD');
263 $str .= $this->build_input_row(
'TR-EVEN');
264 $str .= $this->build_input_row(
'FONT-TABLE-HEADER');
267 $str.=$this->
title(
'(7)'._(
"Boîte de dialogue"));
268 $str .= $this->build_input_row(
'INNER-BOX');
269 $str .= $this->build_input_row(
'INNER-BOX-TITLE');
271 $str.=$this->input_reset();
280 return self::$aCSSColor;
288 self::$aCSSColor = $aCSSColor;
296 return self::$aCSSColorName;
304 self::$aCSSColorName = $aCSSColorName;
309 $this->aColor=self::$aCSSColor ;
316 $http=new \HttpInput();
317 if (
$http->post(
"reset_color",
"number",0) == 1 ) {
321 foreach (self::$aCSSColorName as $key=>
$value) {
323 if (empty(
$color) ) {
return false;}
324 $this->set_color($key,
$color);
h2($p_string, $p_class="", $raw="")
th($p_string, $p_extra='', $raw='')
tr($p_string, $p_extra='')
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
set_color($p_code, $p_value)
static setACSSColor(array $aCSSColor)
static getACSSColorName()
build_input_row(string $p_key)
Build a html string for each color.
from_post()
retrieve data from POST and returns true, if nothing is retrieved , returns false
static setACSSColorName(array $aCSSColorName)
input_form()
Build the HTML string for inputing the color.