Completed
Push — master ( 913952...f8c7e1 )
by Alexey
06:23
created
system/modules/Callbacks/install_script.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function($step = NULL, $params = []) {
4 4
     //Категории
5 5
     App::$cur->db->createTable('callbacks_category', [
6 6
         'category_id' => 'pk',
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
         'category_weight' => 'int(11) UNSIGNED NOT NULL',
20 20
         'category_date_create' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP',
21 21
             ], [
22
-        'INDEX ' . App::$cur->db->table_prefix . '_callbacks_category_category_parent_id (category_parent_id)',
23
-        'INDEX ' . App::$cur->db->table_prefix . '_callbacks_category_category_tree_path (category_tree_path(255))',
22
+        'INDEX '.App::$cur->db->table_prefix.'_callbacks_category_category_parent_id (category_parent_id)',
23
+        'INDEX '.App::$cur->db->table_prefix.'_callbacks_category_category_tree_path (category_tree_path(255))',
24 24
     ]);
25 25
     App::$cur->db->createTable('callbacks_callback', [
26 26
         'callback_id' => 'pk',
Please login to merge, or discard this patch.
system/modules/Callbacks/appControllers/CallbacksController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
             Tools::header(404);
40 40
             Tools::redirect('/', 'Отзыв не найден', 'danger');
41 41
         }
42
-        $this->view->setTitle('Отзыв: ' . $callback->name);
42
+        $this->view->setTitle('Отзыв: '.$callback->name);
43 43
         $this->view->page(['data' => compact('callback')]);
44 44
     }
45 45
 
Please login to merge, or discard this patch.
system/modules/Callbacks/Callbacks.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
                 $callback->save();
48 48
                 if (!empty(App::$cur->config['site']['email'])) {
49 49
                     $subject = 'Новый отзыв';
50
-                    $text = 'Вы можете его посмотреть по этому адресу: <a href = "http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/admin/callbacks">http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/admin/callbacks</a>';
51
-                    Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, App::$cur->config['site']['email'], $subject, $text);
50
+                    $text = 'Вы можете его посмотреть по этому адресу: <a href = "http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/admin/callbacks">http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/admin/callbacks</a>';
51
+                    Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, App::$cur->config['site']['email'], $subject, $text);
52 52
                 }
53 53
                 Tools::redirect('/', 'Ваш отзыв был получен и появится после обработки администратором', 'success');
54 54
             }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
         if (!empty($conf['files']['aditionTemplateFiels'])) {
86 86
             foreach ($conf['files']['aditionTemplateFiels'] as $file) {
87
-                $return[$file['file']] = '- ' . $file['name'];
87
+                $return[$file['file']] = '- '.$file['name'];
88 88
             }
89 89
         }
90 90
         return $return;
Please login to merge, or discard this patch.
system/modules/Files/appAdminControllers/content/managerForEditor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
             if ($file->type->group == 'image') {
26 26
                 echo "<img class='img-responsive' src ='{$file->path}?resize=200x200' />";
27 27
             } else {
28
-                echo "<img class='img-responsive' src ='/static/moduleAsset/Files/images/formats/" . pathinfo($file->path, PATHINFO_EXTENSION) . ".png' />";
28
+                echo "<img class='img-responsive' src ='/static/moduleAsset/Files/images/formats/".pathinfo($file->path, PATHINFO_EXTENSION).".png' />";
29 29
             }
30 30
             ?>
31 31
 
Please login to merge, or discard this patch.
system/modules/Modules/appAdminControllers/content/editor.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,22 +12,22 @@  discard block
 block discarded – undo
12 12
     'Операции'
13 13
 ]);
14 14
 $modulePath = Module::getModulePath($module);
