@@ -140,8 +140,9 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | private function parseRaw($source) |
| 142 | 142 | { |
| 143 | - if (!$source) |
|
| 144 | - return []; |
|
| 143 | + if (!$source) { |
|
| 144 | + return []; |
|
| 145 | + } |
|
| 145 | 146 | |
| 146 | 147 | preg_match_all("|{([^}]+)}|", $source, $result); |
| 147 | 148 | return $result[1]; |
@@ -327,10 +328,11 @@ discard block |
||
| 327 | 328 | $this->ResolveCssHref($css, $type, $hrefs); |
| 328 | 329 | continue; |
| 329 | 330 | } |
| 330 | - if (strpos($css, '//') !== false) |
|
| 331 | - $href = $css; |
|
| 332 | - else |
|
| 333 | - $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css; |
|
| 331 | + if (strpos($css, '//') !== false) { |
|
| 332 | + $href = $css; |
|
| 333 | + } else { |
|
| 334 | + $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css; |
|
| 335 | + } |
|
| 334 | 336 | $hrefs[$href] = $href; |
| 335 | 337 | } |
| 336 | 338 | break; |
@@ -340,10 +342,11 @@ discard block |
||
| 340 | 342 | $this->ResolveCssHref($css, $type, $hrefs); |
| 341 | 343 | continue; |
| 342 | 344 | } |
| 343 | - if (strpos($css, '://') !== false) |
|
| 344 | - $href = $css; |
|
| 345 | - else |
|
| 346 | - $href = $this->app->templatesPath . "/{$this->template->name}/css/{$css}"; |
|
| 345 | + if (strpos($css, '://') !== false) { |
|
| 346 | + $href = $css; |
|
| 347 | + } else { |
|
| 348 | + $href = $this->app->templatesPath . "/{$this->template->name}/css/{$css}"; |
|
| 349 | + } |
|
| 347 | 350 | $hrefs[$href] = $href; |
| 348 | 351 | } |
| 349 | 352 | break; |
@@ -353,10 +356,11 @@ discard block |
||
| 353 | 356 | $this->ResolveCssHref($css, $type, $hrefs); |
| 354 | 357 | continue; |
| 355 | 358 | } |
| 356 | - if (strpos($css, '//') !== false) |
|
| 357 | - $href = $css; |
|
| 358 | - else |
|
| 359 | - $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css; |
|
| 359 | + if (strpos($css, '//') !== false) { |
|
| 360 | + $href = $css; |
|
| 361 | + } else { |
|
| 362 | + $href = ($this->app->type != 'app' ? '/' . $this->app->name : '' ) . $css; |
|
| 363 | + } |
|
| 360 | 364 | $hrefs[$href] = $href; |
| 361 | 365 | } |
| 362 | 366 | break; |
@@ -410,8 +414,9 @@ discard block |
||
| 410 | 414 | $noParsedScripts = []; |
| 411 | 415 | foreach ($scripts as $script) { |
| 412 | 416 | if (is_string($script)) { |
| 413 | - if (!empty($urls[$script])) |
|
| 414 | - continue; |
|
| 417 | + if (!empty($urls[$script])) { |
|
| 418 | + continue; |
|
| 419 | + } |
|
| 415 | 420 | |
| 416 | 421 | $path = $this->app->staticLoader->parsePath($script); |
| 417 | 422 | if (file_exists($path)) { |
@@ -422,8 +427,9 @@ discard block |
||
| 422 | 427 | $noParsedScripts[$script] = $script; |
| 423 | 428 | } |
| 424 | 429 | } elseif (!empty($script['file'])) { |
| 425 | - if (!empty($urls[$script['file']])) |
|
| 426 | - continue; |
|
| 430 | + if (!empty($urls[$script['file']])) { |
|
| 431 | + continue; |
|
| 432 | + } |
|
| 427 | 433 | |
| 428 | 434 | $path = $this->app->staticLoader->parsePath($script['file']); |
| 429 | 435 | if (file_exists($path)) { |
@@ -482,12 +488,14 @@ discard block |
||
| 482 | 488 | $this->genScriptArray($js, $type, $resultArray); |
| 483 | 489 | continue; |
| 484 | 490 | } |
| 485 | - if (strpos($js, '//') !== false) |
|
| 486 | - $href = $js; |
|
| 487 | - else |
|
| 488 | - $href = $this->getHref('js', $js); |
|
| 489 | - if (!$href) |
|
| 490 | - continue; |
|
| 491 | + if (strpos($js, '//') !== false) { |
|
| 492 | + $href = $js; |
|
| 493 | + } else { |
|
| 494 | + $href = $this->getHref('js', $js); |
|
| 495 | + } |
|
| 496 | + if (!$href) { |
|
| 497 | + continue; |
|
| 498 | + } |
|
| 491 | 499 | |
| 492 | 500 | $resultArray[] = $href; |
| 493 | 501 | } |
@@ -498,10 +506,11 @@ discard block |
||
| 498 | 506 | $this->genScriptArray($js, $type, $resultArray); |
| 499 | 507 | continue; |
| 500 | 508 | } |
| 501 | - if (strpos($js, '//') !== false) |
|
| 502 | - $href = $js; |
|
| 503 | - else |
|
| 504 | - $href = $this->app->templatesPath . "/{$this->template->name}/js/{$js}"; |
|
| 509 | + if (strpos($js, '//') !== false) { |
|
| 510 | + $href = $js; |
|
| 511 | + } else { |
|
| 512 | + $href = $this->app->templatesPath . "/{$this->template->name}/js/{$js}"; |
|
| 513 | + } |
|
| 505 | 514 | $resultArray[] = $href; |
| 506 | 515 | } |
| 507 | 516 | break; |
@@ -517,8 +526,9 @@ discard block |
||
| 517 | 526 | $asset = []; |
| 518 | 527 | } |
| 519 | 528 | $asset['file'] = $this->getHref('js', $js); |
| 520 | - if (!$asset['file']) |
|
| 521 | - continue; |
|
| 529 | + if (!$asset['file']) { |
|
| 530 | + continue; |
|
| 531 | + } |
|
| 522 | 532 | $resultArray[] = $asset; |
| 523 | 533 | } |
| 524 | 534 | break; |
@@ -568,8 +578,9 @@ discard block |
||
| 568 | 578 | $paramArray = true; |
| 569 | 579 | } |
| 570 | 580 | } |
| 571 | - if (!$paramArray) |
|
| 572 | - $lineParams = ':' . implode(':', $_params); |
|
| 581 | + if (!$paramArray) { |
|
| 582 | + $lineParams = ':' . implode(':', $_params); |
|
| 583 | + } |
|
| 573 | 584 | } |
| 574 | 585 | } |
| 575 | 586 | echo "<!--start:{WIDGET:{$_widgetName}{$lineParams}}-->\n"; |
@@ -270,10 +270,11 @@ |
||
| 270 | 270 | $item->sales ++; |
| 271 | 271 | $item->save(); |
| 272 | 272 | |
| 273 | - if (empty($_GET['count'])) |
|
| 274 | - $count = 1; |
|
| 275 | - else |
|
| 276 | - $count = (float) $_GET['count']; |
|
| 273 | + if (empty($_GET['count'])) { |
|
| 274 | + $count = 1; |
|
| 275 | + } else { |
|
| 276 | + $count = (float) $_GET['count']; |
|
| 277 | + } |
|
| 277 | 278 | |
| 278 | 279 | $cart = $this->ecommerce->getCurCart(); |
| 279 | 280 | |
@@ -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 | } |
@@ -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; |
@@ -3,9 +3,9 @@ |
||
| 3 | 3 | <div class="cart-order_page"> |
| 4 | 4 | <h2>Быстрое оформление заказа</h2> |
| 5 | 5 | <?php |
| 6 | - if (!$cart || !$cart->cartItems) |
|
| 7 | - echo "<h1>Ваша корзина пуста</h1>"; |
|
| 8 | - else { |
|
| 6 | + if (!$cart || !$cart->cartItems) { |
|
| 7 | + echo "<h1>Ваша корзина пуста</h1>"; |
|
| 8 | + } else { |
|
| 9 | 9 | $sums = []; |
| 10 | 10 | $cartDelivery = $cart->delivery; |
| 11 | 11 | $deliveryPrice = 0; |
@@ -9,18 +9,20 @@ |
||
| 9 | 9 | $menu = \Menu\Menu::get($code, 'code'); |
| 10 | 10 | if ($menu) { |
| 11 | 11 | foreach ($menu->items(['where' => ['parent_id', 0], 'order' => ['weight', 'asc']]) as $item) { |
| 12 | - if (urldecode($_SERVER['REQUEST_URI']) == $item->href) |
|
| 13 | - $active = ' class = "active" '; |
|
| 14 | - else |
|
| 15 | - $active = ''; |
|
| 12 | + if (urldecode($_SERVER['REQUEST_URI']) == $item->href) { |
|
| 13 | + $active = ' class = "active" '; |
|
| 14 | + } else { |
|
| 15 | + $active = ''; |
|
| 16 | + } |
|
| 16 | 17 | echo "<li {$active}><a href = '{$item->href}'>{$item->name}</a>"; |
| 17 | 18 | if ($item->childs(['order' => ['weight', 'asc']])) { |
| 18 | 19 | echo "<ul>"; |
| 19 | 20 | foreach ($item->childs as $item) { |
| 20 | - if (urldecode($_SERVER['REQUEST_URI']) == $item->href) |
|
| 21 | - $active = ' class = "active" '; |
|
| 22 | - else |
|
| 23 | - $active = ''; |
|
| 21 | + if (urldecode($_SERVER['REQUEST_URI']) == $item->href) { |
|
| 22 | + $active = ' class = "active" '; |
|
| 23 | + } else { |
|
| 24 | + $active = ''; |
|
| 25 | + } |
|
| 24 | 26 | echo "<li {$active}><a href = '{$item->href}'>{$item->name}</a>"; |
| 25 | 27 | } |
| 26 | 28 | echo "</ul>"; |
@@ -718,17 +718,21 @@ discard block |
||
| 718 | 718 | if (!$query) { |
| 719 | 719 | return []; |
| 720 | 720 | } |
| 721 | - if (!empty($options['where'])) |
|
| 722 | - $query->where($options['where']); |
|
| 721 | + if (!empty($options['where'])) { |
|
| 722 | + $query->where($options['where']); |
|
| 723 | + } |
|
| 723 | 724 | if (!empty($options['group'])) { |
| 724 | 725 | $query->group($options['group']); |
| 725 | 726 | } |
| 726 | - if (!empty($options['order'])) |
|
| 727 | - $query->order($options['order']); |
|
| 728 | - if (!empty($options['join'])) |
|
| 729 | - $query->join($options['join']); |
|
| 730 | - if (!empty($options['distinct'])) |
|
| 731 | - $query->distinct = $options['distinct']; |
|
| 727 | + if (!empty($options['order'])) { |
|
| 728 | + $query->order($options['order']); |
|
| 729 | + } |
|
| 730 | + if (!empty($options['join'])) { |
|
| 731 | + $query->join($options['join']); |
|
| 732 | + } |
|
| 733 | + if (!empty($options['distinct'])) { |
|
| 734 | + $query->distinct = $options['distinct']; |
|
| 735 | + } |
|
| 732 | 736 | |
| 733 | 737 | foreach (static::$relJoins as $join) { |
| 734 | 738 | $query->join($join[0], $join[1]); |
@@ -754,14 +758,14 @@ discard block |
||
| 754 | 758 | } |
| 755 | 759 | static::$needJoin = []; |
| 756 | 760 | |
| 757 | - if (!empty($options['limit'])) |
|
| 758 | - $limit = (int) $options['limit']; |
|
| 759 | - else { |
|
| 761 | + if (!empty($options['limit'])) { |
|
| 762 | + $limit = (int) $options['limit']; |
|
| 763 | + } else { |
|
| 760 | 764 | $limit = 0; |
| 761 | 765 | } |
| 762 | - if (!empty($options['start'])) |
|
| 763 | - $start = (int) $options['start']; |
|
| 764 | - else { |
|
| 766 | + if (!empty($options['start'])) { |
|
| 767 | + $start = (int) $options['start']; |
|
| 768 | + } else { |
|
| 765 | 769 | $start = 0; |
| 766 | 770 | } |
| 767 | 771 | if ($limit || $start) { |
@@ -1020,21 +1024,23 @@ discard block |
||
| 1020 | 1024 | if (!empty($options['where'])) { |
| 1021 | 1025 | static::fixPrefix($options['where'], 'first'); |
| 1022 | 1026 | } |
| 1023 | - if (!empty($options['where'])) |
|
| 1024 | - $query->where($options['where']); |
|
| 1025 | - if (!empty($options['join'])) |
|
| 1026 | - $query->join($options['join']); |
|
| 1027 | + if (!empty($options['where'])) { |
|
| 1028 | + $query->where($options['where']); |
|
| 1029 | + } |
|
| 1030 | + if (!empty($options['join'])) { |
|
| 1031 | + $query->join($options['join']); |
|
| 1032 | + } |
|
| 1027 | 1033 | if (!empty($options['order'])) { |
| 1028 | 1034 | $query->order($options['order']); |
| 1029 | 1035 | } |
| 1030 | - if (!empty($options['limit'])) |
|
| 1031 | - $limit = (int) $options['limit']; |
|
| 1032 | - else { |
|
| 1036 | + if (!empty($options['limit'])) { |
|
| 1037 | + $limit = (int) $options['limit']; |
|
| 1038 | + } else { |
|
| 1033 | 1039 | $limit = 0; |
| 1034 | 1040 | } |
| 1035 | - if (!empty($options['start'])) |
|
| 1036 | - $start = (int) $options['start']; |
|
| 1037 | - else { |
|
| 1041 | + if (!empty($options['start'])) { |
|
| 1042 | + $start = (int) $options['start']; |
|
| 1043 | + } else { |
|
| 1038 | 1044 | $start = 0; |
| 1039 | 1045 | } |
| 1040 | 1046 | if ($limit || $start) { |
@@ -1112,8 +1118,9 @@ discard block |
||
| 1112 | 1118 | |
| 1113 | 1119 | $values = []; |
| 1114 | 1120 | foreach ($cols as $col => $param) { |
| 1115 | - if (isset($params[$col])) |
|
| 1116 | - $values[$col] = $params[$col]; |
|
| 1121 | + if (isset($params[$col])) { |
|
| 1122 | + $values[$col] = $params[$col]; |
|
| 1123 | + } |
|
| 1117 | 1124 | } |
| 1118 | 1125 | if (empty($values)) { |
| 1119 | 1126 | return false; |
@@ -1296,8 +1303,9 @@ discard block |
||
| 1296 | 1303 | $values = []; |
| 1297 | 1304 | |
| 1298 | 1305 | foreach ($this->cols() as $col => $param) { |
| 1299 | - if (isset($this->_params[$col])) |
|
| 1300 | - $values[$col] = $this->_params[$col]; |
|
| 1306 | + if (isset($this->_params[$col])) { |
|
| 1307 | + $values[$col] = $this->_params[$col]; |
|
| 1308 | + } |
|
| 1301 | 1309 | } |
| 1302 | 1310 | if (empty($values) && empty($options['empty'])) { |
| 1303 | 1311 | return false; |
@@ -1457,8 +1465,9 @@ discard block |
||
| 1457 | 1465 | { |
| 1458 | 1466 | |
| 1459 | 1467 | foreach (static::relations() as $relName => $rel) { |
| 1460 | - if ($rel['col'] == $col) |
|
| 1461 | - return $relName; |
|
| 1468 | + if ($rel['col'] == $col) { |
|
| 1469 | + return $relName; |
|
| 1470 | + } |
|
| 1462 | 1471 | } |
| 1463 | 1472 | return NULL; |
| 1464 | 1473 | } |
@@ -39,8 +39,7 @@ |
||
| 39 | 39 | $form->input($field->type, "deliveryFields[{$field->id}]", $field->name, ['required' => $field->required]);
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | - } |
|
| 43 | - else {
|
|
| 42 | + } else {
|
|
| 44 | 43 | echo "<h4>Выберите способ доставки</h4>"; |
| 45 | 44 | } |
| 46 | 45 | ?> |
@@ -2,27 +2,45 @@ |
||
| 2 | 2 | <form action = '' method = 'POST' enctype="multipart/form-data"> |
| 3 | 3 | <div class ="form-group"> |
| 4 | 4 | <label>Название сайта</label> |
| 5 | - <input class ="form-control" type = 'text' name = 'site_name' value = '<?php if (!empty(\App::$primary->config['site']['name'])) echo \App::$primary->config['site']['name']; ?>' /> |
|
| 5 | + <input class ="form-control" type = 'text' name = 'site_name' value = '<?php if (!empty(\App::$primary->config['site']['name'])) { |
|
| 6 | + echo \App::$primary->config['site']['name']; |
|
| 7 | +} |
|
| 8 | +?>' /> |
|
| 6 | 9 | </div> |
| 7 | 10 | <div class ="form-group"> |
| 8 | 11 | <label>Название компании</label> |
| 9 | - <input class ="form-control" type = 'text' name = 'company_name' value = '<?php if (!empty(\App::$primary->config['site']['company_name'])) echo \App::$primary->config['site']['company_name']; ?>' /> |
|
| 12 | + <input class ="form-control" type = 'text' name = 'company_name' value = '<?php if (!empty(\App::$primary->config['site']['company_name'])) { |
|
| 13 | + echo \App::$primary->config['site']['company_name']; |
|
| 14 | +} |
|
| 15 | +?>' /> |
|
| 10 | 16 | </div> |
| 11 | 17 | <div class ="form-group"> |
| 12 | 18 | <label>Основной домен</label> |
| 13 | - <input class ="form-control" type = 'text' name = 'site_domain' value = '<?php if (!empty(\App::$primary->config['site']['domain'])) echo \App::$primary->config['site']['domain']; ?>' /> |
|
| 19 | + <input class ="form-control" type = 'text' name = 'site_domain' value = '<?php if (!empty(\App::$primary->config['site']['domain'])) { |
|
| 20 | + echo \App::$primary->config['site']['domain']; |
|
| 21 | +} |
|
| 22 | +?>' /> |
|
| 14 | 23 | </div> |
| 15 | 24 | <div class ="form-group"> |
| 16 | 25 | <label>Контактный email</label> |
| 17 | - <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) echo \App::$primary->config['site']['email']; ?>' /> |
|
| 26 | + <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) { |
|
| 27 | + echo \App::$primary->config['site']['email']; |
|
| 28 | +} |
|
| 29 | +?>' /> |
|
| 18 | 30 | </div> |
| 19 | 31 | <div class ="form-group"> |
| 20 | 32 | <label>Ключевые слова</label> |
| 21 | - <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) echo \App::$primary->config['site']['keywords']; ?>' /> |
|
| 33 | + <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) { |
|
| 34 | + echo \App::$primary->config['site']['keywords']; |
|
| 35 | +} |
|
| 36 | +?>' /> |
|
| 22 | 37 | </div> |
| 23 | 38 | <div class ="form-group"> |
| 24 | 39 | <label>Краткое описание сайта</label> |
| 25 | - <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) echo \App::$primary->config['site']['description']; ?>' /> |
|
| 40 | + <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) { |
|
| 41 | + echo \App::$primary->config['site']['description']; |
|
| 42 | +} |
|
| 43 | +?>' /> |
|
| 26 | 44 | </div> |
| 27 | 45 | <?php |
| 28 | 46 | $form = new Ui\Form(); |