@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $tree = new Ui\Tree(); |
4 | -$tree->itemBodyFn = function($category) { |
|
4 | +$tree->itemBodyFn = function ($category) { |
|
5 | 5 | return Html::el('a', ['href' => $category->getHref()], $category->name()); |
6 | 6 | }; |
7 | -$tree->itemActiveCheck = function($curCategory) use($category) { |
|
7 | +$tree->itemActiveCheck = function ($curCategory) use($category) { |
|
8 | 8 | return $curCategory->id == $category->id || strpos($curCategory->tree_path, "/{$category->id}/") !== false; |
9 | 9 | }; |
10 | 10 | $tree->draw($category->getRoot()); |
@@ -62,7 +62,7 @@ |
||
62 | 62 | public static function ul($objectRoot, $maxDeep = 0, $hrefFunc = null, $order = [], $activeFunc = '', $activeClass = 'active') { |
63 | 63 | $count = 0; |
64 | 64 | if (!$hrefFunc) { |
65 | - $hrefFunc = function($object) { |
|
65 | + $hrefFunc = function ($object) { |
|
66 | 66 | return "<a href='#'> {$object->name()}</a>"; |
67 | 67 | }; |
68 | 68 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * @covers Inji::unlisten |
9 | 9 | */ |
10 | 10 | public function testNotSavingEvent() { |
11 | - \Inji::$inst->listen('testEvent', 'testCallback', function() { |
|
11 | + \Inji::$inst->listen('testEvent', 'testCallback', function () { |
|
12 | 12 | return true; |
13 | 13 | }); |
14 | 14 | $this->assertEquals(true, Inji::$inst->event('testEvent')); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | define('INJI_DOMAIN_NAME', 'test.app'); |
17 | 17 | |
18 | -spl_autoload_register(function($class_name) { |
|
18 | +spl_autoload_register(function ($class_name) { |
|
19 | 19 | if (file_exists(INJI_SYSTEM_DIR . '/Inji/' . $class_name . '.php')) { |
20 | 20 | include_once INJI_SYSTEM_DIR . '/Inji/' . $class_name . '.php'; |
21 | 21 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | //load core |
25 | 25 | Inji::$inst = new Inji(); |
26 | 26 | Inji::$config = Config::system(); |
27 | -Inji::$inst->listen('Config-change-system', 'systemConfig', function($event) { |
|
27 | +Inji::$inst->listen('Config-change-system', 'systemConfig', function ($event) { |
|
28 | 28 | Inji::$config = $event['eventObject']; |
29 | 29 | return $event['eventObject']; |
30 | 30 | }); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | App::$cur->params = []; |
46 | 46 | App::$cur->config = Config::app(App::$cur); |
47 | 47 | App::$primary = App::$cur; |
48 | -Inji::$inst->listen('Config-change-app-' . App::$cur->name, 'curAppConfig', function($event) { |
|
48 | +Inji::$inst->listen('Config-change-app-' . App::$cur->name, 'curAppConfig', function ($event) { |
|
49 | 49 | App::$cur->config = $event['eventObject']; |
50 | 50 | return $event['eventObject']; |
51 | 51 | }); |
@@ -5,6 +5,6 @@ |
||
5 | 5 | 'file' => 'index.html', |
6 | 6 | 'css' => ['style.css'], |
7 | 7 | 'libs' => [ |
8 | - 'JqueryUi', 'PaperTheme','FancyBox' |
|
8 | + 'JqueryUi', 'PaperTheme','FancyBox' |
|
9 | 9 | ] |
10 | 10 | ]; |
@@ -5,6 +5,6 @@ |
||
5 | 5 | 'file' => 'index.html', |
6 | 6 | 'css' => ['style.css'], |
7 | 7 | 'libs' => [ |
8 | - 'JqueryUi', 'PaperTheme','FancyBox' |
|
8 | + 'JqueryUi', 'PaperTheme', 'FancyBox' |
|
9 | 9 | ] |
10 | 10 | ]; |
@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | <?php if (empty($noIndicators)) { ?> |
6 | 6 | <ol class="carousel-indicators"> |
7 | 7 | <?php |
8 | - $i = 0; |
|
9 | - for ($i = 0; $i < count($slides); $i++) { |
|
10 | - ?> |
|
8 | + $i = 0; |
|
9 | + for ($i = 0; $i < count($slides); $i++) { |
|
10 | + ?> |
|
11 | 11 | <li data-target="#<?= $id; ?>" data-slide-to="<?= $i; ?>" <?= !$i ? 'class="active"' : ''; ?>></li> |
12 | 12 | <?php |
13 | 13 | } |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | <!-- Wrapper for slides --> |
19 | 19 | <div class="carousel-inner" role="listbox"> |
20 | 20 | <?php |
21 | - $i = 0; |
|
22 | - foreach ($slides as $item) { |
|
23 | - ?> |
|
21 | + $i = 0; |
|
22 | + foreach ($slides as $item) { |
|
23 | + ?> |
|
24 | 24 | <div class="item <?= !$i ? 'active' : ''; ?>"> |
25 | 25 | <?= !empty($item['href']) ? "<a href = '{$item['href']}' style = 'display:inline-block;'>" : ''; ?> |
26 | 26 | <img src="<?= $item['image']; ?>" <?= !empty($item['image']) ? 'alt="' . $item['name'] . '"' : ''; ?> /> |
@@ -61,6 +61,10 @@ |
||
61 | 61 | Inji::$inst->unBlockParallel(); |
62 | 62 | } |
63 | 63 | |
64 | + /** |
|
65 | + * @param string $command |
|
66 | + * @param string $path |
|
67 | + */ |
|
64 | 68 | public static function command($command, $needOutput = true, $path = null) { |
65 | 69 | while (!Inji::$inst->blockParallel()) { |
66 | 70 | sleep(2); |
@@ -15,6 +15,9 @@ |
||
15 | 15 | |
16 | 16 | public $xml = null; |
17 | 17 | |
18 | + /** |
|
19 | + * @param \SimpleXMLElement $xml |
|
20 | + */ |
|
18 | 21 | public function __construct($xml) { |
19 | 22 | $this->xml = $xml; |
20 | 23 | } |
@@ -43,6 +43,10 @@ |
||
43 | 43 | return $modelCols; |
44 | 44 | } |
45 | 45 | |
46 | + /** |
|
47 | + * @param string $colPrefix |
|
48 | + * @param string $tableName |
|
49 | + */ |
|
46 | 50 | public function parseColsForTable($cols, $colPrefix, $tableName) { |
47 | 51 | |
48 | 52 | $colsExist = App::$cur->db->getTableCols($tableName); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | public function parseColsForModel($cols = []) { |
26 | - $modelCols = [ 'labels' => [], 'cols' => [], 'relations' => []]; |
|
26 | + $modelCols = ['labels' => [], 'cols' => [], 'relations' => []]; |
|
27 | 27 | foreach ($cols as $col) { |
28 | 28 | $modelCols['labels'][$col['code']] = $col['label']; |
29 | 29 | $colType = !empty($col['type']['primary']) ? $col['type']['primary'] : $col['type']; |