@@ -45,7 +45,7 @@ |
||
45 | 45 | public function __construct($caption, $name, $value = null) |
46 | 46 | { |
47 | 47 | /* @var $member_handler XoopsMemberHandler */ |
48 | - $member_handler = xoops_getHandler('member'); |
|
48 | + $member_handler = xoops_getHandler('member'); |
|
49 | 49 | $userGroups = $member_handler->getGroupList(); |
50 | 50 | parent::__construct($caption, $name, $value); |
51 | 51 | $this->columns = 3; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | { |
194 | 194 | $access = $this->getAccessKey(); |
195 | 195 | if (!empty($access) && (false !== ($pos = strpos($str, $access)))) { |
196 | - return htmlspecialchars(substr($str, 0, $pos), ENT_QUOTES) . '<span style="text-decoration: underline;">' . htmlspecialchars(substr($str, $pos, 1), ENT_QUOTES) . '</span>' . htmlspecialchars(substr($str, $pos + 1), ENT_QUOTES); |
|
196 | + return htmlspecialchars(substr($str, 0, $pos), ENT_QUOTES).'<span style="text-decoration: underline;">'.htmlspecialchars(substr($str, $pos, 1), ENT_QUOTES).'</span>'.htmlspecialchars(substr($str, $pos + 1), ENT_QUOTES); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | return htmlspecialchars($str, ENT_QUOTES); |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | public function getTitle($encode = true) |
261 | 261 | { |
262 | 262 | if (strlen($this->_description) > 0) { |
263 | - return $encode ? htmlspecialchars(strip_tags($this->_caption . ' - ' . $this->_description), ENT_QUOTES) : strip_tags($this->_caption . ' - ' . $this->_description); |
|
263 | + return $encode ? htmlspecialchars(strip_tags($this->_caption.' - '.$this->_description), ENT_QUOTES) : strip_tags($this->_caption.' - '.$this->_description); |
|
264 | 264 | } else { |
265 | 265 | return $encode ? htmlspecialchars(strip_tags($this->_caption), ENT_QUOTES) : strip_tags($this->_caption); |
266 | 266 | } |
@@ -345,14 +345,14 @@ discard block |
||
345 | 345 | public function getExtra($encode = false) |
346 | 346 | { |
347 | 347 | if (!$encode) { |
348 | - return ' ' . implode(' ', $this->_extra); |
|
348 | + return ' '.implode(' ', $this->_extra); |
|
349 | 349 | } |
350 | 350 | $value = array(); |
351 | 351 | foreach ($this->_extra as $val) { |
352 | 352 | $value[] = str_replace('>', '>', str_replace('<', '<', $val)); |
353 | 353 | } |
354 | 354 | |
355 | - return empty($value) ? '' : ' ' . implode(' ', $value); |
|
355 | + return empty($value) ? '' : ' '.implode(' ', $value); |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | /** |
@@ -428,10 +428,10 @@ discard block |
||
428 | 428 | echo $this->getFormType(); |
429 | 429 | switch ($this->getFormType()) { |
430 | 430 | case 'checkbox': |
431 | - return NWLINE . "if (!myform.{$eltname}.checked) { window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n"; |
|
431 | + return NWLINE."if (!myform.{$eltname}.checked) { window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n"; |
|
432 | 432 | break; |
433 | 433 | default: |
434 | - return NWLINE . "if (myform.{$eltname}.value == \"\") { window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n"; |
|
434 | + return NWLINE."if (myform.{$eltname}.value == \"\") { window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n"; |
|
435 | 435 | break; |
436 | 436 | } // switch |
437 | 437 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function __construct($title, $modid, $permname, $permdesc, $url = '', $anonymous = true) |
75 | 75 | { |
76 | - parent::__construct($title, 'groupperm_form', XOOPS_URL . '/modules/system/admin/groupperm.php', 'post'); |
|
76 | + parent::__construct($title, 'groupperm_form', XOOPS_URL.'/modules/system/admin/groupperm.php', 'post'); |
|
77 | 77 | $this->_modid = (int)$modid; |
78 | 78 | $this->_permName = $permname; |
79 | 79 | $this->_permDesc = $permdesc; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | // get selected item id(s) for each group |
150 | 150 | $selected = $gperm_handler->getItemIds($this->_permName, $i, $this->_modid); |
151 | - $ele = new XoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected); |
|
151 | + $ele = new XoopsGroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected); |
|
152 | 152 | $ele->setOptionTree($this->_itemTree); |
153 | 153 | $this->addElement($ele); |
154 | 154 | unset($ele); |
@@ -158,27 +158,27 @@ discard block |
||
158 | 158 | $tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset')); |
159 | 159 | $this->addElement($tray); |
160 | 160 | |
161 | - $ret = '<h4>' . $this->getTitle() . '</h4>'; |
|
161 | + $ret = '<h4>'.$this->getTitle().'</h4>'; |
|
162 | 162 | if ($this->_permDesc) { |
163 | - $ret .= $this->_permDesc . '<br><br>'; |
|
163 | + $ret .= $this->_permDesc.'<br><br>'; |
|
164 | 164 | } |
165 | - $ret .= '<form title="' . str_replace('"', '', $this->getTitle()) . '" name="' . $this->getName() . '" id="' . $this->getName() . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '"' . $this->getExtra() . '>' . '<table width="100%" class="outer" cellspacing="1" valign="top">'; |
|
166 | - $elements =& $this->getElements(); |
|
165 | + $ret .= '<form title="'.str_replace('"', '', $this->getTitle()).'" name="'.$this->getName().'" id="'.$this->getName().'" action="'.$this->getAction().'" method="'.$this->getMethod().'"'.$this->getExtra().'>'.'<table width="100%" class="outer" cellspacing="1" valign="top">'; |
|
166 | + $elements = & $this->getElements(); |
|
167 | 167 | $hidden = ''; |
168 | 168 | foreach (array_keys($elements) as $i) { |
169 | 169 | if (!is_object($elements[$i])) { |
170 | 170 | $ret .= $elements[$i]; |
171 | 171 | } elseif (!$elements[$i]->isHidden()) { |
172 | - $ret .= '<tr valign="top" align="left"><td class="head">' . $elements[$i]->getCaption(); |
|
172 | + $ret .= '<tr valign="top" align="left"><td class="head">'.$elements[$i]->getCaption(); |
|
173 | 173 | if ($elements[$i]->getDescription() != '') { |
174 | - $ret .= "<br><br><span style='font-weight: normal;'>" . $elements[$i]->getDescription() . '</span>'; |
|
174 | + $ret .= "<br><br><span style='font-weight: normal;'>".$elements[$i]->getDescription().'</span>'; |
|
175 | 175 | } |
176 | - $ret .= '</td>' . '<td class="even">' . $elements[$i]->render() . '</td></tr>' . ''; |
|
176 | + $ret .= '</td>'.'<td class="even">'.$elements[$i]->render().'</td></tr>'.''; |
|
177 | 177 | } else { |
178 | 178 | $hidden .= $elements[$i]->render(); |
179 | 179 | } |
180 | 180 | } |
181 | - $ret .= '</table>' . $hidden . '</form>'; |
|
181 | + $ret .= '</table>'.$hidden.'</form>'; |
|
182 | 182 | $ret .= $this->renderValidationJS(true); |
183 | 183 | |
184 | 184 | return $ret; |
@@ -273,19 +273,19 @@ discard block |
||
273 | 273 | $tree = '<td valign="top">'; |
274 | 274 | $prefix = ''; |
275 | 275 | $this->_renderOptionTree($tree, $this->_optionTree[$topitem], $prefix); |
276 | - $ret .= $tree . '</td>'; |
|
276 | + $ret .= $tree.'</td>'; |
|
277 | 277 | ++$cols; |
278 | 278 | } |
279 | 279 | $ret .= '</tr></table></td><td class="even" valign="top">'; |
280 | 280 | $option_ids = array(); |
281 | 281 | foreach (array_keys($this->_optionTree) as $id) { |
282 | 282 | if (!empty($id)) { |
283 | - $option_ids[] = "'" . $ele_name . '[groups][' . $this->_groupId . '][' . $id . ']' . "'"; |
|
283 | + $option_ids[] = "'".$ele_name.'[groups]['.$this->_groupId.']['.$id.']'."'"; |
|
284 | 284 | } |
285 | 285 | } |
286 | - $checkallbtn_id = $ele_name . '[checkallbtn][' . $this->_groupId . ']'; |
|
286 | + $checkallbtn_id = $ele_name.'[checkallbtn]['.$this->_groupId.']'; |
|
287 | 287 | $option_ids_str = implode(', ', $option_ids); |
288 | - $ret .= _ALL . " <input id=\"" . $checkallbtn_id . "\" type=\"checkbox\" value=\"\" onclick=\"var optionids = new Array(" . $option_ids_str . "); xoopsCheckAllElements(optionids, '" . $checkallbtn_id . "');\" />"; |
|
288 | + $ret .= _ALL." <input id=\"".$checkallbtn_id."\" type=\"checkbox\" value=\"\" onclick=\"var optionids = new Array(".$option_ids_str."); xoopsCheckAllElements(optionids, '".$checkallbtn_id."');\" />"; |
|
289 | 289 | $ret .= '</td></tr></table>'; |
290 | 290 | |
291 | 291 | return $ret; |
@@ -303,31 +303,31 @@ discard block |
||
303 | 303 | public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array()) |
304 | 304 | { |
305 | 305 | $ele_name = $this->getName(); |
306 | - $tree .= $prefix . "<input type=\"checkbox\" name=\"" . $ele_name . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" id=\"" . $ele_name . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" onclick=\""; |
|
306 | + $tree .= $prefix."<input type=\"checkbox\" name=\"".$ele_name.'[groups]['.$this->_groupId.']['.$option['id']."]\" id=\"".$ele_name.'[groups]['.$this->_groupId.']['.$option['id']."]\" onclick=\""; |
|
307 | 307 | // If there are parent elements, add javascript that will |
308 | 308 | // make them selecteded when this element is checked to make |
309 | 309 | // sure permissions to parent items are added as well. |
310 | 310 | foreach ($parentIds as $pid) { |
311 | - $parent_ele = $ele_name . '[groups][' . $this->_groupId . '][' . $pid . ']'; |
|
312 | - $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if(ele.checked != true) {ele.checked = this.checked;}"; |
|
311 | + $parent_ele = $ele_name.'[groups]['.$this->_groupId.']['.$pid.']'; |
|
312 | + $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if(ele.checked != true) {ele.checked = this.checked;}"; |
|
313 | 313 | } |
314 | 314 | // If there are child elements, add javascript that will |
315 | 315 | // make them unchecked when this element is unchecked to make |
316 | 316 | // sure permissions to child items are not added when there |
317 | 317 | // is no permission to this item. |
318 | 318 | foreach ($option['allchild'] as $cid) { |
319 | - $child_ele = $ele_name . '[groups][' . $this->_groupId . '][' . $cid . ']'; |
|
320 | - $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if(this.checked != true) {ele.checked = false;}"; |
|
319 | + $child_ele = $ele_name.'[groups]['.$this->_groupId.']['.$cid.']'; |
|
320 | + $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if(this.checked != true) {ele.checked = false;}"; |
|
321 | 321 | } |
322 | 322 | $tree .= '" value="1"'; |
323 | 323 | if (in_array($option['id'], $this->_value)) { |
324 | 324 | $tree .= ' checked'; |
325 | 325 | } |
326 | - $tree .= ' />' . $option['name'] . "<input type=\"hidden\" name=\"" . $ele_name . '[parents][' . $option['id'] . "]\" value=\"" . implode(':', $parentIds) . "\" /><input type=\"hidden\" name=\"" . $ele_name . '[itemname][' . $option['id'] . "]\" value=\"" . htmlspecialchars($option['name']) . "\" /><br>\n"; |
|
326 | + $tree .= ' />'.$option['name']."<input type=\"hidden\" name=\"".$ele_name.'[parents]['.$option['id']."]\" value=\"".implode(':', $parentIds)."\" /><input type=\"hidden\" name=\"".$ele_name.'[itemname]['.$option['id']."]\" value=\"".htmlspecialchars($option['name'])."\" /><br>\n"; |
|
327 | 327 | if (isset($option['children'])) { |
328 | 328 | foreach ($option['children'] as $child) { |
329 | 329 | $parentIds[] = $option['id']; |
330 | - $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds); |
|
330 | + $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.' -', $parentIds); |
|
331 | 331 | } |
332 | 332 | } |
333 | 333 | } |
@@ -115,7 +115,7 @@ |
||
115 | 115 | } |
116 | 116 | } else { |
117 | 117 | list($class, $path) = $this->htmlEditor; |
118 | - include_once XOOPS_ROOT_PATH . $path; |
|
118 | + include_once XOOPS_ROOT_PATH.$path; |
|
119 | 119 | if (class_exists($class)) { |
120 | 120 | $this->htmlEditor = new $class($options); |
121 | 121 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public function __construct($caption, $name, $size = 15, $value = 0, $showtime = true) |
47 | 47 | { |
48 | 48 | parent::__construct($caption, ' '); |
49 | - switch ((int) $showtime) { |
|
49 | + switch ((int)$showtime) { |
|
50 | 50 | case static::SHOW_DATE: |
51 | 51 | $displayDate = true; |
52 | 52 | $displayTime = false; |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | $value = ($value > 0) ? $value : time(); |
65 | 65 | $datetime = getdate($value); |
66 | 66 | if ($displayDate) { |
67 | - $this->addElement(new XoopsFormTextDateSelect('', $name . '[date]', $size, $value)); |
|
67 | + $this->addElement(new XoopsFormTextDateSelect('', $name.'[date]', $size, $value)); |
|
68 | 68 | } else { |
69 | 69 | $value = !is_numeric($value) ? time() : (int)$value; |
70 | 70 | $value = ($value == 0) ? time() : $value; |
71 | 71 | $displayValue = date(_SHORTDATESTRING, $value); |
72 | - $this->addElement(new XoopsFormHidden($name . '[date]', $displayValue)); |
|
72 | + $this->addElement(new XoopsFormHidden($name.'[date]', $displayValue)); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if ($displayTime) { |
@@ -77,16 +77,16 @@ discard block |
||
77 | 77 | for ($i = 0; $i < 24; ++$i) { |
78 | 78 | for ($j = 0; $j < 60; $j += 10) { |
79 | 79 | $key = ($i * 3600) + ($j * 60); |
80 | - $timearray[$key] = ($j != 0) ? $i . ':' . $j : $i . ':0' . $j; |
|
80 | + $timearray[$key] = ($j != 0) ? $i.':'.$j : $i.':0'.$j; |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | ksort($timearray); |
84 | 84 | |
85 | - $timeselect = new XoopsFormSelect('', $name . '[time]', $datetime['hours'] * 3600 + 600 * ceil($datetime['minutes'] / 10)); |
|
85 | + $timeselect = new XoopsFormSelect('', $name.'[time]', $datetime['hours'] * 3600 + 600 * ceil($datetime['minutes'] / 10)); |
|
86 | 86 | $timeselect->addOptionArray($timearray); |
87 | 87 | $this->addElement($timeselect); |
88 | 88 | } else { |
89 | - $this->addElement(new XoopsFormHidden($name . '[time]', 0)); |
|
89 | + $this->addElement(new XoopsFormHidden($name.'[time]', 0)); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
@@ -42,25 +42,25 @@ |
||
42 | 42 | */ |
43 | 43 | public function render() |
44 | 44 | { |
45 | - $ret = $this->getTitle() . NWLINE . '<form name="' . $this->getName() . '" id="' . $this->getName() . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '"' . $this->getExtra() . '>' . NWLINE . '<table border="0" width="100%">' . NWLINE; |
|
45 | + $ret = $this->getTitle().NWLINE.'<form name="'.$this->getName().'" id="'.$this->getName().'" action="'.$this->getAction().'" method="'.$this->getMethod().'"'.$this->getExtra().'>'.NWLINE.'<table border="0" width="100%">'.NWLINE; |
|
46 | 46 | $hidden = ''; |
47 | 47 | foreach ($this->getElements() as $ele) { |
48 | 48 | if (!$ele->isHidden()) { |
49 | 49 | if (!$ele->getNocolspan()) { |
50 | - $ret .= '<tr valign="top" align="left"><td>' . $ele->getCaption(); |
|
50 | + $ret .= '<tr valign="top" align="left"><td>'.$ele->getCaption(); |
|
51 | 51 | if ($ele_desc = $ele->getDescription()) { |
52 | - $ret .= '<br><br><span style="font-weight: normal;">' . $ele_desc . '</span>'; |
|
52 | + $ret .= '<br><br><span style="font-weight: normal;">'.$ele_desc.'</span>'; |
|
53 | 53 | } |
54 | - $ret .= '</td><td>' . $ele->render() . '</td></tr>'; |
|
54 | + $ret .= '</td><td>'.$ele->render().'</td></tr>'; |
|
55 | 55 | } else { |
56 | - $ret .= '<tr valign="top" align="left"><td colspan="2">' . $ele->getCaption(); |
|
57 | - $ret .= '</td></tr><tr valign="top" align="left"><td>' . $ele->render() . '</td></tr>'; |
|
56 | + $ret .= '<tr valign="top" align="left"><td colspan="2">'.$ele->getCaption(); |
|
57 | + $ret .= '</td></tr><tr valign="top" align="left"><td>'.$ele->render().'</td></tr>'; |
|
58 | 58 | } |
59 | 59 | } else { |
60 | - $hidden .= $ele->render() . NWLINE; |
|
60 | + $hidden .= $ele->render().NWLINE; |
|
61 | 61 | } |
62 | 62 | } |
63 | - $ret .= '</table>' . NWLINE . ' ' . $hidden . '</form>' . NWLINE; |
|
63 | + $ret .= '</table>'.NWLINE.' '.$hidden.'</form>'.NWLINE; |
|
64 | 64 | |
65 | 65 | return $ret; |
66 | 66 | } |
@@ -32,6 +32,6 @@ |
||
32 | 32 | */ |
33 | 33 | public function __construct($name = 'XOOPS_TOKEN', $timeout = 0) |
34 | 34 | { |
35 | - parent::__construct($name . '_REQUEST', $GLOBALS['xoopsSecurity']->createToken($timeout, $name)); |
|
35 | + parent::__construct($name.'_REQUEST', $GLOBALS['xoopsSecurity']->createToken($timeout, $name)); |
|
36 | 36 | } |
37 | 37 | } |
@@ -65,7 +65,7 @@ |
||
65 | 65 | $editor_handler->allowed_editors = $this->allowed_editors; |
66 | 66 | $option_select = new XoopsFormSelect('', $this->name, $this->value); |
67 | 67 | $extra = 'onchange="if (this.options[this.selectedIndex].value.length > 0) { |
68 | - window.document.forms.' . $this->form->getName() . '.submit(); |
|
68 | + window.document.forms.' . $this->form->getName().'.submit(); |
|
69 | 69 | }"'; |
70 | 70 | $option_select->setExtra($extra); |
71 | 71 | $option_select->addOptionArray($editor_handler->getList($this->nohtml)); |
@@ -75,6 +75,6 @@ |
||
75 | 75 | */ |
76 | 76 | public function render() |
77 | 77 | { |
78 | - return '<input type="hidden" name="' . $this->getName() . '" id="' . $this->getName() . '" value="' . $this->getValue() . '" />'; |
|
78 | + return '<input type="hidden" name="'.$this->getName().'" id="'.$this->getName().'" value="'.$this->getValue().'" />'; |
|
79 | 79 | } |
80 | 80 | } |