@@ -66,7 +66,7 @@ |
||
66 | 66 | // truncate the user name to $maxLength chars |
67 | 67 | $length = strlen($userDisplayName); |
68 | 68 | $truncEnd = ($maxLength > $length) ? $length : $maxLength; |
69 | - $show = DataUtil::formatForDisplay(substr($userDisplayName, 0, $truncEnd)); |
|
69 | + $show = DataUtil::formatForDisplay(substr($userDisplayName, 0, $truncEnd)); |
|
70 | 70 | } else { |
71 | 71 | $show = DataUtil::formatForDisplay($userDisplayName); |
72 | 72 | } |
@@ -95,10 +95,10 @@ |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | $_code = "\$_values = $_rval; ". |
98 | - "if (!isset($_lval)) { $_lval = []; } " |
|
99 | - ."foreach (explode($_delim, ".$_attrs['keys'].") as \$_i => \$_key) { " |
|
100 | - ." ${_lval}[\$_key] = \$_values[\$_i]; " |
|
101 | - ."}"; |
|
98 | + "if (!isset($_lval)) { $_lval = []; } " |
|
99 | + ."foreach (explode($_delim, ".$_attrs['keys'].") as \$_i => \$_key) { " |
|
100 | + ." ${_lval}[\$_key] = \$_values[\$_i]; " |
|
101 | + ."}"; |
|
102 | 102 | |
103 | 103 | return $_code; |
104 | 104 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | function smarty_compiler_setvar($params, Smarty_Compiler $compiler) |
51 | 51 | { |
52 | 52 | /* extract the var parameter */ |
53 | - if (preg_match('!(.*)var=('.$compiler->_qstr_regexp.'|\S+?)(.*?)!Us', $params, $_match)) { |
|
53 | + if (preg_match('!(.*)var=(' . $compiler->_qstr_regexp . '|\S+?)(.*?)!Us', $params, $_match)) { |
|
54 | 54 | $_lval = $_match[2]; |
55 | 55 | $_attrs = $compiler->_parse_attrs($_match[1] . $_match[3]); |
56 | 56 | } else { |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | /* test a possible variable */ |
63 | - $_lval_var = $compiler->_parse_var_props('$'.$compiler->_dequote($_lval)); |
|
63 | + $_lval_var = $compiler->_parse_var_props('$' . $compiler->_dequote($_lval)); |
|
64 | 64 | |
65 | 65 | if ($_lval_var[0] == '$') { |
66 | 66 | $_lval = $_lval_var; |
67 | 67 | } else { |
68 | 68 | /* take it as a variable-name */ |
69 | - $_lval = '$this->_tpl_vars['.$compiler->_parse_var_props($_lval).']'; |
|
69 | + $_lval = '$this->_tpl_vars[' . $compiler->_parse_var_props($_lval) . ']'; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /* check for a PHP command as value */ |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | /* list of array-values */ |
85 | 85 | } elseif (isset($_attrs['values'])) { |
86 | 86 | $_delim = (isset($_attrs['delim'])) ? $_attrs['delim'] : "','"; |
87 | - $_rval = 'explode('.$_delim.', '.$_attrs['values'].')'; |
|
87 | + $_rval = 'explode(' . $_delim . ', ' . $_attrs['values'] . ')'; |
|
88 | 88 | |
89 | 89 | /* if indexed */ |
90 | 90 | if (isset($_attrs['keys'])) { |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | return; |
95 | 95 | } |
96 | 96 | |
97 | - $_code = "\$_values = $_rval; ". |
|
97 | + $_code = "\$_values = $_rval; " . |
|
98 | 98 | "if (!isset($_lval)) { $_lval = []; } " |
99 | - ."foreach (explode($_delim, ".$_attrs['keys'].") as \$_i => \$_key) { " |
|
99 | + ."foreach (explode($_delim, " . $_attrs['keys'] . ") as \$_i => \$_key) { " |
|
100 | 100 | ." ${_lval}[\$_key] = \$_values[\$_i]; " |
101 | 101 | ."}"; |
102 | 102 |
@@ -50,45 +50,45 @@ |
||
50 | 50 | function smarty_function_search($params, Zikula_View $view) |
51 | 51 | { |
52 | 52 | // set some defaults |
53 | - $class = (!isset($params['class']) || empty($params['class'])) ? '' : 'class="' . DataUtil::formatForDisplay($params['class']) .'"'; |
|
53 | + $class = (!isset($params['class']) || empty($params['class'])) ? '' : 'class="' . DataUtil::formatForDisplay($params['class']) . '"'; |
|
54 | 54 | $size = (!isset($params['size']) || empty($params['size'])) ? 12 : $params['size']; |
55 | - $search_tabindex = (!isset($params['search_tabindex']) || empty($params['search_tabindex'])) ? 0 : (int)$params['search_tabindex']; |
|
56 | - $search_accesskey = (!isset($params['search_accesskey']) || empty($params['search_accesskey'])) ? '' : 'accesskey="'.DataUtil::formatForDisplay($params['search_accesskey']).'" '; |
|
57 | - $search_class = (!isset($params['search_class']) || empty($params['search_class'])) ? '' : 'class="'.DataUtil::formatForDisplay($params['search_class']).'" '; |
|
55 | + $search_tabindex = (!isset($params['search_tabindex']) || empty($params['search_tabindex'])) ? 0 : (int)$params['search_tabindex']; |
|
56 | + $search_accesskey = (!isset($params['search_accesskey']) || empty($params['search_accesskey'])) ? '' : 'accesskey="' . DataUtil::formatForDisplay($params['search_accesskey']) . '" '; |
|
57 | + $search_class = (!isset($params['search_class']) || empty($params['search_class'])) ? '' : 'class="' . DataUtil::formatForDisplay($params['search_class']) . '" '; |
|
58 | 58 | $value = (!isset($params['value']) || empty($params['value'])) ? '' : $params['value']; |
59 | - $js = (!isset($params['js']) || empty($params['js'])) ? '' : ' onblur="if (this.value==\'\')this.value=\''.$params['value'].'\';" onfocus="if (this.value==\''.$params['value'].'\')this.value=\'\';"'; |
|
59 | + $js = (!isset($params['js']) || empty($params['js'])) ? '' : ' onblur="if (this.value==\'\')this.value=\'' . $params['value'] . '\';" onfocus="if (this.value==\'' . $params['value'] . '\')this.value=\'\';"'; |
|
60 | 60 | $bool = (!isset($params['bool']) || ($params['bool'] != 'OR')) ? 'AND' : $params['bool']; |
61 | - $button_tabindex = (!isset($params['button_tabindex']) || empty($params['button_tabindex'])) ? 0 : (int)$params['button_tabindex']; |
|
62 | - $button_accesskey = (!isset($params['button_accesskey']) || empty($params['button_accesskey'])) ? '' : 'accesskey="'.DataUtil::formatForDisplay($params['button_accesskey']).'" '; |
|
63 | - $button_class = (!isset($params['button_class']) || empty($params['button_class'])) ? '' : 'class="'.DataUtil::formatForDisplay($params['button_class']).'" '; |
|
61 | + $button_tabindex = (!isset($params['button_tabindex']) || empty($params['button_tabindex'])) ? 0 : (int)$params['button_tabindex']; |
|
62 | + $button_accesskey = (!isset($params['button_accesskey']) || empty($params['button_accesskey'])) ? '' : 'accesskey="' . DataUtil::formatForDisplay($params['button_accesskey']) . '" '; |
|
63 | + $button_class = (!isset($params['button_class']) || empty($params['button_class'])) ? '' : 'class="' . DataUtil::formatForDisplay($params['button_class']) . '" '; |
|
64 | 64 | |
65 | 65 | // Staring the search box |
66 | - $searchbox = '<form ' . $class . ' action="'.DataUtil::formatForDisplay(ModUtil::url('ZikulaSearchModule', 'user', 'search')).'" method="post">'."\n"; |
|
67 | - $searchbox .= ' <div>'."\n"; |
|
68 | - $searchbox .= ' <input type="hidden" name="overview" value="1" />'."\n"; |
|
69 | - $searchbox .= ' <input type="hidden" name="bool" value="'.DataUtil::formatForDisplay($bool).'" />'."\n"; |
|
66 | + $searchbox = '<form ' . $class . ' action="' . DataUtil::formatForDisplay(ModUtil::url('ZikulaSearchModule', 'user', 'search')) . '" method="post">' . "\n"; |
|
67 | + $searchbox .= ' <div>' . "\n"; |
|
68 | + $searchbox .= ' <input type="hidden" name="overview" value="1" />' . "\n"; |
|
69 | + $searchbox .= ' <input type="hidden" name="bool" value="' . DataUtil::formatForDisplay($bool) . '" />' . "\n"; |
|
70 | 70 | |
71 | 71 | // Loop through the active modules and assign them |
72 | 72 | if (isset($params['active'])) { |
73 | 73 | $active_modules = explode(',', $params['active']); |
74 | 74 | foreach ($active_modules as $active_module) { |
75 | 75 | $active_module = trim($active_module); |
76 | - $searchbox .= ' <input type="hidden" name="active_'.DataUtil::formatForDisplay($active_module).'" value="1" />'."\n"; |
|
76 | + $searchbox .= ' <input type="hidden" name="active_' . DataUtil::formatForDisplay($active_module) . '" value="1" />' . "\n"; |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | 80 | if (isset($params['label'])) { |
81 | - $searchbox .= ' <label for="search_plugin_q">'.DataUtil::formatForDisplay($params['label']).'</label>'."\n"; |
|
81 | + $searchbox .= ' <label for="search_plugin_q">' . DataUtil::formatForDisplay($params['label']) . '</label>' . "\n"; |
|
82 | 82 | } |
83 | 83 | |
84 | - $searchbox .= ' <input id="search_plugin_q" type="text" name="q" value="'.$value.'" size="'.DataUtil::formatForDisplay($size).'" tabindex="'.DataUtil::formatForDisplay($search_tabindex).'" '.$search_class.$search_accesskey.$js.' />'."\n"; |
|
84 | + $searchbox .= ' <input id="search_plugin_q" type="text" name="q" value="' . $value . '" size="' . DataUtil::formatForDisplay($size) . '" tabindex="' . DataUtil::formatForDisplay($search_tabindex) . '" ' . $search_class . $search_accesskey . $js . ' />' . "\n"; |
|
85 | 85 | |
86 | 86 | if (isset($params['button'])) { |
87 | - $searchbox .= ' <input type="submit" value="'.DataUtil::formatForDisplay($params['button']).'" tabindex="'.DataUtil::formatForDisplay($button_tabindex).'"'.$button_accesskey.$button_class.' />'."\n"; |
|
87 | + $searchbox .= ' <input type="submit" value="' . DataUtil::formatForDisplay($params['button']) . '" tabindex="' . DataUtil::formatForDisplay($button_tabindex) . '"' . $button_accesskey . $button_class . ' />' . "\n"; |
|
88 | 88 | } |
89 | 89 | |
90 | - $searchbox .= ' </div>'."\n"; |
|
91 | - $searchbox .= '</form>'."\n"; |
|
90 | + $searchbox .= ' </div>' . "\n"; |
|
91 | + $searchbox .= '</form>' . "\n"; |
|
92 | 92 | |
93 | 93 | return $searchbox; |
94 | 94 | } |
@@ -45,9 +45,9 @@ |
||
45 | 45 | */ |
46 | 46 | function smarty_function_pageregistervar($params, Zikula_View $view) |
47 | 47 | { |
48 | - $name = isset($params['name']) ? $params['name'] : null; |
|
48 | + $name = isset($params['name']) ? $params['name'] : null; |
|
49 | 49 | $multivalue = isset($params['multivalue']) ? $params['multivalue'] : null; |
50 | - $default = isset($params['default']) ? $params['default'] : null; |
|
50 | + $default = isset($params['default']) ? $params['default'] : null; |
|
51 | 51 | |
52 | 52 | if (!$name) { |
53 | 53 | $view->trigger_error(__f('Error! in %1$s: the %2$s parameter must be specified.', ['pageregistervar', 'name'])); |
@@ -161,12 +161,12 @@ |
||
161 | 161 | PageUtil::addVar('javascript', 'zikula.ui'); |
162 | 162 | $link = []; |
163 | 163 | $link[] = "<a id=\"{$linkID}\" {$class} data-toggle=\"modal\" data-target=\"#{$linkID}_content\" title=\"{$title}\">" . $linkContents . "</a>"; |
164 | - $link[] = '<div class="modal fade" id="'.$linkID.'_content" tabindex="-1" role="dialog" aria-labelledby="'.$linkID.'_label" aria-hidden="true">'; |
|
164 | + $link[] = '<div class="modal fade" id="' . $linkID . '_content" tabindex="-1" role="dialog" aria-labelledby="' . $linkID . '_label" aria-hidden="true">'; |
|
165 | 165 | $link[] = '<div class="modal-dialog">'; |
166 | 166 | $link[] = '<div class="modal-content">'; |
167 | 167 | $link[] = '<div class="modal-header">'; |
168 | 168 | $link[] = '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>'; |
169 | - $link[] = '<h4 class="modal-title" id="'.$linkID.'_label">'.$title.'</h4>'; |
|
169 | + $link[] = '<h4 class="modal-title" id="' . $linkID . '_label">' . $title . '</h4>'; |
|
170 | 170 | $link[] = '</div>'; |
171 | 171 | $link[] = '<div class="modal-body">'; |
172 | 172 | $link[] = $contents; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $defaultValue = isset($params['defaultValue']) ? $params['defaultValue'] : 0; |
32 | 32 | $defaultText = isset($params['defaultText']) ? $params['defaultText'] : ''; |
33 | 33 | $disabled = isset($params['disabled']) ? $params['disable'] : false; |
34 | - $id = isset($params['id']) ? $params['id'] : null; |
|
34 | + $id = isset($params['id']) ? $params['id'] : null; |
|
35 | 35 | $multipleSize = isset($params['multipleSize']) ? $params['multipleSize'] : 1; |
36 | 36 | $name = isset($params['name']) ? $params['name'] : 'defautlselectorname'; |
37 | 37 | $required = (isset($params['required'])) ? (bool)$params['required'] : false; |
@@ -65,7 +65,7 @@ |
||
65 | 65 | |
66 | 66 | ModUtil::dbInfoLoad($params['module']); |
67 | 67 | |
68 | - $class = "{$params['module']}_DBObject_".StringUtil::camelize($params['objecttype']).'Array'; |
|
68 | + $class = "{$params['module']}_DBObject_" . StringUtil::camelize($params['objecttype']) . 'Array'; |
|
69 | 69 | |
70 | 70 | // instantiate the object-array |
71 | 71 | $objectArray = new $class(); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $startfunc = System::getVar('startfunc'); |
176 | 176 | $pager['func'] = !empty($startfunc) ? $startfunc : 'index'; |
177 | 177 | |
178 | - $startargs = explode(',', System::getVar('startargs')); |
|
178 | + $startargs = explode(',', System::getVar('startargs')); |
|
179 | 179 | foreach ($startargs as $arg) { |
180 | 180 | if (!empty($arg)) { |
181 | 181 | $argument = explode('=', $arg); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | case 'lang': |
208 | 208 | $addcurrentlang2url = System::getVar('languageurl'); |
209 | 209 | if ($addcurrentlang2url == 0) { |
210 | - $pager['args'][$k] = $v; |
|
210 | + $pager['args'][$k] = $v; |
|
211 | 211 | } |
212 | 212 | break; |
213 | 213 | default: |
@@ -229,12 +229,12 @@ discard block |
||
229 | 229 | } |
230 | 230 | } elseif (strlen($vv)) { |
231 | 231 | $tkey = $k . '[' . $kk . ']'; |
232 | - $pager['args'][$tkey] = $vv; |
|
232 | + $pager['args'][$tkey] = $vv; |
|
233 | 233 | } |
234 | 234 | } |
235 | 235 | } else { |
236 | 236 | if (strlen($v)) { |
237 | - $pager['args'][$k] = $v; |
|
237 | + $pager['args'][$k] = $v; |
|
238 | 238 | } |
239 | 239 | } |
240 | 240 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | unset($params['func']); |
247 | 247 | unset($params['route']); |
248 | 248 | |
249 | - $pagerUrl = function ($pager) use ($view) { |
|
249 | + $pagerUrl = function($pager) use ($view) { |
|
250 | 250 | if (!$pager['route']) { |
251 | 251 | return ModUtil::url($pager['module'], $pager['type'], $pager['func'], $pager['args']); |
252 | 252 | } |
@@ -66,7 +66,7 @@ |
||
66 | 66 | |
67 | 67 | ModUtil::dbInfoLoad($params['module']); |
68 | 68 | |
69 | - $class = "{$params['module']}_DBObject_".StringUtil::camelize($params['objecttype']); |
|
69 | + $class = "{$params['module']}_DBObject_" . StringUtil::camelize($params['objecttype']); |
|
70 | 70 | |
71 | 71 | // intantiate object model |
72 | 72 | $object = new $class(); |