@@ -275,8 +275,9 @@ |
||
| 275 | 275 | break; |
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | - if (!$price) |
|
| 279 | - return false; |
|
| 278 | + if (!$price) { |
|
| 279 | + return false; |
|
| 280 | + } |
|
| 280 | 281 | |
| 281 | 282 | if ($count <= 0) { |
| 282 | 283 | $count = 1; |
@@ -22,16 +22,19 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | $sitePath = App::$primary->path; |
| 24 | 24 | |
| 25 | - if (!is_uploaded_file($file['tmp_name'])) |
|
| 26 | - return 0; |
|
| 25 | + if (!is_uploaded_file($file['tmp_name'])) { |
|
| 26 | + return 0; |
|
| 27 | + } |
|
| 27 | 28 | |
| 28 | 29 | $fileinfo = pathinfo($file['name']); |
| 29 | - if (empty($fileinfo['extension'])) |
|
| 30 | - return 0; |
|
| 30 | + if (empty($fileinfo['extension'])) { |
|
| 31 | + return 0; |
|
| 32 | + } |
|
| 31 | 33 | |
| 32 | 34 | $type = Files\Type::get($fileinfo['extension'], 'ext'); |
| 33 | - if (!$type) |
|
| 34 | - return 0; |
|
| 35 | + if (!$type) { |
|
| 36 | + return 0; |
|
| 37 | + } |
|
| 35 | 38 | |
| 36 | 39 | if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) { |
| 37 | 40 | return 0; |
@@ -47,13 +50,15 @@ discard block |
||
| 47 | 50 | } |
| 48 | 51 | $fileObject->name = $fileinfo['filename']; |
| 49 | 52 | $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension']; |
| 50 | - if ($fileObject->id && file_exists($sitePath . $fileObject->path)) |
|
| 51 | - unlink($sitePath . $fileObject->path); |
|
| 53 | + if ($fileObject->id && file_exists($sitePath . $fileObject->path)) { |
|
| 54 | + unlink($sitePath . $fileObject->path); |
|
| 55 | + } |
|
| 52 | 56 | |
| 53 | 57 | Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/'); |
| 54 | 58 | |
| 55 | - if (!move_uploaded_file($file['tmp_name'], $sitePath . $fileObject->path)) |
|
| 56 | - return false; |
|
| 59 | + if (!move_uploaded_file($file['tmp_name'], $sitePath . $fileObject->path)) { |
|
| 60 | + return false; |
|
| 61 | + } |
|
| 57 | 62 | |
| 58 | 63 | $fileObject->type_id = $type->pk(); |
| 59 | 64 | $fileObject->original_name = $file['name']; |
@@ -76,12 +81,14 @@ discard block |
||
| 76 | 81 | $sitePath = App::$primary->path; |
| 77 | 82 | |
| 78 | 83 | $fileinfo = pathinfo($url); |
| 79 | - if (empty($fileinfo['extension'])) |
|
| 80 | - return 0; |
|
| 84 | + if (empty($fileinfo['extension'])) { |
|
| 85 | + return 0; |
|
| 86 | + } |
|
| 81 | 87 | |
| 82 | 88 | $type = Files\Type::get($fileinfo['extension'], 'ext'); |
| 83 | - if (!$type) |
|
| 84 | - return 0; |
|
| 89 | + if (!$type) { |
|
| 90 | + return 0; |
|
| 91 | + } |
|
| 85 | 92 | |
| 86 | 93 | if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) { |
| 87 | 94 | return 0; |
@@ -97,8 +104,9 @@ discard block |
||
| 97 | 104 | } |
| 98 | 105 | $fileObject->name = $fileinfo['filename']; |
| 99 | 106 | $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension']; |
| 100 | - if ($fileObject->id && file_exists($sitePath . $fileObject->path)) |
|
| 101 | - unlink($sitePath . $fileObject->path); |
|
| 107 | + if ($fileObject->id && file_exists($sitePath . $fileObject->path)) { |
|
| 108 | + unlink($sitePath . $fileObject->path); |
|
| 109 | + } |
|
| 102 | 110 | |
| 103 | 111 | Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/'); |
| 104 | 112 | |
@@ -7,16 +7,18 @@ |
||
| 7 | 7 | $code = 'main'; |
| 8 | 8 | } |
| 9 | 9 | $menu = \Menu\Menu::get($code, 'code'); |
| 10 | -if ($menu) |
|
| 10 | +if ($menu) { |
|
| 11 | 11 | foreach ($menu->items(['order' => ['weight', 'ASC']]) as $item) { |
| 12 | 12 | $href = $item->href; |
| 13 | +} |
|
| 13 | 14 | if ($item->type == 'materialCategory') { |
| 14 | 15 | $category = \Materials\Category::get($item->aditional); |
| 15 | 16 | $href = $category->alias ? "/materials/{$category->alias}" : "/materials/category/{$category->id}"; |
| 16 | 17 | } |
| 17 | - if (urldecode($_SERVER['REQUEST_URI']) == $href) |
|
| 18 | - $active = ' class = "active" '; |
|
| 19 | - else |
|
| 20 | - $active = ''; |
|
| 18 | + if (urldecode($_SERVER['REQUEST_URI']) == $href) { |
|
| 19 | + $active = ' class = "active" '; |
|
| 20 | + } else { |
|
| 21 | + $active = ''; |
|
| 22 | + } |
|
| 21 | 23 | echo "<li {$active}><a href = '{$href}'>{$item->name}</a></li>"; |
| 22 | 24 | } |
@@ -6,8 +6,9 @@ |
||
| 6 | 6 | $systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2); |
| 7 | 7 | foreach ($systemModules as $module) { |
| 8 | 8 | $info = Module::getInfo($module); |
| 9 | - if (!$info || isset($modules[$module])) |
|
| 10 | - continue; |
|
| 9 | + if (!$info || isset($modules[$module])) { |
|
| 10 | + continue; |
|
| 11 | + } |
|
| 11 | 12 | ?> |
| 12 | 13 | <div class ="form-group"> |
| 13 | 14 | <div class="checkbox"> |
@@ -25,8 +25,9 @@ |
||
| 25 | 25 | |
| 26 | 26 | $result['payId'] = $data["InvId"]; |
| 27 | 27 | |
| 28 | - if (strtolower($data['SignatureValue']) == $hashGenerated) |
|
| 29 | - $result['status'] = 'success'; |
|
| 28 | + if (strtolower($data['SignatureValue']) == $hashGenerated) { |
|
| 29 | + $result['status'] = 'success'; |
|
| 30 | + } |
|
| 30 | 31 | |
| 31 | 32 | return $result; |
| 32 | 33 | } |
@@ -28,20 +28,24 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | // Проверка наличия необходимых параметров в POST-запросе |
| 30 | 30 | |
| 31 | - if (!isset($data["WMI_SIGNATURE"])) |
|
| 32 | - $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_SIGNATURE"); |
|
| 31 | + if (!isset($data["WMI_SIGNATURE"])) { |
|
| 32 | + $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_SIGNATURE"); |
|
| 33 | + } |
|
| 33 | 34 | |
| 34 | - if (!isset($data["WMI_PAYMENT_NO"])) |
|
| 35 | - $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_PAYMENT_NO"); |
|
| 35 | + if (!isset($data["WMI_PAYMENT_NO"])) { |
|
| 36 | + $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_PAYMENT_NO"); |
|
| 37 | + } |
|
| 36 | 38 | |
| 37 | - if (!isset($data["WMI_ORDER_STATE"])) |
|
| 38 | - $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_ORDER_STATE"); |
|
| 39 | + if (!isset($data["WMI_ORDER_STATE"])) { |
|
| 40 | + $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_ORDER_STATE"); |
|
| 41 | + } |
|
| 39 | 42 | |
| 40 | 43 | // Извлечение всех параметров POST-запроса, кроме WMI_SIGNATURE |
| 41 | 44 | $params = []; |
| 42 | 45 | foreach ($data as $name => $value) { |
| 43 | - if ($name !== "WMI_SIGNATURE") |
|
| 44 | - $params[$name] = $value; |
|
| 46 | + if ($name !== "WMI_SIGNATURE") { |
|
| 47 | + $params[$name] = $value; |
|
| 48 | + } |
|
| 45 | 49 | } |
| 46 | 50 | |
| 47 | 51 | // Сортировка массива по именам ключей в порядке возрастания |
@@ -86,8 +90,9 @@ discard block |
||
| 86 | 90 | $config = static::getConfig(); |
| 87 | 91 | $merchantCurrency = static::getMerchantCurrency($currency); |
| 88 | 92 | |
| 89 | - if (!$description) |
|
| 90 | - $description = "Оплата заказа на сайте " . idn_to_utf8(INJI_DOMAIN_NAME); |
|
| 93 | + if (!$description) { |
|
| 94 | + $description = "Оплата заказа на сайте " . idn_to_utf8(INJI_DOMAIN_NAME); |
|
| 95 | + } |
|
| 91 | 96 | |
| 92 | 97 | //Секретный ключ интернет-магазина |
| 93 | 98 | $key = $config['secret']; |
@@ -117,11 +122,12 @@ discard block |
||
| 117 | 122 | $fieldValues = ""; |
| 118 | 123 | |
| 119 | 124 | foreach ($fields as $value) { |
| 120 | - if (is_array($value)) |
|
| 121 | - foreach ($value as $v) { |
|
| 125 | + if (is_array($value)) { |
|
| 126 | + foreach ($value as $v) { |
|
| 122 | 127 | //Конвертация из текущей кодировки (UTF-8) |
| 123 | 128 | //необходима только если кодировка магазина отлична от Windows-1251 |
| 124 | 129 | $v = iconv("utf-8", "windows-1251", $v); |
| 130 | + } |
|
| 125 | 131 | $fieldValues .= $v; |
| 126 | 132 | } else { |
| 127 | 133 | //Конвертация из текущей кодировки (UTF-8) |
@@ -112,10 +112,11 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $sizes = explode('x', $_GET['resize']); |
| 114 | 114 | $sizes[0] = intval($sizes[0]); |
| 115 | - if (isset($sizes[1])) |
|
| 116 | - $sizes[1] = intval($sizes[1]); |
|
| 117 | - else |
|
| 118 | - $sizes[1] = 0; |
|
| 115 | + if (isset($sizes[1])) { |
|
| 116 | + $sizes[1] = intval($sizes[1]); |
|
| 117 | + } else { |
|
| 118 | + $sizes[1] = 0; |
|
| 119 | + } |
|
| 119 | 120 | |
| 120 | 121 | if (!$sizes[0] || !$sizes[1]) { |
| 121 | 122 | header('HTTP/1.1 404 Not Found'); |
@@ -127,15 +128,16 @@ discard block |
||
| 127 | 128 | $dir = App::$primary->path; |
| 128 | 129 | |
| 129 | 130 | if (!empty($_GET['resize_crop'])) { |
| 130 | - if (in_array($_GET['resize_crop'], array('q', 'c'))) |
|
| 131 | - $crop = $_GET['resize_crop']; |
|
| 132 | - else |
|
| 133 | - $crop = 'c'; |
|
| 131 | + if (in_array($_GET['resize_crop'], array('q', 'c'))) { |
|
| 132 | + $crop = $_GET['resize_crop']; |
|
| 133 | + } else { |
|
| 134 | + $crop = 'c'; |
|
| 135 | + } |
|
| 136 | + } elseif (!empty($_GET['resize_quadro'])) { |
|
| 137 | + $crop = 'q'; |
|
| 138 | + } else { |
|
| 139 | + $crop = ''; |
|
| 134 | 140 | } |
| 135 | - elseif (!empty($_GET['resize_quadro'])) |
|
| 136 | - $crop = 'q'; |
|
| 137 | - else |
|
| 138 | - $crop = ''; |
|
| 139 | 141 | $pos = 'center'; |
| 140 | 142 | if (!empty($_GET['resize_pos']) && in_array($_GET['resize_pos'], array('top', 'center'))) { |
| 141 | 143 | $pos = $_GET['resize_pos']; |
@@ -620,8 +620,9 @@ |
||
| 620 | 620 | </label> |
| 621 | 621 | </li>"; |
| 622 | 622 | foreach ($categorys as $category) { |
| 623 | - if ($category->parent_id == 0) |
|
| 624 | - $this->showCategory($categorys, $category); |
|
| 623 | + if ($category->parent_id == 0) { |
|
| 624 | + $this->showCategory($categorys, $category); |
|
| 625 | + } |
|
| 625 | 626 | } |
| 626 | 627 | ?> |
| 627 | 628 | </ul> |
@@ -34,10 +34,11 @@ |
||
| 34 | 34 | $this->params['page'] = 1; |
| 35 | 35 | if (!empty($this->data['page'])) { |
| 36 | 36 | $this->params['page'] = (int) $this->data['page']; |
| 37 | - if ($this->params['page'] <= 0) |
|
| 38 | - $this->params['page'] = 1; |
|
| 39 | - elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) |
|
| 40 | - $this->params['page'] = ceil($this->options['count'] / $this->params['limit']); |
|
| 37 | + if ($this->params['page'] <= 0) { |
|
| 38 | + $this->params['page'] = 1; |
|
| 39 | + } elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) { |
|
| 40 | + $this->params['page'] = ceil($this->options['count'] / $this->params['limit']); |
|
| 41 | + } |
|
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | $this->params['start'] = $this->params['page'] * $this->params['limit'] - $this->params['limit']; |