@@ -492,7 +492,7 @@ |
||
| 492 | 492 | * handling applied. If the $mode and $options parameters are not |
| 493 | 493 | * specified, the object's defaults are used. |
| 494 | 494 | * |
| 495 | - * @param mixed $message a text error message or a PEAR error object |
|
| 495 | + * @param string|null $message a text error message or a PEAR error object |
|
| 496 | 496 | * |
| 497 | 497 | * @param int $code a numeric error code (it is up to your class |
| 498 | 498 | * to define these if you want to use codes) |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | $suffix = '.so'; |
| 764 | 764 | } |
| 765 | 765 | |
| 766 | - return @dl('php_' . $ext . $suffix) || @dl($ext . $suffix); |
|
| 766 | + return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); |
|
| 767 | 767 | } |
| 768 | 768 | |
| 769 | 769 | return true; |
@@ -877,7 +877,7 @@ discard block |
||
| 877 | 877 | unset($this->backtrace[0]['object']); |
| 878 | 878 | } |
| 879 | 879 | } |
| 880 | - if ($mode & references_PEAR_ERROR_CALLBACK) { |
|
| 880 | + if ($mode&references_PEAR_ERROR_CALLBACK) { |
|
| 881 | 881 | $this->level = E_USER_NOTICE; |
| 882 | 882 | $this->callback = $options; |
| 883 | 883 | } else { |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | $this->level = $options; |
| 888 | 888 | $this->callback = null; |
| 889 | 889 | } |
| 890 | - if ($this->mode & references_PEAR_ERROR_PRINT) { |
|
| 890 | + if ($this->mode&references_PEAR_ERROR_PRINT) { |
|
| 891 | 891 | if (is_null($options) || is_int($options)) { |
| 892 | 892 | $format = '%s'; |
| 893 | 893 | } else { |
@@ -895,10 +895,10 @@ discard block |
||
| 895 | 895 | } |
| 896 | 896 | printf($format, $this->getMessage()); |
| 897 | 897 | } |
| 898 | - if ($this->mode & references_PEAR_ERROR_TRIGGER) { |
|
| 898 | + if ($this->mode&references_PEAR_ERROR_TRIGGER) { |
|
| 899 | 899 | trigger_error($this->getMessage(), $this->level); |
| 900 | 900 | } |
| 901 | - if ($this->mode & references_PEAR_ERROR_DIE) { |
|
| 901 | + if ($this->mode&references_PEAR_ERROR_DIE) { |
|
| 902 | 902 | $msg = $this->getMessage(); |
| 903 | 903 | if (is_null($options) || is_int($options)) { |
| 904 | 904 | $format = '%s'; |
@@ -910,12 +910,12 @@ discard block |
||
| 910 | 910 | } |
| 911 | 911 | die(sprintf($format, $msg)); |
| 912 | 912 | } |
| 913 | - if ($this->mode & references_PEAR_ERROR_CALLBACK) { |
|
| 913 | + if ($this->mode&references_PEAR_ERROR_CALLBACK) { |
|
| 914 | 914 | if (is_callable($this->callback)) { |
| 915 | 915 | call_user_func($this->callback, $this); |
| 916 | 916 | } |
| 917 | 917 | } |
| 918 | - if ($this->mode & references_PEAR_ERROR_EXCEPTION) { |
|
| 918 | + if ($this->mode&references_PEAR_ERROR_EXCEPTION) { |
|
| 919 | 919 | trigger_error('references_PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions', E_USER_WARNING); |
| 920 | 920 | eval('$e = new Exception($this->message, $this->code);throw($e);'); |
| 921 | 921 | } |
@@ -960,7 +960,7 @@ discard block |
||
| 960 | 960 | */ |
| 961 | 961 | public function getMessage() |
| 962 | 962 | { |
| 963 | - return ($this->error_message_prefix . $this->message); |
|
| 963 | + return ($this->error_message_prefix.$this->message); |
|
| 964 | 964 | } |
| 965 | 965 | |
| 966 | 966 | // }}} |
@@ -1071,29 +1071,29 @@ discard block |
||
| 1071 | 1071 | E_USER_WARNING => 'warning', |
| 1072 | 1072 | E_USER_ERROR => 'error' |
| 1073 | 1073 | ); |
| 1074 | - if ($this->mode & references_PEAR_ERROR_CALLBACK) { |
|
| 1074 | + if ($this->mode&references_PEAR_ERROR_CALLBACK) { |
|
| 1075 | 1075 | if (is_array($this->callback)) { |
| 1076 | - $callback = (is_object($this->callback[0]) ? strtolower(get_class($this->callback[0])) : $this->callback[0]) . '::' . $this->callback[1]; |
|
| 1076 | + $callback = (is_object($this->callback[0]) ? strtolower(get_class($this->callback[0])) : $this->callback[0]).'::'.$this->callback[1]; |
|
| 1077 | 1077 | } else { |
| 1078 | 1078 | $callback = $this->callback; |
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 1081 | - return sprintf('[%s: message="%s" code=%d mode=callback ' . 'callback=%s prefix="%s" info="%s"]', strtolower(get_class($this)), $this->message, $this->code, $callback, $this->error_message_prefix, $this->userinfo); |
|
| 1081 | + return sprintf('[%s: message="%s" code=%d mode=callback '.'callback=%s prefix="%s" info="%s"]', strtolower(get_class($this)), $this->message, $this->code, $callback, $this->error_message_prefix, $this->userinfo); |
|
| 1082 | 1082 | } |
| 1083 | - if ($this->mode & references_PEAR_ERROR_PRINT) { |
|
| 1083 | + if ($this->mode&references_PEAR_ERROR_PRINT) { |
|
| 1084 | 1084 | $modes[] = 'print'; |
| 1085 | 1085 | } |
| 1086 | - if ($this->mode & references_PEAR_ERROR_TRIGGER) { |
|
| 1086 | + if ($this->mode&references_PEAR_ERROR_TRIGGER) { |
|
| 1087 | 1087 | $modes[] = 'trigger'; |
| 1088 | 1088 | } |
| 1089 | - if ($this->mode & references_PEAR_ERROR_DIE) { |
|
| 1089 | + if ($this->mode&references_PEAR_ERROR_DIE) { |
|
| 1090 | 1090 | $modes[] = 'die'; |
| 1091 | 1091 | } |
| 1092 | - if ($this->mode & references_PEAR_ERROR_RETURN) { |
|
| 1092 | + if ($this->mode&references_PEAR_ERROR_RETURN) { |
|
| 1093 | 1093 | $modes[] = 'return'; |
| 1094 | 1094 | } |
| 1095 | 1095 | |
| 1096 | - return sprintf('[%s: message="%s" code=%d mode=%s level=%s ' . 'prefix="%s" info="%s"]', strtolower(get_class($this)), $this->message, $this->code, implode('|', $modes), $levels[$this->level], $this->error_message_prefix, $this->userinfo); |
|
| 1096 | + return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.'prefix="%s" info="%s"]', strtolower(get_class($this)), $this->message, $this->code, implode('|', $modes), $levels[$this->level], $this->error_message_prefix, $this->userinfo); |
|
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | 1099 | // }}} |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | * @param boolean $as_object |
| 236 | 236 | * @param string $fields Requested fields from the query |
| 237 | 237 | * |
| 238 | - * @return array |
|
| 238 | + * @return string |
|
| 239 | 239 | */ |
| 240 | 240 | protected function convertResultSet($result, $id_as_key = false, $as_object = true, $fields = '*') |
| 241 | 241 | { |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | /** |
| 503 | 503 | * delete an object from the database |
| 504 | 504 | * |
| 505 | - * @param XoopsObject $obj reference to the object to delete |
|
| 505 | + * @param references_articles $obj reference to the object to delete |
|
| 506 | 506 | * @param bool $force |
| 507 | 507 | * @return bool FALSE if failed. |
| 508 | 508 | */ |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | protected function _getIdForCache($query, $start, $limit) |
| 131 | 131 | { |
| 132 | - $id = md5($query . '-' . (string)$start . '-' . (string)$limit); |
|
| 132 | + $id = md5($query.'-'.(string) $start.'-'.(string) $limit); |
|
| 133 | 133 | |
| 134 | 134 | return $id; |
| 135 | 135 | } |
@@ -164,17 +164,17 @@ discard block |
||
| 164 | 164 | $criteria = new CriteriaCompo(); |
| 165 | 165 | $vnb = count($this->keyName); |
| 166 | 166 | for ($i = 0; $i < $vnb; ++$i) { |
| 167 | - $criteria->add(new Criteria($this->keyName[$i], (int)$id[$i])); |
|
| 167 | + $criteria->add(new Criteria($this->keyName[$i], (int) $id[$i])); |
|
| 168 | 168 | } |
| 169 | 169 | } else { |
| 170 | - $criteria = new Criteria($this->keyName, (int)$id); |
|
| 170 | + $criteria = new Criteria($this->keyName, (int) $id); |
|
| 171 | 171 | } |
| 172 | 172 | $criteria->setLimit(1); |
| 173 | - $obj_array =& $this->getObjects($criteria, false, $as_object); |
|
| 173 | + $obj_array = & $this->getObjects($criteria, false, $as_object); |
|
| 174 | 174 | if (count($obj_array) != 1) { |
| 175 | 175 | $ret = null; |
| 176 | 176 | } else { |
| 177 | - $ret =& $obj_array[0]; |
|
| 177 | + $ret = & $obj_array[0]; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | return $ret; |
@@ -193,19 +193,19 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function &getObjects(CriteriaElement $criteria = null, $id_as_key = false, $as_object = true, $fields = '*', $autoSort = true) |
| 195 | 195 | { |
| 196 | - require_once __DIR__ . '/lite.php'; |
|
| 196 | + require_once __DIR__.'/lite.php'; |
|
| 197 | 197 | $ret = array(); |
| 198 | 198 | $limit = $start = 0; |
| 199 | - $sql = 'SELECT ' . $fields . ' FROM ' . $this->table; |
|
| 199 | + $sql = 'SELECT '.$fields.' FROM '.$this->table; |
|
| 200 | 200 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 201 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 201 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 202 | 202 | if ($criteria->groupby != '') { |
| 203 | 203 | $sql .= $criteria->getGroupby(); |
| 204 | 204 | } |
| 205 | 205 | if ($criteria->getSort() != '') { |
| 206 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 206 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 207 | 207 | } elseif ($this->identifierName != '' && $autoSort) { |
| 208 | - $sql .= ' ORDER BY ' . $this->identifierName; |
|
| 208 | + $sql .= ' ORDER BY '.$this->identifierName; |
|
| 209 | 209 | } |
| 210 | 210 | $limit = $criteria->getLimit(); |
| 211 | 211 | $start = $criteria->getStart(); |
@@ -241,11 +241,11 @@ discard block |
||
| 241 | 241 | { |
| 242 | 242 | $ret = array(); |
| 243 | 243 | while ($myrow = $this->db->fetchArray($result)) { |
| 244 | - $obj =& $this->create(false); |
|
| 244 | + $obj = & $this->create(false); |
|
| 245 | 245 | $obj->assignVars($myrow); |
| 246 | 246 | if (!$id_as_key) { |
| 247 | 247 | if ($as_object) { |
| 248 | - $ret[] =& $obj; |
|
| 248 | + $ret[] = & $obj; |
|
| 249 | 249 | } else { |
| 250 | 250 | $row = array(); |
| 251 | 251 | $vars = $obj->getVars(); |
@@ -258,9 +258,9 @@ discard block |
||
| 258 | 258 | } else { |
| 259 | 259 | if ($as_object) { |
| 260 | 260 | if ($fields === '*') { |
| 261 | - $ret[$myrow[$this->keyName]] =& $obj; |
|
| 261 | + $ret[$myrow[$this->keyName]] = & $obj; |
|
| 262 | 262 | } else { |
| 263 | - $ret[] =& $obj; |
|
| 263 | + $ret[] = & $obj; |
|
| 264 | 264 | } |
| 265 | 265 | } else { |
| 266 | 266 | $row = array(); |
@@ -286,20 +286,20 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | public function getIds($criteria = null) |
| 288 | 288 | { |
| 289 | - require_once __DIR__ . '/lite.php'; |
|
| 289 | + require_once __DIR__.'/lite.php'; |
|
| 290 | 290 | $limit = $start = 0; |
| 291 | 291 | |
| 292 | 292 | $Cache_Lite = new references_Cache_Lite($this->cacheOptions); |
| 293 | - $sql = 'SELECT ' . $this->keyName . ' FROM ' . $this->table; |
|
| 293 | + $sql = 'SELECT '.$this->keyName.' FROM '.$this->table; |
|
| 294 | 294 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 295 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 295 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 296 | 296 | if ($criteria->groupby != '') { |
| 297 | 297 | $sql .= $criteria->getGroupby(); |
| 298 | 298 | } |
| 299 | 299 | if ($criteria->getSort() != '') { |
| 300 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 300 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 301 | 301 | } elseif ($this->identifierName != '') { |
| 302 | - $sql .= ' ORDER BY ' . $this->identifierName; |
|
| 302 | + $sql .= ' ORDER BY '.$this->identifierName; |
|
| 303 | 303 | } |
| 304 | 304 | $limit = $criteria->getLimit(); |
| 305 | 305 | $start = $criteria->getStart(); |
@@ -329,26 +329,26 @@ discard block |
||
| 329 | 329 | */ |
| 330 | 330 | public function getList($criteria = null) |
| 331 | 331 | { |
| 332 | - require_once __DIR__ . '/lite.php'; |
|
| 332 | + require_once __DIR__.'/lite.php'; |
|
| 333 | 333 | $limit = $start = 0; |
| 334 | 334 | $Cache_Lite = new references_Cache_Lite($this->cacheOptions); |
| 335 | 335 | |
| 336 | 336 | $ret = array(); |
| 337 | 337 | |
| 338 | - $sql = 'SELECT ' . $this->keyName; |
|
| 338 | + $sql = 'SELECT '.$this->keyName; |
|
| 339 | 339 | if (!empty($this->identifierName)) { |
| 340 | - $sql .= ', ' . $this->identifierName; |
|
| 340 | + $sql .= ', '.$this->identifierName; |
|
| 341 | 341 | } |
| 342 | - $sql .= ' FROM ' . $this->table; |
|
| 342 | + $sql .= ' FROM '.$this->table; |
|
| 343 | 343 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 344 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 344 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 345 | 345 | if ($criteria->groupby != '') { |
| 346 | 346 | $sql .= $criteria->getGroupby(); |
| 347 | 347 | } |
| 348 | 348 | if ($criteria->getSort() != '') { |
| 349 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 349 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 350 | 350 | } elseif ($this->identifierName != '') { |
| 351 | - $sql .= ' ORDER BY ' . $this->identifierName; |
|
| 351 | + $sql .= ' ORDER BY '.$this->identifierName; |
|
| 352 | 352 | } |
| 353 | 353 | $limit = $criteria->getLimit(); |
| 354 | 354 | $start = $criteria->getStart(); |
@@ -389,11 +389,11 @@ discard block |
||
| 389 | 389 | $ret = array(); |
| 390 | 390 | if (is_array($ids) && count($ids) > 0) { |
| 391 | 391 | $criteria = new CriteriaCompo(); |
| 392 | - $criteria->add(new Criteria($this->keyName, '(' . implode(',', $ids) . ')', 'IN')); |
|
| 392 | + $criteria->add(new Criteria($this->keyName, '('.implode(',', $ids).')', 'IN')); |
|
| 393 | 393 | if (!is_null($additionnal)) { |
| 394 | 394 | $criteria->add($additionnal); |
| 395 | 395 | } |
| 396 | - $ret =& $this->getObjects($criteria, true); |
|
| 396 | + $ret = & $this->getObjects($criteria, true); |
|
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | return $ret; |
@@ -410,17 +410,17 @@ discard block |
||
| 410 | 410 | $field = ''; |
| 411 | 411 | $groupby = false; |
| 412 | 412 | $limit = $start = 0; |
| 413 | - require_once __DIR__ . '/lite.php'; |
|
| 413 | + require_once __DIR__.'/lite.php'; |
|
| 414 | 414 | |
| 415 | 415 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 416 | 416 | if ($criteria->groupby != '') { |
| 417 | 417 | $groupby = true; |
| 418 | - $field = $criteria->groupby . ', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
| 418 | + $field = $criteria->groupby.', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
| 419 | 419 | } |
| 420 | 420 | } |
| 421 | - $sql = 'SELECT ' . $field . 'COUNT(*) FROM ' . $this->table; |
|
| 421 | + $sql = 'SELECT '.$field.'COUNT(*) FROM '.$this->table; |
|
| 422 | 422 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 423 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 423 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 424 | 424 | if ($criteria->groupby != '') { |
| 425 | 425 | $sql .= $criteria->getGroupby(); |
| 426 | 426 | } |
@@ -467,11 +467,11 @@ discard block |
||
| 467 | 467 | public function getSum($field, $criteria = null) |
| 468 | 468 | { |
| 469 | 469 | $limit = $start = 0; |
| 470 | - require_once __DIR__ . '/lite.php'; |
|
| 470 | + require_once __DIR__.'/lite.php'; |
|
| 471 | 471 | |
| 472 | - $sql = 'SELECT Sum(' . $field . ') as cpt FROM ' . $this->table; |
|
| 472 | + $sql = 'SELECT Sum('.$field.') as cpt FROM '.$this->table; |
|
| 473 | 473 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 474 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 474 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 475 | 475 | if ($criteria->groupby != '') { |
| 476 | 476 | $sql .= $criteria->getGroupby(); |
| 477 | 477 | } |
@@ -512,13 +512,13 @@ discard block |
||
| 512 | 512 | $clause = array(); |
| 513 | 513 | $vnb = count($this->keyName); |
| 514 | 514 | for ($i = 0; $i < $vnb; ++$i) { |
| 515 | - $clause[] = $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]); |
|
| 515 | + $clause[] = $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]); |
|
| 516 | 516 | } |
| 517 | 517 | $whereclause = implode(' AND ', $clause); |
| 518 | 518 | } else { |
| 519 | - $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName); |
|
| 519 | + $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName); |
|
| 520 | 520 | } |
| 521 | - $sql = 'DELETE FROM ' . $this->table . ' WHERE ' . $whereclause; |
|
| 521 | + $sql = 'DELETE FROM '.$this->table.' WHERE '.$whereclause; |
|
| 522 | 522 | if (false != $force) { |
| 523 | 523 | $result = $this->db->queryF($sql); |
| 524 | 524 | } else { |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | { |
| 546 | 546 | $object = $this->create(true); |
| 547 | 547 | $object->setVars($vars); |
| 548 | - $retval =& $this->insert($object, $force); |
|
| 548 | + $retval = & $this->insert($object, $force); |
|
| 549 | 549 | unset($object); |
| 550 | 550 | |
| 551 | 551 | // Clear cache |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 |
| 577 | 577 | */ |
| 578 | 578 | if (!is_a($obj, $this->className)) { |
| 579 | - $obj->setErrors(get_class($obj) . ' Differs from ' . $this->className); |
|
| 579 | + $obj->setErrors(get_class($obj).' Differs from '.$this->className); |
|
| 580 | 580 | |
| 581 | 581 | return false; |
| 582 | 582 | } |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | } |
| 596 | 596 | foreach ($obj->cleanVars as $k => $v) { |
| 597 | 597 | if ($obj->vars[$k]['data_type'] == XOBJ_DTYPE_INT) { |
| 598 | - $cleanvars[$k] = (int)$v; |
|
| 598 | + $cleanvars[$k] = (int) $v; |
|
| 599 | 599 | } elseif (is_array($v)) { |
| 600 | 600 | $cleanvars[$k] = $this->db->quoteString(implode(',', $v)); |
| 601 | 601 | } else { |
@@ -608,16 +608,16 @@ discard block |
||
| 608 | 608 | if ($obj->isNew()) { |
| 609 | 609 | if (!is_array($this->keyName)) { |
| 610 | 610 | if ($cleanvars[$this->keyName] < 1) { |
| 611 | - $cleanvars[$this->keyName] = $this->db->genId($this->table . '_' . $this->keyName . '_seq'); |
|
| 611 | + $cleanvars[$this->keyName] = $this->db->genId($this->table.'_'.$this->keyName.'_seq'); |
|
| 612 | 612 | } |
| 613 | 613 | } |
| 614 | 614 | $ignore = ''; |
| 615 | 615 | if ($ignoreInsert) { |
| 616 | 616 | $ignore = 'IGNORE'; |
| 617 | 617 | } |
| 618 | - $sql = "INSERT $ignore INTO " . $this->table . ' (' . implode(',', array_keys($cleanvars)) . ') VALUES (' . implode(',', array_values($cleanvars)) . ')'; |
|
| 618 | + $sql = "INSERT $ignore INTO ".$this->table.' ('.implode(',', array_keys($cleanvars)).') VALUES ('.implode(',', array_values($cleanvars)).')'; |
|
| 619 | 619 | } else { |
| 620 | - $sql = 'UPDATE ' . $this->table . ' SET'; |
|
| 620 | + $sql = 'UPDATE '.$this->table.' SET'; |
|
| 621 | 621 | foreach ($cleanvars as $key => $value) { |
| 622 | 622 | if ((!is_array($this->keyName) && $key == $this->keyName) || (is_array($this->keyName) && in_array($key, $this->keyName))) { |
| 623 | 623 | continue; |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | if (isset($notfirst)) { |
| 626 | 626 | $sql .= ','; |
| 627 | 627 | } |
| 628 | - $sql .= ' ' . $key . ' = ' . $value; |
|
| 628 | + $sql .= ' '.$key.' = '.$value; |
|
| 629 | 629 | $notfirst = true; |
| 630 | 630 | } |
| 631 | 631 | if (is_array($this->keyName)) { |
@@ -635,12 +635,12 @@ discard block |
||
| 635 | 635 | if ($i > 0) { |
| 636 | 636 | $whereclause .= ' AND '; |
| 637 | 637 | } |
| 638 | - $whereclause .= $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]); |
|
| 638 | + $whereclause .= $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]); |
|
| 639 | 639 | } |
| 640 | 640 | } else { |
| 641 | - $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName); |
|
| 641 | + $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName); |
|
| 642 | 642 | } |
| 643 | - $sql .= ' WHERE ' . $whereclause; |
|
| 643 | + $sql .= ' WHERE '.$whereclause; |
|
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | if (false != $force) { |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | */ |
| 675 | 675 | public function updateAll($fieldname, $fieldvalue, $criteria = null, $force = false) |
| 676 | 676 | { |
| 677 | - $set_clause = $fieldname . ' = '; |
|
| 677 | + $set_clause = $fieldname.' = '; |
|
| 678 | 678 | if (is_numeric($fieldvalue)) { |
| 679 | 679 | $set_clause .= $fieldvalue; |
| 680 | 680 | } elseif (is_array($fieldvalue)) { |
@@ -682,9 +682,9 @@ discard block |
||
| 682 | 682 | } else { |
| 683 | 683 | $set_clause .= $this->db->quoteString($fieldvalue); |
| 684 | 684 | } |
| 685 | - $sql = 'UPDATE ' . $this->table . ' SET ' . $set_clause; |
|
| 685 | + $sql = 'UPDATE '.$this->table.' SET '.$set_clause; |
|
| 686 | 686 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 687 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 687 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 688 | 688 | } |
| 689 | 689 | if ($force) { |
| 690 | 690 | $result = $this->db->queryF($sql); |
@@ -732,8 +732,8 @@ discard block |
||
| 732 | 732 | public function deleteAll($criteria = null) |
| 733 | 733 | { |
| 734 | 734 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 735 | - $sql = 'DELETE FROM ' . $this->table; |
|
| 736 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 735 | + $sql = 'DELETE FROM '.$this->table; |
|
| 736 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 737 | 737 | if (!$this->db->queryF($sql)) { |
| 738 | 738 | return false; |
| 739 | 739 | } |
@@ -779,15 +779,15 @@ discard block |
||
| 779 | 779 | */ |
| 780 | 780 | public function getDistincts($field, $criteria = null, $format = 's') |
| 781 | 781 | { |
| 782 | - require_once __DIR__ . '/lite.php'; |
|
| 782 | + require_once __DIR__.'/lite.php'; |
|
| 783 | 783 | $limit = $start = 0; |
| 784 | - $sql = 'SELECT ' . $this->keyName . ', ' . $field . ' FROM ' . $this->table; |
|
| 784 | + $sql = 'SELECT '.$this->keyName.', '.$field.' FROM '.$this->table; |
|
| 785 | 785 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 786 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 786 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 787 | 787 | $limit = $criteria->getLimit(); |
| 788 | 788 | $start = $criteria->getStart(); |
| 789 | 789 | } |
| 790 | - $sql .= ' GROUP BY ' . $field . ' ORDER BY ' . $field; |
|
| 790 | + $sql .= ' GROUP BY '.$field.' ORDER BY '.$field; |
|
| 791 | 791 | |
| 792 | 792 | $Cache_Lite = new references_Cache_Lite($this->cacheOptions); |
| 793 | 793 | $id = $this->_getIdForCache($sql, $start, $limit); |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | $critere->setStart($start); |
| 836 | 836 | $critere->setSort($sort); |
| 837 | 837 | $critere->setOrder($order); |
| 838 | - $items =& $this->getObjects($critere, $idAsKey); |
|
| 838 | + $items = & $this->getObjects($critere, $idAsKey); |
|
| 839 | 839 | |
| 840 | 840 | return $items; |
| 841 | 841 | } |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | */ |
| 846 | 846 | public function forceCacheClean() |
| 847 | 847 | { |
| 848 | - require_once __DIR__ . '/lite.php'; |
|
| 848 | + require_once __DIR__.'/lite.php'; |
|
| 849 | 849 | $Cache_Lite = new references_Cache_Lite($this->cacheOptions); |
| 850 | 850 | $Cache_Lite->clean(); |
| 851 | 851 | } |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | /** |
| 500 | 500 | * Notification de la publication d'une nouvelle référence |
| 501 | 501 | * |
| 502 | - * @param object|references_articles $article L'annonce pour laquelle on fait la notification |
|
| 502 | + * @param references_articles $article L'annonce pour laquelle on fait la notification |
|
| 503 | 503 | * @return bool |
| 504 | 504 | */ |
| 505 | 505 | public function notifyNewArticle(references_articles $article) |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | /** |
| 575 | 575 | * Indique si une référence est visible d'un utilisateur |
| 576 | 576 | * |
| 577 | - * @param object|references_articles $article L'article à controler |
|
| 577 | + * @param references_articles $article L'article à controler |
|
| 578 | 578 | * @param integer $uid L'id de l'utilisateur à controler |
| 579 | 579 | * @return bool |
| 580 | 580 | */ |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 22 | 22 | |
| 23 | -require_once XOOPS_ROOT_PATH . '/kernel/object.php'; |
|
| 23 | +require_once XOOPS_ROOT_PATH.'/kernel/object.php'; |
|
| 24 | 24 | if (!class_exists('references_XoopsPersistableObjectHandler')) { |
| 25 | - require_once XOOPS_ROOT_PATH . '/modules/references/class/PersistableObjectHandler.php'; |
|
| 25 | + require_once XOOPS_ROOT_PATH.'/modules/references/class/PersistableObjectHandler.php'; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -define('REFERENCES_STATUS_ONLINE', 1); // Articles en ligne |
|
| 29 | -define('REFERENCES_STATUS_OFFLINE', 0); // Articles hors ligne |
|
| 28 | +define('REFERENCES_STATUS_ONLINE', 1); // Articles en ligne |
|
| 29 | +define('REFERENCES_STATUS_OFFLINE', 0); // Articles hors ligne |
|
| 30 | 30 | |
| 31 | 31 | class references_articles extends references_Object |
| 32 | 32 | { |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | public function getOnlinePicture() |
| 88 | 88 | { |
| 89 | 89 | if ($this->isArticleOnline()) { |
| 90 | - return REFERENCES_IMAGES_URL . 'status_online.png'; |
|
| 90 | + return REFERENCES_IMAGES_URL.'status_online.png'; |
|
| 91 | 91 | } else { |
| 92 | - return REFERENCES_IMAGES_URL . 'status_offline.png'; |
|
| 92 | + return REFERENCES_IMAGES_URL.'status_offline.png'; |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | public function pictureExists($indice) |
| 113 | 113 | { |
| 114 | 114 | $return = false; |
| 115 | - $fieldName = 'article_picture' . $indice; |
|
| 116 | - if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . $this->getVar($fieldName))) { |
|
| 115 | + $fieldName = 'article_picture'.$indice; |
|
| 116 | + if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.$this->getVar($fieldName))) { |
|
| 117 | 117 | $return = true; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -128,9 +128,9 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function deletePicture($indice) |
| 130 | 130 | { |
| 131 | - $fieldName = 'article_picture' . $indice; |
|
| 131 | + $fieldName = 'article_picture'.$indice; |
|
| 132 | 132 | if ($this->pictureExists($indice)) { |
| 133 | - @unlink(references_utils::getModuleOption('images_path') . references_utils::getModuleOption('images_path') . $this->getVar($fieldName)); |
|
| 133 | + @unlink(references_utils::getModuleOption('images_path').references_utils::getModuleOption('images_path').$this->getVar($fieldName)); |
|
| 134 | 134 | } |
| 135 | 135 | $this->setVar($fieldName, ''); |
| 136 | 136 | } |
@@ -143,11 +143,11 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function getPictureUrl($indice) |
| 145 | 145 | { |
| 146 | - $fieldName = 'article_picture' . $indice; |
|
| 146 | + $fieldName = 'article_picture'.$indice; |
|
| 147 | 147 | if (xoops_trim($this->getVar($fieldName)) != '' && $this->pictureExists($indice)) { |
| 148 | - return references_utils::getModuleOption('images_url') . '/' . $this->getVar($fieldName); |
|
| 148 | + return references_utils::getModuleOption('images_url').'/'.$this->getVar($fieldName); |
|
| 149 | 149 | } else { |
| 150 | - return REFERENCES_IMAGES_URL . 'blank.gif'; |
|
| 150 | + return REFERENCES_IMAGES_URL.'blank.gif'; |
|
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public function getPicturePath($indice) |
| 161 | 161 | { |
| 162 | - $fieldName = 'article_picture' . $indice; |
|
| 162 | + $fieldName = 'article_picture'.$indice; |
|
| 163 | 163 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 164 | - return references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . $this->getVar($fieldName); |
|
| 164 | + return references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.$this->getVar($fieldName); |
|
| 165 | 165 | } else { |
| 166 | 166 | return ''; |
| 167 | 167 | } |
@@ -175,9 +175,9 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function thumbExists($indice) |
| 177 | 177 | { |
| 178 | - $fieldName = 'article_picture' . $indice; |
|
| 178 | + $fieldName = 'article_picture'.$indice; |
|
| 179 | 179 | $return = false; |
| 180 | - if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName))) { |
|
| 180 | + if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName))) { |
|
| 181 | 181 | $return = true; |
| 182 | 182 | } |
| 183 | 183 | |
@@ -192,11 +192,11 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function getThumbUrl($indice) |
| 194 | 194 | { |
| 195 | - $fieldName = 'article_picture' . $indice; |
|
| 195 | + $fieldName = 'article_picture'.$indice; |
|
| 196 | 196 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 197 | - return references_utils::getModuleOption('images_url') . '/' . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName); |
|
| 197 | + return references_utils::getModuleOption('images_url').'/'.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName); |
|
| 198 | 198 | } else { |
| 199 | - return REFERENCES_IMAGES_URL . 'blank.gif'; |
|
| 199 | + return REFERENCES_IMAGES_URL.'blank.gif'; |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
@@ -208,9 +208,9 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | public function getThumbPath($indice) |
| 210 | 210 | { |
| 211 | - $fieldName = 'article_picture' . $indice; |
|
| 211 | + $fieldName = 'article_picture'.$indice; |
|
| 212 | 212 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 213 | - return references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName); |
|
| 213 | + return references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName); |
|
| 214 | 214 | } else { |
| 215 | 215 | return ''; |
| 216 | 216 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | public function attachmentExists() |
| 225 | 225 | { |
| 226 | 226 | $return = false; |
| 227 | - if (xoops_trim($this->getVar('article_attached_file')) != '' && file_exists(references_utils::getModuleOption('attached_path') . DIRECTORY_SEPARATOR . $this->getVar('article_attached_file'))) { |
|
| 227 | + if (xoops_trim($this->getVar('article_attached_file')) != '' && file_exists(references_utils::getModuleOption('attached_path').DIRECTORY_SEPARATOR.$this->getVar('article_attached_file'))) { |
|
| 228 | 228 | $return = true; |
| 229 | 229 | } |
| 230 | 230 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | public function getAttachmentUrl() |
| 240 | 240 | { |
| 241 | 241 | if (xoops_trim($this->getVar('article_attached_file')) != '' && $this->attachmentExists()) { |
| 242 | - return references_utils::getModuleOption('attached_url') . '/' . $this->getVar('article_attached_file'); |
|
| 242 | + return references_utils::getModuleOption('attached_url').'/'.$this->getVar('article_attached_file'); |
|
| 243 | 243 | } else { |
| 244 | 244 | return ''; |
| 245 | 245 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | public function getAttachmentPath() |
| 254 | 254 | { |
| 255 | 255 | if (xoops_trim($this->getVar('article_attached_file')) != '' && $this->attachmentExists()) { |
| 256 | - return references_utils::getModuleOption('attached_path') . DIRECTORY_SEPARATOR . $this->getVar('article_attached_file'); |
|
| 256 | + return references_utils::getModuleOption('attached_path').DIRECTORY_SEPARATOR.$this->getVar('article_attached_file'); |
|
| 257 | 257 | } else { |
| 258 | 258 | return ''; |
| 259 | 259 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | public function deleteAttachment() |
| 266 | 266 | { |
| 267 | 267 | if ($this->attachmentExists()) { |
| 268 | - @unlink(references_utils::getModuleOption('attached_path') . DIRECTORY_SEPARATOR . $this->getVar('article_attached_file')); |
|
| 268 | + @unlink(references_utils::getModuleOption('attached_path').DIRECTORY_SEPARATOR.$this->getVar('article_attached_file')); |
|
| 269 | 269 | } |
| 270 | 270 | $this->setVar('article_attached_file', ''); |
| 271 | 271 | } |
@@ -278,9 +278,9 @@ discard block |
||
| 278 | 278 | */ |
| 279 | 279 | public function deleteThumb($indice) |
| 280 | 280 | { |
| 281 | - $fieldName = 'article_picture' . $indice; |
|
| 281 | + $fieldName = 'article_picture'.$indice; |
|
| 282 | 282 | if ($this->thumbExists($indice)) { |
| 283 | - @unlink(references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName)); |
|
| 283 | + @unlink(references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName)); |
|
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | |
@@ -348,9 +348,9 @@ discard block |
||
| 348 | 348 | public function getUrl($shortVersion = false) |
| 349 | 349 | { |
| 350 | 350 | if (!$shortVersion) { |
| 351 | - return REFERENCES_URL . 'reference.php?article_id=' . $this->getVar('article_id'); |
|
| 351 | + return REFERENCES_URL.'reference.php?article_id='.$this->getVar('article_id'); |
|
| 352 | 352 | } else { |
| 353 | - return 'reference.php?article_id=' . $this->getVar('article_id'); |
|
| 353 | + return 'reference.php?article_id='.$this->getVar('article_id'); |
|
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | 356 | |
@@ -373,11 +373,11 @@ discard block |
||
| 373 | 373 | $ret['article_picture_exists'] = true; |
| 374 | 374 | for ($i = 1; $i <= 10; ++$i) { |
| 375 | 375 | if ($this->pictureExists($i)) { |
| 376 | - $ret['article_picture_url' . $i] = $this->getPictureUrl($i); |
|
| 377 | - $ret['article_picture_path' . $i] = $this->getPicturePath($i); |
|
| 376 | + $ret['article_picture_url'.$i] = $this->getPictureUrl($i); |
|
| 377 | + $ret['article_picture_path'.$i] = $this->getPicturePath($i); |
|
| 378 | 378 | $ret['article_pictures_urls'][] = $this->getPictureUrl($i); |
| 379 | 379 | $ret['article_pictures_paths'][] = $this->getPicturePath($i); |
| 380 | - $fieldName = 'article_picture' . $i . '_text'; |
|
| 380 | + $fieldName = 'article_picture'.$i.'_text'; |
|
| 381 | 381 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 382 | 382 | $ret['article_pictures_texts'][] = references_utils::makeHrefTitle($this->getVar($fieldName)); |
| 383 | 383 | } else { |
@@ -402,8 +402,8 @@ discard block |
||
| 402 | 402 | $ret['article_thumb_exists'] = true; |
| 403 | 403 | for ($i = 1; $i <= 10; ++$i) { |
| 404 | 404 | if ($this->thumbExists($i)) { |
| 405 | - $ret['article_thumb_url' . $i] = $this->getThumbUrl($i); |
|
| 406 | - $ret['article_thumb_path' . $i] = $this->getThumbPath($i); |
|
| 405 | + $ret['article_thumb_url'.$i] = $this->getThumbUrl($i); |
|
| 406 | + $ret['article_thumb_path'.$i] = $this->getThumbPath($i); |
|
| 407 | 407 | $ret['article_thumbs_urls'][] = $this->getThumbUrl($i); |
| 408 | 408 | $ret['article_thumbs_paths'][] = $this->getThumbPath($i); |
| 409 | 409 | } |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | $gperm_handler = xoops_getHandler('groupperm'); |
| 445 | 445 | $categories = $gperm_handler->getItemIds($permissionsType, $groups, $currentModule->getVar('mid')); |
| 446 | 446 | if (is_array($categories) && count($categories) > 0) { |
| 447 | - $permissions[$permissionsType] = new Criteria('article_category_id', '(' . implode(',', $categories) . ')', 'IN'); |
|
| 447 | + $permissions[$permissionsType] = new Criteria('article_category_id', '('.implode(',', $categories).')', 'IN'); |
|
| 448 | 448 | } else { // Ne peut rien voir |
| 449 | 449 | $permissions[$permissionsType] = new Criteria('article_category_id', '0', '='); |
| 450 | 450 | } |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | $criteria->add(new Criteria('article_online', REFERENCES_STATUS_ONLINE, '=')); |
| 473 | 473 | } |
| 474 | 474 | if (is_array($categoryId) && count($categoryId) > 0) { |
| 475 | - $criteria->add(new Criteria('article_category_id', '(' . implode(',', $categoryId) . ')', 'IN')); |
|
| 475 | + $criteria->add(new Criteria('article_category_id', '('.implode(',', $categoryId).')', 'IN')); |
|
| 476 | 476 | } elseif ($categoryId > 0) { |
| 477 | 477 | $criteria->add(new Criteria('article_category_id', $categoryId, '=')); |
| 478 | 478 | } |
@@ -529,8 +529,8 @@ discard block |
||
| 529 | 529 | public function getDistinctCategoriesIds() |
| 530 | 530 | { |
| 531 | 531 | $ret = array(); |
| 532 | - $sql = 'SELECT distinct(article_category_id) FROM ' . $this->table; |
|
| 533 | - $sql .= ' ' . $this->getPermissionsCategoriesCriteria()->renderWhere(); // Permissions |
|
| 532 | + $sql = 'SELECT distinct(article_category_id) FROM '.$this->table; |
|
| 533 | + $sql .= ' '.$this->getPermissionsCategoriesCriteria()->renderWhere(); // Permissions |
|
| 534 | 534 | $sql .= ' GROUP BY article_category_id ORDER BY article_category_id'; |
| 535 | 535 | $result = $this->db->query($sql); |
| 536 | 536 | if (!$result) { |
@@ -598,17 +598,17 @@ discard block |
||
| 598 | 598 | */ |
| 599 | 599 | public function moveUp($currentId, $currentOrder) |
| 600 | 600 | { |
| 601 | - $sql_plus = 'SELECT article_id FROM ' . $this->table . ' WHERE article_weight = ' . ((int)$currentOrder - 1); |
|
| 601 | + $sql_plus = 'SELECT article_id FROM '.$this->table.' WHERE article_weight = '.((int) $currentOrder - 1); |
|
| 602 | 602 | $res_plus = $this->db->query($sql_plus); |
| 603 | 603 | if ($this->db->getRowsNum($res_plus) == 0) { |
| 604 | 604 | return; |
| 605 | 605 | } |
| 606 | 606 | $row_plus = $this->db->fetchArray($res_plus); |
| 607 | 607 | |
| 608 | - $upd1 = 'UPDATE ' . $this->table . ' SET article_weight = (article_weight + 1) WHERE article_id = ' . $row_plus['article_id']; |
|
| 608 | + $upd1 = 'UPDATE '.$this->table.' SET article_weight = (article_weight + 1) WHERE article_id = '.$row_plus['article_id']; |
|
| 609 | 609 | $this->db->queryF($upd1); |
| 610 | 610 | |
| 611 | - $upd2 = 'UPDATE ' . $this->table . ' SET article_weight = (article_weight - 1) WHERE article_id = ' . (int)$currentId; |
|
| 611 | + $upd2 = 'UPDATE '.$this->table.' SET article_weight = (article_weight - 1) WHERE article_id = '.(int) $currentId; |
|
| 612 | 612 | $this->db->queryF($upd2); |
| 613 | 613 | $this->forceCacheClean(); |
| 614 | 614 | } |
@@ -622,17 +622,17 @@ discard block |
||
| 622 | 622 | */ |
| 623 | 623 | public function moveDown($currentId, $currentOrder) |
| 624 | 624 | { |
| 625 | - $sql_moins = 'SELECT article_id FROM ' . $this->table . ' WHERE article_weight = ' . ((int)$currentOrder + 1); |
|
| 625 | + $sql_moins = 'SELECT article_id FROM '.$this->table.' WHERE article_weight = '.((int) $currentOrder + 1); |
|
| 626 | 626 | $res_moins = $this->db->query($sql_moins); |
| 627 | 627 | if ($this->db->getRowsNum($res_moins) == 0) { |
| 628 | 628 | return; |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | $row_moins = $this->db->fetchArray($res_moins); |
| 632 | - $upd1 = 'UPDATE ' . $this->table . ' SET article_weight = (article_weight - 1) WHERE article_id = ' . $row_moins['article_id']; |
|
| 632 | + $upd1 = 'UPDATE '.$this->table.' SET article_weight = (article_weight - 1) WHERE article_id = '.$row_moins['article_id']; |
|
| 633 | 633 | $this->db->queryF($upd1); |
| 634 | 634 | |
| 635 | - $upd2 = 'UPDATE ' . $this->table . ' SET article_weight =( article_weight + 1) WHERE article_id = ' . (int)$currentId; |
|
| 635 | + $upd2 = 'UPDATE '.$this->table.' SET article_weight =( article_weight + 1) WHERE article_id = '.(int) $currentId; |
|
| 636 | 636 | $this->db->queryF($upd2); |
| 637 | 637 | $this->forceCacheClean(); |
| 638 | 638 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | /** |
| 186 | 186 | * Notification de la création d'une nouvelle catégorie |
| 187 | 187 | * |
| 188 | - * @param object|references_categories $category |
|
| 188 | + * @param references_categories $category |
|
| 189 | 189 | * @return bool |
| 190 | 190 | */ |
| 191 | 191 | public function notifyNewCategory(references_categories $category) |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | /** |
| 200 | 200 | * Indique si une catégorie est visible d'un utilisateur |
| 201 | 201 | * |
| 202 | - * @param object|references_categories $category La catégorie à controler |
|
| 202 | + * @param references_categories $category La catégorie à controler |
|
| 203 | 203 | * @param integer $uid L'id de l'utilisateur à controler |
| 204 | 204 | * @return bool |
| 205 | 205 | */ |
@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 22 | 22 | |
| 23 | -require_once XOOPS_ROOT_PATH . '/kernel/object.php'; |
|
| 23 | +require_once XOOPS_ROOT_PATH.'/kernel/object.php'; |
|
| 24 | 24 | if (!class_exists('references_XoopsPersistableObjectHandler')) { |
| 25 | - require_once XOOPS_ROOT_PATH . '/modules/references/class/PersistableObjectHandler.php'; |
|
| 25 | + require_once XOOPS_ROOT_PATH.'/modules/references/class/PersistableObjectHandler.php'; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | class references_categories extends references_Object |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | public function getUrl($shortVersion = false) |
| 57 | 57 | { |
| 58 | 58 | if (!$shortVersion) { |
| 59 | - return REFERENCES_URL . 'category.php?category_id=' . $this->getVar('category_id'); |
|
| 59 | + return REFERENCES_URL.'category.php?category_id='.$this->getVar('category_id'); |
|
| 60 | 60 | } else { |
| 61 | - return 'category.php?category_id=' . $this->getVar('category_id'); |
|
| 61 | + return 'category.php?category_id='.$this->getVar('category_id'); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $gperm_handler = xoops_getHandler('groupperm'); |
| 109 | 109 | $categories = $gperm_handler->getItemIds($permissionsType, $groups, $currentModule->getVar('mid')); |
| 110 | 110 | if (is_array($categories) && count($categories) > 0) { |
| 111 | - $permissions[$permissionsType] = new Criteria('category_id', '(' . implode(',', $categories) . ')', 'IN'); |
|
| 111 | + $permissions[$permissionsType] = new Criteria('category_id', '('.implode(',', $categories).')', 'IN'); |
|
| 112 | 112 | } else { // Ne peut rien voir |
| 113 | 113 | $permissions[$permissionsType] = new Criteria('category_id', '0', '='); |
| 114 | 114 | } |
@@ -174,8 +174,8 @@ discard block |
||
| 174 | 174 | if (count($categories) == 0) { |
| 175 | 175 | return $ret; |
| 176 | 176 | } |
| 177 | - $jump = REFERENCES_URL . 'category.php?category_id='; |
|
| 178 | - $extra = " onchange='location=\"" . $jump . "\"+this.options[this.selectedIndex].value'"; |
|
| 177 | + $jump = REFERENCES_URL.'category.php?category_id='; |
|
| 178 | + $extra = " onchange='location=\"".$jump."\"+this.options[this.selectedIndex].value'"; |
|
| 179 | 179 | |
| 180 | 180 | return references_utils::htmlSelect($selectName, $categories, $selected, true, '', false, 1, $extra); |
| 181 | 181 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | /** |
| 254 | 254 | * Retourne les noms à utiliser pour les champs de tri (sélecteur de champ et ordre de tri) |
| 255 | 255 | * |
| 256 | - * @return array [0] = Nom du sélecteur de champs, [1] = Nom du sélecteur pour le sens du tri |
|
| 256 | + * @return string[] [0] = Nom du sélecteur de champs, [1] = Nom du sélecteur pour le sens du tri |
|
| 257 | 257 | */ |
| 258 | 258 | private function getSortPlaceHolderNames() |
| 259 | 259 | { |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | * |
| 280 | 280 | * @param string $optionName |
| 281 | 281 | * @param mixed $optionValue |
| 282 | - * @return object |
|
| 282 | + * @return references_listFilter |
|
| 283 | 283 | */ |
| 284 | 284 | public function setOption($optionName, $optionValue) |
| 285 | 285 | { |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | * [data] A ne pas renseigner, contient la valeur saisie par l'utilisateur |
| 409 | 409 | * [operator] Opérateur de comparaison pour le Criteria |
| 410 | 410 | * [autoComplete] Indique si on active l'auto complétion sur le champs |
| 411 | - * @return object L'objet courant pour pouvoir chainer |
|
| 411 | + * @return references_listFilter L'objet courant pour pouvoir chainer |
|
| 412 | 412 | */ |
| 413 | 413 | public function initFilter($fieldName, $parameters) |
| 414 | 414 | { |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | /** |
| 465 | 465 | * Ajoute les critères par défaut au critère général |
| 466 | 466 | * |
| 467 | - * @return void |
|
| 467 | + * @return references_listFilter |
|
| 468 | 468 | */ |
| 469 | 469 | private function addDefaultCriterias() |
| 470 | 470 | { |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | /** |
| 593 | 593 | * Méthode à appeler juste après le constructeur pour qu'elle récupère les données saisies |
| 594 | 594 | * |
| 595 | - * @return object L'objet courant pour pouvoir chainer |
|
| 595 | + * @return references_listFilter L'objet courant pour pouvoir chainer |
|
| 596 | 596 | */ |
| 597 | 597 | public function filter() |
| 598 | 598 | { |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | * |
| 718 | 718 | * @param string $key |
| 719 | 719 | * @param string $value |
| 720 | - * @return object |
|
| 720 | + * @return references_listFilter |
|
| 721 | 721 | */ |
| 722 | 722 | public function addAdditionnalParameterToPager($key, $value = '') |
| 723 | 723 | { |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | * |
| 732 | 732 | * @param string $key |
| 733 | 733 | * @param string $value |
| 734 | - * @return object |
|
| 734 | + * @return references_listFilter |
|
| 735 | 735 | */ |
| 736 | 736 | public function addAdditionnalParameterToClearButton($key, $value = '') |
| 737 | 737 | { |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | * Permet d'ajouter des paramètres supplémentaires au pager |
| 745 | 745 | * |
| 746 | 746 | * @param $array |
| 747 | - * @return object |
|
| 747 | + * @return references_listFilter |
|
| 748 | 748 | * @internal param string $key |
| 749 | 749 | * @internal param string $value |
| 750 | 750 | */ |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | /** |
| 763 | 763 | * Retourne le pager à utiliser |
| 764 | 764 | * |
| 765 | - * @return mixed Null s'il n'y a pas lieu d'y avoir un pager, sinon un objet de type {@link XoopsPageNav} |
|
| 765 | + * @return XoopsPageNav|null Null s'il n'y a pas lieu d'y avoir un pager, sinon un objet de type {@link XoopsPageNav} |
|
| 766 | 766 | */ |
| 767 | 767 | public function getPager() |
| 768 | 768 | { |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $this->jsFolderUrl = ''; |
| 201 | 201 | $this->additionnalPagerParameters = array(); |
| 202 | 202 | $this->additionnalClearButtonParameters = array(); |
| 203 | - $this->sortFields = array(); // Les champs qui peuvent être utilisés pour trier |
|
| 203 | + $this->sortFields = array(); // Les champs qui peuvent être utilisés pour trier |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | private function getSortPlaceHolderNames() |
| 259 | 259 | { |
| 260 | - return array(self::PREFIX . 'sortFields', self::PREFIX . 'sortOrder'); |
|
| 260 | + return array(self::PREFIX.'sortFields', self::PREFIX.'sortOrder'); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /** |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $sortFieldsHtml = references_utils::htmlSelect($sortNames[0], $this->sortFields, $this->sortField, false); |
| 272 | 272 | $sortOrderHtml = references_utils::htmlSelect($sortNames[1], array('asc' => _MD_REFERENCES_ASC, 'desc' => _MD_REFERENCES_DESC), $this->sortOrder, false); |
| 273 | 273 | |
| 274 | - return _MD_REFERENCES_SORT_BY . ' ' . $sortFieldsHtml . ' ' . $sortOrderHtml; |
|
| 274 | + return _MD_REFERENCES_SORT_BY.' '.$sortFieldsHtml.' '.$sortOrderHtml; |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | private function getArrayValue($array, $index, $defaultValue = false) |
| 310 | 310 | { |
| 311 | 311 | if ($index === 'autoComplete' && isset($array[$index]) && isset($array[$index]) == true) { |
| 312 | - $this->hasAutoComplete = true; // On en profite pour vérifier si un champ utilise l'autocomplétion |
|
| 312 | + $this->hasAutoComplete = true; // On en profite pour vérifier si un champ utilise l'autocomplétion |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | return isset($array[$index]) ? $array[$index] : $defaultValue; |
@@ -333,14 +333,14 @@ discard block |
||
| 333 | 333 | if (isset($this->vars[$fieldName])) { // On vérifie que le champ demandé est bien en autocomplétion |
| 334 | 334 | if ($this->vars[$fieldName]['autoComplete'] == true) { |
| 335 | 335 | if ($this->vars[$fieldName]['dataType'] == self::FILTER_DATA_TEXT) { |
| 336 | - $criteria = new Criteria($fieldName, $query . '%', 'LIKE'); |
|
| 336 | + $criteria = new Criteria($fieldName, $query.'%', 'LIKE'); |
|
| 337 | 337 | } |
| 338 | - $criteria->setLimit((int)$limit); |
|
| 338 | + $criteria->setLimit((int) $limit); |
|
| 339 | 339 | $ret = $this->handler->getObjects($criteria); |
| 340 | 340 | |
| 341 | 341 | if (count($ret) > 0) { |
| 342 | 342 | foreach ($ret as $object) { |
| 343 | - $return .= $object->getVar($fieldName, 'n') . "\n"; |
|
| 343 | + $return .= $object->getVar($fieldName, 'n')."\n"; |
|
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | } |
@@ -362,23 +362,23 @@ discard block |
||
| 362 | 362 | return $return; |
| 363 | 363 | } |
| 364 | 364 | $return = ''; |
| 365 | - $return .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" title=\"Style sheet\" href=\"" . $this->jsFolderUrl . "autocomplete/jquery.autocomplete.css\" />\n"; |
|
| 365 | + $return .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" title=\"Style sheet\" href=\"".$this->jsFolderUrl."autocomplete/jquery.autocomplete.css\" />\n"; |
|
| 366 | 366 | if (!$jqueryAlreadyLoaded) { |
| 367 | - $return .= "<script type=\"text/javascript\" src=\"" . $this->jsFolderUrl . "jquery/jquery.js\"></script>\n"; |
|
| 367 | + $return .= "<script type=\"text/javascript\" src=\"".$this->jsFolderUrl."jquery/jquery.js\"></script>\n"; |
|
| 368 | 368 | } |
| 369 | - $return .= "<script type=\"text/javascript\" src=\"" . $this->jsFolderUrl . "noconflict.js\"></script>\n"; |
|
| 370 | - $return .= "<script type=\"text/javascript\" src=\"" . $this->jsFolderUrl . "autocomplete/jquery.autocomplete.min.js\"></script>\n"; |
|
| 369 | + $return .= "<script type=\"text/javascript\" src=\"".$this->jsFolderUrl."noconflict.js\"></script>\n"; |
|
| 370 | + $return .= "<script type=\"text/javascript\" src=\"".$this->jsFolderUrl."autocomplete/jquery.autocomplete.min.js\"></script>\n"; |
|
| 371 | 371 | $return .= "<script type=\"text/javascript\">\n"; |
| 372 | 372 | $return .= "jQuery(function($) {\n"; |
| 373 | - $return .= "var url='" . $this->baseUrl . "';\n"; // TODO: Supprimer "var" car cela limite sa portée ! |
|
| 374 | - $return .= "var handlerName='" . $this->handler->className . "';\n"; |
|
| 373 | + $return .= "var url='".$this->baseUrl."';\n"; // TODO: Supprimer "var" car cela limite sa portée ! |
|
| 374 | + $return .= "var handlerName='".$this->handler->className."';\n"; |
|
| 375 | 375 | |
| 376 | 376 | foreach ($this->vars as $fieldName => $parameters) { |
| 377 | 377 | if ($parameters['autoComplete'] == true) { |
| 378 | - $field = self::PREFIX . $fieldName; |
|
| 379 | - $return .= "$('#" . $field . "').autocomplete(url, {\n"; |
|
| 378 | + $field = self::PREFIX.$fieldName; |
|
| 379 | + $return .= "$('#".$field."').autocomplete(url, {\n"; |
|
| 380 | 380 | $return .= "extraParams: {\n"; |
| 381 | - $return .= " field: '" . $fieldName . "',\n"; |
|
| 381 | + $return .= " field: '".$fieldName."',\n"; |
|
| 382 | 382 | $return .= " op: 'autocomplete',\n"; |
| 383 | 383 | $return .= " handler: handlerName\n"; |
| 384 | 384 | $return .= "}\n"; |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | */ |
| 432 | 432 | private function getSessionName() |
| 433 | 433 | { |
| 434 | - return self::MODULE_NAME . '_' . $this->handler->table; |
|
| 434 | + return self::MODULE_NAME.'_'.$this->handler->table; |
|
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | /** |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | */ |
| 442 | 442 | private function getStartSessionName() |
| 443 | 443 | { |
| 444 | - return $this->getSessionName() . '_start'; |
|
| 444 | + return $this->getSessionName().'_start'; |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /** |
@@ -533,11 +533,11 @@ discard block |
||
| 533 | 533 | $sortField = $_REQUEST[$orderFieldsNames[0]]; |
| 534 | 534 | $sortOrder = $_REQUEST[$orderFieldsNames[1]]; |
| 535 | 535 | } else { |
| 536 | - if (isset($_SESSION[$cookieName . '_sortField'])) { |
|
| 537 | - $sortField = $_SESSION[$cookieName . '_sortField']; |
|
| 536 | + if (isset($_SESSION[$cookieName.'_sortField'])) { |
|
| 537 | + $sortField = $_SESSION[$cookieName.'_sortField']; |
|
| 538 | 538 | } |
| 539 | - if (isset($_SESSION[$cookieName . '_sortOrder'])) { |
|
| 540 | - $sortOrder = $_SESSION[$cookieName . '_sortOrder']; |
|
| 539 | + if (isset($_SESSION[$cookieName.'_sortOrder'])) { |
|
| 540 | + $sortOrder = $_SESSION[$cookieName.'_sortOrder']; |
|
| 541 | 541 | } |
| 542 | 542 | } |
| 543 | 543 | |
@@ -546,8 +546,8 @@ discard block |
||
| 546 | 546 | $this->sortOrder = $sortOrder; |
| 547 | 547 | } |
| 548 | 548 | if (trim($sortField) != '' && trim($sortOrder) != '') { |
| 549 | - $_SESSION[$cookieName . '_sortField'] = $sortField; |
|
| 550 | - $_SESSION[$cookieName . '_sortOrder'] = $sortOrder; |
|
| 549 | + $_SESSION[$cookieName.'_sortField'] = $sortField; |
|
| 550 | + $_SESSION[$cookieName.'_sortOrder'] = $sortOrder; |
|
| 551 | 551 | } |
| 552 | 552 | } |
| 553 | 553 | |
@@ -596,19 +596,19 @@ discard block |
||
| 596 | 596 | */ |
| 597 | 597 | public function filter() |
| 598 | 598 | { |
| 599 | - $this->setupFilter(); // Réinitialisations |
|
| 599 | + $this->setupFilter(); // Réinitialisations |
|
| 600 | 600 | $ts = MyTextSanitizer::getInstance(); |
| 601 | - $this->setSortFieldsFromRequest(); // On récupère la zone de tri éventuellement passée dans la requête |
|
| 601 | + $this->setSortFieldsFromRequest(); // On récupère la zone de tri éventuellement passée dans la requête |
|
| 602 | 602 | $this->isSetCleanFilter(); |
| 603 | 603 | |
| 604 | 604 | foreach ($this->vars as $fieldName => $fieldProperties) { |
| 605 | 605 | // On commence par récupérer toutes les valeurs |
| 606 | - $formFieldName = self::PREFIX . $fieldName; // "filter_website_id" par exemple |
|
| 607 | - $fieldProperties['data'] = null; // Valeur par défaut |
|
| 606 | + $formFieldName = self::PREFIX.$fieldName; // "filter_website_id" par exemple |
|
| 607 | + $fieldProperties['data'] = null; // Valeur par défaut |
|
| 608 | 608 | if (isset($_REQUEST[$formFieldName])) { |
| 609 | 609 | if ($fieldProperties['dataType'] == self::FILTER_DATA_NUMERIC) { // Zone numérique |
| 610 | - if ((int)$_REQUEST[$formFieldName] != 0) { |
|
| 611 | - $fieldProperties['data'] = (int)$_REQUEST[$formFieldName]; |
|
| 610 | + if ((int) $_REQUEST[$formFieldName] != 0) { |
|
| 611 | + $fieldProperties['data'] = (int) $_REQUEST[$formFieldName]; |
|
| 612 | 612 | if (!$fieldProperties['minusOne']) { |
| 613 | 613 | $this->criteria->add(new Criteria($fieldName, $fieldProperties['data'], $fieldProperties['operator'])); |
| 614 | 614 | } else { |
@@ -620,9 +620,9 @@ discard block |
||
| 620 | 620 | if (trim($_REQUEST[$formFieldName]) != '') { |
| 621 | 621 | $fieldProperties['data'] = $_REQUEST[$formFieldName]; |
| 622 | 622 | if (!REFERENCES_EXACT_SEARCH) { |
| 623 | - $this->criteria->add(new Criteria($fieldName, '%' . $ts->addSlashes($fieldProperties['data']) . '%', 'LIKE')); |
|
| 623 | + $this->criteria->add(new Criteria($fieldName, '%'.$ts->addSlashes($fieldProperties['data']).'%', 'LIKE')); |
|
| 624 | 624 | } else { |
| 625 | - $this->criteria->add(new Criteria($fieldName, $ts->addSlashes($fieldProperties['data']) . '%', 'LIKE')); |
|
| 625 | + $this->criteria->add(new Criteria($fieldName, $ts->addSlashes($fieldProperties['data']).'%', 'LIKE')); |
|
| 626 | 626 | } |
| 627 | 627 | $this->newFilter = true; |
| 628 | 628 | } |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | { |
| 687 | 687 | if ($this->keepStart) { |
| 688 | 688 | $startSessionName = $this->getStartSessionName(); |
| 689 | - $_SESSION[$startSessionName] = (int)$start; |
|
| 689 | + $_SESSION[$startSessionName] = (int) $start; |
|
| 690 | 690 | } |
| 691 | 691 | } |
| 692 | 692 | |
@@ -699,11 +699,11 @@ discard block |
||
| 699 | 699 | { |
| 700 | 700 | $start = 0; |
| 701 | 701 | if (isset($_REQUEST[$this->startName])) { |
| 702 | - $start = (int)$_REQUEST[$this->startName]; |
|
| 702 | + $start = (int) $_REQUEST[$this->startName]; |
|
| 703 | 703 | } elseif ($this->keepStart) { |
| 704 | 704 | $startSessionName = $this->getStartSessionName(); |
| 705 | 705 | if (isset($_SESSION[$startSessionName])) { |
| 706 | - $start = (int)$_SESSION[$startSessionName]; |
|
| 706 | + $start = (int) $_SESSION[$startSessionName]; |
|
| 707 | 707 | } |
| 708 | 708 | } |
| 709 | 709 | // Mise en session |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | if (!$this->isInitialized) { |
| 770 | 770 | $this->filter(); |
| 771 | 771 | } |
| 772 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 772 | + require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 773 | 773 | $itemsCount = $this->getCount(); |
| 774 | 774 | $queryString = array(); |
| 775 | 775 | if (trim($this->op) != '') { |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | |
| 780 | 780 | if ($itemsCount > $this->limit) { |
| 781 | 781 | foreach ($this->vars as $fieldName => $fieldProperties) { |
| 782 | - $formFieldName = self::PREFIX . $fieldName; // "filter_website_id" par exemple |
|
| 782 | + $formFieldName = self::PREFIX.$fieldName; // "filter_website_id" par exemple |
|
| 783 | 783 | $queryString[$formFieldName] = $fieldProperties['data']; |
| 784 | 784 | } |
| 785 | 785 | // Ajout des paramètres supplémentaires éventuels |
@@ -839,15 +839,15 @@ discard block |
||
| 839 | 839 | return $html; |
| 840 | 840 | } |
| 841 | 841 | $fieldData = $this->vars[$fieldName]; |
| 842 | - $htmlFieldName = self::PREFIX . $fieldName; |
|
| 842 | + $htmlFieldName = self::PREFIX.$fieldName; |
|
| 843 | 843 | |
| 844 | 844 | switch ($fieldData['fieldType']) { |
| 845 | 845 | case self::FILTER_FIELD_TEXT: // Zone de texte |
| 846 | 846 | $ts = MyTextSanitizer::getInstance(); |
| 847 | - $html = "<input type='text' name='$htmlFieldName' id='$htmlFieldName' size='" . $fieldData['size'] . "' maxlength='" . $fieldData['maxLength'] . "' value='" . $ts->htmlSpecialChars($fieldData['data']) . "' />"; |
|
| 847 | + $html = "<input type='text' name='$htmlFieldName' id='$htmlFieldName' size='".$fieldData['size']."' maxlength='".$fieldData['maxLength']."' value='".$ts->htmlSpecialChars($fieldData['data'])."' />"; |
|
| 848 | 848 | break; |
| 849 | 849 | |
| 850 | - case self::FILTER_FIELD_SELECT; // Select |
|
| 850 | + case self::FILTER_FIELD_SELECT; // Select |
|
| 851 | 851 | $style = ''; |
| 852 | 852 | if (isset($fieldData['style']) && trim($fieldData['style']) != '') { |
| 853 | 853 | $style = $fieldData['style']; |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | $queryString['cleanFilter'] = '1'; |
| 901 | 901 | $baseurl = $this->baseUrl; |
| 902 | 902 | |
| 903 | - return " <a href='$baseurl?" . http_build_query($queryString) . "' title='" . _MD_REFERENCES_CLEAN_FILTER . "'><img align='top' src='../assets/images/clear_left.png' alt='" . _MD_REFERENCES_CLEAN_FILTER . "' /></a>"; |
|
| 903 | + return " <a href='$baseurl?".http_build_query($queryString)."' title='"._MD_REFERENCES_CLEAN_FILTER."'><img align='top' src='../assets/images/clear_left.png' alt='"._MD_REFERENCES_CLEAN_FILTER."' /></a>"; |
|
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | /** |
@@ -914,11 +914,11 @@ discard block |
||
| 914 | 914 | { |
| 915 | 915 | $html = ''; |
| 916 | 916 | if (trim($this->operationName) != '' && trim($this->op) != '') { |
| 917 | - $html .= "<input type='hidden' name='" . $this->operationName . "' id='" . $this->operationName . "' value='" . $this->op . "' />"; |
|
| 917 | + $html .= "<input type='hidden' name='".$this->operationName."' id='".$this->operationName."' value='".$this->op."' />"; |
|
| 918 | 918 | } |
| 919 | 919 | if (!is_null($additionnals)) { |
| 920 | 920 | foreach ($additionnals as $key => $value) { |
| 921 | - $html .= "<input type='hidden' name='" . $key . "' id='" . $key . "' value='" . $value . "' />"; |
|
| 921 | + $html .= "<input type='hidden' name='".$key."' id='".$key."' value='".$value."' />"; |
|
| 922 | 922 | } |
| 923 | 923 | } |
| 924 | 924 | $html .= "<input type='submit' name='btngo' id='btngo' value='$description' />"; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | /** |
| 96 | 96 | * Retourne l'instance unique de la classe |
| 97 | 97 | * |
| 98 | - * @return object |
|
| 98 | + * @return references_plugins |
|
| 99 | 99 | */ |
| 100 | 100 | public static function getInstance() |
| 101 | 101 | { |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | * Déclenchement d'une action et appel des plugins liés |
| 178 | 178 | * |
| 179 | 179 | * @param string $eventToFire L'action déclenchée |
| 180 | - * @param object|references_parameters $parameters Les paramètres à passer à chaque plugin |
|
| 181 | - * @return object L'objet lui même pour chaîner |
|
| 180 | + * @param references_parameters $parameters Les paramètres à passer à chaque plugin |
|
| 181 | + * @return references_plugins L'objet lui même pour chaîner |
|
| 182 | 182 | */ |
| 183 | 183 | public function fireAction($eventToFire, references_parameters $parameters = null) |
| 184 | 184 | { |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | * Déclenchement d'un filtre et appel des plugins liés |
| 213 | 213 | * |
| 214 | 214 | * @param string $eventToFire Le filtre appelé |
| 215 | - * @param object|references_parameters $parameters Les paramètres à passer à chaque plugin |
|
| 215 | + * @param references_parameters $parameters Les paramètres à passer à chaque plugin |
|
| 216 | 216 | * @return object Le contenu de l'objet passé en paramètre |
| 217 | 217 | */ |
| 218 | 218 | public function fireFilter($eventToFire, references_parameters $parameters) |
@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | * Priorités des plugins |
| 60 | 60 | * @var constant |
| 61 | 61 | */ |
| 62 | - const EVENT_PRIORITY_1 = 1; // Priorité la plus haute |
|
| 62 | + const EVENT_PRIORITY_1 = 1; // Priorité la plus haute |
|
| 63 | 63 | const EVENT_PRIORITY_2 = 2; |
| 64 | 64 | const EVENT_PRIORITY_3 = 3; |
| 65 | 65 | const EVENT_PRIORITY_4 = 4; |
| 66 | - const EVENT_PRIORITY_5 = 5; // Priorité la plus basse |
|
| 66 | + const EVENT_PRIORITY_5 = 5; // Priorité la plus basse |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * Utilisé pour construire le nom de la classe |
@@ -123,8 +123,8 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function loadPlugins() |
| 125 | 125 | { |
| 126 | - $this->loadPluginsFiles(REFERENCES_PLUGINS_PATH . $this->pluginsTypesFolder[self::PLUGIN_ACTION], self::PLUGIN_ACTION); |
|
| 127 | - $this->loadPluginsFiles(REFERENCES_PLUGINS_PATH . $this->pluginsTypesFolder[self::PLUGIN_FILTER], self::PLUGIN_FILTER); |
|
| 126 | + $this->loadPluginsFiles(REFERENCES_PLUGINS_PATH.$this->pluginsTypesFolder[self::PLUGIN_ACTION], self::PLUGIN_ACTION); |
|
| 127 | + $this->loadPluginsFiles(REFERENCES_PLUGINS_PATH.$this->pluginsTypesFolder[self::PLUGIN_FILTER], self::PLUGIN_FILTER); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -138,14 +138,14 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | require_once $fullPathName; |
| 140 | 140 | // Du style referencesRegionalizationFilter |
| 141 | - $className = self::MODULE_DIRNAME . ucfirst(strtolower($pluginFolder)) . $this->pluginsTypeLabel[$type]; |
|
| 141 | + $className = self::MODULE_DIRNAME.ucfirst(strtolower($pluginFolder)).$this->pluginsTypeLabel[$type]; |
|
| 142 | 142 | if (class_exists($className) && get_parent_class($className) == $this->pluginsClassName[$type]) { |
| 143 | 143 | // TODO: Vérifier que l'évènement n'est pas déjà en mémoire |
| 144 | 144 | $events = call_user_func(array($className, self::PLUGIN_DESCRIBE_METHOD)); |
| 145 | 145 | foreach ($events as $event) { |
| 146 | 146 | $eventName = $event[0]; |
| 147 | 147 | $eventPriority = $event[1]; |
| 148 | - $fileToInclude = REFERENCES_PLUGINS_PATH . $this->pluginsTypesFolder[$type] . DIRECTORY_SEPARATOR . $pluginFolder . DIRECTORY_SEPARATOR . $event[2]; |
|
| 148 | + $fileToInclude = REFERENCES_PLUGINS_PATH.$this->pluginsTypesFolder[$type].DIRECTORY_SEPARATOR.$pluginFolder.DIRECTORY_SEPARATOR.$event[2]; |
|
| 149 | 149 | $classToCall = $event[3]; |
| 150 | 150 | $methodToCall = $event[4]; |
| 151 | 151 | $this->events[$type][$eventName][$eventPriority][] = array('fullPathName' => $fileToInclude, 'className' => $classToCall, 'method' => $methodToCall); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $objects = new DirectoryIterator($path); |
| 166 | 166 | foreach ($objects as $object) { |
| 167 | 167 | if ($object->isDir() && !$object->isDot()) { |
| 168 | - $file = $path . DIRECTORY_SEPARATOR . $object->current() . DIRECTORY_SEPARATOR . self::PLUGIN_SCRIPT_NAME; |
|
| 168 | + $file = $path.DIRECTORY_SEPARATOR.$object->current().DIRECTORY_SEPARATOR.self::PLUGIN_SCRIPT_NAME; |
|
| 169 | 169 | if (file_exists($file)) { |
| 170 | 170 | $this->loadClass($file, $type, $object->current()); |
| 171 | 171 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | return $this; |
| 189 | 189 | } |
| 190 | - ksort($this->events[self::PLUGIN_ACTION][$eventToFire]); // Tri par priorit� |
|
| 190 | + ksort($this->events[self::PLUGIN_ACTION][$eventToFire]); // Tri par priorit� |
|
| 191 | 191 | foreach ($this->events[self::PLUGIN_ACTION][$eventToFire] as $priority => $events) { |
| 192 | 192 | foreach ($events as $event) { |
| 193 | 193 | if ($this->isUnplug(self::PLUGIN_ACTION, $eventToFire, $event['fullPathName'], $event['className'], $event['method'])) { |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | return $this; |
| 224 | 224 | } |
| 225 | - ksort($this->events[self::PLUGIN_FILTER][$eventToFire]); // Tri par priorité |
|
| 225 | + ksort($this->events[self::PLUGIN_FILTER][$eventToFire]); // Tri par priorité |
|
| 226 | 226 | foreach ($this->events[self::PLUGIN_FILTER][$eventToFire] as $priority => $events) { |
| 227 | 227 | foreach ($events as $event) { |
| 228 | 228 | if ($this->isUnplug(self::PLUGIN_FILTER, $eventToFire, $event['fullPathName'], $event['className'], $event['method'])) { |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * Access the only instance of this class |
| 28 | 28 | * |
| 29 | - * @return object |
|
| 29 | + * @return references_registryfile |
|
| 30 | 30 | * |
| 31 | 31 | * @static |
| 32 | 32 | * @staticvar object |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | class references_registryfile |
| 23 | 23 | { |
| 24 | - public $filename; // Nom du fichier � traiter |
|
| 24 | + public $filename; // Nom du fichier � traiter |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Access the only instance of this class |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function setfile($fichier = null) |
| 50 | 50 | { |
| 51 | 51 | if ($fichier) { |
| 52 | - $this->filename = XOOPS_UPLOAD_PATH . DIRECTORY_SEPARATOR . $fichier; |
|
| 52 | + $this->filename = XOOPS_UPLOAD_PATH.DIRECTORY_SEPARATOR.$fichier; |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | if (!$fichier) { |
| 60 | 60 | $fw = $this->filename; |
| 61 | 61 | } else { |
| 62 | - $fw = XOOPS_UPLOAD_PATH . DIRECTORY_SEPARATOR . $fichier; |
|
| 62 | + $fw = XOOPS_UPLOAD_PATH.DIRECTORY_SEPARATOR.$fichier; |
|
| 63 | 63 | } |
| 64 | 64 | if (file_exists($fw)) { |
| 65 | 65 | return file_get_contents($fw); |
@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | if (!$fichier) { |
| 75 | 75 | $fw = $this->filename; |
| 76 | 76 | } else { |
| 77 | - $fw = XOOPS_UPLOAD_PATH . DIRECTORY_SEPARATOR . $fichier; |
|
| 77 | + $fw = XOOPS_UPLOAD_PATH.DIRECTORY_SEPARATOR.$fichier; |
|
| 78 | 78 | } |
| 79 | 79 | if (file_exists($fw)) { |
| 80 | 80 | @unlink($fw); |
| 81 | 81 | } |
| 82 | - $fp = fopen($fw, 'w') || exit('Error, impossible to create the file ' . $this->filename); |
|
| 82 | + $fp = fopen($fw, 'w') || exit('Error, impossible to create the file '.$this->filename); |
|
| 83 | 83 | fwrite($fp, $content); |
| 84 | 84 | fclose($fp); |
| 85 | 85 | |
@@ -16,6 +16,10 @@ discard block |
||
| 16 | 16 | private $debug = false; |
| 17 | 17 | public $error = false; |
| 18 | 18 | |
| 19 | + /** |
|
| 20 | + * @param string $user |
|
| 21 | + * @param string $pass |
|
| 22 | + */ |
|
| 19 | 23 | function __construct($user, $pass, $debug = false) |
| 20 | 24 | { |
| 21 | 25 | // Store an auth key for the HTTP Authorization: header |
@@ -23,6 +27,9 @@ discard block |
||
| 23 | 27 | $this->debug = $debug; |
| 24 | 28 | } |
| 25 | 29 | |
| 30 | + /** |
|
| 31 | + * @param string $new_status |
|
| 32 | + */ |
|
| 26 | 33 | function update($new_status) |
| 27 | 34 | { |
| 28 | 35 | if (strlen($new_status) > 140) { |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | function __construct($user, $pass, $debug = false) |
| 20 | 20 | { |
| 21 | 21 | // Store an auth key for the HTTP Authorization: header |
| 22 | - $this->auth = base64_encode($user . ':' . $pass); |
|
| 22 | + $this->auth = base64_encode($user.':'.$pass); |
|
| 23 | 23 | $this->debug = $debug; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -34,12 +34,12 @@ discard block |
||
| 34 | 34 | $this->error = "Socket error #{$errno}: {$errstr}"; |
| 35 | 35 | return false; |
| 36 | 36 | } |
| 37 | - $post_data = 'status=' . urlencode($new_status); |
|
| 37 | + $post_data = 'status='.urlencode($new_status); |
|
| 38 | 38 | $to_send = "POST /statuses/update.xml HTTP/1.1\r\n"; |
| 39 | 39 | $to_send .= "Host: twitter.com\r\n"; |
| 40 | - $to_send .= 'Content-Length: ' . strlen($post_data) . "\r\n"; |
|
| 40 | + $to_send .= 'Content-Length: '.strlen($post_data)."\r\n"; |
|
| 41 | 41 | $to_send .= "Authorization: Basic {$this->auth}\r\n\r\n"; |
| 42 | - $to_send .= $post_data . "\r\n\r\n"; |
|
| 42 | + $to_send .= $post_data."\r\n\r\n"; |
|
| 43 | 43 | $bytes = fwrite($fp, $to_send); |
| 44 | 44 | if ($bytes === false) { |
| 45 | 45 | $this->error = 'Socket error: Error sending data.'; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $response .= $buf; |
| 60 | 60 | } |
| 61 | 61 | if ($this->debug) echo "Received:\n{$response}"; |
| 62 | - $was_error = preg_match('#' . preg_quote('<error>') . '(.+)' . preg_quote('</error>') . '#i', $response, $matches); |
|
| 62 | + $was_error = preg_match('#'.preg_quote('<error>').'(.+)'.preg_quote('</error>').'#i', $response, $matches); |
|
| 63 | 63 | if ($was_error) { |
| 64 | 64 | $this->error = "Twitter error: {$matches[1]}"; |
| 65 | 65 | return false; |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | |
| 91 | 91 | //Help |
| 92 | 92 | define('_MI_REFERENCES_DIRNAME', basename(dirname(dirname(__DIR__)))); |
| 93 | -define('_MI_REFERENCES_HELP_HEADER', __DIR__ . '/help/helpheader.html'); |
|
| 93 | +define('_MI_REFERENCES_HELP_HEADER', __DIR__.'/help/helpheader.html'); |
|
| 94 | 94 | define('_MI_REFERENCES_BACK_2_ADMIN', 'Back to Administration of '); |
| 95 | 95 | define('_MI_REFERENCES_HELP_OVERVIEW', 'Overview'); |
| 96 | 96 | |