@@ -237,7 +237,7 @@ |
||
237 | 237 | * Creates a random number with a specified number of $digits |
238 | 238 | * |
239 | 239 | * @param int $digits number of digits |
240 | - * @return return int random number |
|
240 | + * @return string int random number |
|
241 | 241 | * @author xHelp Team |
242 | 242 | * |
243 | 243 | * @access public |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
21 | -require_once XOOPS_ROOT_PATH . '/kernel/user.php'; |
|
22 | -require_once XOOPS_ROOT_PATH . '/kernel/group.php'; |
|
23 | -require_once XOOPS_ROOT_PATH . '/kernel/member.php'; |
|
21 | +require_once XOOPS_ROOT_PATH.'/kernel/user.php'; |
|
22 | +require_once XOOPS_ROOT_PATH.'/kernel/group.php'; |
|
23 | +require_once XOOPS_ROOT_PATH.'/kernel/member.php'; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * XOOPS member handler class. |
@@ -141,12 +141,12 @@ discard block |
||
141 | 141 | // send some notifications |
142 | 142 | $xoopsMailer = xoops_getMailer(); |
143 | 143 | $xoopsMailer->useMail(); |
144 | - $xoopsMailer->setTemplateDir(SMARTOBJECT_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/mail_template'); |
|
144 | + $xoopsMailer->setTemplateDir(SMARTOBJECT_ROOT_PATH.'language/'.$xoopsConfig['language'].'/mail_template'); |
|
145 | 145 | $xoopsMailer->setTemplate('smartobject_notify_user_added_by_admin.tpl'); |
146 | 146 | $xoopsMailer->assign('XOOPS_USER_PASSWORD', $password); |
147 | 147 | $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']); |
148 | 148 | $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
149 | - $xoopsMailer->assign('SITEURL', XOOPS_URL . '/'); |
|
149 | + $xoopsMailer->assign('SITEURL', XOOPS_URL.'/'); |
|
150 | 150 | $xoopsMailer->assign('NAME', $userObj->getVar('name')); |
151 | 151 | $xoopsMailer->assign('UNAME', $userObj->getVar('uname')); |
152 | 152 | $xoopsMailer->setToUsers($userObj); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if (strlen($name) > 0) { |
193 | 193 | $name = explode(' ', trim($name)); |
194 | 194 | if (count($name) > 1) { |
195 | - $basename = strtolower(substr($name[0], 0, 1) . $name[count($name) - 1]); |
|
195 | + $basename = strtolower(substr($name[0], 0, 1).$name[count($name) - 1]); |
|
196 | 196 | } else { |
197 | 197 | $basename = strtolower($name[0]); |
198 | 198 | } |
@@ -209,9 +209,9 @@ discard block |
||
209 | 209 | while ($i < $count) { |
210 | 210 | $num = $this->genRandNumber(); |
211 | 211 | if ($onbasename < 0 && $hasbasename) { |
212 | - $names[] = xoops_substr($basename, 0, 58, '') . $num; |
|
212 | + $names[] = xoops_substr($basename, 0, 58, '').$num; |
|
213 | 213 | } else { |
214 | - $names[] = xoops_substr($emailname, 0, 58, '') . $num; |
|
214 | + $names[] = xoops_substr($emailname, 0, 58, '').$num; |
|
215 | 215 | } |
216 | 216 | $i = count($names); |
217 | 217 | $onbasename = ~$onbasename; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | { |
254 | 254 | static $randCalled = false; |
255 | 255 | if (!$randCalled) { |
256 | - mt_srand((double)microtime() * 1000000); |
|
256 | + mt_srand((double) microtime() * 1000000); |
|
257 | 257 | $randCalled = true; |
258 | 258 | } |
259 | 259 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
179 | - * @param $key |
|
179 | + * @param string $key |
|
180 | 180 | * @param $data_type |
181 | 181 | * @param bool $itemName |
182 | 182 | * @param string $form_caption |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * @param bool $required set to TRUE if this variable needs to have a value set before storing the object in the table |
213 | 213 | * @param string $form_caption caption of this variable in a {@link SmartobjectForm} and title of a column in a {@link SmartObjectTable} |
214 | 214 | * @param string $form_dsc description of this variable in a {@link SmartobjectForm} |
215 | - * @param mixed $value default value of this variable |
|
215 | + * @param string|false $value default value of this variable |
|
216 | 216 | */ |
217 | 217 | public function quickInitVar( |
218 | 218 | $key, |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
230 | - * @param $varname |
|
230 | + * @param string $varname |
|
231 | 231 | * @param bool $displayOnForm |
232 | 232 | * @param string $default |
233 | 233 | */ |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | /** |
490 | 490 | * add an error |
491 | 491 | * |
492 | - * @param $err_str |
|
492 | + * @param string $err_str |
|
493 | 493 | * @param bool $prefix |
494 | 494 | * @internal param string $value error to add |
495 | 495 | * @access public |
@@ -751,8 +751,8 @@ discard block |
||
751 | 751 | |
752 | 752 | /** |
753 | 753 | * @param $key |
754 | - * @param $info |
|
755 | - * @param $value |
|
754 | + * @param string $info |
|
755 | + * @param boolean $value |
|
756 | 756 | */ |
757 | 757 | public function setVarInfo($key, $info, $value) |
758 | 758 | { |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | } |
761 | 761 | |
762 | 762 | /** |
763 | - * @param $key |
|
763 | + * @param string $key |
|
764 | 764 | * @param bool $editor |
765 | 765 | * @return string |
766 | 766 | */ |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | * @access public |
940 | 940 | * @param string $key key of the object's variable to be returned |
941 | 941 | * @param string $format format to use for the output |
942 | - * @return mixed formatted value of the variable |
|
942 | + * @return string formatted value of the variable |
|
943 | 943 | */ |
944 | 944 | public function getVar($key, $format = 's') |
945 | 945 | { |
@@ -1249,7 +1249,7 @@ discard block |
||
1249 | 1249 | } |
1250 | 1250 | |
1251 | 1251 | /** |
1252 | - * @param $key |
|
1252 | + * @param string $key |
|
1253 | 1253 | */ |
1254 | 1254 | public function hideFieldFromForm($key) |
1255 | 1255 | { |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | |
13 | 13 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
14 | 14 | |
15 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'; |
|
15 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'; |
|
16 | 16 | |
17 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php'; |
|
17 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectcontroller.php'; |
|
18 | 18 | |
19 | 19 | if (!defined('XOBJ_DTYPE_SIMPLE_ARRAY')) { |
20 | 20 | define('XOBJ_DTYPE_SIMPLE_ARRAY', 101); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function closeSection($section_name) |
115 | 115 | { |
116 | - $this->initVar('close_section_' . $section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true); |
|
116 | + $this->initVar('close_section_'.$section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | } |
152 | 152 | parent::initVar($key, $data_type, $value, $required, $maxlength, $options); |
153 | 153 | if ($this->handler && (!$form_caption || $form_caption === '')) { |
154 | - $dyn_form_caption = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key); |
|
154 | + $dyn_form_caption = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key); |
|
155 | 155 | if (defined($dyn_form_caption)) { |
156 | 156 | $form_caption = constant($dyn_form_caption); |
157 | 157 | } |
158 | 158 | } |
159 | 159 | if ($this->handler && (!$form_dsc || $form_dsc === '')) { |
160 | - $dyn_form_dsc = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key . '_DSC'); |
|
160 | + $dyn_form_dsc = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key.'_DSC'); |
|
161 | 161 | if (defined($dyn_form_dsc)) { |
162 | 162 | $form_dsc = constant($dyn_form_dsc); |
163 | 163 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | $cancel_js_action = false, |
442 | 442 | $captcha = false |
443 | 443 | ) { |
444 | - require_once SMARTOBJECT_ROOT_PATH . 'class/form/smartobjectform.php'; |
|
444 | + require_once SMARTOBJECT_ROOT_PATH.'class/form/smartobjectform.php'; |
|
445 | 445 | $form = new SmartobjectForm($this, $form_name, $form_caption, $form_action, null, $submit_button_caption, $cancel_js_action, $captcha); |
446 | 446 | |
447 | 447 | return $form; |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | public function toArray() |
454 | 454 | { |
455 | 455 | $ret = array(); |
456 | - $vars =& $this->getVars(); |
|
456 | + $vars = & $this->getVars(); |
|
457 | 457 | foreach ($vars as $key => $var) { |
458 | 458 | $value = $this->getVar($key); |
459 | 459 | $ret[$key] = $value; |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | } |
472 | 472 | |
473 | 473 | // Hightlighting searched words |
474 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smarthighlighter.php'; |
|
474 | + require_once SMARTOBJECT_ROOT_PATH.'class/smarthighlighter.php'; |
|
475 | 475 | $highlight = smart_getConfig('module_search_highlighter', false, true); |
476 | 476 | |
477 | 477 | if ($highlight && isset($_GET['keywords'])) { |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | } |
503 | 503 | } else { |
504 | 504 | if ($prefix) { |
505 | - $err_str = '[' . $prefix . '] ' . $err_str; |
|
505 | + $err_str = '['.$prefix.'] '.$err_str; |
|
506 | 506 | } |
507 | 507 | parent::setErrors($err_str); |
508 | 508 | } |
@@ -830,8 +830,8 @@ discard block |
||
830 | 830 | $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); |
831 | 831 | continue 2; |
832 | 832 | } |
833 | - if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) { |
|
834 | - $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength'])); |
|
833 | + if (isset($v['maxlength']) && strlen($cleanv) > (int) $v['maxlength']) { |
|
834 | + $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int) $v['maxlength'])); |
|
835 | 835 | continue 2; |
836 | 836 | } |
837 | 837 | if (!$v['not_gpc']) { |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | break; |
861 | 861 | case XOBJ_DTYPE_INT: |
862 | 862 | case XOBJ_DTYPE_TIME_ONLY: |
863 | - $cleanv = (int)$cleanv; |
|
863 | + $cleanv = (int) $cleanv; |
|
864 | 864 | break; |
865 | 865 | |
866 | 866 | case XOBJ_DTYPE_CURRENCY: |
@@ -891,10 +891,10 @@ discard block |
||
891 | 891 | continue 2; |
892 | 892 | } |
893 | 893 | if ($cleanv !== '' && !preg_match("/^http[s]*:\/\//i", $cleanv)) { |
894 | - $cleanv = 'http://' . $cleanv; |
|
894 | + $cleanv = 'http://'.$cleanv; |
|
895 | 895 | } |
896 | 896 | if (!$v['not_gpc']) { |
897 | - $cleanv =& $ts->stripSlashesGPC($cleanv); |
|
897 | + $cleanv = & $ts->stripSlashesGPC($cleanv); |
|
898 | 898 | } |
899 | 899 | break; |
900 | 900 | case XOBJ_DTYPE_SIMPLE_ARRAY: |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | case XOBJ_DTYPE_STIME: |
907 | 907 | case XOBJ_DTYPE_MTIME: |
908 | 908 | case XOBJ_DTYPE_LTIME: |
909 | - $cleanv = !is_string($cleanv) ? (int)$cleanv : strtotime($cleanv); |
|
909 | + $cleanv = !is_string($cleanv) ? (int) $cleanv : strtotime($cleanv); |
|
910 | 910 | if (!($cleanv > 0)) { |
911 | 911 | $cleanv = strtotime($cleanv); |
912 | 912 | } |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | break; |
916 | 916 | } |
917 | 917 | } |
918 | - $this->cleanVars[$k] =& $cleanv; |
|
918 | + $this->cleanVars[$k] = & $cleanv; |
|
919 | 919 | unset($cleanv); |
920 | 920 | } |
921 | 921 | if (count($this->_errors) > 0) { |
@@ -1140,10 +1140,10 @@ discard block |
||
1140 | 1140 | } |
1141 | 1141 | break; |
1142 | 1142 | case XOBJ_DTYPE_SIMPLE_ARRAY: |
1143 | - $ret =& explode('|', $ret); |
|
1143 | + $ret = & explode('|', $ret); |
|
1144 | 1144 | break; |
1145 | 1145 | case XOBJ_DTYPE_ARRAY: |
1146 | - $ret =& unserialize($ret); |
|
1146 | + $ret = & unserialize($ret); |
|
1147 | 1147 | break; |
1148 | 1148 | case XOBJ_DTYPE_SOURCE: |
1149 | 1149 | switch (strtolower($format)) { |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | $actions = array(), |
1302 | 1302 | $headerAsRow = true |
1303 | 1303 | ) { |
1304 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectsingleview.php'; |
|
1304 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectsingleview.php'; |
|
1305 | 1305 | $singleview = new SmartObjectSingleView($this, $userSide, $actions, $headerAsRow); |
1306 | 1306 | // add all fields mark as displayOnSingleView except the keyid |
1307 | 1307 | foreach ($this->vars as $key => $var) { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | /** |
191 | 191 | * @param $criteria |
192 | - * @param $perm_name |
|
192 | + * @param boolean $perm_name |
|
193 | 193 | * @return bool |
194 | 194 | */ |
195 | 195 | public function setGrantedObjectsCriteria(&$criteria, $perm_name) |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | } |
384 | 384 | |
385 | 385 | /** |
386 | - * @param $sql |
|
386 | + * @param string $sql |
|
387 | 387 | * @param $criteria |
388 | 388 | * @param bool $force |
389 | 389 | * @param bool $debug |
@@ -146,16 +146,16 @@ discard block |
||
146 | 146 | |
147 | 147 | $this->_itemname = $itemname; |
148 | 148 | $this->_moduleName = $modulename; |
149 | - $this->table = $db->prefix($modulename . '_' . $itemname); |
|
149 | + $this->table = $db->prefix($modulename.'_'.$itemname); |
|
150 | 150 | $this->keyName = $keyname; |
151 | - $this->className = ucfirst($modulename) . ucfirst($itemname); |
|
151 | + $this->className = ucfirst($modulename).ucfirst($itemname); |
|
152 | 152 | $this->identifierName = $idenfierName; |
153 | 153 | $this->summaryName = $summaryName; |
154 | - $this->_page = $itemname . '.php'; |
|
155 | - $this->_modulePath = XOOPS_ROOT_PATH . '/modules/' . $this->_moduleName . '/'; |
|
156 | - $this->_moduleUrl = XOOPS_URL . '/modules/' . $this->_moduleName . '/'; |
|
157 | - $this->_uploadPath = XOOPS_UPLOAD_PATH . '/' . $this->_moduleName . '/'; |
|
158 | - $this->_uploadUrl = XOOPS_UPLOAD_URL . '/' . $this->_moduleName . '/'; |
|
154 | + $this->_page = $itemname.'.php'; |
|
155 | + $this->_modulePath = XOOPS_ROOT_PATH.'/modules/'.$this->_moduleName.'/'; |
|
156 | + $this->_moduleUrl = XOOPS_URL.'/modules/'.$this->_moduleName.'/'; |
|
157 | + $this->_uploadPath = XOOPS_UPLOAD_PATH.'/'.$this->_moduleName.'/'; |
|
158 | + $this->_uploadUrl = XOOPS_UPLOAD_URL.'/'.$this->_moduleName.'/'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function addPermission($perm_name, $caption, $description = false) |
180 | 180 | { |
181 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectpermission.php'; |
|
181 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectpermission.php'; |
|
182 | 182 | |
183 | 183 | $this->permissionsArray[] = array( |
184 | 184 | 'perm_name' => $perm_name, |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $smartPermissionsHandler = new SmartobjectPermissionHandler($this); |
198 | 198 | $grantedItems = $smartPermissionsHandler->getGrantedItems($perm_name); |
199 | 199 | if (count($grantedItems) > 0) { |
200 | - $criteria->add(new Criteria($this->keyName, '(' . implode(', ', $grantedItems) . ')', 'IN')); |
|
200 | + $criteria->add(new Criteria($this->keyName, '('.implode(', ', $grantedItems).')', 'IN')); |
|
201 | 201 | |
202 | 202 | return true; |
203 | 203 | } else { |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | */ |
254 | 254 | public function getImageUrl() |
255 | 255 | { |
256 | - return $this->_uploadUrl . $this->_itemname . '/'; |
|
256 | + return $this->_uploadUrl.$this->_itemname.'/'; |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -261,12 +261,12 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function getImagePath() |
263 | 263 | { |
264 | - $dir = $this->_uploadPath . $this->_itemname; |
|
264 | + $dir = $this->_uploadPath.$this->_itemname; |
|
265 | 265 | if (!file_exists($dir)) { |
266 | 266 | smart_admin_mkdir($dir); |
267 | 267 | } |
268 | 268 | |
269 | - return $dir . '/'; |
|
269 | + return $dir.'/'; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -359,13 +359,13 @@ discard block |
||
359 | 359 | if ($this->generalSQL) { |
360 | 360 | $sql = $this->generalSQL; |
361 | 361 | } elseif (!$sql) { |
362 | - $sql = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname; |
|
362 | + $sql = 'SELECT * FROM '.$this->table.' AS '.$this->_itemname; |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
366 | - $sql .= ' ' . $criteria->renderWhere(); |
|
366 | + $sql .= ' '.$criteria->renderWhere(); |
|
367 | 367 | if ($criteria->getSort() !== '') { |
368 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
368 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
369 | 369 | } |
370 | 370 | $limit = $criteria->getLimit(); |
371 | 371 | $start = $criteria->getStart(); |
@@ -394,12 +394,12 @@ discard block |
||
394 | 394 | $ret = array(); |
395 | 395 | |
396 | 396 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
397 | - $sql .= ' ' . $criteria->renderWhere(); |
|
397 | + $sql .= ' '.$criteria->renderWhere(); |
|
398 | 398 | if ($criteria->groupby) { |
399 | 399 | $sql .= $criteria->getGroupby(); |
400 | 400 | } |
401 | 401 | if ($criteria->getSort() !== '') { |
402 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
402 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | if ($debug) { |
@@ -472,18 +472,18 @@ discard block |
||
472 | 472 | $obj->assignVars($myrow); |
473 | 473 | if (!$id_as_key) { |
474 | 474 | if ($as_object) { |
475 | - $ret[] =& $obj; |
|
475 | + $ret[] = & $obj; |
|
476 | 476 | } else { |
477 | 477 | $ret[] = $obj->toArray(); |
478 | 478 | } |
479 | 479 | } else { |
480 | 480 | if ($as_object) { |
481 | - $value =& $obj; |
|
481 | + $value = & $obj; |
|
482 | 482 | } else { |
483 | 483 | $value = $obj->toArray(); |
484 | 484 | } |
485 | 485 | if ($id_as_key === 'parentid') { |
486 | - $ret[$obj->getVar('parentid', 'e')][$obj->getVar($this->keyName)] =& $value; |
|
486 | + $ret[$obj->getVar('parentid', 'e')][$obj->getVar($this->keyName)] = & $value; |
|
487 | 487 | } else { |
488 | 488 | $ret[$obj->getVar($this->keyName)] = $value; |
489 | 489 | } |
@@ -526,15 +526,15 @@ discard block |
||
526 | 526 | $criteria->setSort($this->getIdentifierName()); |
527 | 527 | } |
528 | 528 | |
529 | - $sql = 'SELECT ' . (is_array($this->keyName) ? implode(', ', $this->keyName) : $this->keyName); |
|
529 | + $sql = 'SELECT '.(is_array($this->keyName) ? implode(', ', $this->keyName) : $this->keyName); |
|
530 | 530 | if (!empty($this->identifierName)) { |
531 | - $sql .= ', ' . $this->getIdentifierName(); |
|
531 | + $sql .= ', '.$this->getIdentifierName(); |
|
532 | 532 | } |
533 | - $sql .= ' FROM ' . $this->table . ' AS ' . $this->_itemname; |
|
533 | + $sql .= ' FROM '.$this->table.' AS '.$this->_itemname; |
|
534 | 534 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
535 | - $sql .= ' ' . $criteria->renderWhere(); |
|
535 | + $sql .= ' '.$criteria->renderWhere(); |
|
536 | 536 | if ($criteria->getSort() !== '') { |
537 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
537 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
538 | 538 | } |
539 | 539 | $limit = $criteria->getLimit(); |
540 | 540 | $start = $criteria->getStart(); |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
572 | 572 | if ($criteria->groupby !== '') { |
573 | 573 | $groupby = true; |
574 | - $field = $criteria->groupby . ', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
574 | + $field = $criteria->groupby.', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
575 | 575 | } |
576 | 576 | } |
577 | 577 | /** |
@@ -582,10 +582,10 @@ discard block |
||
582 | 582 | $sql = $this->generalSQL; |
583 | 583 | $sql = str_replace('SELECT *', 'SELECT COUNT(*)', $sql); |
584 | 584 | } else { |
585 | - $sql = 'SELECT ' . $field . 'COUNT(*) FROM ' . $this->table . ' AS ' . $this->_itemname; |
|
585 | + $sql = 'SELECT '.$field.'COUNT(*) FROM '.$this->table.' AS '.$this->_itemname; |
|
586 | 586 | } |
587 | 587 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
588 | - $sql .= ' ' . $criteria->renderWhere(); |
|
588 | + $sql .= ' '.$criteria->renderWhere(); |
|
589 | 589 | if ($criteria->groupby !== '') { |
590 | 590 | $sql .= $criteria->getGroupby(); |
591 | 591 | } |
@@ -628,13 +628,13 @@ discard block |
||
628 | 628 | if (is_array($this->keyName)) { |
629 | 629 | $clause = array(); |
630 | 630 | for ($i = 0, $iMax = count($this->keyName); $i < $iMax; ++$i) { |
631 | - $clause[] = $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]); |
|
631 | + $clause[] = $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]); |
|
632 | 632 | } |
633 | 633 | $whereclause = implode(' AND ', $clause); |
634 | 634 | } else { |
635 | - $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName); |
|
635 | + $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName); |
|
636 | 636 | } |
637 | - $sql = 'DELETE FROM ' . $this->table . ' WHERE ' . $whereclause; |
|
637 | + $sql = 'DELETE FROM '.$this->table.' WHERE '.$whereclause; |
|
638 | 638 | if (false !== $force) { |
639 | 639 | $result = $this->db->queryF($sql); |
640 | 640 | } else { |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 |
696 | 696 | */ |
697 | 697 | if (!is_a($obj, $this->className)) { |
698 | - $obj->setError(get_class($obj) . ' Differs from ' . $this->className); |
|
698 | + $obj->setError(get_class($obj).' Differs from '.$this->className); |
|
699 | 699 | |
700 | 700 | return false; |
701 | 701 | } |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | $fieldsToStoreInDB = array(); |
757 | 757 | foreach ($obj->cleanVars as $k => $v) { |
758 | 758 | if ($obj->vars[$k]['data_type'] == XOBJ_DTYPE_INT) { |
759 | - $cleanvars[$k] = (int)$v; |
|
759 | + $cleanvars[$k] = (int) $v; |
|
760 | 760 | } elseif (is_array($v)) { |
761 | 761 | $cleanvars[$k] = $this->db->quoteString(implode(',', $v)); |
762 | 762 | } else { |
@@ -769,13 +769,13 @@ discard block |
||
769 | 769 | if ($obj->isNew()) { |
770 | 770 | if (!is_array($this->keyName)) { |
771 | 771 | if ($cleanvars[$this->keyName] < 1) { |
772 | - $cleanvars[$this->keyName] = $this->db->genId($this->table . '_' . $this->keyName . '_seq'); |
|
772 | + $cleanvars[$this->keyName] = $this->db->genId($this->table.'_'.$this->keyName.'_seq'); |
|
773 | 773 | } |
774 | 774 | } |
775 | 775 | |
776 | - $sql = 'INSERT INTO ' . $this->table . ' (' . implode(',', array_keys($fieldsToStoreInDB)) . ') VALUES (' . implode(',', array_values($fieldsToStoreInDB)) . ')'; |
|
776 | + $sql = 'INSERT INTO '.$this->table.' ('.implode(',', array_keys($fieldsToStoreInDB)).') VALUES ('.implode(',', array_values($fieldsToStoreInDB)).')'; |
|
777 | 777 | } else { |
778 | - $sql = 'UPDATE ' . $this->table . ' SET'; |
|
778 | + $sql = 'UPDATE '.$this->table.' SET'; |
|
779 | 779 | foreach ($fieldsToStoreInDB as $key => $value) { |
780 | 780 | if ((!is_array($this->keyName) && $key == $this->keyName) |
781 | 781 | || (is_array($this->keyName) |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | if (isset($notfirst)) { |
786 | 786 | $sql .= ','; |
787 | 787 | } |
788 | - $sql .= ' ' . $key . ' = ' . $value; |
|
788 | + $sql .= ' '.$key.' = '.$value; |
|
789 | 789 | $notfirst = true; |
790 | 790 | } |
791 | 791 | if (is_array($this->keyName)) { |
@@ -794,12 +794,12 @@ discard block |
||
794 | 794 | if ($i > 0) { |
795 | 795 | $whereclause .= ' AND '; |
796 | 796 | } |
797 | - $whereclause .= $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]); |
|
797 | + $whereclause .= $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]); |
|
798 | 798 | } |
799 | 799 | } else { |
800 | - $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName); |
|
800 | + $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName); |
|
801 | 801 | } |
802 | - $sql .= ' WHERE ' . $whereclause; |
|
802 | + $sql .= ' WHERE '.$whereclause; |
|
803 | 803 | } |
804 | 804 | |
805 | 805 | if ($debug) { |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | */ |
873 | 873 | public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false) |
874 | 874 | { |
875 | - $set_clause = $fieldname . ' = '; |
|
875 | + $set_clause = $fieldname.' = '; |
|
876 | 876 | if (is_numeric($fieldvalue)) { |
877 | 877 | $set_clause .= $fieldvalue; |
878 | 878 | } elseif (is_array($fieldvalue)) { |
@@ -880,9 +880,9 @@ discard block |
||
880 | 880 | } else { |
881 | 881 | $set_clause .= $this->db->quoteString($fieldvalue); |
882 | 882 | } |
883 | - $sql = 'UPDATE ' . $this->table . ' SET ' . $set_clause; |
|
883 | + $sql = 'UPDATE '.$this->table.' SET '.$set_clause; |
|
884 | 884 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
885 | - $sql .= ' ' . $criteria->renderWhere(); |
|
885 | + $sql .= ' '.$criteria->renderWhere(); |
|
886 | 886 | } |
887 | 887 | if (false != $force) { |
888 | 888 | $result = $this->db->queryF($sql); |
@@ -906,8 +906,8 @@ discard block |
||
906 | 906 | public function deleteAll(CriteriaElement $criteria = null) |
907 | 907 | { |
908 | 908 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
909 | - $sql = 'DELETE FROM ' . $this->table; |
|
910 | - $sql .= ' ' . $criteria->renderWhere(); |
|
909 | + $sql = 'DELETE FROM '.$this->table; |
|
910 | + $sql .= ' '.$criteria->renderWhere(); |
|
911 | 911 | if (!$this->db->query($sql)) { |
912 | 912 | return false; |
913 | 913 | } |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | */ |
941 | 941 | public function getModuleItemString() |
942 | 942 | { |
943 | - $ret = $this->_moduleName . '_' . $this->_itemname; |
|
943 | + $ret = $this->_moduleName.'_'.$this->_itemname; |
|
944 | 944 | |
945 | 945 | return $ret; |
946 | 946 | } |
@@ -952,7 +952,7 @@ discard block |
||
952 | 952 | { |
953 | 953 | if (isset($object->vars['counter'])) { |
954 | 954 | $new_counter = $object->getVar('counter') + 1; |
955 | - $sql = 'UPDATE ' . $this->table . ' SET counter=' . $new_counter . ' WHERE ' . $this->keyName . '=' . $object->id(); |
|
955 | + $sql = 'UPDATE '.$this->table.' SET counter='.$new_counter.' WHERE '.$this->keyName.'='.$object->id(); |
|
956 | 956 | $this->query($sql, null, true); |
957 | 957 | } |
958 | 958 | } |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | public function getIdentifierName($withprefix = true) |
997 | 997 | { |
998 | 998 | if ($withprefix) { |
999 | - return $this->_itemname . '.' . $this->identifierName; |
|
999 | + return $this->_itemname.'.'.$this->identifierName; |
|
1000 | 1000 | } else { |
1001 | 1001 | return $this->identifierName; |
1002 | 1002 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | /** |
33 | 33 | * SmartObjectColumn constructor. |
34 | - * @param $keyname |
|
34 | + * @param string $keyname |
|
35 | 35 | * @param string $align |
36 | 36 | * @param bool $width |
37 | 37 | * @param bool $customMethodForValue |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
196 | - * @param $columnObj |
|
196 | + * @param SmartObjectColumn $columnObj |
|
197 | 197 | */ |
198 | 198 | public function addColumn($columnObj) |
199 | 199 | { |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
204 | - * @param $name |
|
205 | - * @param $location |
|
204 | + * @param string $name |
|
205 | + * @param string $location |
|
206 | 206 | * @param $value |
207 | 207 | */ |
208 | 208 | public function addIntroButton($name, $location, $value) |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function addActionButton($op, $caption = false, $text = false) |
186 | 186 | { |
187 | - $action = array( |
|
187 | + $action = array( |
|
188 | 188 | 'op' => $op, |
189 | 189 | 'caption' => $caption, |
190 | 190 | 'text' => $text |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | { |
220 | 220 | $current_urls = smart_getCurrentUrls(); |
221 | 221 | $current_url = $current_urls['full']; |
222 | - $this->_printerFriendlyPage = $current_url . '&print'; |
|
222 | + $this->_printerFriendlyPage = $current_url.'&print'; |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | public function addDefaultIntroButton($caption) |
254 | 254 | { |
255 | - $this->addIntroButton($this->_objectHandler->_itemname, $this->_objectHandler->_page . '?op=mod', $caption); |
|
255 | + $this->addIntroButton($this->_objectHandler->_itemname, $this->_objectHandler->_page.'?op=mod', $caption); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | /** |
@@ -277,9 +277,9 @@ discard block |
||
277 | 277 | public function getDefaultSort() |
278 | 278 | { |
279 | 279 | if ($this->_sortsel) { |
280 | - return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_sortsel); |
|
280 | + return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_sortsel); |
|
281 | 281 | } else { |
282 | - return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_objectHandler->identifierName); |
|
282 | + return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_objectHandler->identifierName); |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | |
@@ -297,9 +297,9 @@ discard block |
||
297 | 297 | public function getDefaultOrder() |
298 | 298 | { |
299 | 299 | if ($this->_ordersel) { |
300 | - return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', $this->_ordersel); |
|
300 | + return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', $this->_ordersel); |
|
301 | 301 | } else { |
302 | - return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', 'ASC'); |
|
302 | + return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', 'ASC'); |
|
303 | 303 | } |
304 | 304 | } |
305 | 305 | |
@@ -348,21 +348,21 @@ discard block |
||
348 | 348 | |
349 | 349 | public function setSortOrder() |
350 | 350 | { |
351 | - $this->_sortsel = isset($_GET[$this->_objectHandler->_itemname . '_' . 'sortsel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'] : $this->getDefaultSort(); |
|
351 | + $this->_sortsel = isset($_GET[$this->_objectHandler->_itemname.'_'.'sortsel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'sortsel'] : $this->getDefaultSort(); |
|
352 | 352 | //$this->_sortsel = isset($_POST['sortsel']) ? $_POST['sortsel']: $this->_sortsel; |
353 | - smart_setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_sortsel', $this->_sortsel); |
|
353 | + smart_setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_sortsel', $this->_sortsel); |
|
354 | 354 | $fieldsForSorting = $this->_tempObject->getFieldsForSorting($this->_sortsel); |
355 | 355 | |
356 | 356 | if (isset($this->_tempObject->vars[$this->_sortsel]['itemName']) |
357 | 357 | && $this->_tempObject->vars[$this->_sortsel]['itemName']) { |
358 | - $this->_criteria->setSort($this->_tempObject->vars[$this->_sortsel]['itemName'] . '.' . $this->_sortsel); |
|
358 | + $this->_criteria->setSort($this->_tempObject->vars[$this->_sortsel]['itemName'].'.'.$this->_sortsel); |
|
359 | 359 | } else { |
360 | - $this->_criteria->setSort($this->_objectHandler->_itemname . '.' . $this->_sortsel); |
|
360 | + $this->_criteria->setSort($this->_objectHandler->_itemname.'.'.$this->_sortsel); |
|
361 | 361 | } |
362 | 362 | |
363 | - $this->_ordersel = isset($_GET[$this->_objectHandler->_itemname . '_' . 'ordersel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'ordersel'] : $this->getDefaultOrder(); |
|
363 | + $this->_ordersel = isset($_GET[$this->_objectHandler->_itemname.'_'.'ordersel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'ordersel'] : $this->getDefaultOrder(); |
|
364 | 364 | //$this->_ordersel = isset($_POST['ordersel']) ? $_POST['ordersel']:$this->_ordersel; |
365 | - smart_setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', $this->_ordersel); |
|
365 | + smart_setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_ordersel', $this->_ordersel); |
|
366 | 366 | $ordersArray = $this->getOrdersArray(); |
367 | 367 | $this->_criteria->setOrder($this->_ordersel); |
368 | 368 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | //$object->initiateCustomFields(); |
413 | 413 | } |
414 | 414 | if ($column->_keyname === 'checked') { |
415 | - $value = '<input type ="checkbox" name="selected_smartobjects[]" value="' . $object->id() . '">'; |
|
415 | + $value = '<input type ="checkbox" name="selected_smartobjects[]" value="'.$object->id().'">'; |
|
416 | 416 | } elseif ($column->_customMethodForValue |
417 | 417 | && method_exists($object, $column->_customMethodForValue)) { |
418 | 418 | $method = $column->_customMethodForValue; |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | } |
458 | 458 | } |
459 | 459 | |
460 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php'; |
|
460 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectcontroller.php'; |
|
461 | 461 | $controller = new SmartObjectController($this->_objectHandler); |
462 | 462 | |
463 | 463 | if ((!is_array($this->_actions)) || in_array('edit', $this->_actions)) { |
@@ -497,9 +497,9 @@ discard block |
||
497 | 497 | public function getDefaultFilter() |
498 | 498 | { |
499 | 499 | if ($this->_filtersel) { |
500 | - return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', $this->_filtersel); |
|
500 | + return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', $this->_filtersel); |
|
501 | 501 | } else { |
502 | - return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', 'default'); |
|
502 | + return smart_getCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', 'default'); |
|
503 | 503 | } |
504 | 504 | } |
505 | 505 | |
@@ -549,9 +549,9 @@ discard block |
||
549 | 549 | public function getDefaultFilter2() |
550 | 550 | { |
551 | 551 | if ($this->_filtersel2) { |
552 | - return smart_getCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', $this->_filtersel2); |
|
552 | + return smart_getCookieVar($_SERVER['PHP_SELF'].'_filtersel2', $this->_filtersel2); |
|
553 | 553 | } else { |
554 | - return smart_getCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', 'default'); |
|
554 | + return smart_getCookieVar($_SERVER['PHP_SELF'].'_filtersel2', 'default'); |
|
555 | 555 | } |
556 | 556 | } |
557 | 557 | |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | */ |
680 | 680 | public function render($fetchOnly = false, $debug = false) |
681 | 681 | { |
682 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
682 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
683 | 683 | |
684 | 684 | $this->_tpl = new XoopsTpl(); |
685 | 685 | |
@@ -690,24 +690,24 @@ discard block |
||
690 | 690 | */ |
691 | 691 | $this->_tempObject = $this->_objectHandler->create(); |
692 | 692 | |
693 | - $this->_criteria->setStart(isset($_GET['start' . $this->_objectHandler->keyName]) ? (int)$_GET['start' . $this->_objectHandler->keyName] : 0); |
|
693 | + $this->_criteria->setStart(isset($_GET['start'.$this->_objectHandler->keyName]) ? (int) $_GET['start'.$this->_objectHandler->keyName] : 0); |
|
694 | 694 | |
695 | 695 | $this->setSortOrder(); |
696 | 696 | |
697 | 697 | if (!$this->_isTree) { |
698 | - $this->_limitsel = isset($_GET['limitsel']) ? $_GET['limitsel'] : smart_getCookieVar($_SERVER['PHP_SELF'] . '_limitsel', '15'); |
|
698 | + $this->_limitsel = isset($_GET['limitsel']) ? $_GET['limitsel'] : smart_getCookieVar($_SERVER['PHP_SELF'].'_limitsel', '15'); |
|
699 | 699 | } else { |
700 | 700 | $this->_limitsel = 'all'; |
701 | 701 | } |
702 | 702 | |
703 | 703 | $this->_limitsel = isset($_POST['limitsel']) ? $_POST['limitsel'] : $this->_limitsel; |
704 | - smart_setCookieVar($_SERVER['PHP_SELF'] . '_limitsel', $this->_limitsel); |
|
704 | + smart_setCookieVar($_SERVER['PHP_SELF'].'_limitsel', $this->_limitsel); |
|
705 | 705 | $limitsArray = $this->getLimitsArray(); |
706 | 706 | $this->_criteria->setLimit($this->_limitsel); |
707 | 707 | |
708 | 708 | $this->_filtersel = isset($_GET['filtersel']) ? $_GET['filtersel'] : $this->getDefaultFilter(); |
709 | 709 | $this->_filtersel = isset($_POST['filtersel']) ? $_POST['filtersel'] : $this->_filtersel; |
710 | - smart_setCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_filtersel', $this->_filtersel); |
|
710 | + smart_setCookieVar($_SERVER['PHP_SELF'].'_'.$this->_id.'_filtersel', $this->_filtersel); |
|
711 | 711 | $filtersArray = $this->getFiltersArray(); |
712 | 712 | |
713 | 713 | if ($filtersArray) { |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | $filters2Array = $this->getFilters2Array(); |
734 | 734 | $this->_tpl->assign('smartobject_optionssel_filters2Array', $filters2Array); |
735 | 735 | |
736 | - smart_setCookieVar($_SERVER['PHP_SELF'] . '_filtersel2', $this->_filtersel2); |
|
736 | + smart_setCookieVar($_SERVER['PHP_SELF'].'_filtersel2', $this->_filtersel2); |
|
737 | 737 | if ($this->_filtersel2 !== 'default') { |
738 | 738 | $this->_criteria->add(new Criteria($this->_filtersel, $this->_filtersel2)); |
739 | 739 | } |
@@ -742,21 +742,21 @@ discard block |
||
742 | 742 | } |
743 | 743 | // Check if we have a quicksearch |
744 | 744 | |
745 | - if (isset($_POST['quicksearch_' . $this->_id]) && $_POST['quicksearch_' . $this->_id] != '') { |
|
745 | + if (isset($_POST['quicksearch_'.$this->_id]) && $_POST['quicksearch_'.$this->_id] != '') { |
|
746 | 746 | $quicksearch_criteria = new CriteriaCompo(); |
747 | 747 | if (is_array($this->_quickSearch['fields'])) { |
748 | 748 | foreach ($this->_quickSearch['fields'] as $v) { |
749 | - $quicksearch_criteria->add(new Criteria($v, '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE'), 'OR'); |
|
749 | + $quicksearch_criteria->add(new Criteria($v, '%'.$_POST['quicksearch_'.$this->_id].'%', 'LIKE'), 'OR'); |
|
750 | 750 | } |
751 | 751 | } else { |
752 | - $quicksearch_criteria->add(new Criteria($this->_quickSearch['fields'], '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE')); |
|
752 | + $quicksearch_criteria->add(new Criteria($this->_quickSearch['fields'], '%'.$_POST['quicksearch_'.$this->_id].'%', 'LIKE')); |
|
753 | 753 | } |
754 | 754 | $this->_criteria->add($quicksearch_criteria); |
755 | 755 | } |
756 | 756 | |
757 | 757 | $this->_objects = $this->fetchObjects($debug); |
758 | 758 | |
759 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
759 | + require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
760 | 760 | if ($this->_criteria->getLimit() > 0) { |
761 | 761 | |
762 | 762 | /** |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | */ |
773 | 773 | $params_of_the_options_sel = array(); |
774 | 774 | |
775 | - $not_needed_params = array('sortsel', 'limitsel', 'ordersel', 'start' . $this->_objectHandler->keyName); |
|
775 | + $not_needed_params = array('sortsel', 'limitsel', 'ordersel', 'start'.$this->_objectHandler->keyName); |
|
776 | 776 | foreach ($_GET as $k => $v) { |
777 | 777 | if (!in_array($k, $not_needed_params)) { |
778 | 778 | $new_get_array[] = "$k=$v"; |
@@ -783,12 +783,12 @@ discard block |
||
783 | 783 | /** |
784 | 784 | * Adding the new params of the pagenav |
785 | 785 | */ |
786 | - $new_get_array[] = 'sortsel=' . $this->_sortsel; |
|
787 | - $new_get_array[] = 'ordersel=' . $this->_ordersel; |
|
788 | - $new_get_array[] = 'limitsel=' . $this->_limitsel; |
|
786 | + $new_get_array[] = 'sortsel='.$this->_sortsel; |
|
787 | + $new_get_array[] = 'ordersel='.$this->_ordersel; |
|
788 | + $new_get_array[] = 'limitsel='.$this->_limitsel; |
|
789 | 789 | $otherParams = implode('&', $new_get_array); |
790 | 790 | |
791 | - $pagenav = new XoopsPageNav($this->_objectHandler->getCount($this->_criteria), $this->_criteria->getLimit(), $this->_criteria->getStart(), 'start' . $this->_objectHandler->keyName, $otherParams); |
|
791 | + $pagenav = new XoopsPageNav($this->_objectHandler->getCount($this->_criteria), $this->_criteria->getLimit(), $this->_criteria->getStart(), 'start'.$this->_objectHandler->keyName, $otherParams); |
|
792 | 792 | $this->_tpl->assign('smartobject_pagenav', $pagenav->renderNav()); |
793 | 793 | } |
794 | 794 | $this->renderOptionSelection($limitsArray, $params_of_the_options_sel); |
@@ -824,20 +824,20 @@ discard block |
||
824 | 824 | $aColumn['align'] = $column->getAlign(); |
825 | 825 | $aColumn['key'] = $column->getKeyName(); |
826 | 826 | if ($column->_keyname === 'checked') { |
827 | - $aColumn['caption'] = '<input type ="checkbox" id="checkall_smartobjects" name="checkall_smartobjects"' . ' value="checkall_smartobjects" onclick="smartobject_checkall(window.document.form_' . $this->_id . ', \'selected_smartobjects\');">'; |
|
827 | + $aColumn['caption'] = '<input type ="checkbox" id="checkall_smartobjects" name="checkall_smartobjects"'.' value="checkall_smartobjects" onclick="smartobject_checkall(window.document.form_'.$this->_id.', \'selected_smartobjects\');">'; |
|
828 | 828 | } elseif ($column->getCustomCaption()) { |
829 | 829 | $aColumn['caption'] = $column->getCustomCaption(); |
830 | 830 | } else { |
831 | 831 | $aColumn['caption'] = isset($this->_tempObject->vars[$column->getKeyName()]['form_caption']) ? $this->_tempObject->vars[$column->getKeyName()]['form_caption'] : $column->getKeyName(); |
832 | 832 | } |
833 | 833 | // Are we doing a GET sort on this column ? |
834 | - $getSort = (isset($_GET[$this->_objectHandler->_itemname . '_' . 'sortsel']) |
|
835 | - && $_GET[$this->_objectHandler->_itemname . '_' . 'sortsel'] == $column->getKeyName()) |
|
834 | + $getSort = (isset($_GET[$this->_objectHandler->_itemname.'_'.'sortsel']) |
|
835 | + && $_GET[$this->_objectHandler->_itemname.'_'.'sortsel'] == $column->getKeyName()) |
|
836 | 836 | || ($this->_sortsel == $column->getKeyName()); |
837 | - $order = isset($_GET[$this->_objectHandler->_itemname . '_' . 'ordersel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'ordersel'] : 'DESC'; |
|
837 | + $order = isset($_GET[$this->_objectHandler->_itemname.'_'.'ordersel']) ? $_GET[$this->_objectHandler->_itemname.'_'.'ordersel'] : 'DESC'; |
|
838 | 838 | |
839 | - if (isset($_REQUEST['quicksearch_' . $this->_id]) && $_REQUEST['quicksearch_' . $this->_id] != '') { |
|
840 | - $qs_param = '&quicksearch_' . $this->_id . '=' . $_REQUEST['quicksearch_' . $this->_id]; |
|
839 | + if (isset($_REQUEST['quicksearch_'.$this->_id]) && $_REQUEST['quicksearch_'.$this->_id] != '') { |
|
840 | + $qs_param = '&quicksearch_'.$this->_id.'='.$_REQUEST['quicksearch_'.$this->_id]; |
|
841 | 841 | } |
842 | 842 | if (!$this->_enableColumnsSorting || $column->_keyname === 'checked' || !$column->isSortable()) { |
843 | 843 | $aColumn['caption'] = $aColumn['caption']; |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | . $orderArray[$order]['image'] |
865 | 865 | . '" alt="ASC"></a>'; |
866 | 866 | } else { |
867 | - $aColumn['caption'] = '<a href="' . $current_url . '?' . $this->_objectHandler->_itemname . '_' . 'sortsel=' . $column->getKeyName() . '&' . $this->_objectHandler->_itemname . '_' . 'ordersel=ASC' . $qs_param . '&' . $new_query_string . '">' . $aColumn['caption'] . '</a>'; |
|
867 | + $aColumn['caption'] = '<a href="'.$current_url.'?'.$this->_objectHandler->_itemname.'_'.'sortsel='.$column->getKeyName().'&'.$this->_objectHandler->_itemname.'_'.'ordersel=ASC'.$qs_param.'&'.$new_query_string.'">'.$aColumn['caption'].'</a>'; |
|
868 | 868 | } |
869 | 869 | $aColumns[] = $aColumn; |
870 | 870 | } |
@@ -894,9 +894,9 @@ discard block |
||
894 | 894 | |
895 | 895 | $smartobjectTable_template = $this->_customTemplate ?: 'smartobject_smarttable_display.tpl'; |
896 | 896 | if ($fetchOnly) { |
897 | - return $this->_tpl->fetch('db:' . $smartobjectTable_template); |
|
897 | + return $this->_tpl->fetch('db:'.$smartobjectTable_template); |
|
898 | 898 | } else { |
899 | - $this->_tpl->display('db:' . $smartobjectTable_template); |
|
899 | + $this->_tpl->display('db:'.$smartobjectTable_template); |
|
900 | 900 | } |
901 | 901 | } |
902 | 902 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @param $javascript |
30 | - * @return mixed|string |
|
30 | + * @return string |
|
31 | 31 | */ |
32 | 32 | public function escape($javascript) |
33 | 33 | { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | /** |
50 | 50 | * @param $name |
51 | - * @param $function |
|
51 | + * @param string $function |
|
52 | 52 | * @param null $html_options |
53 | 53 | * @return string |
54 | 54 | */ |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function button_to_function($name, $function = null) |
24 | 24 | { |
25 | - return '<input type="button" value="' . $name . '" onclick="' . $function . '">'; |
|
25 | + return '<input type="button" value="'.$name.'" onclick="'.$function.'">'; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function tag($content) |
45 | 45 | { |
46 | - return '<script type="text/javascript">' . $content . '</script>'; |
|
46 | + return '<script type="text/javascript">'.$content.'</script>'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function link_to_function($name, $function, $html_options = null) |
56 | 56 | { |
57 | - return '<a href="' . (isset($html_options['href']) ? $html_options['href'] : '#') . '" onclick="' . (isset($html_options['onclick']) ? $html_options['onclick'] . ';' : '') . $function . '; return false;">' . $name . '</a>'; |
|
57 | + return '<a href="'.(isset($html_options['href']) ? $html_options['href'] : '#').'" onclick="'.(isset($html_options['onclick']) ? $html_options['onclick'].';' : '').$function.'; return false;">'.$name.'</a>'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | ///////////////////////////////////////////////////////////////////////////////////// |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $return_val .= $value; |
77 | 77 | } |
78 | 78 | |
79 | - return '[' . $return_val . ']'; |
|
79 | + return '['.$return_val.']'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | return "'$option'"; |
@@ -99,6 +99,6 @@ discard block |
||
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | - return '{' . $return_val . '}'; |
|
102 | + return '{'.$return_val.'}'; |
|
103 | 103 | } |
104 | 104 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
215 | - * @param $klass |
|
215 | + * @param string $klass |
|
216 | 216 | * @param $name |
217 | 217 | * @param null $options |
218 | 218 | * @return string |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
314 | - * @param $variable |
|
314 | + * @param string $variable |
|
315 | 315 | * @param $value |
316 | 316 | * @return string |
317 | 317 | */ |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
324 | - * @param $function |
|
324 | + * @param string $function |
|
325 | 325 | * @param null $args |
326 | 326 | * @return string |
327 | 327 | */ |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | $options['form'] = true; |
65 | 65 | |
66 | - return '<form action="' . $options['url'] . '" onsubmit="' . $this->remote_function($options) . '; return false;" method="' . (isset($options['method']) ? $options['method'] : 'post') . '" >'; |
|
66 | + return '<form action="'.$options['url'].'" onsubmit="'.$this->remote_function($options).'; return false;" method="'.(isset($options['method']) ? $options['method'] : 'post').'" >'; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | public function periodically_call_remote($options = null) |
113 | 113 | { |
114 | 114 | $frequency = isset($options['frequency']) ? $options['frequency'] : 10; |
115 | - $code = 'new PeriodicalExecuter(function() {' . $this->remote_function($options) . '},' . $frequency . ')'; |
|
115 | + $code = 'new PeriodicalExecuter(function() {'.$this->remote_function($options).'},'.$frequency.')'; |
|
116 | 116 | |
117 | 117 | return $code; |
118 | 118 | } |
@@ -128,22 +128,22 @@ discard block |
||
128 | 128 | $update = ''; |
129 | 129 | |
130 | 130 | if (isset($options['update']) && is_array($options['update'])) { |
131 | - $update = isset($options['update']['success']) ? 'success: ' . $options['update']['success'] : ''; |
|
131 | + $update = isset($options['update']['success']) ? 'success: '.$options['update']['success'] : ''; |
|
132 | 132 | $update .= empty($update) ? '' : ','; |
133 | - $update .= isset($options['update']['failure']) ? 'failure: ' . $options['update']['failure'] : ''; |
|
133 | + $update .= isset($options['update']['failure']) ? 'failure: '.$options['update']['failure'] : ''; |
|
134 | 134 | } else { |
135 | 135 | $update .= isset($options['update']) ? $options['update'] : ''; |
136 | 136 | } |
137 | 137 | |
138 | - $ajax_function = empty($update) ? 'new Ajax.Request(' : 'new Ajax.Updater(\'' . $update . '\','; |
|
138 | + $ajax_function = empty($update) ? 'new Ajax.Request(' : 'new Ajax.Updater(\''.$update.'\','; |
|
139 | 139 | |
140 | - $ajax_function .= "'" . $options['url'] . "'"; |
|
141 | - $ajax_function .= ',' . $javascript_options . ')'; |
|
140 | + $ajax_function .= "'".$options['url']."'"; |
|
141 | + $ajax_function .= ','.$javascript_options.')'; |
|
142 | 142 | |
143 | - $ajax_function = isset($options['before']) ? $options['before'] . ';' . $ajax_function : $ajax_function; |
|
144 | - $ajax_function = isset($options['after']) ? $ajax_function . ';' . $options['after'] : $ajax_function; |
|
145 | - $ajax_function = isset($options['condition']) ? 'if (' . $options['condition'] . ') {' . $ajax_function . '}' : $ajax_function; |
|
146 | - $ajax_function = isset($options['confirm']) ? 'if ( confirm(\'' . $options['confirm'] . '\' ) ) { ' . $ajax_function . ' } ' : $ajax_function; |
|
143 | + $ajax_function = isset($options['before']) ? $options['before'].';'.$ajax_function : $ajax_function; |
|
144 | + $ajax_function = isset($options['after']) ? $ajax_function.';'.$options['after'] : $ajax_function; |
|
145 | + $ajax_function = isset($options['condition']) ? 'if ('.$options['condition'].') {'.$ajax_function.'}' : $ajax_function; |
|
146 | + $ajax_function = isset($options['confirm']) ? 'if ( confirm(\''.$options['confirm'].'\' ) ) { '.$ajax_function.' } ' : $ajax_function; |
|
147 | 147 | |
148 | 148 | return $ajax_function; |
149 | 149 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $options['with'] = 'Form.serialize(this.form)'; |
161 | 161 | } |
162 | 162 | |
163 | - return '<input type="button" onclick="' . $this->remote_function($options) . '" name="' . $name . '" value ="' . $value . '">'; |
|
163 | + return '<input type="button" onclick="'.$this->remote_function($options).'" name="'.$name.'" value ="'.$value.'">'; |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | $callbacks = array(); |
204 | 204 | foreach ($options as $callback => $code) { |
205 | 205 | if (in_array($callback, $this->CALLBACKS)) { |
206 | - $name = 'on' . ucfirst($callback); |
|
207 | - $callbacks[$name] = 'function(request){' . $code . '}'; |
|
206 | + $name = 'on'.ucfirst($callback); |
|
207 | + $callbacks[$name] = 'function(request){'.$code.'}'; |
|
208 | 208 | } |
209 | 209 | } |
210 | 210 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | public function _build_observer($klass, $name, $options = null) |
221 | 221 | { |
222 | 222 | if (isset($options['with']) && false === strpos($options['with'], '=')) { |
223 | - $options['with'] = '\'' . $options['with'] . '=\' + value'; |
|
223 | + $options['with'] = '\''.$options['with'].'=\' + value'; |
|
224 | 224 | } elseif (isset($options['with']) && isset($options['update'])) { |
225 | 225 | $options['with'] = 'value'; |
226 | 226 | } |
@@ -228,10 +228,10 @@ discard block |
||
228 | 228 | $callback = $options['function'] ?: $this->remote_function($options); |
229 | 229 | |
230 | 230 | $javascript = "new $klass('$name', "; |
231 | - $javascript .= isset($options['frequency']) ? $options['frequency'] . ', ' : ''; |
|
231 | + $javascript .= isset($options['frequency']) ? $options['frequency'].', ' : ''; |
|
232 | 232 | $javascript .= 'function (element,value) { '; |
233 | 233 | $javascript .= $callback; |
234 | - $javascript .= isset($options['on']) ? ', ' . $options['on'] : ''; |
|
234 | + $javascript .= isset($options['on']) ? ', '.$options['on'] : ''; |
|
235 | 235 | $javascript .= '})'; |
236 | 236 | |
237 | 237 | return $javascript; |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | } |
264 | 264 | |
265 | 265 | if (isset($options['position'])) { |
266 | - $js_options['insertion'] = 'Insertion.' . ucfirst($options['position']); |
|
266 | + $js_options['insertion'] = 'Insertion.'.ucfirst($options['position']); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | $js_options['evalScripts'] = isset($options['script']) ? $options['script'] : 'true'; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | if (isset($options['form'])) { |
272 | 272 | $js_options['parameters'] = 'Form.serialize(this)'; |
273 | 273 | } elseif (isset($options['parameters'])) { |
274 | - $js_options['parameters'] = 'Form.serialize(\'' . $options['submit'] . '\')'; |
|
274 | + $js_options['parameters'] = 'Form.serialize(\''.$options['submit'].'\')'; |
|
275 | 275 | } elseif (isset($options['with'])) { |
276 | 276 | $js_options['parameters'] = $options['with']; |
277 | 277 | } |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | */ |
299 | 299 | public function ID($id, $extend = null) |
300 | 300 | { |
301 | - return "$('$id')" . (!empty($extend)) ? '.' . $extend . '()' : ''; |
|
301 | + return "$('$id')".(!empty($extend)) ? '.'.$extend.'()' : ''; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | /** |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function delay($seconds = 1, $script = '') |
359 | 359 | { |
360 | - return "setTimeout( function() { $script } , " . ($seconds * 1000) . ' )'; |
|
360 | + return "setTimeout( function() { $script } , ".($seconds * 1000).' )'; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | /** |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | { |
380 | 380 | $args = array_merge(array($id), (is_array($options_for_render) ? $options_for_render : array($options_for_render))); |
381 | 381 | |
382 | - return $this->call('new Insertion.' . ucfirst($position), $args); |
|
382 | + return $this->call('new Insertion.'.ucfirst($position), $args); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | /** |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | */ |
444 | 444 | public function select($pattern, $extend = null) |
445 | 445 | { |
446 | - return "$$('$pattern')" . (!empty($extend)) ? '.' . $extend : ''; |
|
446 | + return "$$('$pattern')".(!empty($extend)) ? '.'.$extend : ''; |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @param $javascript |
30 | - * @return mixed|string |
|
30 | + * @return string |
|
31 | 31 | */ |
32 | 32 | public function escape($javascript) |
33 | 33 | { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | /** |
50 | 50 | * @param $name |
51 | - * @param $function |
|
51 | + * @param string $function |
|
52 | 52 | * @param null $html_options |
53 | 53 | * @return string |
54 | 54 | */ |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function button_to_function($name, $function = null) |
24 | 24 | { |
25 | - return '<input type="button" value="' . $name . '" onclick="' . $function . '">'; |
|
25 | + return '<input type="button" value="'.$name.'" onclick="'.$function.'">'; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function tag($content) |
45 | 45 | { |
46 | - return '<script type="text/javascript">' . $content . '</script>'; |
|
46 | + return '<script type="text/javascript">'.$content.'</script>'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function link_to_function($name, $function, $html_options = null) |
56 | 56 | { |
57 | - return '<a href="' . (isset($html_options['href']) ? $html_options['href'] : '#') . '" onclick="' . (isset($html_options['onclick']) ? $html_options['onclick'] . ';' : '') . $function . '; return false;">' . $name . '</a>'; |
|
57 | + return '<a href="'.(isset($html_options['href']) ? $html_options['href'] : '#').'" onclick="'.(isset($html_options['onclick']) ? $html_options['onclick'].';' : '').$function.'; return false;">'.$name.'</a>'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | ///////////////////////////////////////////////////////////////////////////////////// |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $return_val .= $value; |
77 | 77 | } |
78 | 78 | |
79 | - return '[' . $return_val . ']'; |
|
79 | + return '['.$return_val.']'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | return "'$option'"; |
@@ -99,6 +99,6 @@ discard block |
||
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | - return '{' . $return_val . '}'; |
|
102 | + return '{'.$return_val.'}'; |
|
103 | 103 | } |
104 | 104 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
215 | - * @param $klass |
|
215 | + * @param string $klass |
|
216 | 216 | * @param $name |
217 | 217 | * @param null $options |
218 | 218 | * @return string |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
314 | - * @param $variable |
|
314 | + * @param string $variable |
|
315 | 315 | * @param $value |
316 | 316 | * @return string |
317 | 317 | */ |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
324 | - * @param $function |
|
324 | + * @param string $function |
|
325 | 325 | * @param null $args |
326 | 326 | * @return string |
327 | 327 | */ |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | $options['form'] = true; |
65 | 65 | |
66 | - return '<form action="' . $options['url'] . '" onsubmit="' . $this->remote_function($options) . '; return false;" method="' . (isset($options['method']) ? $options['method'] : 'post') . '" >'; |
|
66 | + return '<form action="'.$options['url'].'" onsubmit="'.$this->remote_function($options).'; return false;" method="'.(isset($options['method']) ? $options['method'] : 'post').'" >'; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | public function periodically_call_remote($options = null) |
113 | 113 | { |
114 | 114 | $frequency = isset($options['frequency']) ? $options['frequency'] : 10; |
115 | - $code = 'new PeriodicalExecuter(function() {' . $this->remote_function($options) . '},' . $frequency . ')'; |
|
115 | + $code = 'new PeriodicalExecuter(function() {'.$this->remote_function($options).'},'.$frequency.')'; |
|
116 | 116 | |
117 | 117 | return $code; |
118 | 118 | } |
@@ -128,22 +128,22 @@ discard block |
||
128 | 128 | $update = ''; |
129 | 129 | |
130 | 130 | if (isset($options['update']) && is_array($options['update'])) { |
131 | - $update = isset($options['update']['success']) ? 'success: ' . $options['update']['success'] : ''; |
|
131 | + $update = isset($options['update']['success']) ? 'success: '.$options['update']['success'] : ''; |
|
132 | 132 | $update .= empty($update) ? '' : ','; |
133 | - $update .= isset($options['update']['failure']) ? 'failure: ' . $options['update']['failure'] : ''; |
|
133 | + $update .= isset($options['update']['failure']) ? 'failure: '.$options['update']['failure'] : ''; |
|
134 | 134 | } else { |
135 | 135 | $update .= isset($options['update']) ? $options['update'] : ''; |
136 | 136 | } |
137 | 137 | |
138 | - $ajax_function = empty($update) ? 'new Ajax.Request(' : 'new Ajax.Updater(\'' . $update . '\','; |
|
138 | + $ajax_function = empty($update) ? 'new Ajax.Request(' : 'new Ajax.Updater(\''.$update.'\','; |
|
139 | 139 | |
140 | - $ajax_function .= "'" . $options['url'] . "'"; |
|
141 | - $ajax_function .= ',' . $javascript_options . ')'; |
|
140 | + $ajax_function .= "'".$options['url']."'"; |
|
141 | + $ajax_function .= ','.$javascript_options.')'; |
|
142 | 142 | |
143 | - $ajax_function = isset($options['before']) ? $options['before'] . ';' . $ajax_function : $ajax_function; |
|
144 | - $ajax_function = isset($options['after']) ? $ajax_function . ';' . $options['after'] : $ajax_function; |
|
145 | - $ajax_function = isset($options['condition']) ? 'if (' . $options['condition'] . ') {' . $ajax_function . '}' : $ajax_function; |
|
146 | - $ajax_function = isset($options['confirm']) ? 'if ( confirm(\'' . $options['confirm'] . '\' ) ) { ' . $ajax_function . ' } ' : $ajax_function; |
|
143 | + $ajax_function = isset($options['before']) ? $options['before'].';'.$ajax_function : $ajax_function; |
|
144 | + $ajax_function = isset($options['after']) ? $ajax_function.';'.$options['after'] : $ajax_function; |
|
145 | + $ajax_function = isset($options['condition']) ? 'if ('.$options['condition'].') {'.$ajax_function.'}' : $ajax_function; |
|
146 | + $ajax_function = isset($options['confirm']) ? 'if ( confirm(\''.$options['confirm'].'\' ) ) { '.$ajax_function.' } ' : $ajax_function; |
|
147 | 147 | |
148 | 148 | return $ajax_function; |
149 | 149 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $options['with'] = 'Form.serialize(this.form)'; |
161 | 161 | } |
162 | 162 | |
163 | - return '<input type="button" onclick="' . $this->remote_function($options) . '" name="' . $name . '" value ="' . $value . '">'; |
|
163 | + return '<input type="button" onclick="'.$this->remote_function($options).'" name="'.$name.'" value ="'.$value.'">'; |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | $callbacks = array(); |
204 | 204 | foreach ($options as $callback => $code) { |
205 | 205 | if (in_array($callback, $this->CALLBACKS)) { |
206 | - $name = 'on' . ucfirst($callback); |
|
207 | - $callbacks[$name] = 'function(request){' . $code . '}'; |
|
206 | + $name = 'on'.ucfirst($callback); |
|
207 | + $callbacks[$name] = 'function(request){'.$code.'}'; |
|
208 | 208 | } |
209 | 209 | } |
210 | 210 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | public function _build_observer($klass, $name, $options = null) |
221 | 221 | { |
222 | 222 | if (isset($options['with']) && false === strpos($options['with'], '=')) { |
223 | - $options['with'] = '\'' . $options['with'] . '=\' + value'; |
|
223 | + $options['with'] = '\''.$options['with'].'=\' + value'; |
|
224 | 224 | } elseif (isset($options['with']) && isset($options['update'])) { |
225 | 225 | $options['with'] = 'value'; |
226 | 226 | } |
@@ -228,10 +228,10 @@ discard block |
||
228 | 228 | $callback = $options['function'] ?: $this->remote_function($options); |
229 | 229 | |
230 | 230 | $javascript = "new $klass('$name', "; |
231 | - $javascript .= isset($options['frequency']) ? $options['frequency'] . ', ' : ''; |
|
231 | + $javascript .= isset($options['frequency']) ? $options['frequency'].', ' : ''; |
|
232 | 232 | $javascript .= 'function (element,value) { '; |
233 | 233 | $javascript .= $callback; |
234 | - $javascript .= isset($options['on']) ? ', ' . $options['on'] : ''; |
|
234 | + $javascript .= isset($options['on']) ? ', '.$options['on'] : ''; |
|
235 | 235 | $javascript .= '})'; |
236 | 236 | |
237 | 237 | return $javascript; |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | } |
264 | 264 | |
265 | 265 | if (isset($options['position'])) { |
266 | - $js_options['insertion'] = 'Insertion.' . ucfirst($options['position']); |
|
266 | + $js_options['insertion'] = 'Insertion.'.ucfirst($options['position']); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | $js_options['evalScripts'] = isset($options['script']) ? $options['script'] : 'true'; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | if (isset($options['form'])) { |
272 | 272 | $js_options['parameters'] = 'Form.serialize(this)'; |
273 | 273 | } elseif (isset($options['parameters'])) { |
274 | - $js_options['parameters'] = 'Form.serialize(\'' . $options['submit'] . '\')'; |
|
274 | + $js_options['parameters'] = 'Form.serialize(\''.$options['submit'].'\')'; |
|
275 | 275 | } elseif (isset($options['with'])) { |
276 | 276 | $js_options['parameters'] = $options['with']; |
277 | 277 | } |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | */ |
299 | 299 | public function ID($id, $extend = null) |
300 | 300 | { |
301 | - return "$('$id')" . (!empty($extend)) ? '.' . $extend . '()' : ''; |
|
301 | + return "$('$id')".(!empty($extend)) ? '.'.$extend.'()' : ''; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | /** |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function delay($seconds = 1, $script = '') |
359 | 359 | { |
360 | - return "setTimeout( function() { $script } , " . ($seconds * 1000) . ' )'; |
|
360 | + return "setTimeout( function() { $script } , ".($seconds * 1000).' )'; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | /** |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | { |
380 | 380 | $args = array_merge(array($id), (is_array($options_for_render) ? $options_for_render : array($options_for_render))); |
381 | 381 | |
382 | - return $this->call('new Insertion.' . ucfirst($position), $args); |
|
382 | + return $this->call('new Insertion.'.ucfirst($position), $args); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | /** |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | */ |
444 | 444 | public function select($pattern, $extend = null) |
445 | 445 | { |
446 | - return "$$('$pattern')" . (!empty($extend)) ? '.' . $extend : ''; |
|
446 | + return "$$('$pattern')".(!empty($extend)) ? '.'.$extend : ''; |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | 8 | |
9 | -include __DIR__ . '/../../mainfile.php'; |
|
10 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'; |
|
9 | +include __DIR__.'/../../mainfile.php'; |
|
10 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'; |
|
11 | 11 | |
12 | 12 | smart_loadCommonLanguageFile(); |