15
-$path = $modulePath . '/models';
16
-$config = Config::custom(App::$primary->path . '/modules/' . $module . '/generatorHash.php');
15
+$path = $modulePath.'/models';
16
+$config = Config::custom(App::$primary->path.'/modules/'.$module.'/generatorHash.php');
17 17
 if (file_exists($path)) {
18 18
     $files = array_slice(scandir($path), 2);
19 19
     foreach ($files as $file) {
20
-        if (is_dir($path . '/' . $file)) {
20
+        if (is_dir($path.'/'.$file)) {
21 21
             continue;
22 22
         }
23 23
         $modelName = pathinfo($file, PATHINFO_FILENAME);
24 24
         $table->addRow([
25 25
             $modelName,
26
-            (!empty($config['models/' . $file]) && $config['models/' . $file] == md5(file_get_contents($path . '/' . $file))) ? '<b class="text-success">Нету</b>' : '<b class="text-danger">Есть</b>',
26
+            (!empty($config['models/'.$file]) && $config['models/'.$file] == md5(file_get_contents($path.'/'.$file))) ? '<b class="text-success">Нету</b>' : '<b class="text-danger">Есть</b>',
27 27
             [
28 28
                 'class' => 'actionTd',
29
-                'html' => '<a class="btn btn-xs btn-success" href="/admin/modules/editModel/' . $module . '/' . $modelName . '"><i class="glyphicon glyphicon-edit"></i></a>'
30
-                . ' <a class="btn btn-xs btn-danger" href="/admin/modules/delModel/' . $module . '/' . $modelName . '"><i class="glyphicon glyphicon-remove"></i></a>'
29
+                'html' => '<a class="btn btn-xs btn-success" href="/admin/modules/editModel/'.$module.'/'.$modelName.'"><i class="glyphicon glyphicon-edit"></i></a>'
30
+                . ' <a class="btn btn-xs btn-danger" href="/admin/modules/delModel/'.$module.'/'.$modelName.'"><i class="glyphicon glyphicon-remove"></i></a>'
31 31
             ]
32 32
         ]);
33 33
     }
@@ -50,16 +50,16 @@  discard block
 block discarded – undo
50 50
     'Controllers'
51 51
 ];
52 52
 foreach ($types as $type) {
53
-    if (file_exists($modulePath . '/' . $type)) {
54
-        $files = array_slice(scandir($modulePath . '/' . $type), 2);
53
+    if (file_exists($modulePath.'/'.$type)) {
54
+        $files = array_slice(scandir($modulePath.'/'.$type), 2);
55 55
         foreach ($files as $file) {
56 56
             $table->addRow([
57 57
                 pathinfo($file, PATHINFO_FILENAME),
58 58
                 $type,
59 59
                 [
60 60
                     'class' => 'actionTd',
61
-                    'html' => '<a class="btn btn-xs btn-success" href="/admin/modules/controllerEditor/' . $module . '/' . $type . '/' . pathinfo($file, PATHINFO_FILENAME) . '"><i class="glyphicon glyphicon-edit"></i></a>'
62
-                    . ' <a class="btn btn-xs btn-danger" href="/admin/modules/delController/' . $module . '/' . $type . '/' . pathinfo($file, PATHINFO_FILENAME) . '"><i class="glyphicon glyphicon-remove"></i></a>'
61
+                    'html' => '<a class="btn btn-xs btn-success" href="/admin/modules/controllerEditor/'.$module.'/'.$type.'/'.pathinfo($file, PATHINFO_FILENAME).'"><i class="glyphicon glyphicon-edit"></i></a>'
62
+                    . ' <a class="btn btn-xs btn-danger" href="/admin/modules/delController/'.$module.'/'.$type.'/'.pathinfo($file, PATHINFO_FILENAME).'"><i class="glyphicon glyphicon-remove"></i></a>'
63 63
                 ]
64 64
             ]);
65 65
         }
Please login to merge, or discard this patch.
system/modules/Modules/appAdminControllers/content/modelEditor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 $form = new Ui\Form();
3
-$form->begin((!empty($modelFullName) ? 'Изменение' : 'Создание') . ' модели');
3
+$form->begin((!empty($modelFullName) ? 'Изменение' : 'Создание').' модели');
4 4
 $cols = [
5 5
     'label' => ['type' => 'text', 'label' => 'Название'],
6 6
     'code' => ['type' => 'text', 'label' => 'Код'],
Please login to merge, or discard this patch.
system/modules/Modules/appAdminControllers/content/controllerEditor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,15 +10,15 @@
 block discarded – undo
10 10
     'href' => "/admin/modules/createControllerMethod/{$module}/{$type}/{$controller}",
11 11
     'text' => 'Создать'
12 12
 ]);
13
-$class = CodeGenerator::parseClass(Modules::getModulePath($module) . '/' . $type . '/' . $controller . '.php');
13
+$class = CodeGenerator::parseClass(Modules::getModulePath($module).'/'.$type.'/'.$controller.'.php');
14 14
 foreach ($class->methods as $method) {
15 15
     $name = str_replace('Action', '', $method->name);
16 16
     $table->addRow([
17 17
         $name,
18 18
         [
19 19
             'class' => 'actionTd',
20
-            'html' => '<a class="btn btn-xs btn-success" href="/admin/modules/editControllerMethod/' . $module . '/' . $type . '/' . $controller . '/' . $name . '"><i class="glyphicon glyphicon-edit"></i></a>'
21
-            . ' <a class="btn btn-xs btn-danger" href="/admin/modules/delControllerMethod/' . $module . '/' . $type . '/' . $controller . '/' . $name . '"><i class="glyphicon glyphicon-remove"></i></a>'
20
+            'html' => '<a class="btn btn-xs btn-success" href="/admin/modules/editControllerMethod/'.$module.'/'.$type.'/'.$controller.'/'.$name.'"><i class="glyphicon glyphicon-edit"></i></a>'
21
+            . ' <a class="btn btn-xs btn-danger" href="/admin/modules/delControllerMethod/'.$module.'/'.$type.'/'.$controller.'/'.$name.'"><i class="glyphicon glyphicon-remove"></i></a>'
22 22
         ]
23 23
     ]);
24 24
 }
Please login to merge, or discard this patch.
system/modules/Modules/appAdminControllers/ModulesController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         $config = App::$primary->config;
22 22
         $config['defaultModule'] = $module;
23 23
         Config::save('app', $config);
24
-        Tools::redirect('/admin/modules', 'Модулем по умолчанию установлен: ' . $module, 'success');
24
+        Tools::redirect('/admin/modules', 'Модулем по умолчанию установлен: '.$module, 'success');
25 25
     }
26 26
 
27 27
     public function installAction()
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
             foreach ($_GET['modules'] as $module) {
31 31
                 $this->modules->install($module);
32 32
             }
33
-            Tools::redirect('/admin/modules', 'Моудли ' . implode(',', $_GET['modules']) . ' установлены');
33
+            Tools::redirect('/admin/modules', 'Моудли '.implode(',', $_GET['modules']).' установлены');
34 34
         }
35 35
         $this->view->page();
36 36
     }
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
         $codeName = filter_input(INPUT_POST, 'codeName');
41 41
         if ($codeName && filter_input(INPUT_POST, 'name')) {
42 42
             $codeName = ucfirst($codeName);
43
-            if (file_exists(App::$primary->path . '/modules/' . $codeName . '.php')) {
43
+            if (file_exists(App::$primary->path.'/modules/'.$codeName.'.php')) {
44 44
                 Msg::add('Модуль с таким именем уже существует');
45 45
             } else {
46 46
                 $this->modules->createBlankModule(filter_input(INPUT_POST, 'name'), $codeName);
47 47
                 $config = App::$primary->config;
48 48
                 $config['modules'][] = $codeName;
49 49
                 Config::save('app', $config);
50
-                Tools::redirect('/admin/modules', 'Моудль ' . $codeName . ' создан и установлен');
50
+                Tools::redirect('/admin/modules', 'Моудль '.$codeName.' создан и установлен');
51 51
             }
52 52
         }
53 53
         $this->view->page();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
     public function editorAction($module)
57 57
     {
58
-        if (!file_exists(Module::getModulePath($module) . '/generatorHash.php')) {
58
+        if (!file_exists(Module::getModulePath($module).'/generatorHash.php')) {
59 59
             Msg::add('Этот модуль был создан без помощи генератора. Возможности его изменения ограничены и могут привести к порче модуля', 'danger');
60 60
         }
61 61
         $this->view->page(['data' => compact('module')]);
@@ -63,18 +63,18 @@  discard block
 block discarded – undo
63 63
 
64 64
     public function editModelAction($module, $modelName)
65 65
     {
66
-        $path = Modules::getModulePath($module) . '/models/' . $modelName . '.php';
66
+        $path = Modules::getModulePath($module).'/models/'.$modelName.'.php';
67 67
         if (!file_exists($path)) {
68
-            Tools::redirect('/admin/modules/edit/' . $module, 'Модель ' . $modelName . ' не найдена', 'danger');
68
+            Tools::redirect('/admin/modules/edit/'.$module, 'Модель '.$modelName.' не найдена', 'danger');
69 69
         }
70
-        include_once Modules::getModulePath($module) . '/models/' . $modelName . '.php';
71
-        $modelFullName = $module . '\\' . $modelName;
70
+        include_once Modules::getModulePath($module).'/models/'.$modelName.'.php';
71
+        $modelFullName = $module.'\\'.$modelName;
72 72
         $model = new $modelFullName;
73 73
         if (filter_input(INPUT_POST, 'codeName') && filter_input(INPUT_POST, 'name')) {
74 74
             $this->modules->generateModel($module, filter_input(INPUT_POST, 'name'), filter_input(INPUT_POST, 'codeName'), [
75 75
                 'cols' => $_POST['cols']
76 76
             ]);
77
-            Tools::redirect('/admin/modules/editor/' . $module, 'Модель ' . filter_input(INPUT_POST, 'codeName') . ' была сохранена');
77
+            Tools::redirect('/admin/modules/editor/'.$module, 'Модель '.filter_input(INPUT_POST, 'codeName').' была сохранена');
78 78
         }
79 79
         $this->view->page(['content' => 'modelEditor', 'data' => compact('module', 'modelName', 'modelFullName', 'model')]);
80 80
     }
@@ -85,20 +85,20 @@  discard block
 block discarded – undo
85 85
             $this->modules->generateModel($module, filter_input(INPUT_POST, 'name'), filter_input(INPUT_POST, 'codeName'), [
86 86
                 'cols' => $_POST['cols']
87 87
             ]);
88
-            Tools::redirect('/admin/modules/editor/' . $module, 'Модель ' . filter_input(INPUT_POST, 'codeName') . ' была создана');
88
+            Tools::redirect('/admin/modules/editor/'.$module, 'Модель '.filter_input(INPUT_POST, 'codeName').' была создана');
89 89
         }
90 90
         $this->view->page(['content' => 'modelEditor', 'data' => compact('module')]);
91 91
     }
92 92
 
93 93
     public function delModelAction($module, $modelName)
94 94
     {
95
-        unlink(App::$primary->path . '/modules/' . $module . '/models/' . $modelName . '.php');
96
-        $config = Config::custom(App::$primary->path . '/modules/' . $module . '/generatorHash.php');
97
-        if (isset($config['models/' . $modelName . '.php'])) {
98
-            unset($config['models/' . $modelName . '.php']);
99
-            Config::save(App::$primary->path . '/modules/' . $module . '/generatorHash.php', $config);
95
+        unlink(App::$primary->path.'/modules/'.$module.'/models/'.$modelName.'.php');
96
+        $config = Config::custom(App::$primary->path.'/modules/'.$module.'/generatorHash.php');
97
+        if (isset($config['models/'.$modelName.'.php'])) {
98
+            unset($config['models/'.$modelName.'.php']);
99
+            Config::save(App::$primary->path.'/modules/'.$module.'/generatorHash.php', $config);
100 100
         }
101
-        Tools::redirect('/admin/modules/editor/' . $module, 'Модель ' . $modelName . ' была удалена');
101
+        Tools::redirect('/admin/modules/editor/'.$module, 'Модель '.$modelName.' была удалена');
102 102
     }
103 103
 
104 104
     public function createControllerAction($module)
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $controllerType = filter_input(INPUT_POST, 'type');
107 107
         if ($controllerType) {
108 108
             $this->modules->createController($module, $controllerType);
109
-            Tools::redirect('/admin/modules/editor/' . $module, 'Контроллер был создан');
109
+            Tools::redirect('/admin/modules/editor/'.$module, 'Контроллер был создан');
110 110
         }
111 111
         $this->view->page();
112 112
     }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         $url = filter_input(INPUT_POST, 'url');
122 122
         if ($url) {
123 123
             $this->modules->addActionToController($module, $type, $controller, $url);
124
-            Tools::redirect('/admin/modules/editor/' . $module, 'Контроллер был изменен');
124
+            Tools::redirect('/admin/modules/editor/'.$module, 'Контроллер был изменен');
125 125
         }
126 126
         $this->view->page(['data' => compact('module', 'type', 'controller')]);
127 127
     }
Please login to merge, or discard this patch.
system/modules/Modules/tpls/Model.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
 class <?= $codeName; ?> extends \Model {
6 6
 //modelParams<?php
7 7
 if (!empty($name)) {
8
-    echo "\n    static " . '$objectName = \'' . $name . "';";
8
+    echo "\n    static ".'$objectName = \''.$name."';";
9 9
 }
10 10
 if (!empty($labels)) {
11
-    echo "\n    static " . '$labels = [' . CodeGenerator::genArray($labels, 1) . "\n    ];";
11
+    echo "\n    static ".'$labels = ['.CodeGenerator::genArray($labels, 1)."\n    ];";
12 12
 }
13 13
 if (!empty($cols)) {
14
-    echo "\n    static " . '$cols = [' . CodeGenerator::genArray($cols, 1) . "\n    ];";
14
+    echo "\n    static ".'$cols = ['.CodeGenerator::genArray($cols, 1)."\n    ];";
15 15
 }
16 16
 ?>
17 17
 //!modelParams
Please login to merge, or discard this patch.