@@ -139,7 +139,7 @@ |
||
139 | 139 | // namespace 'Foo', class Foo\BadFoo\Class should match and become Foo/BadFoo/Class.php |
140 | 140 | // namespace 'Bar', separator '_', class Bar should match and become Bar.php |
141 | 141 | // namespace 'Bar', separator '_', class Bar_Exception should match and become Bar\Exception.php |
142 | - if (strpos($class, $namespace.$array['separator']) === 0 || $class == $namespace || empty($namespace)) { |
|
142 | + if (strpos($class, $namespace . $array['separator']) === 0 || $class == $namespace || empty($namespace)) { |
|
143 | 143 | // replace namespace separator with \DIRECTORY_SEPARATOR |
144 | 144 | $file = str_replace($array['separator'], DIRECTORY_SEPARATOR, $class); |
145 | 145 |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $tree = $this->_toHTML($this->tree, 1, $this->config['id'], true); |
176 | 176 | |
177 | 177 | if ($this->config['withWraper']) { |
178 | - $wraperClass = !empty($this->config['wraperClass']) ? 'class="'.$this->config['wraperClass'].'"' : ''; |
|
178 | + $wraperClass = !empty($this->config['wraperClass']) ? 'class="' . $this->config['wraperClass'] . '"' : ''; |
|
179 | 179 | $this->html = "\n<div {$wraperClass}>\n{$tree}</div>"; |
180 | 180 | } else { |
181 | 181 | $this->html = $tree; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $tree = $this->_toHTML($this->tree, 1, $this->config['id'], true); |
199 | 199 | |
200 | 200 | if ($this->config['withWraper']) { |
201 | - $wraperClass = !empty($this->config['wraperClass']) ? 'class="'.$this->config['wraperClass'].'"' : ''; |
|
201 | + $wraperClass = !empty($this->config['wraperClass']) ? 'class="' . $this->config['wraperClass'] . '"' : ''; |
|
202 | 202 | $this->html = "\n<div {$wraperClass}>\n{$tree}</div>"; |
203 | 203 | } else { |
204 | 204 | $this->html = $tree; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | public function getConfigForScript($encode = true) |
218 | 218 | { |
219 | 219 | $jsConfig = $this->config; |
220 | - $omitKeys = ['objid', 'nestedSet', 'customJSClass'. 'cssFile']; |
|
220 | + $omitKeys = ['objid', 'nestedSet', 'customJSClass' . 'cssFile']; |
|
221 | 221 | foreach ($omitKeys as $key) { |
222 | 222 | unset($jsConfig[$key]); |
223 | 223 | } |
@@ -366,8 +366,8 @@ discard block |
||
366 | 366 | $html = $liHtml; |
367 | 367 | } else { |
368 | 368 | $indent = str_repeat(' ', $indentLevel * 4); |
369 | - $ulID = !empty($treeId) ? ' id="'.$treeId.'"' : ''; |
|
370 | - $ulClass = !empty($this->config['treeClass']) ? ' class="'.$this->config['treeClass'].'"' : ''; |
|
369 | + $ulID = !empty($treeId) ? ' id="' . $treeId . '"' : ''; |
|
370 | + $ulClass = !empty($this->config['treeClass']) ? ' class="' . $this->config['treeClass'] . '"' : ''; |
|
371 | 371 | $html = "{$indent}<ul{$ulID}{$ulClass}>\n{$liHtml}\n{$indent}</ul>\n"; |
372 | 372 | } |
373 | 373 | |
@@ -391,18 +391,18 @@ discard block |
||
391 | 391 | $item = $tab['item']; |
392 | 392 | $indent = str_repeat(' ', ($indentLevel + 1) * 4); |
393 | 393 | |
394 | - $toggle = $indent.'<img class="'.$this->config['toggler'].'" alt="" src="'.$this->config['imagesDir'].$this->config['minus'].'" />'; |
|
394 | + $toggle = $indent . '<img class="' . $this->config['toggler'] . '" alt="" src="' . $this->config['imagesDir'] . $this->config['minus'] . '" />'; |
|
395 | 395 | |
396 | 396 | $iconImage = !empty($item['icon']) ? $item['icon'] : (!empty($tab['nodes']) ? $this->config['parentOpen'] : $this->config['item']); |
397 | - $icon = $indent.'<img class="'.$this->config['icon'].'" alt="" src="'.$this->config['imagesDir'].$iconImage.'" />'; |
|
397 | + $icon = $indent . '<img class="' . $this->config['icon'] . '" alt="" src="' . $this->config['imagesDir'] . $iconImage . '" />'; |
|
398 | 398 | |
399 | - $linkClass = $item['active'] == 1 ? $item['class'] : $this->config['nodeUnactive'].' '.$item['class']; |
|
400 | - $linkClass = !empty($linkClass) ? ' class="'.$linkClass.'"' : ''; |
|
401 | - $linkHref = 'href="'.DataUtil::formatForDisplay($item['href']).'"'; |
|
402 | - $linkTitle = !empty($item['title']) ? ' title="'.$item['title'].'"' : ''; |
|
403 | - $link = $indent."<a {$linkHref}{$linkClass}{$linkTitle}>{$item['name']}</a>"; |
|
399 | + $linkClass = $item['active'] == 1 ? $item['class'] : $this->config['nodeUnactive'] . ' ' . $item['class']; |
|
400 | + $linkClass = !empty($linkClass) ? ' class="' . $linkClass . '"' : ''; |
|
401 | + $linkHref = 'href="' . DataUtil::formatForDisplay($item['href']) . '"'; |
|
402 | + $linkTitle = !empty($item['title']) ? ' title="' . $item['title'] . '"' : ''; |
|
403 | + $link = $indent . "<a {$linkHref}{$linkClass}{$linkTitle}>{$item['name']}</a>"; |
|
404 | 404 | |
405 | - $liId = !empty($this->config['nodePrefix']) ? ' id="'.$this->config['nodePrefix'].$id.'"' : ''; |
|
405 | + $liId = !empty($this->config['nodePrefix']) ? ' id="' . $this->config['nodePrefix'] . $id . '"' : ''; |
|
406 | 406 | $liClass = []; |
407 | 407 | $liClass[] = $size == 1 ? $this->config['nodeSingle'] : ''; |
408 | 408 | $liClass[] = ($i == 1 && $size > 1) ? $this->config['nodeFirst'] : ''; |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | $liClass[] = !empty($tab['nodes']) ? $this->config['nodeParent'] : $this->config['nodeLeaf']; |
411 | 411 | $liClass[] = isset($item['class']) ? $item['class'] : ''; |
412 | 412 | $liClass = trim(implode(' ', array_filter($liClass))); |
413 | - $liClass = ' class="'.$liClass.'"'; |
|
413 | + $liClass = ' class="' . $liClass . '"'; |
|
414 | 414 | |
415 | 415 | $indent = str_repeat(' ', $indentLevel * 4); |
416 | 416 |
@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | } else { |
45 | 45 | $base = ModUtil::getBaseDir($this->modinfo['name']); |
46 | 46 | $path = is_dir("$base/{$this->modinfo['directory']}/plugins/{$pluginName}/templates/plugins") ? |
47 | - "$base/{$this->modinfo['directory']}/plugins/{$pluginName}/templates/plugins" : |
|
48 | - "$base/{$this->modinfo['directory']}/plugins/{$pluginName}/Resources/views/plugins"; |
|
47 | + "$base/{$this->modinfo['directory']}/plugins/{$pluginName}/templates/plugins" : "$base/{$this->modinfo['directory']}/plugins/{$pluginName}/Resources/views/plugins"; |
|
49 | 48 | } |
50 | 49 | |
51 | 50 | $this->addPluginDir($path); |
@@ -136,8 +135,7 @@ discard block |
||
136 | 135 | break; |
137 | 136 | case ModUtil::TYPE_MODULE: |
138 | 137 | $pluginsDir = is_dir("modules/{$modinfo['directory']}/plugins/$plugin/templates/plugins") ? |
139 | - "modules/{$modinfo['directory']}/plugins/$plugin/templates/plugins" : |
|
140 | - "modules/{$modinfo['directory']}/plugins/$plugin/Resources/views/plugins"; |
|
138 | + "modules/{$modinfo['directory']}/plugins/$plugin/templates/plugins" : "modules/{$modinfo['directory']}/plugins/$plugin/Resources/views/plugins"; |
|
141 | 139 | break; |
142 | 140 | case ModUtil::TYPE_CORE: |
143 | 141 | $pluginsDir = is_dir("plugins/$plugin/templates/plugins") ? |
@@ -178,7 +176,7 @@ discard block |
||
178 | 176 | $search_path = []; |
179 | 177 | try { |
180 | 178 | $bundle = $this->getContainer()->get('kernel')->getBundle($module); |
181 | - $bundlePath = $relativepath = $bundle->getRelalativePath().'/Resources/views'; |
|
179 | + $bundlePath = $relativepath = $bundle->getRelalativePath() . '/Resources/views'; |
|
182 | 180 | $search_path[] = $bundlePath; |
183 | 181 | } catch (\InvalidArgumentException $e) { |
184 | 182 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | return LogUtil::registerError(__f('Error! The template [%1$s] is not available in the [%2$s] module.', |
103 | - [$resource, $view->toplevelmodule])); |
|
103 | + [$resource, $view->toplevelmodule])); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | if (!self::$cache['insert'][$name]) { |
192 | 192 | return LogUtil::registerError(__f('Error! The insert [%1$s] is not available in the [%2$s] module.', |
193 | - [$insert, $view->toplevelmodule])); |
|
193 | + [$insert, $view->toplevelmodule])); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | return true; |
@@ -659,14 +659,14 @@ |
||
659 | 659 | |
660 | 660 | // make the base vars available to all templates |
661 | 661 | $this->assign('module', $this->toplevelmodule) |
662 | - ->assign('uid', $this->uid) |
|
663 | - ->assign('loggedin', $this->isloggedin) |
|
664 | - ->assign('pagetype', $this->pagetype) |
|
665 | - ->assign('themepath', $this->themepath) |
|
666 | - ->assign('imagepath', $this->imagepath) |
|
667 | - ->assign('imagelangpath', $this->imagelangpath) |
|
668 | - ->assign('stylepath', $this->stylepath) |
|
669 | - ->assign('scriptpath', $this->scriptpath); |
|
662 | + ->assign('uid', $this->uid) |
|
663 | + ->assign('loggedin', $this->isloggedin) |
|
664 | + ->assign('pagetype', $this->pagetype) |
|
665 | + ->assign('themepath', $this->themepath) |
|
666 | + ->assign('imagepath', $this->imagepath) |
|
667 | + ->assign('imagelangpath', $this->imagelangpath) |
|
668 | + ->assign('stylepath', $this->stylepath) |
|
669 | + ->assign('scriptpath', $this->scriptpath); |
|
670 | 670 | |
671 | 671 | // load the theme variables |
672 | 672 | $variables = ModUtil::apiFunc('ZikulaThemeModule', 'user', 'getvariables', ['theme' => $this->name]); |
@@ -328,13 +328,13 @@ discard block |
||
328 | 328 | |
329 | 329 | // add the module wrapper |
330 | 330 | if (!$this->themeinfo['system'] && (bool)$this->themeconfig['modulewrapper'] && $this->toplevelmodule) { |
331 | - $maincontent = '<div id="z-maincontent" class="'.($this->homepage ? 'z-homepage ' : '').'z-module-'.DataUtil::formatForDisplay(strtolower($this->toplevelmodule)).' '.$this->type.' '.$this->func.'">'.$maincontent.'</div>'; |
|
331 | + $maincontent = '<div id="z-maincontent" class="' . ($this->homepage ? 'z-homepage ' : '') . 'z-module-' . DataUtil::formatForDisplay(strtolower($this->toplevelmodule)) . ' ' . $this->type . ' ' . $this->func . '">' . $maincontent . '</div>'; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | $event = new \Zikula\Core\Event\GenericEvent($this, [], $maincontent); |
335 | 335 | $maincontent = $this->eventManager->dispatch('theme.prefetch', $event)->getData(); |
336 | 336 | |
337 | - $this->cache_id = md5($this->cache_id.'|'.$maincontent); |
|
337 | + $this->cache_id = md5($this->cache_id . '|' . $maincontent); |
|
338 | 338 | |
339 | 339 | // Assign the main content area to the template engine |
340 | 340 | $this->assign('maincontent', $maincontent); |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | |
434 | 434 | $theme = ThemeUtil::getTheme($this->name); |
435 | 435 | if (null !== $theme) { |
436 | - $relativePath = $theme->getRelativePath().'/Resources/views'; |
|
436 | + $relativePath = $theme->getRelativePath() . '/Resources/views'; |
|
437 | 437 | } else { |
438 | 438 | $relativePath = "themes/$themeDir/templates"; |
439 | 439 | } |
@@ -744,8 +744,8 @@ discard block |
||
744 | 744 | $file = $pageconfigurations['*home']['file']; |
745 | 745 | |
746 | 746 | // identify a type match |
747 | - } elseif (isset($pageconfigurations['*'.$this->type])) { |
|
748 | - $file = $pageconfigurations['*'.$this->type]['file']; |
|
747 | + } elseif (isset($pageconfigurations['*' . $this->type])) { |
|
748 | + $file = $pageconfigurations['*' . $this->type]['file']; |
|
749 | 749 | |
750 | 750 | // identify an admin-like type |
751 | 751 | } elseif (isset($pageconfigurations['*admin']) |
@@ -750,7 +750,8 @@ |
||
750 | 750 | // identify an admin-like type |
751 | 751 | } elseif (isset($pageconfigurations['*admin']) |
752 | 752 | && ((strpos($this->type, 'admin') === 0) |
753 | - || (isset($methodAnnotationValue) && ($methodAnnotationValue == 'admin')))) { // Core-2.0 FC |
|
753 | + || (isset($methodAnnotationValue) && ($methodAnnotationValue == 'admin')))) { |
|
754 | +// Core-2.0 FC |
|
754 | 755 | $file = $pageconfigurations['*admin']['file']; |
755 | 756 | |
756 | 757 | // search for arguments match |
@@ -37,14 +37,14 @@ |
||
37 | 37 | $this->name = $bundle->getName(); |
38 | 38 | $this->domain = ZLanguage::getModuleDomain($this->name); |
39 | 39 | $this->baseDir = $bundle->getPath(); |
40 | - $versionClass = $bundle->getVersionClass(); |
|
40 | + $versionClass = $bundle->getVersionClass(); |
|
41 | 41 | $this->version = new $versionClass($bundle); |
42 | 42 | } else { |
43 | 43 | $className = $this->getReflection()->getName(); |
44 | 44 | $separator = (false === strpos($className, '_')) ? '\\' : '_'; |
45 | 45 | $parts = explode($separator, $className); |
46 | 46 | $this->name = $parts[0]; |
47 | - $this->baseDir = $this->libBaseDir = realpath(dirname($this->reflection->getFileName()).'/../..'); |
|
47 | + $this->baseDir = $this->libBaseDir = realpath(dirname($this->reflection->getFileName()) . '/../..'); |
|
48 | 48 | if (realpath("{$this->baseDir}/lib/" . $this->name)) { |
49 | 49 | $this->libBaseDir = realpath("{$this->baseDir}/lib/" . $this->name); |
50 | 50 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $this->libBaseDir = realpath("{$this->baseDir}/lib/" . $this->name); |
52 | 52 | } |
53 | 53 | |
54 | - $versionClass = "{$this->name}\\{$this->name}Version"; |
|
54 | + $versionClass = "{$this->name}\\{$this->name}version"; |
|
55 | 55 | $versionClassOld = "{$this->name}_Version"; |
56 | 56 | $versionClass = class_exists($versionClass) ? $versionClass : $versionClassOld; |
57 | 57 | $this->version = new $versionClass(); |
@@ -828,7 +828,7 @@ |
||
828 | 828 | return true; |
829 | 829 | } else { |
830 | 830 | // for BC: if only url is provided, send redirect immediately, discarding all future lifecycle changes |
831 | - $response = new RedirectResponse(System::normalizeUrl($url)); |
|
831 | + $response = new RedirectResponse(System::normalizeUrl($url)); |
|
832 | 832 | $response->send(); |
833 | 833 | exit; |
834 | 834 | } |
@@ -108,7 +108,7 @@ |
||
108 | 108 | |
109 | 109 | $html .= "<input type=\"hidden\" name=\"{$this->id}SelectedIndex\" id=\"{$this->id}SelectedIndex\" value=\"{$this->selectedIndex}\" />\n"; |
110 | 110 | |
111 | - return $html .'<div class="tab-content">'.$content.'</div>'; |
|
111 | + return $html . '<div class="tab-content">' . $content . '</div>'; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -143,6 +143,6 @@ |
||
143 | 143 | */ |
144 | 144 | public function decode(Zikula_Form_View $view) |
145 | 145 | { |
146 | - $this->selectedIndex = (int)$this->request->request->get("{$this->id}SelectedIndex", 1); |
|
146 | + $this->selectedIndex = (int)$this->request->request->get("{$this->id}selectedindex", 1); |
|
147 | 147 | } |
148 | 148 | } |
@@ -243,7 +243,7 @@ |
||
243 | 243 | if (!$collection) { |
244 | 244 | $collection = new \Doctrine\Common\Collections\ArrayCollection(); |
245 | 245 | $entityManager->getClassMetadata($entityClass) |
246 | - ->setFieldValue($entity, $this->dataField, $collection); |
|
246 | + ->setFieldValue($entity, $this->dataField, $collection); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | if (is_array($this->getSelectedValue())) { |