@@ -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' => [ |
@@ -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>"; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | if (empty($blocks[$block->wallet->currency_id])) { |
| 103 | 103 | $blocks[$block->wallet->currency_id] = $block->amount; |
| 104 | 104 | } else { |
| 105 | - $blocks[$block->wallet->currency_id]+= $block->amount; |
|
| 105 | + $blocks[$block->wallet->currency_id] += $block->amount; |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | return $blocks; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $rootUser = $rootUser ? $rootUser : \Users\User::$cur; |
| 169 | 169 | $reward = \Money\Reward::get($reward_id); |
| 170 | 170 | $reward->checkBlocked(); |
| 171 | - $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id]]); |
|
| 171 | + $reward_count = \Money\Reward\Recive::getCount(['where' => ['reward_id', $reward_id]]); |
|
| 172 | 172 | if ($reward_count >= $reward->quantity && $reward->quantity) |
| 173 | 173 | return false; |
| 174 | 174 | $types = $this->getSnippets('rewardType'); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $recives = \Money\Reward\Recive::getList(['where' => [['user_id', $user->id], ['reward_id', $reward->id]]]); |
| 190 | 190 | $amount = 0; |
| 191 | 191 | foreach ($recives as $recive) { |
| 192 | - $amount+=$recive->amount; |
|
| 192 | + $amount += $recive->amount; |
|
| 193 | 193 | } |
| 194 | 194 | if ($amount >= $reward->peruser) { |
| 195 | 195 | continue; |
@@ -61,21 +61,21 @@ |
||
| 61 | 61 | if ($first) { |
| 62 | 62 | $first = false; |
| 63 | 63 | } else { |
| 64 | - $string.= '<br />'; |
|
| 64 | + $string .= '<br />'; |
|
| 65 | 65 | } |
| 66 | - $string.= '<span style="white-space:nowrap;">'; |
|
| 67 | - $string.= number_format($sum, 2, '.', ' '); |
|
| 66 | + $string .= '<span style="white-space:nowrap;">'; |
|
| 67 | + $string .= number_format($sum, 2, '.', ' '); |
|
| 68 | 68 | if (\App::$cur->money) { |
| 69 | 69 | $currency = \Money\Currency::get($currency_id); |
| 70 | 70 | if ($currency) { |
| 71 | - $string.= ' ' . $currency->acronym(); |
|
| 71 | + $string .= ' ' . $currency->acronym(); |
|
| 72 | 72 | } else { |
| 73 | - $string.= ' руб.'; |
|
| 73 | + $string .= ' руб.'; |
|
| 74 | 74 | } |
| 75 | 75 | } else { |
| 76 | - $string.= ' руб.'; |
|
| 76 | + $string .= ' руб.'; |
|
| 77 | 77 | } |
| 78 | - $string.= '</span>'; |
|
| 78 | + $string .= '</span>'; |
|
| 79 | 79 | } |
| 80 | 80 | return $string; |
| 81 | 81 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($step = NULL, $params = []) { |
|
| 3 | +return function($step = NULL, $params = []) { |
|
| 4 | 4 | |
| 5 | 5 | $groups = [ |
| 6 | 6 | [ |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($step = NULL, $params = []) { |
|
| 3 | +return function ($step = null, $params = []) { |
|
| 4 | 4 | App::$cur->db->createTable('notifications_notification', [ |
| 5 | 5 | 'notification_id' => 'pk', |
| 6 | 6 | 'notification_chanel_id' => 'int(11) UNSIGNED NOT NULL', |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | * Get installed modules for app |
| 133 | 133 | * |
| 134 | 134 | * @param \App $app |
| 135 | - * @param boolean|\App $primary |
|
| 135 | + * @param App $primary |
|
| 136 | 136 | * @return array |
| 137 | 137 | */ |
| 138 | 138 | public static function getInstalled($app, $primary = false) |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | return true; |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | - return FALSE; |
|
| 84 | + return false; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -11,6 +11,10 @@ |
||
| 11 | 11 | |
| 12 | 12 | function indexAction() { |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param DOMDocument $xml |
|
| 16 | + * @param string $nodeName |
|
| 17 | + */ |
|
| 14 | 18 | function addToXml($xml, $parent, $nodeName, $text) { |
| 15 | 19 | $node = $parent->appendChild($xml->createElement($nodeName)); |
| 16 | 20 | $node->appendChild($xml->createTextNode($text)); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | if ($type->allow_resize && $type->options && json_decode($type->options, true)) { |
| 60 | 60 | $typeOptions = json_decode($type->options, true); |
| 61 | - list( $img_width, $img_height, $img_type, $img_tag ) = getimagesize($sitePath . $fileObject->path); |
|
| 61 | + list($img_width, $img_height, $img_type, $img_tag) = getimagesize($sitePath . $fileObject->path); |
|
| 62 | 62 | if ($img_height > $typeOptions['max_height'] || $img_width > $typeOptions['max_width']) { |
| 63 | 63 | Tools::resizeImage($sitePath . $fileObject->path, $typeOptions['max_width'], $typeOptions['max_height']); |
| 64 | 64 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | if ($type->allow_resize && $type->options && json_decode($type->options, true)) { |
| 122 | 122 | $typeOptions = json_decode($type->options, true); |
| 123 | - list( $img_width, $img_height, $img_type, $img_tag ) = getimagesize($sitePath . $fileObject->path); |
|
| 123 | + list($img_width, $img_height, $img_type, $img_tag) = getimagesize($sitePath . $fileObject->path); |
|
| 124 | 124 | if ($img_height > $typeOptions['max_height'] || $img_width > $typeOptions['max_width']) { |
| 125 | 125 | Tools::resizeImage($sitePath . $fileObject->path, $typeOptions['max_width'], $typeOptions['max_height']); |
| 126 | 126 | } |
@@ -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,8 +50,9 @@ 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 | |
@@ -84,12 +88,14 @@ discard block |
||
| 84 | 88 | $sitePath = App::$primary->path; |
| 85 | 89 | |
| 86 | 90 | $fileinfo = pathinfo($url); |
| 87 | - if (empty($fileinfo['extension'])) |
|
| 88 | - return 0; |
|
| 91 | + if (empty($fileinfo['extension'])) { |
|
| 92 | + return 0; |
|
| 93 | + } |
|
| 89 | 94 | |
| 90 | 95 | $type = Files\Type::get($fileinfo['extension'], 'ext'); |
| 91 | - if (!$type) |
|
| 92 | - return 0; |
|
| 96 | + if (!$type) { |
|
| 97 | + return 0; |
|
| 98 | + } |
|
| 93 | 99 | |
| 94 | 100 | if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) { |
| 95 | 101 | return 0; |
@@ -105,8 +111,9 @@ discard block |
||
| 105 | 111 | } |
| 106 | 112 | $fileObject->name = $fileinfo['filename']; |
| 107 | 113 | $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension']; |
| 108 | - if ($fileObject->id && file_exists($sitePath . $fileObject->path)) |
|
| 109 | - unlink($sitePath . $fileObject->path); |
|
| 114 | + if ($fileObject->id && file_exists($sitePath . $fileObject->path)) { |
|
| 115 | + unlink($sitePath . $fileObject->path); |
|
| 116 | + } |
|
| 110 | 117 | |
| 111 | 118 | Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/'); |
| 112 | 119 | |