@@ -92,6 +92,9 @@ discard block |
||
92 | 92 | } |
93 | 93 | } |
94 | 94 | |
95 | + /** |
|
96 | + * @param string $user_mail |
|
97 | + */ |
|
95 | 98 | public function passre($user_mail) |
96 | 99 | { |
97 | 100 | $user = $this->get($user_mail, 'mail'); |
@@ -322,6 +325,9 @@ discard block |
||
322 | 325 | return $user->id; |
323 | 326 | } |
324 | 327 | |
328 | + /** |
|
329 | + * @param string $pass |
|
330 | + */ |
|
325 | 331 | public function hashpass($pass) |
326 | 332 | { |
327 | 333 | return password_hash($pass, PASSWORD_DEFAULT); |
@@ -359,6 +365,9 @@ discard block |
||
359 | 365 | return $return; |
360 | 366 | } |
361 | 367 | |
368 | + /** |
|
369 | + * @param integer $cat_id |
|
370 | + */ |
|
362 | 371 | public function addUserActivity($user_id, $cat_id , $text = '') |
363 | 372 | { |
364 | 373 | $ua = new Users\Activity([ |
@@ -196,17 +196,20 @@ |
||
196 | 196 | */ |
197 | 197 | public function get($idn, $ltype = 'id') |
198 | 198 | { |
199 | - if (!$idn) |
|
200 | - return false; |
|
199 | + if (!$idn) { |
|
200 | + return false; |
|
201 | + } |
|
201 | 202 | |
202 | - if (is_numeric($idn) && $ltype != 'login') |
|
203 | - $user = Users\User::get($idn, 'id'); |
|
204 | - elseif ($ltype == 'login') |
|
205 | - $user = Users\User::get($idn, 'login'); |
|
206 | - else |
|
207 | - $user = Users\User::get($idn, 'mail'); |
|
208 | - if (!$user) |
|
209 | - return []; |
|
203 | + if (is_numeric($idn) && $ltype != 'login') { |
|
204 | + $user = Users\User::get($idn, 'id'); |
|
205 | + } elseif ($ltype == 'login') { |
|
206 | + $user = Users\User::get($idn, 'login'); |
|
207 | + } else { |
|
208 | + $user = Users\User::get($idn, 'mail'); |
|
209 | + } |
|
210 | + if (!$user) { |
|
211 | + return []; |
|
212 | + } |
|
210 | 213 | |
211 | 214 | return $user; |
212 | 215 | } |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | if (isset($_GET['logout'])) { |
25 | 25 | return $this->logOut(); |
26 | 26 | } |
27 | - if (filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_session_hash') && filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_id')) { |
|
28 | - return $this->cuntinueSession(filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_session_hash'), filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_id')); |
|
27 | + if (filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_session_hash') && filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_id')) { |
|
28 | + return $this->cuntinueSession(filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_session_hash'), filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_id')); |
|
29 | 29 | } |
30 | 30 | if (isset($_POST['autorization']) && trim(filter_input(INPUT_POST, 'user_login')) && trim(filter_input(INPUT_POST, 'user_pass'))) { |
31 | 31 | unset($_POST['autorization']); |
@@ -41,18 +41,18 @@ discard block |
||
41 | 41 | |
42 | 42 | public function logOut($redirect = true) |
43 | 43 | { |
44 | - if (!empty($_COOKIE[$this->cookiePrefix . "_user_session_hash"]) && !empty($_COOKIE[$this->cookiePrefix . "_user_id"])) { |
|
44 | + if (!empty($_COOKIE[$this->cookiePrefix."_user_session_hash"]) && !empty($_COOKIE[$this->cookiePrefix."_user_id"])) { |
|
45 | 45 | $session = Users\Session::get([ |
46 | - ['user_id', $_COOKIE[$this->cookiePrefix . "_user_id"]], |
|
47 | - ['hash', $_COOKIE[$this->cookiePrefix . "_user_session_hash"]] |
|
46 | + ['user_id', $_COOKIE[$this->cookiePrefix."_user_id"]], |
|
47 | + ['hash', $_COOKIE[$this->cookiePrefix."_user_session_hash"]] |
|
48 | 48 | ]); |
49 | 49 | if ($session) { |
50 | 50 | $session->delete(); |
51 | 51 | } |
52 | 52 | } |
53 | 53 | if (!headers_sent()) { |
54 | - setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/"); |
|
55 | - setcookie($this->cookiePrefix . "_user_id", '', 0, "/"); |
|
54 | + setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/"); |
|
55 | + setcookie($this->cookiePrefix."_user_id", '', 0, "/"); |
|
56 | 56 | } |
57 | 57 | if ($redirect) { |
58 | 58 | if (!empty($this->config['logoutUrl'][$this->app->type])) { |
@@ -70,25 +70,25 @@ discard block |
||
70 | 70 | ]); |
71 | 71 | if ($session && $session->user && $session->user->blocked) { |
72 | 72 | if (!headers_sent()) { |
73 | - setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/"); |
|
74 | - setcookie($this->cookiePrefix . "_user_id", '', 0, "/"); |
|
73 | + setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/"); |
|
74 | + setcookie($this->cookiePrefix."_user_id", '', 0, "/"); |
|
75 | 75 | } |
76 | 76 | Msg::add('Ваш аккаунт заблокирован', 'info'); |
77 | 77 | return; |
78 | 78 | } |
79 | 79 | if ($session && $session->user && !$session->user->blocked) { |
80 | 80 | if (!headers_sent()) { |
81 | - setcookie($this->cookiePrefix . "_user_session_hash", $session->hash, time() + 360000, "/"); |
|
82 | - setcookie($this->cookiePrefix . "_user_id", $session->user_id, time() + 360000, "/"); |
|
81 | + setcookie($this->cookiePrefix."_user_session_hash", $session->hash, time() + 360000, "/"); |
|
82 | + setcookie($this->cookiePrefix."_user_id", $session->user_id, time() + 360000, "/"); |
|
83 | 83 | } |
84 | 84 | if (!empty($this->config['needActivation']) && $session->user->activation) { |
85 | 85 | if (!headers_sent()) { |
86 | - setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/"); |
|
87 | - setcookie($this->cookiePrefix . "_user_id", '', 0, "/"); |
|
86 | + setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/"); |
|
87 | + setcookie($this->cookiePrefix."_user_id", '', 0, "/"); |
|
88 | 88 | } |
89 | - Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $session->user->id . '"><b>повторно выслать ссылку активации</b></a>'); |
|
89 | + Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$session->user->id.'"><b>повторно выслать ссылку активации</b></a>'); |
|
90 | 90 | } elseif ($session->user->activation) { |
91 | - Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $session->user->id . '"><b>повторно выслать ссылку активации</b></a>'); |
|
91 | + Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$session->user->id.'"><b>повторно выслать ссылку активации</b></a>'); |
|
92 | 92 | } |
93 | 93 | if (!$session->user->mail && !empty($this->config['noMailNotify'])) { |
94 | 94 | Msg::add($this->config['noMailNotify']); |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | Users\User::$cur->save(); |
99 | 99 | } else { |
100 | 100 | if (!headers_sent()) { |
101 | - setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/"); |
|
102 | - setcookie($this->cookiePrefix . "_user_id", '', 0, "/"); |
|
101 | + setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/"); |
|
102 | + setcookie($this->cookiePrefix."_user_id", '', 0, "/"); |
|
103 | 103 | } |
104 | 104 | Msg::add('Ваша сессия устарела или более недействительна, вам необходимо пройти <a href = "/users/login">авторизацию</a> заново', 'info'); |
105 | 105 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | $user = $this->get($user_mail, 'mail'); |
111 | 111 | if (!$user) { |
112 | - Msg::add('Пользователь ' . $user_mail . ' не найден, проверьте првильность ввода e-mail или зарегистрируйтесь', 'danger'); |
|
112 | + Msg::add('Пользователь '.$user_mail.' не найден, проверьте првильность ввода e-mail или зарегистрируйтесь', 'danger'); |
|
113 | 113 | return false; |
114 | 114 | } |
115 | 115 | $passre = Users\Passre::get([['user_id', $user->id], ['status', 1]]); |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | $passre->status = 2; |
118 | 118 | $passre->save(); |
119 | 119 | } |
120 | - $hash = $user->id . '_' . Tools::randomString(50); |
|
120 | + $hash = $user->id.'_'.Tools::randomString(50); |
|
121 | 121 | $passre = new Users\Passre(['user_id' => $user->id, 'status' => 1, 'hash' => $hash]); |
122 | 122 | $passre->save(); |
123 | - Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, $user_mail, 'Восстановление пароля на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для продолжения восстановления пароля перейдите по ссылке: <a href = "http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/?passrecont=1&hash=' . $hash . '">' . idn_to_utf8(INJI_DOMAIN_NAME) . '/?passrecont=1&hash=' . $hash . '</a>'); |
|
123 | + Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, $user_mail, 'Восстановление пароля на сайте '.idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />для продолжения восстановления пароля перейдите по ссылке: <a href = "http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/?passrecont=1&hash='.$hash.'">'.idn_to_utf8(INJI_DOMAIN_NAME).'/?passrecont=1&hash='.$hash.'</a>'); |
|
124 | 124 | Tools::redirect('/', 'На указанный почтовый ящик была выслана инструкция по восстановлению пароля', 'success'); |
125 | 125 | } |
126 | 126 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $user->pass = $this->hashpass($pass); |
139 | 139 | $user->save(); |
140 | 140 | $this->autorization($user->mail, $user->pass, 'mail'); |
141 | - Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, $user->mail, 'Новый пароль на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />Ваш новый пароль: ' . $pass); |
|
141 | + Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, $user->mail, 'Новый пароль на сайте '.idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />Ваш новый пароль: '.$pass); |
|
142 | 142 | Tools::redirect('/', 'На указанный почтовый ящик был выслан новый пароль', 'success'); |
143 | 143 | } |
144 | 144 | } |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | $user = $this->get($login, $ltype); |
152 | 152 | if ($user && $this->verifypass($pass, $user->pass) && !$user->blocked) { |
153 | 153 | if (!empty($this->config['needActivation']) && $user->activation) { |
154 | - Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $user->id . '"><b>повторно выслать ссылку активации</b></a>'); |
|
154 | + Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$user->id.'"><b>повторно выслать ссылку активации</b></a>'); |
|
155 | 155 | } elseif ($user->activation) { |
156 | - Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $user->id . '"><b>повторно выслать ссылку активации</b></a>'); |
|
156 | + Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$user->id.'"><b>повторно выслать ссылку активации</b></a>'); |
|
157 | 157 | } |
158 | 158 | if (!$user->mail && !empty($this->config['noMailNotify'])) { |
159 | 159 | Msg::add($this->config['noMailNotify']); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if ($user && $user->blocked) { |
173 | 173 | Msg::add('Вы заблокированы', 'danger'); |
174 | 174 | } elseif ($user) { |
175 | - Msg::add('Вы ошиблись при наборе пароля или логина, попробуйте ещё раз или воспользуйтесь <a href = "?passre=1&user_mail=' . $user->mail . '">Восстановлением пароля</a>', 'danger'); |
|
175 | + Msg::add('Вы ошиблись при наборе пароля или логина, попробуйте ещё раз или воспользуйтесь <a href = "?passre=1&user_mail='.$user->mail.'">Восстановлением пароля</a>', 'danger'); |
|
176 | 176 | } else { |
177 | 177 | Msg::add('Данный почтовый ящик не зарегистрирован в системе', 'danger'); |
178 | 178 | } |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | $session->save(); |
196 | 196 | |
197 | 197 | if (!headers_sent()) { |
198 | - setcookie($this->cookiePrefix . "_user_session_hash", $session->hash, time() + 360000, "/"); |
|
199 | - setcookie($this->cookiePrefix . "_user_id", $session->user_id, time() + 360000, "/"); |
|
198 | + setcookie($this->cookiePrefix."_user_session_hash", $session->hash, time() + 360000, "/"); |
|
199 | + setcookie($this->cookiePrefix."_user_id", $session->user_id, time() + 360000, "/"); |
|
200 | 200 | } else { |
201 | 201 | Msg::add('Не удалось провести авторизацию. Попробуйте позже', 'info'); |
202 | 202 | } |
@@ -318,20 +318,20 @@ discard block |
||
318 | 318 | $this->autorization($user_mail, $pass, 'mail'); |
319 | 319 | } |
320 | 320 | if (!empty($this->config['needActivation'])) { |
321 | - $from = 'noreply@' . INJI_DOMAIN_NAME; |
|
321 | + $from = 'noreply@'.INJI_DOMAIN_NAME; |
|
322 | 322 | $to = $user_mail; |
323 | - $subject = 'Регистрация на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME); |
|
324 | - $text = 'Вы были зарегистрированы на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: ' . $pass; |
|
325 | - $text .='<br />'; |
|
323 | + $subject = 'Регистрация на сайте '.idn_to_utf8(INJI_DOMAIN_NAME); |
|
324 | + $text = 'Вы были зарегистрированы на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: '.$pass; |
|
326 | 325 | $text .= '<br />'; |
327 | - $text .= 'Для активации вашего аккаунта перейдите по ссылке <a href = "http://' . INJI_DOMAIN_NAME . '/users/activation/' . $user->id . '/' . $user->activation . '">http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/users/activation/' . $user->id . '/' . $user->activation . '</a>'; |
|
326 | + $text .= '<br />'; |
|
327 | + $text .= 'Для активации вашего аккаунта перейдите по ссылке <a href = "http://'.INJI_DOMAIN_NAME.'/users/activation/'.$user->id.'/'.$user->activation.'">http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/users/activation/'.$user->id.'/'.$user->activation.'</a>'; |
|
328 | 328 | Tools::sendMail($from, $to, $subject, $text); |
329 | 329 | Msg::add('Вы были зарегистрированы. На указанный почтовый ящик был выслан ваш пароль и ссылка для активации', 'success'); |
330 | 330 | } else { |
331 | - $from = 'noreply@' . INJI_DOMAIN_NAME; |
|
331 | + $from = 'noreply@'.INJI_DOMAIN_NAME; |
|
332 | 332 | $to = $user_mail; |
333 | - $subject = 'Регистрация на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME); |
|
334 | - $text = 'Вы были зарегистрированы на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: ' . $pass; |
|
333 | + $subject = 'Регистрация на сайте '.idn_to_utf8(INJI_DOMAIN_NAME); |
|
334 | + $text = 'Вы были зарегистрированы на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: '.$pass; |
|
335 | 335 | Tools::sendMail($from, $to, $subject, $text); |
336 | 336 | Msg::add('Вы были зарегистрированы. На указанный почтовый ящик был выслан ваш пароль', 'success'); |
337 | 337 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | 'map' => [ |
45 | 45 | ['name', 'type'], |
46 | 46 | ['required', 'save'], |
47 | - [ 'userfield'] |
|
47 | + ['userfield'] |
|
48 | 48 | ] |
49 | 49 | ] |
50 | 50 | ]; |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <fieldset> |
2 | 2 | <?php |
3 | - if (\Users\User::$cur->id) { |
|
4 | - $userAdds = Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id]]); |
|
5 | - $values = []; |
|
6 | - foreach ($userAdds as $userAdd) { |
|
7 | - $values[$userAdd->id] = $userAdd->values(['array' => true]); |
|
8 | - } |
|
9 | - if ($userAdds) { |
|
10 | - $form->input('select', 'userAddsId', 'Ваши контакты', ['values' => ['' => 'Выберите'] + Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id], 'forSelect' => true])]); |
|
11 | - echo '<hr />'; |
|
12 | - } |
|
13 | - ?> |
|
3 | + if (\Users\User::$cur->id) { |
|
4 | + $userAdds = Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id]]); |
|
5 | + $values = []; |
|
6 | + foreach ($userAdds as $userAdd) { |
|
7 | + $values[$userAdd->id] = $userAdd->values(['array' => true]); |
|
8 | + } |
|
9 | + if ($userAdds) { |
|
10 | + $form->input('select', 'userAddsId', 'Ваши контакты', ['values' => ['' => 'Выберите'] + Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id], 'forSelect' => true])]); |
|
11 | + echo '<hr />'; |
|
12 | + } |
|
13 | + ?> |
|
14 | 14 | <script> |
15 | 15 | var userAddsValues = <?= json_encode($values); ?>; |
16 | 16 | inji.onLoad(function () { |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | }) |
25 | 25 | </script> |
26 | 26 | <?php |
27 | - } |
|
28 | - foreach (Ecommerce\UserAdds\Field::getList(['order' => ['weight', 'asc']]) as $field) { |
|
29 | - $form->input($field->type, "userAdds[fields][{$field->id}]", $field->name, ['required' => $field->required]); |
|
30 | - } |
|
31 | - ?> |
|
27 | + } |
|
28 | + foreach (Ecommerce\UserAdds\Field::getList(['order' => ['weight', 'asc']]) as $field) { |
|
29 | + $form->input($field->type, "userAdds[fields][{$field->id}]", $field->name, ['required' => $field->required]); |
|
30 | + } |
|
31 | + ?> |
|
32 | 32 | </fieldset> |
33 | 33 | \ No newline at end of file |
@@ -11,6 +11,11 @@ |
||
11 | 11 | { |
12 | 12 | function indexAction() |
13 | 13 | { |
14 | + |
|
15 | + /** |
|
16 | + * @param DOMDocument $xml |
|
17 | + * @param string $nodeName |
|
18 | + */ |
|
14 | 19 | function addToXml($xml, $parent, $nodeName, $text) |
15 | 20 | { |
16 | 21 | $node = $parent->appendChild($xml->createElement($nodeName)); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | addToXml($xml, $shop, 'name', \App::$cur->config['site']['name']); |
38 | 38 | addToXml($xml, $shop, 'company', \App::$cur->config['site']['company_name']); |
39 | - addToXml($xml, $shop, 'url', 'http://' . INJI_DOMAIN_NAME); |
|
39 | + addToXml($xml, $shop, 'url', 'http://'.INJI_DOMAIN_NAME); |
|
40 | 40 | |
41 | 41 | $currencies = $xml->createElement('currencies'); |
42 | 42 | $currency = $currencies->appendChild($xml->createElement('currency')); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $offers = $xml->createElement('offers'); |
61 | 61 | foreach (App::$cur->ecommerce->getItems() as $item) { |
62 | 62 | $offer = $offers->appendChild($xml->createElement('offer')); |
63 | - addToXml($xml, $offer, 'url', 'http://' . INJI_DOMAIN_NAME . '/ecommerce/view/' . $item->id); |
|
63 | + addToXml($xml, $offer, 'url', 'http://'.INJI_DOMAIN_NAME.'/ecommerce/view/'.$item->id); |
|
64 | 64 | addToXml($xml, $offer, 'price', $item->getPrice()->price); |
65 | 65 | addToXml($xml, $offer, 'currencyId', 'RUR'); |
66 | 66 | addToXml($xml, $offer, 'categoryId', $item->category_id); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | header("Content-Type: text/xml"); |
88 | 88 | header("Expires: Thu, 19 Feb 1998 13:24:18 GMT"); |
89 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
89 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
90 | 90 | header("Cache-Control: no-cache, must-revalidate"); |
91 | 91 | header("Cache-Control: post-check=0,pre-check=0"); |
92 | 92 | header("Cache-Control: max-age=0"); |
@@ -17,20 +17,20 @@ |
||
17 | 17 | <h1><?= $item->name(); ?></h1> |
18 | 18 | <ul class="item-options"> |
19 | 19 | <?php |
20 | - foreach ($item->options as $param) { |
|
21 | - if (!$param->item_option_view || !$param->value) |
|
22 | - continue; |
|
23 | - if ($param->item_option_type == 'select') { |
|
24 | - if (empty($param->option->items[$param->value])) |
|
25 | - continue; |
|
26 | - $value = $param->option->items[$param->value]->value; |
|
27 | - } else { |
|
28 | - $value = $param->value; |
|
29 | - } |
|
30 | - $paramName = $param->item_option_name; |
|
31 | - echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>"; |
|
32 | - } |
|
33 | - ?> |
|
20 | + foreach ($item->options as $param) { |
|
21 | + if (!$param->item_option_view || !$param->value) |
|
22 | + continue; |
|
23 | + if ($param->item_option_type == 'select') { |
|
24 | + if (empty($param->option->items[$param->value])) |
|
25 | + continue; |
|
26 | + $value = $param->option->items[$param->value]->value; |
|
27 | + } else { |
|
28 | + $value = $param->value; |
|
29 | + } |
|
30 | + $paramName = $param->item_option_name; |
|
31 | + echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>"; |
|
32 | + } |
|
33 | + ?> |
|
34 | 34 | </ul> |
35 | 35 | <div class="item-actions"> |
36 | 36 | <div class="item-price"> |
@@ -18,11 +18,13 @@ |
||
18 | 18 | <ul class="item-options"> |
19 | 19 | <?php |
20 | 20 | foreach ($item->options as $param) { |
21 | - if (!$param->item_option_view || !$param->value) |
|
22 | - continue; |
|
21 | + if (!$param->item_option_view || !$param->value) { |
|
22 | + continue; |
|
23 | + } |
|
23 | 24 | if ($param->item_option_type == 'select') { |
24 | - if (empty($param->option->items[$param->value])) |
|
25 | - continue; |
|
25 | + if (empty($param->option->items[$param->value])) { |
|
26 | + continue; |
|
27 | + } |
|
26 | 28 | $value = $param->option->items[$param->value]->value; |
27 | 29 | } else { |
28 | 30 | $value = $param->value; |
@@ -24,8 +24,8 @@ |
||
24 | 24 | 'label' => ['type' => 'text'], |
25 | 25 | 'type' => ['type' => 'text'], |
26 | 26 | 'required' => ['type' => 'bool'], |
27 | - 'form_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'form'], |
|
28 | - 'user_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
27 | + 'form_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'form'], |
|
28 | + 'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
29 | 29 | 'input_params' => ['type' => 'textarea'], |
30 | 30 | 'weight' => ['type' => 'number'] |
31 | 31 | ]; |
@@ -24,10 +24,10 @@ |
||
24 | 24 | public static $cols = [ |
25 | 25 | 'name' => ['type' => 'text'], |
26 | 26 | 'description' => ['type' => 'html'], |
27 | - 'user_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
27 | + 'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
28 | 28 | 'date_create' => ['type' => 'dateTime'], |
29 | 29 | //Менеджеры |
30 | - 'inputs' => [ 'type' => 'dataManager', 'relation' => 'inputs'], |
|
30 | + 'inputs' => ['type' => 'dataManager', 'relation' => 'inputs'], |
|
31 | 31 | ]; |
32 | 32 | public static $dataManagers = [ |
33 | 33 | 'manager' => [ |
@@ -2,17 +2,17 @@ |
||
2 | 2 | <div class="table-responsive"> |
3 | 3 | <table class="table table-bordered table-condensed table-striped table-hover"> |
4 | 4 | <?php |
5 | - $i = 0; |
|
6 | - foreach ($items as $item) { |
|
7 | - ?> |
|
5 | + $i = 0; |
|
6 | + foreach ($items as $item) { |
|
7 | + ?> |
|
8 | 8 | <tr> |
9 | 9 | <?php $this->widget('Ecommerce\items/item-tablerow', ['item' => $item]); ?> |
10 | 10 | </tr> |
11 | 11 | <?php |
12 | - if (!( ++$i % 3)) { |
|
13 | - echo '</div><div class="row">'; |
|
14 | - } |
|
15 | - } |
|
16 | - ?> |
|
12 | + if (!( ++$i % 3)) { |
|
13 | + echo '</div><div class="row">'; |
|
14 | + } |
|
15 | + } |
|
16 | + ?> |
|
17 | 17 | </table></div> |
18 | 18 | </div> |
19 | 19 | \ No newline at end of file |
@@ -1,21 +1,21 @@ |
||
1 | 1 | <div class="ecommerce-sidebar-categorys"> |
2 | 2 | <?php |
3 | - if (empty($category)) { |
|
4 | - $category = []; |
|
5 | - } |
|
6 | - $tree = new Ui\Tree(); |
|
7 | - $tree->ul('\Ecommerce\Category', 0, function($categoryItem) use($category) { |
|
8 | - if ($category && $category->id == $categoryItem->id) { |
|
9 | - $class = 'active'; |
|
10 | - } else { |
|
11 | - $class = ''; |
|
12 | - } |
|
13 | - return [ |
|
14 | - 'attributes' => [ |
|
15 | - 'class' => $class, |
|
16 | - ], |
|
17 | - 'text' => "<a {$class} href = '/ecommerce/itemList/{$categoryItem->id}'>{$categoryItem->name}</a>" |
|
18 | - ]; |
|
19 | - }); |
|
20 | - ?> |
|
3 | + if (empty($category)) { |
|
4 | + $category = []; |
|
5 | + } |
|
6 | + $tree = new Ui\Tree(); |
|
7 | + $tree->ul('\Ecommerce\Category', 0, function($categoryItem) use($category) { |
|
8 | + if ($category && $category->id == $categoryItem->id) { |
|
9 | + $class = 'active'; |
|
10 | + } else { |
|
11 | + $class = ''; |
|
12 | + } |
|
13 | + return [ |
|
14 | + 'attributes' => [ |
|
15 | + 'class' => $class, |
|
16 | + ], |
|
17 | + 'text' => "<a {$class} href = '/ecommerce/itemList/{$categoryItem->id}'>{$categoryItem->name}</a>" |
|
18 | + ]; |
|
19 | + }); |
|
20 | + ?> |
|
21 | 21 | </div> |
22 | 22 | \ No newline at end of file |