@@ -57,7 +57,7 @@ |
||
57 | 57 | if (array_key_exists('options', $spec) && $spec['options']) { |
58 | 58 | $options = $spec['options']; |
59 | 59 | } |
60 | - $className = __NAMESPACE__ . '\\' . ucfirst($spec['type']); |
|
60 | + $className = __NAMESPACE__.'\\'.ucfirst($spec['type']); |
|
61 | 61 | $reflectionClass = new ReflectionClass($className); |
62 | 62 | if (!$reflectionClass->isInstantiable()) { |
63 | 63 | throw new Exception\RuntimeException( |
@@ -68,7 +68,7 @@ |
||
68 | 68 | $options = array_merge($this->getRouteOptions(), $this->getRowData()); |
69 | 69 | return '<a href="' |
70 | 70 | . $this->getUrl($urlHelper($this->getRouteName(), $this->getRouteParams(), $options)) |
71 | - . '">' . $value . '</a>'; |
|
71 | + . '">'.$value.'</a>'; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | // Generated by ZF2's ./bin/templatemap_generator.php |
3 | 3 | return array( |
4 | - 'grid/data/get' => __DIR__ . '/view/grid/data/get.phtml', |
|
4 | + 'grid/data/get' => __DIR__.'/view/grid/data/get.phtml', |
|
5 | 5 | ); |
@@ -57,7 +57,7 @@ |
||
57 | 57 | if (array_key_exists('options', $spec) && $spec['options']) { |
58 | 58 | $options = $spec['options']; |
59 | 59 | } |
60 | - $className = __NAMESPACE__ . '\\' . ucfirst($spec['type']); |
|
60 | + $className = __NAMESPACE__.'\\'.ucfirst($spec['type']); |
|
61 | 61 | $reflectionClass = new ReflectionClass($className); |
62 | 62 | if (!$reflectionClass->isInstantiable()) { |
63 | 63 | throw new Exception\RuntimeException( |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | if (count($this->getConditions()) !== 0) { |
112 | 112 | foreach ($this->getConditions() as $condition) { |
113 | 113 | $conditionKey = 'NNXGridCondition_'.$i; |
114 | - $query->andWhere($condition->getKey() . ' ' . $condition->getCriteria() . ' :'.$conditionKey); |
|
114 | + $query->andWhere($condition->getKey().' '.$condition->getCriteria().' :'.$conditionKey); |
|
115 | 115 | $query->setParameter($conditionKey, $condition->getValue()); |
116 | 116 | $i++; |
117 | 117 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | $query = clone $query; |
140 | 140 | $this->setCountQuery($query |
141 | - ->select('COUNT(DISTINCT ' . $this->getRootAlias() . '.id) AS total_results') |
|
141 | + ->select('COUNT(DISTINCT '.$this->getRootAlias().'.id) AS total_results') |
|
142 | 142 | ->resetQueryParts(['groupBy', 'orderBy']) |
143 | 143 | ->setMaxResults(1) |
144 | 144 | ); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $attributes = $column->getAttributes(); |
27 | 27 | $config = [ |
28 | 28 | 'hidden' => true, |
29 | - 'hidedlg' => empty($attributes['hidedlg']) ? false: (bool)$attributes['hidedlg'], |
|
29 | + 'hidedlg' => empty($attributes['hidedlg']) ? false : (bool)$attributes['hidedlg'], |
|
30 | 30 | 'name' => $escape($column->getName()) |
31 | 31 | ]; |
32 | 32 | $config = array_merge($config, $column->getAttributes()); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @param GridPluginManager | ServiceLocatorInterface $serviceLocator |
115 | 115 | * @param $name |
116 | 116 | * @param $requestedName |
117 | - * @return mixed |
|
117 | + * @return GridInterface |
|
118 | 118 | * @throws Exception\RuntimeException |
119 | 119 | */ |
120 | 120 | public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | /** |
182 | 182 | * @param $navigationBarOptions |
183 | 183 | * @param ServiceLocatorInterface $serviceManager |
184 | - * @return NavigationBarInterface|null |
|
184 | + * @return NavigationBarInterface |
|
185 | 185 | * @throws NavigationBar\Exception\InvalidArgumentException |
186 | 186 | * @throws NavigationBar\Exception\NavigationBarNotFoundException |
187 | 187 | * @throws NavigationBar\Exception\RuntimeException |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) |
38 | 38 | { |
39 | 39 | $res = false; |
40 | - if (strpos($requestedName, static::CONFIG_KEY . '.') === 0) { |
|
40 | + if (strpos($requestedName, static::CONFIG_KEY.'.') === 0) { |
|
41 | 41 | $res = true; |
42 | 42 | } |
43 | 43 | return $res; |
@@ -129,17 +129,17 @@ discard block |
||
129 | 129 | if ($gridsConfig === null || count($gridsConfig) === 0) { |
130 | 130 | throw new Exception\RuntimeException('В конфигурационном файле нет секции grids'); |
131 | 131 | } |
132 | - $gridName = substr($requestedName, strlen(self::CONFIG_KEY . '.')); |
|
132 | + $gridName = substr($requestedName, strlen(self::CONFIG_KEY.'.')); |
|
133 | 133 | if (!array_key_exists($gridName, $gridsConfig) || !$gridsConfig[$gridName]) { |
134 | 134 | throw new Exception\RuntimeException( |
135 | 135 | sprintf('Таблица с именем %s не найдена в конфиге гридов.', $gridName) |
136 | 136 | ); |
137 | 137 | } |
138 | - $gridConfig =& $gridsConfig[$gridName]; |
|
138 | + $gridConfig = & $gridsConfig[$gridName]; |
|
139 | 139 | if (!array_key_exists('class', $gridConfig) || !$gridConfig['class']) { |
140 | 140 | throw new Exception\RuntimeException('Необходимо задать класс таблицы в конфиге.'); |
141 | 141 | } |
142 | - $gridClass =& $gridConfig['class']; |
|
142 | + $gridClass = & $gridConfig['class']; |
|
143 | 143 | $options = []; |
144 | 144 | if (array_key_exists('options', $gridConfig) && $gridConfig['options']) { |
145 | 145 | if (!is_array($gridConfig['options']) && !$gridConfig['options'] instanceof ArrayAccess) { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | /** @var \ZF\ContentNegotiation\Request $request */ |
169 | 169 | $request = $serviceManager->get('request'); |
170 | 170 | $cookie = $request->getCookie(); |
171 | - $name = !empty($gridConfig['options']['name'])? $gridConfig['options']['name'] : $gridName; |
|
171 | + $name = !empty($gridConfig['options']['name']) ? $gridConfig['options']['name'] : $gridName; |
|
172 | 172 | if (!empty($cookie['nnx']['grid'][$name]) |
173 | 173 | && is_string($cookie['nnx']['grid'][$name]) |
174 | 174 | && $userHideColums = json_decode($cookie['nnx']['grid'][$name], true)) { |
@@ -50,7 +50,6 @@ |
||
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Создает экземпляр класса фабрики |
53 | - * @param array|Traversable $spec |
|
54 | 53 | * @throws InvalidButtonException |
55 | 54 | * @throws InvalidNameException |
56 | 55 | * @throws InValidSpecificationException |
@@ -57,7 +57,7 @@ |
||
57 | 57 | if (array_key_exists('options', $spec) && $spec['options']) { |
58 | 58 | $options = $spec['options']; |
59 | 59 | } |
60 | - $className = __NAMESPACE__ . '\\' . ucfirst($spec['type']); |
|
60 | + $className = __NAMESPACE__.'\\'.ucfirst($spec['type']); |
|
61 | 61 | $reflectionClass = new ReflectionClass($className); |
62 | 62 | if (!$reflectionClass->isInstantiable()) { |
63 | 63 | throw new Exception\RuntimeException( |
@@ -117,7 +117,7 @@ |
||
117 | 117 | /** |
118 | 118 | * @param string $key |
119 | 119 | * @param array $options |
120 | - * @param mixed $default |
|
120 | + * @param string $default |
|
121 | 121 | * @return null|string|array |
122 | 122 | */ |
123 | 123 | protected function getConfigVal($key, array $options, $default = null) |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | $escape = $view->plugin('escapeHtml'); |
39 | 39 | $bottomNavigationBar = $this->renderNavigationBar($grid->getBottomNavigationBar()); |
40 | 40 | $topNavigationBar = $this->renderNavigationBar($grid->getTopNavigationBar()); |
41 | - $res = $topNavigationBar['html'] . '<table id="grid-' . $escape($grid->getName()) . '"></table>' . $bottomNavigationBar['html']; |
|
42 | - $buttonsJs = $topNavigationBar['js'] . $bottomNavigationBar['js']; |
|
41 | + $res = $topNavigationBar['html'].'<table id="grid-'.$escape($grid->getName()).'"></table>'.$bottomNavigationBar['html']; |
|
42 | + $buttonsJs = $topNavigationBar['js'].$bottomNavigationBar['js']; |
|
43 | 43 | /** @var PhpRenderer $view */ |
44 | 44 | $view = $this->getView(); |
45 | 45 | $config = $this->getGridConfig($grid); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $columnClass = get_class($column); |
48 | 48 | $columnPath = explode('\\', $columnClass); |
49 | 49 | $colName = array_pop($columnPath); |
50 | - $helperName = 'nnxGridJqGrid' . $colName; |
|
50 | + $helperName = 'nnxGridJqGrid'.$colName; |
|
51 | 51 | /** @var string $columnsJqOptions */ |
52 | 52 | $config['colModel'][] = $view->$helperName($column); |
53 | 53 | } |
@@ -57,18 +57,18 @@ discard block |
||
57 | 57 | foreach ($mutators as $mutator) { |
58 | 58 | if ($mutator instanceof HighlightMutatorInterface) { |
59 | 59 | $config['rowattr'] = '%rowAttrFunction%'; |
60 | - $rowAttr = 'function(rd) {' . |
|
61 | - 'if(rd.' . $mutator->getDataName() . ') {' |
|
62 | - . 'return {"class": rd.' . $mutator->getDataName() . '};' |
|
60 | + $rowAttr = 'function(rd) {'. |
|
61 | + 'if(rd.'.$mutator->getDataName().') {' |
|
62 | + . 'return {"class": rd.'.$mutator->getDataName().'};' |
|
63 | 63 | . '}' |
64 | 64 | . '}'; |
65 | 65 | } |
66 | 66 | } |
67 | 67 | } |
68 | 68 | $view->headScript()->appendScript('$(function(){' |
69 | - . 'var grid = $("#grid-' . $grid->getName() . '").jqGrid(' |
|
70 | - . str_replace('"%rowAttrFunction%"', $rowAttr, json_encode((object)$config)) . ');' |
|
71 | - . str_replace('%gridName%', $grid->getName(), $buttonsJs) .'});'); |
|
69 | + . 'var grid = $("#grid-'.$grid->getName().'").jqGrid(' |
|
70 | + . str_replace('"%rowAttrFunction%"', $rowAttr, json_encode((object)$config)).');' |
|
71 | + . str_replace('%gridName%', $grid->getName(), $buttonsJs).'});'); |
|
72 | 72 | return $res; |
73 | 73 | } |
74 | 74 | |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | /** @var ButtonInterface $button */ |
87 | 87 | foreach ($navigationBar->getButtons() as $button) { |
88 | 88 | $buttonResult = $view->nnxGridJqGridButton($button); |
89 | - $html .= $buttonResult['html']; |
|
90 | - $js .= $buttonResult['js']; |
|
89 | + $html .= $buttonResult['html']; |
|
90 | + $js .= $buttonResult['js']; |
|
91 | 91 | } |
92 | 92 | $html = "<div class='buttons-panel'>$html</div><br>"; |
93 | 93 | } |
94 | - return ['html' => $html,'js' => $js]; |
|
94 | + return ['html' => $html, 'js' => $js]; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |