Skip to content

Commit 6decf88

Browse files
committed
Some fixes and improvements
1 parent c5b138e commit 6decf88

File tree

8 files changed

+162
-173
lines changed

8 files changed

+162
-173
lines changed

routes/language_change.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
<?php
2-
/**
3-
* @file setting_user_save.php
4-
* @brief При сохранении параметра оканчивающегося на _json производится
5-
* попытка распарсить значение, чтобы исключить опечатки в формате.
6-
*/
72

83
function language_change(&$core, $params, $post_data)
94
{
@@ -15,7 +10,7 @@ function language_change(&$core, $params, $post_data)
1510

1611
$language = @$post_data['value'];
1712

18-
$_SESSION[DB_PREFIX.'lang'] = $language;
13+
setcookie('lang', $language, time() + 31536000);
1914
if($core->UserAuth->get_id())
2015
{
2116
$core->Config->set_user('language', $language);

templates/style.css

Lines changed: 125 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,116 @@
1+
:root {
2+
--color-bg: #EBEBEB;
3+
--color-modal-bg: white;
4+
--color-text: black;
5+
--color-border: darkgrey;
6+
--color-table-border: #DDDDDD;
7+
--color-white: white;
8+
--color-light-bg: #FAFAFA;
9+
--color-light-border: #CCC;
10+
--color-border-2: #d4d4d4;
11+
--color-border-3: #eee;
12+
--color-bg-2: white;
13+
--color-bg-3: #f5f5f5;
14+
--color-light-text: #000;
15+
--color-light-text-2: #333;
16+
--color-hover-bg: #555;
17+
--color-hover-bg-light: #e9e9e9;
18+
--color-hover-bg-dark: #111;
19+
--color-hover-text: white;
20+
--color-active-bg: #4CAF50;
21+
--color-link: blue;
22+
--color-success: #3a3;
23+
--color-success-hover: #494;
24+
--color-progress-bar: #B4F5B4;
25+
--color-row-hover: #E0E0E0;
26+
--color-header-bg: #EFF3F8;
27+
--color-menu-bg: #333;
28+
--color-tooltip-bg: #ffffe6;
29+
--color-error-bg: #f2dede;
30+
--color-error-text: #a94442;
31+
--color-warning-bg: #fcf8e3;
32+
--color-warning-text: #c09853;
33+
--color-info-bg: #d9edf7;
34+
--color-info-text: #3a87ad;
35+
--color-button-accept: #d6f5d6;
36+
--color-button-decline: #ffe6e6;
37+
--color-button-other: #f5eaea;
38+
--color-button-default: #d3f2bf;
39+
--color-button-accept-hover: #b8e6b8;
40+
--color-button-decline-hover: #ffcccc;
41+
--color-button-other-hover: #e8d5d5;
42+
--color-button-default-hover: #b8e0a0;
43+
--color-description-bg: #F5F5F5;
44+
--color-description-text: #aaa;
45+
--color-calendar-bg: #ddd;
46+
--color-calendar-hover: #ccc;
47+
--color-weekend: red;
48+
--color-disabled: gray;
49+
--color-input-bg: white;
50+
--color-error-border: #ebccd1;
51+
}
52+
53+
:root[data-theme-color="dark"] {
54+
--color-bg: #1a1a1a;
55+
--color-modal-bg: #2a2a2a;
56+
--color-text: #e0e0e0;
57+
--color-border: #444;
58+
--color-table-border: #444;
59+
--color-white: #e0e0e0;
60+
--color-light-bg: #2a2a2a;
61+
--color-light-border: #444;
62+
--color-border-2: #444;
63+
--color-border-3: #444;
64+
--color-bg-2: #1a1a1a;
65+
--color-bg-3: #2a2a2a;
66+
--color-light-text: #e0e0e0;
67+
--color-light-text-2: #e0e0e0;
68+
--color-hover-bg: #555;
69+
--color-hover-bg-light: #333;
70+
--color-hover-bg-dark: #555;
71+
--color-hover-text: #e0e0e0;
72+
--color-active-bg: #4CAF50;
73+
--color-link: #5d9cec;
74+
--color-success: #3a5a3a;
75+
--color-success-hover: #494;
76+
--color-progress-bar: #3a6b3a;
77+
--color-row-hover: #333;
78+
--color-header-bg: #333;
79+
--color-menu-bg: #333;
80+
--color-tooltip-bg: #333;
81+
--color-error-bg: #5a2a2a;
82+
--color-error-text: #FF6B6B;
83+
--color-warning-bg: #5a4a2a;
84+
--color-warning-text: #FFD700;
85+
--color-info-bg: #2a3a5a;
86+
--color-info-text: #7FBFFF;
87+
/* --color-button-accept: #2E7D32; */
88+
/* --color-button-decline: #C62828; */
89+
90+
--color-button-accept: #4CAF50;
91+
--color-button-decline: #F44336;
92+
--color-button-accept-hover: #66BB6A;
93+
--color-button-decline-hover: #EF5350;
94+
95+
/* --color-button-accept: #003500; */
96+
/* --color-button-decline: #3A0000; */
97+
/* --color-button-accept-hover: #005000; */
98+
/* --color-button-decline-hover: #5a0000; */
99+
100+
--color-button-other: #424242;
101+
--color-button-default: #3a5a3a;
102+
--color-button-other-hover: #5a5a5a;
103+
--color-button-default-hover: #4a7a4a;
104+
--color-description-bg: #2a2a2a;
105+
--color-description-text: #999;
106+
--color-calendar-bg: #2a2a2a;
107+
--color-calendar-hover: #333;
108+
--color-weekend: #FF6B6B;
109+
--color-disabled: #777;
110+
--color-input-bg: #333;
111+
--color-error-border: #ebccd1;
112+
}
113+
1114
pre {
2115
margin: 0px 0px;
3116
}
@@ -231,7 +344,6 @@ body {
231344
border: 0px solid #2a2;
232345
color: var(--color-white);
233346
font-weight: bold;
234-
text-transform: uppercase;
235347
font-size: 14px;
236348
outline: none;
237349
cursor: pointer;
@@ -499,6 +611,9 @@ body {
499611
margin-bottom: 5px;
500612
width: 130px;
501613
}
614+
.form-button:hover {
615+
background-color: var(--color-button-default-hover);
616+
}
502617
.button-accept {
503618
background-color: var(--color-button-accept);
504619
color: var(--color-text);
@@ -508,6 +623,9 @@ body {
508623
margin-bottom: 5px;
509624
width: 130px;
510625
}
626+
.button-accept:hover {
627+
background-color: var(--color-button-accept-hover);
628+
}
511629
.button-decline {
512630
background-color: var(--color-button-decline);
513631
color: var(--color-text);
@@ -517,6 +635,9 @@ body {
517635
margin-bottom: 5px;
518636
width: 130px;
519637
}
638+
.button-decline:hover {
639+
background-color: var(--color-button-decline-hover);
640+
}
520641
.button-other {
521642
background-color: var(--color-button-other);
522643
color: var(--color-text);
@@ -526,6 +647,9 @@ body {
526647
margin-bottom: 5px;
527648
width: 130px;
528649
}
650+
.button-other:hover {
651+
background-color: var(--color-button-other-hover);
652+
}
529653
.form-error {
530654
padding: 5px;
531655
margin-bottom: 5px;

templates/style.dark.css

Lines changed: 0 additions & 49 deletions
This file was deleted.

templates/style.light.css

Lines changed: 0 additions & 47 deletions
This file was deleted.

templates/tpl.header.php

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
77
<title><?php L('Title') ?></title>
88
<link rel="icon" type="image/png" href="<?php ls('templates/favicon.png') ?>">
9-
<link type="text/css" href="<?php ls('templates/style.' . $core->Config->get_user('theme', isset($_SESSION[DB_PREFIX.'theme']) ? $_SESSION[DB_PREFIX.'theme'] : 'light') . '.css') ?>" rel="stylesheet" />
109
<link type="text/css" href="<?php ls('templates/style.css') ?>" rel="stylesheet" />
1110
<link type="text/css" href="<?php ls('templates/flatpickr.material_red.css') ?>" rel="stylesheet" />
1211
<script>
@@ -21,6 +20,9 @@
2120
<script src="/websco/moment.js"></script>
2221
<script src="/websco/pikaday.js"></script>
2322
-->
23+
<script type="text/javascript">
24+
document.documentElement.setAttribute("data-theme-color", localStorage.getItem("theme-color") || 'light');
25+
</script>
2426
</head>
2527
<body>
2628
<ul class="menu-bar">
@@ -30,40 +32,36 @@
3032
<li><a href="<?php ln('permissions' . (isset($current_folder['id']) ? '/' . $current_folder['id'] .'/' : '')) ?>"><?php L('Permissions') ?></a></li>
3133
<li><a href="<?php ln('users') ?>"><?php L('Users') ?></a></li>
3234
<?php } ?>
33-
<li class="right-menu-container">
34-
<ul class="right-menu">
35-
<li class="menu-item">
36-
<a href="#" onclick="return false;"><?php L('Language') ?></a>
37-
<ul class="submenu">
38-
<?php
39-
$languages = languages_list();
40-
foreach($languages as $language)
41-
{
42-
echo '<li><a href="#" onclick="f_language_change(\'' . htmlspecialchars($language) . '\'); return false;">' . htmlspecialchars(strtoupper($language)) . '</a></li>';
43-
}
44-
?>
45-
</ul>
46-
</li>
4735

48-
<?php if($core->UserAuth->get_id()) { ?>
36+
<li class="right-menu-container">
37+
<ul class="right-menu">
38+
39+
<li class="menu-item">
40+
<a href="#" onclick="return false;"><?php L('Theme') ?></a>
41+
<ul class="submenu">
42+
<li><a href="#" onclick="f_theme_change('dark'); return false;">dark</a></li>
43+
<li><a href="#" onclick="f_theme_change('light'); return false;">light</a></li>
44+
</ul>
45+
</li>
4946

50-
<li class="menu-item">
51-
<a href="#" onclick="return false;"><?php L('Theme') ?></a>
52-
<ul class="submenu">
53-
<?php
54-
$themes = themes_list();
55-
foreach($themes as $theme)
56-
{
57-
echo '<li><a href="#" onclick="f_theme_change(\'' . htmlspecialchars($theme) . '\'); return false;">' . htmlspecialchars($theme) . '</a></li>';
58-
}
59-
?>
60-
</ul>
61-
</li>
47+
<li class="menu-item">
48+
<a href="#" onclick="return false;"><?php L('Language') ?></a>
49+
<ul class="submenu">
50+
<?php
51+
$languages = languages_list();
52+
foreach($languages as $language)
53+
{
54+
echo '<li><a href="#" onclick="f_language_change(\'' . htmlspecialchars($language) . '\'); return false;">' . htmlspecialchars(strtoupper($language)) . '</a></li>';
55+
}
56+
?>
57+
</ul>
58+
</li>
6259

63-
<li><a href="<?php ln('logoff') ?>"><?php L('Logout') ?> (<?php eh($core->UserAuth->get_login()); ?>)</a></li>
64-
<?php } else { ?>
65-
<li><a href="<?php ln('login') ?>"><?php L('LoginBtn') ?></a></li>
66-
<?php } ?>
67-
</ul>
60+
<?php if($core->UserAuth->get_id()) { ?>
61+
<li><a href="<?php ln('logoff') ?>"><?php L('Logout') ?> (<?php eh($core->UserAuth->get_login()); ?>)</a></li>
62+
<?php } else { ?>
63+
<li><a href="<?php ln('login') ?>"><?php L('LoginBtn') ?></a></li>
64+
<?php } ?>
65+
</ul>
6866
</li>
6967
</ul>

templates/tpl.login.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
<?php if(!empty($error_msg)) { ?>
1111
<p><?php eh($error_msg); ?></p>
1212
<?php } ?>
13-
<input type="submit" value="<?php L('LoginBtn') ?>" /><br />
13+
<button type="submit"><?php L('LoginBtn') ?></button><br />
14+
<br />
1415
</form>
1516
<a href="<?php ln('register_form') ?>" onclick="return f_show_form(this.href);"><?php L('Register') ?></a> &VerticalSeparator; <a href="<?php ln('password_reset_send_form') ?>" onclick="return f_show_form(this.href);"><?php L('ResetPasswordBtn') ?></a><br />
1617
</div>

0 commit comments

Comments
 (0)