@@ -63,7 +63,7 @@ |
||
63 | 63 | $templateParameters['lockadmin'] = $this->getVar('lockadmin', 1) ? 1 : 0; |
64 | 64 | $templateParameters['adminId'] = $this->getVar('adminid', 1); |
65 | 65 | $templateParameters['schema'] = $this->get('zikula_permissions_module.helper.schema_helper')->getAllSchema(); |
66 | - $templateParameters['enableFilter'] = (bool) $this->getVar('filter', 1); |
|
66 | + $templateParameters['enableFilter'] = (bool)$this->getVar('filter', 1); |
|
67 | 67 | |
68 | 68 | return $templateParameters; |
69 | 69 | } |
@@ -135,7 +135,7 @@ |
||
135 | 135 | $factory = new RandomLibFactory(); |
136 | 136 | $generator = $factory->getMediumStrengthGenerator(); |
137 | 137 | $chars = str_replace($saltDelimiter, '', $this->randomStringCharacters); |
138 | - $saltStr = $generator->generateString($saltLength, $chars); |
|
138 | + $saltStr = $generator->generateString($saltLength, $chars); |
|
139 | 139 | |
140 | 140 | return $this->buildSaltedHash($unhashedData, $hashMethodName, $saltStr, $hashMethodNameToCode, $saltDelimiter); |
141 | 141 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | // prepare array values |
89 | 89 | $templatesValues = []; |
90 | 90 | foreach ($templates as $t) { |
91 | - $templatesValues[] = 'Block/Menutree/'.$t; |
|
91 | + $templatesValues[] = 'Block/Menutree/' . $t; |
|
92 | 92 | } |
93 | 93 | // fill array keys using values |
94 | 94 | $templates = array_combine($templatesValues, $templates); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (!empty($tpls['themes']['some'])) { |
98 | 98 | sort($tpls['themes']['some']); |
99 | 99 | foreach ($tpls['themes']['some'] as $k => $t) { |
100 | - $tpls['themes']['some'][$k] = 'Block/Menutree/'.$t; |
|
100 | + $tpls['themes']['some'][$k] = 'Block/Menutree/' . $t; |
|
101 | 101 | } |
102 | 102 | $templates[$someThemes] = array_combine($tpls['themes']['some'], $tpls['themes']['some']); |
103 | 103 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | |
155 | 155 | $tree = $this->_toHTML($this->tree, 1, $this->config['id']); |
156 | 156 | |
157 | - $wraperClass = !empty($this->config['wraperClass']) ? 'class="'.$this->config['wraperClass'].'"' : ''; |
|
157 | + $wraperClass = !empty($this->config['wraperClass']) ? 'class="' . $this->config['wraperClass'] . '"' : ''; |
|
158 | 158 | $this->html = "\n<div {$wraperClass}>\n{$tree}</div>"; |
159 | 159 | |
160 | 160 | return $this->html; |
@@ -181,28 +181,28 @@ discard block |
||
181 | 181 | $item = $tab['item']; |
182 | 182 | $indent = str_repeat(' ', ($indentLevel + 1) * 4); |
183 | 183 | |
184 | - $toggle = $indent.'<img class="'.$this->config['toggler'].'" alt="" src="'.$this->config['imagesDir'].$this->config['minus'].'" />'; |
|
184 | + $toggle = $indent . '<img class="' . $this->config['toggler'] . '" alt="" src="' . $this->config['imagesDir'] . $this->config['minus'] . '" />'; |
|
185 | 185 | |
186 | 186 | $iconImage = !empty($item[$reflang]['icon']) ? $item[$reflang]['icon'] : $this->config['item']; |
187 | 187 | $iconImage = !empty($tab['nodes']) ? $this->config['parentOpen'] : $iconImage; |
188 | - $icon = $indent.'<img class="'.$this->config['icon'].'" alt="" src="'.$this->config['imagesDir'].$iconImage.'" />'; |
|
188 | + $icon = $indent . '<img class="' . $this->config['icon'] . '" alt="" src="' . $this->config['imagesDir'] . $iconImage . '" />'; |
|
189 | 189 | |
190 | 190 | $links = []; |
191 | 191 | foreach ($item as $lang => $translated) { |
192 | 192 | $isDynamic = $isDynamic || $translated['dynamic']; |
193 | - $linkClass = $translated['active'] == 1 ? $translated['class'] : $this->config['nodeUnactive'].' '.$translated['class']; |
|
194 | - $linkClass = !empty($linkClass) ? ' class="'.$linkClass.'"' : ''; |
|
195 | - $linkLang = ' lang="'.$translated['lang'].'"'; |
|
196 | - $linkHref = ' href="'.DataUtil::formatForDisplay($translated['href']).'"'; |
|
197 | - $linkTitle = !empty($translated['title']) ? ' title="'.$translated['title'].'"' : ''; |
|
193 | + $linkClass = $translated['active'] == 1 ? $translated['class'] : $this->config['nodeUnactive'] . ' ' . $translated['class']; |
|
194 | + $linkClass = !empty($linkClass) ? ' class="' . $linkClass . '"' : ''; |
|
195 | + $linkLang = ' lang="' . $translated['lang'] . '"'; |
|
196 | + $linkHref = ' href="' . DataUtil::formatForDisplay($translated['href']) . '"'; |
|
197 | + $linkTitle = !empty($translated['title']) ? ' title="' . $translated['title'] . '"' : ''; |
|
198 | 198 | |
199 | 199 | $links[] = "<a{$linkHref}{$linkLang}{$linkTitle}{$linkClass}>{$translated['name']}</a>"; |
200 | 200 | } |
201 | - $links = $indent.implode("\n{$indent}", $links); |
|
201 | + $links = $indent . implode("\n{$indent}", $links); |
|
202 | 202 | |
203 | - $itemid = $indent.'<span class="sub">'.$translated['id'].'.</span>'; |
|
203 | + $itemid = $indent . '<span class="sub">' . $translated['id'] . '.</span>'; |
|
204 | 204 | |
205 | - $liId = !empty($this->config['nodePrefix']) ? ' id="'.$this->config['nodePrefix'].$id.'"' : ''; |
|
205 | + $liId = !empty($this->config['nodePrefix']) ? ' id="' . $this->config['nodePrefix'] . $id . '"' : ''; |
|
206 | 206 | $liClass = []; |
207 | 207 | $liClass[] = $isDynamic ? $this->config['dynamicClass'] : ''; |
208 | 208 | $liClass[] = $size == 1 ? $this->config['nodeSingle'] : ''; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $liClass[] = ($i == $size && $size > 1) ? $this->config['nodeLast'] : ''; |
211 | 211 | $liClass[] = !empty($tab['nodes']) ? $this->config['nodeParent'] : $this->config['nodeLeaf']; |
212 | 212 | $liClass = trim(implode(' ', array_filter($liClass))); |
213 | - $liClass = ' class="'.$liClass.'"'; |
|
213 | + $liClass = ' class="' . $liClass . '"'; |
|
214 | 214 | |
215 | 215 | $indent = str_repeat(' ', $indentLevel * 4); |
216 | 216 |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $this->entityManager->flush(); |
121 | 121 | |
122 | 122 | $collapseable = $this->getVar('collapseable'); |
123 | - $this->setVar('collapseable', (bool) $collapseable); |
|
123 | + $this->setVar('collapseable', (bool)$collapseable); |
|
124 | 124 | |
125 | 125 | case '3.9.2': |
126 | 126 | // convert Text and Html block types so properties is proper array |
@@ -139,10 +139,10 @@ discard block |
||
139 | 139 | $searchBlocks = $this->entityManager->getRepository('ZikulaBlocksModule:BlockEntity')->findBy(['blocktype' => 'Search']); |
140 | 140 | foreach ($searchBlocks as $searchBlock) { |
141 | 141 | $properties = $searchBlock->getProperties(); |
142 | - $properties['displaySearchBtn'] = (bool) $properties['displaySearchBtn']; |
|
142 | + $properties['displaySearchBtn'] = (bool)$properties['displaySearchBtn']; |
|
143 | 143 | if (isset($properties['active'])) { |
144 | 144 | foreach ($properties['active'] as $module => $active) { |
145 | - $properties['active'][$module] = (bool) $active; |
|
145 | + $properties['active'][$module] = (bool)$active; |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | $searchBlock->setProperties($properties); |
@@ -157,7 +157,7 @@ |
||
157 | 157 | $shorturls = System::getVar('shorturls', false); |
158 | 158 | |
159 | 159 | if ($shorturls) { |
160 | - $homepage = System::getBaseUrl().System::getVar('entrypoint', 'index.php'); |
|
160 | + $homepage = System::getBaseUrl() . System::getVar('entrypoint', 'index.php'); |
|
161 | 161 | $forcefqdn = true; |
162 | 162 | } else { |
163 | 163 | $homepage = System::getVar('entrypoint', 'index.php'); |
@@ -84,7 +84,7 @@ |
||
84 | 84 | // if cache is enabled, checks for a cached output |
85 | 85 | if ($this->view->getCaching()) { |
86 | 86 | // set the cache id |
87 | - $this->view->setCacheId($blockinfo['bkey'].'/bid'.$blockinfo['bid'].'/'.UserUtil::getGidCacheString()); |
|
87 | + $this->view->setCacheId($blockinfo['bkey'] . '/bid' . $blockinfo['bid'] . '/' . UserUtil::getGidCacheString()); |
|
88 | 88 | |
89 | 89 | // check out if the contents are cached |
90 | 90 | if ($this->view->is_cached('Block/menu.tpl')) { |
@@ -32,10 +32,10 @@ |
||
32 | 32 | ; |
33 | 33 | $builder->get('content') |
34 | 34 | ->addModelTransformer(new CallbackTransformer( |
35 | - function ($originalDescription) { |
|
35 | + function($originalDescription) { |
|
36 | 36 | return $originalDescription; |
37 | 37 | }, |
38 | - function ($submittedDescription) { |
|
38 | + function($submittedDescription) { |
|
39 | 39 | // remove all HTML tags |
40 | 40 | return strip_tags($submittedDescription); |
41 | 41 | } |
@@ -177,8 +177,8 @@ discard block |
||
177 | 177 | } |
178 | 178 | |
179 | 179 | $this->view->assign('menutree_editlinks', $vars['menutree_editlinks'] && Securityutil::checkPermission('ZikulaBlocksModule::', "$blockinfo[bkey]:$blockinfo[title]:$blockinfo[bid]", ACCESS_EDIT)) |
180 | - ->assign('menutree_content', $newTree) |
|
181 | - ->assign('blockinfo', $blockinfo); |
|
180 | + ->assign('menutree_content', $newTree) |
|
181 | + ->assign('blockinfo', $blockinfo); |
|
182 | 182 | |
183 | 183 | $blockinfo['content'] = $this->view->fetch($vars['menutree_tpl']); |
184 | 184 | |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | |
334 | 334 | // assign all block variables |
335 | 335 | $this->view->assign($vars) |
336 | - ->assign('blockinfo', $blockinfo); |
|
336 | + ->assign('blockinfo', $blockinfo); |
|
337 | 337 | |
338 | 338 | // Return the output that has been generated by this function |
339 | 339 | return $this->view->fetch('Block/Menutree/modify.tpl'); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // if cache is enabled, checks for a cached output |
93 | 93 | if ($this->view->getCaching()) { |
94 | 94 | // set the cache id |
95 | - $this->view->setCacheId($blockinfo['bkey'].'/bid'.$blockinfo['bid'].'/'.UserUtil::getGidCacheString()); |
|
95 | + $this->view->setCacheId($blockinfo['bkey'] . '/bid' . $blockinfo['bid'] . '/' . UserUtil::getGidCacheString()); |
|
96 | 96 | |
97 | 97 | // check out if the contents are cached |
98 | 98 | if ($this->view->is_cached($vars['menutree_tpl'])) { |
@@ -201,18 +201,18 @@ discard block |
||
201 | 201 | $vars = BlockUtil::varsFromContent($blockinfo['content']); |
202 | 202 | |
203 | 203 | // set some default vars |
204 | - $vars['isnew'] = empty($vars); |
|
205 | - $vars['menutree_content'] = isset($vars['menutree_content']) ? $vars['menutree_content'] : []; |
|
206 | - $vars['menutree_tpl'] = isset($vars['menutree_tpl']) ? $vars['menutree_tpl'] : ''; |
|
207 | - $vars['menutree_stylesheet'] = isset($vars['menutree_stylesheet']) ? $vars['menutree_stylesheet'] : ''; |
|
208 | - $vars['menutree_linkclass'] = isset($vars['menutree_linkclass']) ? $vars['menutree_linkclass'] : false; |
|
209 | - $vars['menutree_linkclasses'] = isset($vars['menutree_linkclasses']) ? $vars['menutree_linkclasses'] : []; |
|
210 | - $vars['menutree_titles'] = isset($vars['menutree_titles']) ? $vars['menutree_titles'] : []; |
|
211 | - $vars['menutree_editlinks'] = isset($vars['menutree_editlinks']) ? $vars['menutree_editlinks'] : false; |
|
212 | - $vars['menutree_stripbaseurl'] = isset($vars['menutree_stripbaseurl']) ? $vars['menutree_stripbaseurl'] : true; |
|
213 | - $vars['menutree_maxdepth'] = isset($vars['menutree_maxdepth']) ? $vars['menutree_maxdepth'] : 0; |
|
214 | - $vars['oldlanguages'] = isset($vars['oldlanguages']) ? $vars['oldlanguages'] : []; |
|
215 | - $vars['olddefaultlanguage'] = isset($vars['olddefaultlanguage']) ? $vars['olddefaultlanguage'] : ''; |
|
204 | + $vars['isnew'] = empty($vars); |
|
205 | + $vars['menutree_content'] = isset($vars['menutree_content']) ? $vars['menutree_content'] : []; |
|
206 | + $vars['menutree_tpl'] = isset($vars['menutree_tpl']) ? $vars['menutree_tpl'] : ''; |
|
207 | + $vars['menutree_stylesheet'] = isset($vars['menutree_stylesheet']) ? $vars['menutree_stylesheet'] : ''; |
|
208 | + $vars['menutree_linkclass'] = isset($vars['menutree_linkclass']) ? $vars['menutree_linkclass'] : false; |
|
209 | + $vars['menutree_linkclasses'] = isset($vars['menutree_linkclasses']) ? $vars['menutree_linkclasses'] : []; |
|
210 | + $vars['menutree_titles'] = isset($vars['menutree_titles']) ? $vars['menutree_titles'] : []; |
|
211 | + $vars['menutree_editlinks'] = isset($vars['menutree_editlinks']) ? $vars['menutree_editlinks'] : false; |
|
212 | + $vars['menutree_stripbaseurl'] = isset($vars['menutree_stripbaseurl']) ? $vars['menutree_stripbaseurl'] : true; |
|
213 | + $vars['menutree_maxdepth'] = isset($vars['menutree_maxdepth']) ? $vars['menutree_maxdepth'] : 0; |
|
214 | + $vars['oldlanguages'] = isset($vars['oldlanguages']) ? $vars['oldlanguages'] : []; |
|
215 | + $vars['olddefaultlanguage'] = isset($vars['olddefaultlanguage']) ? $vars['olddefaultlanguage'] : ''; |
|
216 | 216 | |
217 | 217 | // get list of languages |
218 | 218 | $vars['languages'] = ZLanguage::getInstalledLanguageNames(); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | } |
263 | 263 | // decode tree array |
264 | 264 | $tree = new MenutreeTree(); |
265 | - $tree->setOption('id', 'adm-menutree'.$blockinfo['bid']); |
|
265 | + $tree->setOption('id', 'adm-menutree' . $blockinfo['bid']); |
|
266 | 266 | $tree->setOption('sortable', true); |
267 | 267 | if (isset($langs)) { |
268 | 268 | $tree->setOption('langs', $langs['list']); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | // get all templates and stylesheets. |
276 | 276 | $vars['tpls'] = MenutreeUtil::getTemplates(); |
277 | - $vars['styles'] = MenutreeUtil::getStylesheets(); |
|
277 | + $vars['styles'] = MenutreeUtil::getStylesheets(); |
|
278 | 278 | $someThemes = $this->__('Only in some themes'); |
279 | 279 | $vars['somethemes'] = isset($vars['tpls'][$someThemes]) || isset($vars['styles'][$someThemes]) ? true : false; |
280 | 280 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | } |
292 | 292 | |
293 | 293 | // for permissions settings get first supported permlevels |
294 | - $vars['permlevels'] = $this->_permlevels(); |
|
294 | + $vars['permlevels'] = $this->_permlevels(); |
|
295 | 295 | |
296 | 296 | // check if saved permlevels are correct |
297 | 297 | $vars['menutree_titlesperms'] = !empty($vars['menutree_titlesperms']) ? $vars['menutree_titlesperms'] : 'ACCESS_EDIT'; |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | $blockinfo['content'] = BlockUtil::varsToContent($vars); |
440 | 440 | |
441 | 441 | // clear the block cache |
442 | - $this->view->clear_cache(null, $blockinfo['bkey'].'/bid'.$blockinfo['bid']); |
|
442 | + $this->view->clear_cache(null, $blockinfo['bkey'] . '/bid' . $blockinfo['bid']); |
|
443 | 443 | |
444 | 444 | // and clear the theme cache |
445 | 445 | Zikula_View_Theme::getInstance()->clear_cache(); |