@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * |
| 40 | 40 | * @param string $key Le nom du champ à traiter |
| 41 | 41 | * @param mixed $value La valeur à lui attribuer |
| 42 | - * @return object |
|
| 42 | + * @return references_parameters |
|
| 43 | 43 | */ |
| 44 | 44 | function __set($key, $value) |
| 45 | 45 | { |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | public function __call($method, $args) |
| 59 | 59 | { |
| 60 | 60 | if (substr($method, 0, 3) === 'set') { |
| 61 | - parent::offsetSet(strtolower(substr($method, 3, 1)) . substr($method, 4), $args[0]); |
|
| 61 | + parent::offsetSet(strtolower(substr($method, 3, 1)).substr($method, 4), $args[0]); |
|
| 62 | 62 | |
| 63 | 63 | return $this; |
| 64 | 64 | } else { // Affichage de la valeur |
@@ -28,6 +28,10 @@ discard block |
||
| 28 | 28 | 'expand' |
| 29 | 29 | ); |
| 30 | 30 | |
| 31 | + /** |
|
| 32 | + * @param string $login |
|
| 33 | + * @param string $apiKey |
|
| 34 | + */ |
|
| 31 | 35 | public function Bitly($login, $apiKey) |
| 32 | 36 | { |
| 33 | 37 | $this->login = $login; |
@@ -115,6 +119,10 @@ discard block |
||
| 115 | 119 | return $this->process('stats', $postFields); |
| 116 | 120 | } |
| 117 | 121 | |
| 122 | + /** |
|
| 123 | + * @param string $action |
|
| 124 | + * @param string $postFields |
|
| 125 | + */ |
|
| 118 | 126 | protected function process($action, $postFields) { |
| 119 | 127 | $ch = curl_init( $this->api . $action); |
| 120 | 128 | |
@@ -134,6 +142,9 @@ discard block |
||
| 134 | 142 | return $response; |
| 135 | 143 | } |
| 136 | 144 | |
| 145 | + /** |
|
| 146 | + * @param string $format |
|
| 147 | + */ |
|
| 137 | 148 | public function setReturnFormat($format) |
| 138 | 149 | { |
| 139 | 150 | // needed for restoration |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $curr = $matches[0][$i]; |
| 85 | 85 | // ignore bitly urls |
| 86 | 86 | if (!strstr($curr, 'http://bit.ly')) { |
| 87 | - $postFields .= '&longUrl=' . urlencode($curr); |
|
| 87 | + $postFields .= '&longUrl='.urlencode($curr); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | public function expand($message) |
| 99 | 99 | { |
| 100 | - $postFields = '&hash=' . $this->getHash($message); |
|
| 100 | + $postFields = '&hash='.$this->getHash($message); |
|
| 101 | 101 | return $this->process('expand', $postFields); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | public function info($bitlyUrl) |
| 105 | 105 | { |
| 106 | 106 | $hash = $this->getHash($bitlyUrl); |
| 107 | - $postFields = '&hash=' . $hash; |
|
| 107 | + $postFields = '&hash='.$hash; |
|
| 108 | 108 | return $this->process('info', $postFields); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -112,19 +112,19 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | // Take only first hash or url. Ignore others. |
| 114 | 114 | $a = split(',', $bitlyUrl); |
| 115 | - $postFields = '&hash=' . $this->getHash($a[0]); |
|
| 115 | + $postFields = '&hash='.$this->getHash($a[0]); |
|
| 116 | 116 | return $this->process('stats', $postFields); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | protected function process($action, $postFields) |
| 120 | 120 | { |
| 121 | - $ch = curl_init($this->api . $action); |
|
| 121 | + $ch = curl_init($this->api.$action); |
|
| 122 | 122 | |
| 123 | - $postFields = 'version=' . $this->version . $postFields; |
|
| 124 | - $postFields .= '&format=' . $this->format; |
|
| 123 | + $postFields = 'version='.$this->version.$postFields; |
|
| 124 | + $postFields .= '&format='.$this->format; |
|
| 125 | 125 | $postFields .= '&history=1'; |
| 126 | 126 | |
| 127 | - curl_setopt($ch, CURLOPT_USERPWD, $this->login . ':' . $this->apiKey); |
|
| 127 | + curl_setopt($ch, CURLOPT_USERPWD, $this->login.':'.$this->apiKey); |
|
| 128 | 128 | curl_setopt($ch, CURLOPT_POST, 1); |
| 129 | 129 | curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); |
| 130 | 130 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
@@ -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 | */ |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | die('XOOPS root path not defined'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | -require_once XOOPS_ROOT_PATH . '/kernel/object.php'; |
|
| 25 | +require_once XOOPS_ROOT_PATH.'/kernel/object.php'; |
|
| 26 | 26 | if (!class_exists('references_XoopsPersistableObjectHandler')) { |
| 27 | - require_once XOOPS_ROOT_PATH . '/modules/references/class/PersistableObjectHandler.php'; |
|
| 27 | + require_once XOOPS_ROOT_PATH.'/modules/references/class/PersistableObjectHandler.php'; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -define('REFERENCES_STATUS_ONLINE', 1); // Articles en ligne |
|
| 31 | -define('REFERENCES_STATUS_OFFLINE', 0); // Articles hors ligne |
|
| 30 | +define('REFERENCES_STATUS_ONLINE', 1); // Articles en ligne |
|
| 31 | +define('REFERENCES_STATUS_OFFLINE', 0); // Articles hors ligne |
|
| 32 | 32 | |
| 33 | 33 | class references_articles extends references_Object |
| 34 | 34 | { |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | public function getOnlinePicture() |
| 90 | 90 | { |
| 91 | 91 | if ($this->isArticleOnline()) { |
| 92 | - return REFERENCES_IMAGES_URL . 'status_online.png'; |
|
| 92 | + return REFERENCES_IMAGES_URL.'status_online.png'; |
|
| 93 | 93 | } else { |
| 94 | - return REFERENCES_IMAGES_URL . 'status_offline.png'; |
|
| 94 | + return REFERENCES_IMAGES_URL.'status_offline.png'; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | public function pictureExists($indice) |
| 115 | 115 | { |
| 116 | 116 | $return = false; |
| 117 | - $fieldName = 'article_picture' . $indice; |
|
| 118 | - if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . $this->getVar($fieldName))) { |
|
| 117 | + $fieldName = 'article_picture'.$indice; |
|
| 118 | + if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.$this->getVar($fieldName))) { |
|
| 119 | 119 | $return = true; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -130,9 +130,9 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public function deletePicture($indice) |
| 132 | 132 | { |
| 133 | - $fieldName = 'article_picture' . $indice; |
|
| 133 | + $fieldName = 'article_picture'.$indice; |
|
| 134 | 134 | if ($this->pictureExists($indice)) { |
| 135 | - @unlink(references_utils::getModuleOption('images_path') . references_utils::getModuleOption('images_path') . $this->getVar($fieldName)); |
|
| 135 | + @unlink(references_utils::getModuleOption('images_path').references_utils::getModuleOption('images_path').$this->getVar($fieldName)); |
|
| 136 | 136 | } |
| 137 | 137 | $this->setVar($fieldName, ''); |
| 138 | 138 | } |
@@ -145,11 +145,11 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function getPictureUrl($indice) |
| 147 | 147 | { |
| 148 | - $fieldName = 'article_picture' . $indice; |
|
| 148 | + $fieldName = 'article_picture'.$indice; |
|
| 149 | 149 | if (xoops_trim($this->getVar($fieldName)) != '' && $this->pictureExists($indice)) { |
| 150 | - return references_utils::getModuleOption('images_url') . '/' . $this->getVar($fieldName); |
|
| 150 | + return references_utils::getModuleOption('images_url').'/'.$this->getVar($fieldName); |
|
| 151 | 151 | } else { |
| 152 | - return REFERENCES_IMAGES_URL . 'blank.gif'; |
|
| 152 | + return REFERENCES_IMAGES_URL.'blank.gif'; |
|
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
@@ -161,9 +161,9 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | public function getPicturePath($indice) |
| 163 | 163 | { |
| 164 | - $fieldName = 'article_picture' . $indice; |
|
| 164 | + $fieldName = 'article_picture'.$indice; |
|
| 165 | 165 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 166 | - return references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . $this->getVar($fieldName); |
|
| 166 | + return references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.$this->getVar($fieldName); |
|
| 167 | 167 | } else { |
| 168 | 168 | return ''; |
| 169 | 169 | } |
@@ -177,9 +177,9 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | public function thumbExists($indice) |
| 179 | 179 | { |
| 180 | - $fieldName = 'article_picture' . $indice; |
|
| 180 | + $fieldName = 'article_picture'.$indice; |
|
| 181 | 181 | $return = false; |
| 182 | - if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName))) { |
|
| 182 | + if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName))) { |
|
| 183 | 183 | $return = true; |
| 184 | 184 | } |
| 185 | 185 | |
@@ -194,11 +194,11 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public function getThumbUrl($indice) |
| 196 | 196 | { |
| 197 | - $fieldName = 'article_picture' . $indice; |
|
| 197 | + $fieldName = 'article_picture'.$indice; |
|
| 198 | 198 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 199 | - return references_utils::getModuleOption('images_url') . '/' . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName); |
|
| 199 | + return references_utils::getModuleOption('images_url').'/'.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName); |
|
| 200 | 200 | } else { |
| 201 | - return REFERENCES_IMAGES_URL . 'blank.gif'; |
|
| 201 | + return REFERENCES_IMAGES_URL.'blank.gif'; |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
@@ -210,9 +210,9 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | public function getThumbPath($indice) |
| 212 | 212 | { |
| 213 | - $fieldName = 'article_picture' . $indice; |
|
| 213 | + $fieldName = 'article_picture'.$indice; |
|
| 214 | 214 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 215 | - return references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName); |
|
| 215 | + return references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName); |
|
| 216 | 216 | } else { |
| 217 | 217 | return ''; |
| 218 | 218 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | public function attachmentExists() |
| 227 | 227 | { |
| 228 | 228 | $return = false; |
| 229 | - if (xoops_trim($this->getVar('article_attached_file')) != '' && file_exists(references_utils::getModuleOption('attached_path') . DIRECTORY_SEPARATOR . $this->getVar('article_attached_file'))) { |
|
| 229 | + if (xoops_trim($this->getVar('article_attached_file')) != '' && file_exists(references_utils::getModuleOption('attached_path').DIRECTORY_SEPARATOR.$this->getVar('article_attached_file'))) { |
|
| 230 | 230 | $return = true; |
| 231 | 231 | } |
| 232 | 232 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | public function getAttachmentUrl() |
| 242 | 242 | { |
| 243 | 243 | if (xoops_trim($this->getVar('article_attached_file')) != '' && $this->attachmentExists()) { |
| 244 | - return references_utils::getModuleOption('attached_url') . '/' . $this->getVar('article_attached_file'); |
|
| 244 | + return references_utils::getModuleOption('attached_url').'/'.$this->getVar('article_attached_file'); |
|
| 245 | 245 | } else { |
| 246 | 246 | return ''; |
| 247 | 247 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | public function getAttachmentPath() |
| 256 | 256 | { |
| 257 | 257 | if (xoops_trim($this->getVar('article_attached_file')) != '' && $this->attachmentExists()) { |
| 258 | - return references_utils::getModuleOption('attached_path') . DIRECTORY_SEPARATOR . $this->getVar('article_attached_file'); |
|
| 258 | + return references_utils::getModuleOption('attached_path').DIRECTORY_SEPARATOR.$this->getVar('article_attached_file'); |
|
| 259 | 259 | } else { |
| 260 | 260 | return ''; |
| 261 | 261 | } |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | public function deleteAttachment() |
| 268 | 268 | { |
| 269 | 269 | if ($this->attachmentExists()) { |
| 270 | - @unlink(references_utils::getModuleOption('attached_path') . DIRECTORY_SEPARATOR . $this->getVar('article_attached_file')); |
|
| 270 | + @unlink(references_utils::getModuleOption('attached_path').DIRECTORY_SEPARATOR.$this->getVar('article_attached_file')); |
|
| 271 | 271 | } |
| 272 | 272 | $this->setVar('article_attached_file', ''); |
| 273 | 273 | } |
@@ -280,9 +280,9 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | public function deleteThumb($indice) |
| 282 | 282 | { |
| 283 | - $fieldName = 'article_picture' . $indice; |
|
| 283 | + $fieldName = 'article_picture'.$indice; |
|
| 284 | 284 | if ($this->thumbExists($indice)) { |
| 285 | - @unlink(references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName)); |
|
| 285 | + @unlink(references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName)); |
|
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
@@ -350,9 +350,9 @@ discard block |
||
| 350 | 350 | public function getUrl($shortVersion = false) |
| 351 | 351 | { |
| 352 | 352 | if (!$shortVersion) { |
| 353 | - return REFERENCES_URL . 'reference.php?article_id=' . $this->getVar('article_id'); |
|
| 353 | + return REFERENCES_URL.'reference.php?article_id='.$this->getVar('article_id'); |
|
| 354 | 354 | } else { |
| 355 | - return 'reference.php?article_id=' . $this->getVar('article_id'); |
|
| 355 | + return 'reference.php?article_id='.$this->getVar('article_id'); |
|
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | |
@@ -375,11 +375,11 @@ discard block |
||
| 375 | 375 | $ret['article_picture_exists'] = true; |
| 376 | 376 | for ($i = 1; $i <= 10; ++$i) { |
| 377 | 377 | if ($this->pictureExists($i)) { |
| 378 | - $ret['article_picture_url' . $i] = $this->getPictureUrl($i); |
|
| 379 | - $ret['article_picture_path' . $i] = $this->getPicturePath($i); |
|
| 378 | + $ret['article_picture_url'.$i] = $this->getPictureUrl($i); |
|
| 379 | + $ret['article_picture_path'.$i] = $this->getPicturePath($i); |
|
| 380 | 380 | $ret['article_pictures_urls'][] = $this->getPictureUrl($i); |
| 381 | 381 | $ret['article_pictures_paths'][] = $this->getPicturePath($i); |
| 382 | - $fieldName = 'article_picture' . $i . '_text'; |
|
| 382 | + $fieldName = 'article_picture'.$i.'_text'; |
|
| 383 | 383 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 384 | 384 | $ret['article_pictures_texts'][] = references_utils::makeHrefTitle($this->getVar($fieldName)); |
| 385 | 385 | } else { |
@@ -404,8 +404,8 @@ discard block |
||
| 404 | 404 | $ret['article_thumb_exists'] = true; |
| 405 | 405 | for ($i = 1; $i <= 10; ++$i) { |
| 406 | 406 | if ($this->thumbExists($i)) { |
| 407 | - $ret['article_thumb_url' . $i] = $this->getThumbUrl($i); |
|
| 408 | - $ret['article_thumb_path' . $i] = $this->getThumbPath($i); |
|
| 407 | + $ret['article_thumb_url'.$i] = $this->getThumbUrl($i); |
|
| 408 | + $ret['article_thumb_path'.$i] = $this->getThumbPath($i); |
|
| 409 | 409 | $ret['article_thumbs_urls'][] = $this->getThumbUrl($i); |
| 410 | 410 | $ret['article_thumbs_paths'][] = $this->getThumbPath($i); |
| 411 | 411 | } |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | $gperm_handler = xoops_getHandler('groupperm'); |
| 447 | 447 | $categories = $gperm_handler->getItemIds($permissionsType, $groups, $currentModule->getVar('mid')); |
| 448 | 448 | if (is_array($categories) && count($categories) > 0) { |
| 449 | - $permissions[$permissionsType] = new Criteria('article_category_id', '(' . implode(',', $categories) . ')', 'IN'); |
|
| 449 | + $permissions[$permissionsType] = new Criteria('article_category_id', '('.implode(',', $categories).')', 'IN'); |
|
| 450 | 450 | } else { // Ne peut rien voir |
| 451 | 451 | $permissions[$permissionsType] = new Criteria('article_category_id', '0', '='); |
| 452 | 452 | } |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | $criteria->add(new Criteria('article_online', REFERENCES_STATUS_ONLINE, '=')); |
| 475 | 475 | } |
| 476 | 476 | if (is_array($categoryId) && count($categoryId) > 0) { |
| 477 | - $criteria->add(new Criteria('article_category_id', '(' . implode(',', $categoryId) . ')', 'IN')); |
|
| 477 | + $criteria->add(new Criteria('article_category_id', '('.implode(',', $categoryId).')', 'IN')); |
|
| 478 | 478 | } elseif ($categoryId > 0) { |
| 479 | 479 | $criteria->add(new Criteria('article_category_id', $categoryId, '=')); |
| 480 | 480 | } |
@@ -531,8 +531,8 @@ discard block |
||
| 531 | 531 | public function getDistinctCategoriesIds() |
| 532 | 532 | { |
| 533 | 533 | $ret = array(); |
| 534 | - $sql = 'SELECT distinct(article_category_id) FROM ' . $this->table; |
|
| 535 | - $sql .= ' ' . $this->getPermissionsCategoriesCriteria()->renderWhere(); // Permissions |
|
| 534 | + $sql = 'SELECT distinct(article_category_id) FROM '.$this->table; |
|
| 535 | + $sql .= ' '.$this->getPermissionsCategoriesCriteria()->renderWhere(); // Permissions |
|
| 536 | 536 | $sql .= ' GROUP BY article_category_id ORDER BY article_category_id'; |
| 537 | 537 | $result = $this->db->query($sql); |
| 538 | 538 | if (!$result) { |
@@ -600,17 +600,17 @@ discard block |
||
| 600 | 600 | */ |
| 601 | 601 | public function moveUp($currentId, $currentOrder) |
| 602 | 602 | { |
| 603 | - $sql_plus = 'SELECT article_id FROM ' . $this->table . ' WHERE article_weight = ' . ((int)$currentOrder - 1); |
|
| 603 | + $sql_plus = 'SELECT article_id FROM '.$this->table.' WHERE article_weight = '.((int) $currentOrder - 1); |
|
| 604 | 604 | $res_plus = $this->db->query($sql_plus); |
| 605 | 605 | if ($this->db->getRowsNum($res_plus) == 0) { |
| 606 | 606 | return; |
| 607 | 607 | } |
| 608 | 608 | $row_plus = $this->db->fetchArray($res_plus); |
| 609 | 609 | |
| 610 | - $upd1 = 'UPDATE ' . $this->table . ' SET article_weight = (article_weight + 1) WHERE article_id = ' . $row_plus['article_id']; |
|
| 610 | + $upd1 = 'UPDATE '.$this->table.' SET article_weight = (article_weight + 1) WHERE article_id = '.$row_plus['article_id']; |
|
| 611 | 611 | $this->db->queryF($upd1); |
| 612 | 612 | |
| 613 | - $upd2 = 'UPDATE ' . $this->table . ' SET article_weight = (article_weight - 1) WHERE article_id = ' . (int)$currentId; |
|
| 613 | + $upd2 = 'UPDATE '.$this->table.' SET article_weight = (article_weight - 1) WHERE article_id = '.(int) $currentId; |
|
| 614 | 614 | $this->db->queryF($upd2); |
| 615 | 615 | $this->forceCacheClean(); |
| 616 | 616 | } |
@@ -624,17 +624,17 @@ discard block |
||
| 624 | 624 | */ |
| 625 | 625 | public function moveDown($currentId, $currentOrder) |
| 626 | 626 | { |
| 627 | - $sql_moins = 'SELECT article_id FROM ' . $this->table . ' WHERE article_weight = ' . ((int)$currentOrder + 1); |
|
| 627 | + $sql_moins = 'SELECT article_id FROM '.$this->table.' WHERE article_weight = '.((int) $currentOrder + 1); |
|
| 628 | 628 | $res_moins = $this->db->query($sql_moins); |
| 629 | 629 | if ($this->db->getRowsNum($res_moins) == 0) { |
| 630 | 630 | return; |
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | $row_moins = $this->db->fetchArray($res_moins); |
| 634 | - $upd1 = 'UPDATE ' . $this->table . ' SET article_weight = (article_weight - 1) WHERE article_id = ' . $row_moins['article_id']; |
|
| 634 | + $upd1 = 'UPDATE '.$this->table.' SET article_weight = (article_weight - 1) WHERE article_id = '.$row_moins['article_id']; |
|
| 635 | 635 | $this->db->queryF($upd1); |
| 636 | 636 | |
| 637 | - $upd2 = 'UPDATE ' . $this->table . ' SET article_weight =( article_weight + 1) WHERE article_id = ' . (int)$currentId; |
|
| 637 | + $upd2 = 'UPDATE '.$this->table.' SET article_weight =( article_weight + 1) WHERE article_id = '.(int) $currentId; |
|
| 638 | 638 | $this->db->queryF($upd2); |
| 639 | 639 | $this->forceCacheClean(); |
| 640 | 640 | } |
@@ -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 | */ |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | die('XOOPS root path not defined'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | -require_once XOOPS_ROOT_PATH . '/kernel/object.php'; |
|
| 25 | +require_once XOOPS_ROOT_PATH.'/kernel/object.php'; |
|
| 26 | 26 | if (!class_exists('references_XoopsPersistableObjectHandler')) { |
| 27 | - require_once XOOPS_ROOT_PATH . '/modules/references/class/PersistableObjectHandler.php'; |
|
| 27 | + require_once XOOPS_ROOT_PATH.'/modules/references/class/PersistableObjectHandler.php'; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | class references_categories extends references_Object |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | public function getUrl($shortVersion = false) |
| 59 | 59 | { |
| 60 | 60 | if (!$shortVersion) { |
| 61 | - return REFERENCES_URL . 'category.php?category_id=' . $this->getVar('category_id'); |
|
| 61 | + return REFERENCES_URL.'category.php?category_id='.$this->getVar('category_id'); |
|
| 62 | 62 | } else { |
| 63 | - return 'category.php?category_id=' . $this->getVar('category_id'); |
|
| 63 | + return 'category.php?category_id='.$this->getVar('category_id'); |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $gperm_handler = xoops_getHandler('groupperm'); |
| 111 | 111 | $categories = $gperm_handler->getItemIds($permissionsType, $groups, $currentModule->getVar('mid')); |
| 112 | 112 | if (is_array($categories) && count($categories) > 0) { |
| 113 | - $permissions[$permissionsType] = new Criteria('category_id', '(' . implode(',', $categories) . ')', 'IN'); |
|
| 113 | + $permissions[$permissionsType] = new Criteria('category_id', '('.implode(',', $categories).')', 'IN'); |
|
| 114 | 114 | } else { // Ne peut rien voir |
| 115 | 115 | $permissions[$permissionsType] = new Criteria('category_id', '0', '='); |
| 116 | 116 | } |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | if (count($categories) == 0) { |
| 177 | 177 | return $ret; |
| 178 | 178 | } |
| 179 | - $jump = REFERENCES_URL . 'category.php?category_id='; |
|
| 180 | - $extra = " onchange='location=\"" . $jump . "\"+this.options[this.selectedIndex].value'"; |
|
| 179 | + $jump = REFERENCES_URL.'category.php?category_id='; |
|
| 180 | + $extra = " onchange='location=\"".$jump."\"+this.options[this.selectedIndex].value'"; |
|
| 181 | 181 | |
| 182 | 182 | return references_utils::htmlSelect($selectName, $categories, $selected, true, '', false, 1, $extra); |
| 183 | 183 | } |
@@ -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'])) { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | /** |
| 49 | 49 | * Access the only instance of this class |
| 50 | 50 | * |
| 51 | - * @return object |
|
| 51 | + * @return references_utils |
|
| 52 | 52 | * |
| 53 | 53 | * @static |
| 54 | 54 | * @staticvar object |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | /** |
| 387 | 387 | * Internal function used to get the handler of the current module |
| 388 | 388 | * |
| 389 | - * @return object The module |
|
| 389 | + * @return integer The module |
|
| 390 | 390 | */ |
| 391 | 391 | public static function getModule() |
| 392 | 392 | { |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | /** |
| 490 | 490 | * V�rifie que l'utilisateur courant fait partie du groupe des administrateurs |
| 491 | 491 | * |
| 492 | - * @return booleean Admin or not |
|
| 492 | + * @return boolean Admin or not |
|
| 493 | 493 | */ |
| 494 | 494 | public static function isAdmin() |
| 495 | 495 | { |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | /** |
| 551 | 551 | * Conversion d'un dateTime Mysql en date lisible en fran�ais |
| 552 | 552 | * @param $dateTime |
| 553 | - * @return bool|string |
|
| 553 | + * @return string |
|
| 554 | 554 | */ |
| 555 | 555 | public static function sqlDateTimeToFrench($dateTime) |
| 556 | 556 | { |
@@ -943,7 +943,7 @@ discard block |
||
| 943 | 943 | * @param null $uploadMaxSize |
| 944 | 944 | * @param null $maxWidth |
| 945 | 945 | * @param null $maxHeight |
| 946 | - * @return mixed True si l'upload s'est bien déroulé sinon le message d'erreur correspondant |
|
| 946 | + * @return boolean|string True si l'upload s'est bien déroulé sinon le message d'erreur correspondant |
|
| 947 | 947 | */ |
| 948 | 948 | public static function uploadFile($indice, $dstpath = XOOPS_UPLOAD_PATH, $mimeTypes = null, $uploadMaxSize = null, $maxWidth = null, $maxHeight = null) |
| 949 | 949 | { |
@@ -1031,7 +1031,7 @@ discard block |
||
| 1031 | 1031 | * |
| 1032 | 1032 | * @param int $duration |
| 1033 | 1033 | * @param integer $startingDate Date de départ (timestamp) |
| 1034 | - * @return bool|string |
|
| 1034 | + * @return string |
|
| 1035 | 1035 | * @internal param int $durations Durée en jours |
| 1036 | 1036 | */ |
| 1037 | 1037 | public static function addDaysToDate($duration = 1, $startingDate = 0) |
@@ -1073,6 +1073,9 @@ discard block |
||
| 1073 | 1073 | return $breadcrumb; |
| 1074 | 1074 | } |
| 1075 | 1075 | |
| 1076 | + /** |
|
| 1077 | + * @param string $string |
|
| 1078 | + */ |
|
| 1076 | 1079 | public static function close_tags($string) |
| 1077 | 1080 | { |
| 1078 | 1081 | // match opened tags |
@@ -1394,7 +1397,7 @@ discard block |
||
| 1394 | 1397 | * Create the <option> of an html select |
| 1395 | 1398 | * |
| 1396 | 1399 | * @param array $array Array of index and labels |
| 1397 | - * @param mixed $default the default value |
|
| 1400 | + * @param integer $default the default value |
|
| 1398 | 1401 | * @param bool $withNull |
| 1399 | 1402 | * @return string |
| 1400 | 1403 | */ |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $x23 = false; |
| 109 | 109 | $xv = str_replace('XOOPS ', '', XOOPS_VERSION); |
| 110 | - if ((int)substr($xv, 2, 1) >= 3) { |
|
| 110 | + if ((int) substr($xv, 2, 1) >= 3) { |
|
| 111 | 111 | $x23 = true; |
| 112 | 112 | } |
| 113 | 113 | |
@@ -147,15 +147,15 @@ discard block |
||
| 147 | 147 | // Only for Xoops 2.0.x |
| 148 | 148 | switch ($editor_option) { |
| 149 | 149 | case 'fckeditor': |
| 150 | - if (is_readable(XOOPS_ROOT_PATH . '/class/fckeditor/formfckeditor.php')) { |
|
| 151 | - require_once(XOOPS_ROOT_PATH . '/class/fckeditor/formfckeditor.php'); |
|
| 150 | + if (is_readable(XOOPS_ROOT_PATH.'/class/fckeditor/formfckeditor.php')) { |
|
| 151 | + require_once(XOOPS_ROOT_PATH.'/class/fckeditor/formfckeditor.php'); |
|
| 152 | 152 | $editor = new XoopsFormFckeditor($caption, $name, $value); |
| 153 | 153 | } |
| 154 | 154 | break; |
| 155 | 155 | |
| 156 | 156 | case 'htmlarea': |
| 157 | - if (is_readable(XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php')) { |
|
| 158 | - require_once(XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php'); |
|
| 157 | + if (is_readable(XOOPS_ROOT_PATH.'/class/htmlarea/formhtmlarea.php')) { |
|
| 158 | + require_once(XOOPS_ROOT_PATH.'/class/htmlarea/formhtmlarea.php'); |
|
| 159 | 159 | $editor = new XoopsFormHtmlarea($caption, $name, $value); |
| 160 | 160 | } |
| 161 | 161 | break; |
@@ -170,15 +170,15 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | case 'tinyeditor': |
| 172 | 172 | case 'tinymce': |
| 173 | - if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinyeditortextarea.php')) { |
|
| 174 | - require_once XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinyeditortextarea.php'; |
|
| 173 | + if (is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinyeditortextarea.php')) { |
|
| 174 | + require_once XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinyeditortextarea.php'; |
|
| 175 | 175 | $editor = new XoopsFormTinyeditorTextArea(array('caption' => $caption, 'name' => $name, 'value' => $value, 'width' => '100%', 'height' => '400px')); |
| 176 | 176 | } |
| 177 | 177 | break; |
| 178 | 178 | |
| 179 | 179 | case 'koivi': |
| 180 | - if (is_readable(XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php')) { |
|
| 181 | - require_once(XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php'); |
|
| 180 | + if (is_readable(XOOPS_ROOT_PATH.'/class/wysiwyg/formwysiwygtextarea.php')) { |
|
| 181 | + require_once(XOOPS_ROOT_PATH.'/class/wysiwyg/formwysiwygtextarea.php'); |
|
| 182 | 182 | $editor = new XoopsFormWysiwygTextArea($caption, $name, $value, $width, $height, ''); |
| 183 | 183 | } |
| 184 | 184 | break; |
@@ -200,9 +200,9 @@ discard block |
||
| 200 | 200 | public static function javascriptLinkConfirm($message, $form = false) |
| 201 | 201 | { |
| 202 | 202 | if (!$form) { |
| 203 | - return "onclick=\"javascript:return confirm('" . str_replace("'", ' ', $message) . "')\""; |
|
| 203 | + return "onclick=\"javascript:return confirm('".str_replace("'", ' ', $message)."')\""; |
|
| 204 | 204 | } else { |
| 205 | - return "onSubmit=\"javascript:return confirm('" . str_replace("'", ' ', $message) . "')\""; |
|
| 205 | + return "onSubmit=\"javascript:return confirm('".str_replace("'", ' ', $message)."')\""; |
|
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | public static function sendEmailFromTpl($tplName, $recipients, $subject, $variables) |
| 283 | 283 | { |
| 284 | 284 | global $xoopsConfig; |
| 285 | - require_once XOOPS_ROOT_PATH . '/class/xoopsmailer.php'; |
|
| 285 | + require_once XOOPS_ROOT_PATH.'/class/xoopsmailer.php'; |
|
| 286 | 286 | if (!is_array($recipients)) { |
| 287 | 287 | if (trim($recipients) == '') { |
| 288 | 288 | return false; |
@@ -293,13 +293,13 @@ discard block |
||
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | if (function_exists('xoops_getMailer')) { |
| 296 | - $xoopsMailer =& xoops_getMailer(); |
|
| 296 | + $xoopsMailer = & xoops_getMailer(); |
|
| 297 | 297 | } else { |
| 298 | - $xoopsMailer =& getMailer(); |
|
| 298 | + $xoopsMailer = & getMailer(); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | $xoopsMailer->useMail(); |
| 302 | - $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH . '/modules/' . self::MODULE_NAME . '/language/' . $xoopsConfig['language'] . '/mail_template'); |
|
| 302 | + $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/'.self::MODULE_NAME.'/language/'.$xoopsConfig['language'].'/mail_template'); |
|
| 303 | 303 | $xoopsMailer->setTemplate($tplName); |
| 304 | 304 | $xoopsMailer->setToEmails($recipients); |
| 305 | 305 | // TODO: Change ! |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | } |
| 312 | 312 | $res = $xoopsMailer->send(); |
| 313 | 313 | unset($xoopsMailer); |
| 314 | - $filename = XOOPS_UPLOAD_PATH . '/logmail_' . self::MODULE_NAME . '.php'; |
|
| 314 | + $filename = XOOPS_UPLOAD_PATH.'/logmail_'.self::MODULE_NAME.'.php'; |
|
| 315 | 315 | if (!file_exists($filename)) { |
| 316 | 316 | $fp = @fopen($filename, 'a'); |
| 317 | 317 | if ($fp) { |
@@ -322,16 +322,16 @@ discard block |
||
| 322 | 322 | $fp = @fopen($filename, 'a'); |
| 323 | 323 | |
| 324 | 324 | if ($fp) { |
| 325 | - fwrite($fp, str_repeat('-', 120) . "\n"); |
|
| 326 | - fwrite($fp, date('d/m/Y H:i:s') . "\n"); |
|
| 327 | - fwrite($fp, 'Template name : ' . $tplName . "\n"); |
|
| 328 | - fwrite($fp, 'Email subject : ' . $subject . "\n"); |
|
| 325 | + fwrite($fp, str_repeat('-', 120)."\n"); |
|
| 326 | + fwrite($fp, date('d/m/Y H:i:s')."\n"); |
|
| 327 | + fwrite($fp, 'Template name : '.$tplName."\n"); |
|
| 328 | + fwrite($fp, 'Email subject : '.$subject."\n"); |
|
| 329 | 329 | if (is_array($recipients)) { |
| 330 | - fwrite($fp, 'Recipient(s) : ' . implode(',', $recipients) . "\n"); |
|
| 330 | + fwrite($fp, 'Recipient(s) : '.implode(',', $recipients)."\n"); |
|
| 331 | 331 | } else { |
| 332 | - fwrite($fp, 'Recipient(s) : ' . $recipients . "\n"); |
|
| 332 | + fwrite($fp, 'Recipient(s) : '.$recipients."\n"); |
|
| 333 | 333 | } |
| 334 | - fwrite($fp, 'Transmited variables : ' . implode(',', $variables) . "\n"); |
|
| 334 | + fwrite($fp, 'Transmited variables : '.implode(',', $variables)."\n"); |
|
| 335 | 335 | fclose($fp); |
| 336 | 336 | } |
| 337 | 337 | |
@@ -346,17 +346,17 @@ discard block |
||
| 346 | 346 | global $xoopsModule; |
| 347 | 347 | $folder = $xoopsModule->getVar('dirname'); |
| 348 | 348 | $tpllist = array(); |
| 349 | - require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php'; |
|
| 350 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 349 | + require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
|
| 350 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 351 | 351 | $tplfile_handler = xoops_getHandler('tplfile'); |
| 352 | 352 | $tpllist = $tplfile_handler->find(null, null, null, $folder); |
| 353 | - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); // Clear module's blocks cache |
|
| 353 | + xoops_template_clear_module_cache($xoopsModule->getVar('mid')); // Clear module's blocks cache |
|
| 354 | 354 | |
| 355 | 355 | foreach ($tpllist as $onetemplate) { // Remove cache for each page. |
| 356 | 356 | if ($onetemplate->getVar('tpl_type') === 'module') { |
| 357 | 357 | // Note, I've been testing all the other methods (like the one of Smarty) and none of them run, that's why I have used this code |
| 358 | 358 | $files_del = array(); |
| 359 | - $files_del = glob(XOOPS_CACHE_PATH . '/*' . $onetemplate->getVar('tpl_file') . '*'); |
|
| 359 | + $files_del = glob(XOOPS_CACHE_PATH.'/*'.$onetemplate->getVar('tpl_file').'*'); |
|
| 360 | 360 | if (count($files_del) > 0 && is_array($files_del)) { |
| 361 | 361 | foreach ($files_del as $one_file) { |
| 362 | 362 | if (is_file($one_file)) { |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | if (!isset($mymodule)) { |
| 393 | 393 | global $xoopsModule; |
| 394 | 394 | if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == REFERENCES_DIRNAME) { |
| 395 | - $mymodule =& $xoopsModule; |
|
| 395 | + $mymodule = & $xoopsModule; |
|
| 396 | 396 | } else { |
| 397 | 397 | $hModule = xoops_getHandler('module'); |
| 398 | 398 | $mymodule = $hModule->getByDirname(REFERENCES_DIRNAME); |
@@ -510,12 +510,12 @@ discard block |
||
| 510 | 510 | */ |
| 511 | 511 | public static function getCurrentSQLDate() |
| 512 | 512 | { |
| 513 | - return date('Y-m-d'); // 2007-05-02 |
|
| 513 | + return date('Y-m-d'); // 2007-05-02 |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | public static function getCurrentSQLDateTime() |
| 517 | 517 | { |
| 518 | - return date('Y-m-d H:i:s'); // 2007-05-02 |
|
| 518 | + return date('Y-m-d H:i:s'); // 2007-05-02 |
|
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | /** |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | */ |
| 543 | 543 | public static function timestampToMysqlDate($timestamp) |
| 544 | 544 | { |
| 545 | - return date('Y-m-d', (int)$timestamp); |
|
| 545 | + return date('Y-m-d', (int) $timestamp); |
|
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | /** |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | } |
| 581 | 581 | if (strpos(strtolower(XOOPS_VERSION), 'legacy') === false) { |
| 582 | 582 | $xv = xoops_trim(str_replace('XOOPS ', '', XOOPS_VERSION)); |
| 583 | - if ((int)substr($xv, 4, 2) >= 17) { |
|
| 583 | + if ((int) substr($xv, 4, 2) >= 17) { |
|
| 584 | 584 | return false; |
| 585 | 585 | } |
| 586 | 586 | } |
@@ -643,25 +643,25 @@ discard block |
||
| 643 | 643 | } |
| 644 | 644 | $ext = basename($fileName); |
| 645 | 645 | $ext = explode('.', $ext); |
| 646 | - $ext = '.' . $ext[count($ext) - 1]; |
|
| 646 | + $ext = '.'.$ext[count($ext) - 1]; |
|
| 647 | 647 | $true = true; |
| 648 | 648 | while ($true) { |
| 649 | 649 | $ipbits = explode('.', $_SERVER['REMOTE_ADDR']); |
| 650 | 650 | list($usec, $sec) = explode(' ', microtime()); |
| 651 | - $usec = (integer)($usec * 65536); |
|
| 652 | - $sec = ((integer)$sec) & 0xFFFF; |
|
| 651 | + $usec = (integer) ($usec * 65536); |
|
| 652 | + $sec = ((integer) $sec)&0xFFFF; |
|
| 653 | 653 | |
| 654 | 654 | if ($trimName) { |
| 655 | - $uid = sprintf('%06x%04x%04x', ($ipbits[0] << 24) | ($ipbits[1] << 16) | ($ipbits[2] << 8) | $ipbits[3], $sec, $usec); |
|
| 655 | + $uid = sprintf('%06x%04x%04x', ($ipbits[0] << 24)|($ipbits[1] << 16)|($ipbits[2] << 8)|$ipbits[3], $sec, $usec); |
|
| 656 | 656 | } else { |
| 657 | - $uid = sprintf('%08x-%04x-%04x', ($ipbits[0] << 24) | ($ipbits[1] << 16) | ($ipbits[2] << 8) | $ipbits[3], $sec, $usec); |
|
| 657 | + $uid = sprintf('%08x-%04x-%04x', ($ipbits[0] << 24)|($ipbits[1] << 16)|($ipbits[2] << 8)|$ipbits[3], $sec, $usec); |
|
| 658 | 658 | } |
| 659 | - if (!file_exists($workingfolder . $uid . $ext)) { |
|
| 659 | + if (!file_exists($workingfolder.$uid.$ext)) { |
|
| 660 | 660 | $true = false; |
| 661 | 661 | } |
| 662 | 662 | } |
| 663 | 663 | |
| 664 | - return $uid . $ext; |
|
| 664 | + return $uid.$ext; |
|
| 665 | 665 | } |
| 666 | 666 | |
| 667 | 667 | /** |
@@ -676,135 +676,135 @@ discard block |
||
| 676 | 676 | $chaine = html_entity_decode($chaine); |
| 677 | 677 | |
| 678 | 678 | for ($i = 0; $i <= 255; ++$i) { |
| 679 | - $search[] = '&#' . $i . ';'; |
|
| 679 | + $search[] = '&#'.$i.';'; |
|
| 680 | 680 | $replace[] = chr($i); |
| 681 | 681 | } |
| 682 | - $replace[]='...'; $search[]='…'; |
|
| 683 | - $replace[]="'"; $search[]='‘'; |
|
| 684 | - $replace[]="'"; $search[]= '’'; |
|
| 685 | - $replace[]='-'; $search[] = '•'; // $replace[] = '•'; |
|
| 686 | - $replace[]='—'; $search[]='—'; |
|
| 687 | - $replace[]='-'; $search[]='–'; |
|
| 688 | - $replace[]='-'; $search[]='­'; |
|
| 689 | - $replace[]='"'; $search[]='"'; |
|
| 690 | - $replace[]='&'; $search[]='&'; |
|
| 691 | - $replace[]='ˆ'; $search[]='ˆ'; |
|
| 692 | - $replace[]='¡'; $search[]='¡'; |
|
| 693 | - $replace[]='¦'; $search[]='¦'; |
|
| 694 | - $replace[]='¨'; $search[]='¨'; |
|
| 695 | - $replace[]='¯'; $search[]='¯'; |
|
| 696 | - $replace[]='´'; $search[]='´'; |
|
| 697 | - $replace[]='¸'; $search[]='¸'; |
|
| 698 | - $replace[]='¿'; $search[]='¿'; |
|
| 699 | - $replace[]='˜'; $search[]='˜'; |
|
| 700 | - $replace[]="'"; $search[]='‘'; // $replace[]='‘'; |
|
| 701 | - $replace[]="'"; $search[]='’'; // $replace[]='’'; |
|
| 702 | - $replace[]='‚'; $search[]='‚'; |
|
| 703 | - $replace[]="'"; $search[]='“'; // $replace[]='“'; |
|
| 704 | - $replace[]="'"; $search[]='”'; // $replace[]='”'; |
|
| 705 | - $replace[]='„'; $search[]='„'; |
|
| 706 | - $replace[]='‹'; $search[]='‹'; |
|
| 707 | - $replace[]='›'; $search[]='›'; |
|
| 708 | - $replace[]='<'; $search[]='<'; |
|
| 709 | - $replace[]='>'; $search[]='>'; |
|
| 710 | - $replace[]='±'; $search[]='±'; |
|
| 711 | - $replace[]='«'; $search[]='«'; |
|
| 712 | - $replace[]='»'; $search[]='»'; |
|
| 713 | - $replace[]='×'; $search[]='×'; |
|
| 714 | - $replace[]='÷'; $search[]='÷'; |
|
| 715 | - $replace[]='¢'; $search[]='¢'; |
|
| 716 | - $replace[]='£'; $search[]='£'; |
|
| 717 | - $replace[]='¤'; $search[]='¤'; |
|
| 718 | - $replace[]='¥'; $search[]='¥'; |
|
| 719 | - $replace[]='§'; $search[]='§'; |
|
| 720 | - $replace[]='©'; $search[]='©'; |
|
| 721 | - $replace[]='¬'; $search[]='¬'; |
|
| 722 | - $replace[]='®'; $search[]='®'; |
|
| 723 | - $replace[]='°'; $search[]='°'; |
|
| 724 | - $replace[]='µ'; $search[]='µ'; |
|
| 725 | - $replace[]='¶'; $search[]='¶'; |
|
| 726 | - $replace[]='·'; $search[]='·'; |
|
| 727 | - $replace[]='†'; $search[]='†'; |
|
| 728 | - $replace[]='‡'; $search[]='‡'; |
|
| 729 | - $replace[]='‰'; $search[]='‰'; |
|
| 730 | - $replace[]='Euro'; $search[]='€'; // $replace[]='€' |
|
| 731 | - $replace[]='¼'; $search[]='¼'; |
|
| 732 | - $replace[]='½'; $search[]='½'; |
|
| 733 | - $replace[]='¾'; $search[]='¾'; |
|
| 734 | - $replace[]='¹'; $search[]='¹'; |
|
| 735 | - $replace[]='²'; $search[]='²'; |
|
| 736 | - $replace[]='³'; $search[]='³'; |
|
| 737 | - $replace[]='á'; $search[]='á'; |
|
| 738 | - $replace[]='Á'; $search[]='Á'; |
|
| 739 | - $replace[]='â'; $search[]='â'; |
|
| 740 | - $replace[]='Â'; $search[]='Â'; |
|
| 741 | - $replace[]='à'; $search[]='à'; |
|
| 742 | - $replace[]='À'; $search[]='À'; |
|
| 743 | - $replace[]='å'; $search[]='å'; |
|
| 744 | - $replace[]='Å'; $search[]='Å'; |
|
| 745 | - $replace[]='ã'; $search[]='ã'; |
|
| 746 | - $replace[]='Ã'; $search[]='Ã'; |
|
| 747 | - $replace[]='ä'; $search[]='ä'; |
|
| 748 | - $replace[]='Ä'; $search[]='Ä'; |
|
| 749 | - $replace[]='ª'; $search[]='ª'; |
|
| 750 | - $replace[]='æ'; $search[]='æ'; |
|
| 751 | - $replace[]='Æ'; $search[]='Æ'; |
|
| 752 | - $replace[]='ç'; $search[]='ç'; |
|
| 753 | - $replace[]='Ç'; $search[]='Ç'; |
|
| 754 | - $replace[]='ð'; $search[]='ð'; |
|
| 755 | - $replace[]='Ð'; $search[]='Ð'; |
|
| 756 | - $replace[]='é'; $search[]='é'; |
|
| 757 | - $replace[]='É'; $search[]='É'; |
|
| 758 | - $replace[]='ê'; $search[]='ê'; |
|
| 759 | - $replace[]='Ê'; $search[]='Ê'; |
|
| 760 | - $replace[]='è'; $search[]='è'; |
|
| 761 | - $replace[]='È'; $search[]='È'; |
|
| 762 | - $replace[]='ë'; $search[]='ë'; |
|
| 763 | - $replace[]='Ë'; $search[]='Ë'; |
|
| 764 | - $replace[]='ƒ'; $search[]='ƒ'; |
|
| 765 | - $replace[]='í'; $search[]='í'; |
|
| 766 | - $replace[]='Í'; $search[]='Í'; |
|
| 767 | - $replace[]='î'; $search[]='î'; |
|
| 768 | - $replace[]='Î'; $search[]='Î'; |
|
| 769 | - $replace[]='ì'; $search[]='ì'; |
|
| 770 | - $replace[]='Ì'; $search[]='Ì'; |
|
| 771 | - $replace[]='ï'; $search[]='ï'; |
|
| 772 | - $replace[]='Ï'; $search[]='Ï'; |
|
| 773 | - $replace[]='ñ'; $search[]='ñ'; |
|
| 774 | - $replace[]='Ñ'; $search[]='Ñ'; |
|
| 775 | - $replace[]='ó'; $search[]='ó'; |
|
| 776 | - $replace[]='Ó'; $search[]='Ó'; |
|
| 777 | - $replace[]='ô'; $search[]='ô'; |
|
| 778 | - $replace[]='Ô'; $search[]='Ô'; |
|
| 779 | - $replace[]='ò'; $search[]='ò'; |
|
| 780 | - $replace[]='Ò'; $search[]='Ò'; |
|
| 781 | - $replace[]='º'; $search[]='º'; |
|
| 782 | - $replace[]='ø'; $search[]='ø'; |
|
| 783 | - $replace[]='Ø'; $search[]='Ø'; |
|
| 784 | - $replace[]='õ'; $search[]='õ'; |
|
| 785 | - $replace[]='Õ'; $search[]='Õ'; |
|
| 786 | - $replace[]='ö'; $search[]='ö'; |
|
| 787 | - $replace[]='Ö'; $search[]='Ö'; |
|
| 788 | - $replace[]='œ'; $search[]='œ'; |
|
| 789 | - $replace[]='Œ'; $search[]='Œ'; |
|
| 790 | - $replace[]='š'; $search[]='š'; |
|
| 791 | - $replace[]='Š'; $search[]='Š'; |
|
| 792 | - $replace[]='ß'; $search[]='ß'; |
|
| 793 | - $replace[]='þ'; $search[]='þ'; |
|
| 794 | - $replace[]='Þ'; $search[]='Þ'; |
|
| 795 | - $replace[]='ú'; $search[]='ú'; |
|
| 796 | - $replace[]='Ú'; $search[]='Ú'; |
|
| 797 | - $replace[]='û'; $search[]='û'; |
|
| 798 | - $replace[]='Û'; $search[]='Û'; |
|
| 799 | - $replace[]='ù'; $search[]='ù'; |
|
| 800 | - $replace[]='Ù'; $search[]='Ù'; |
|
| 801 | - $replace[]='ü'; $search[]='ü'; |
|
| 802 | - $replace[]='Ü'; $search[]='Ü'; |
|
| 803 | - $replace[]='ý'; $search[]='ý'; |
|
| 804 | - $replace[]='Ý'; $search[]='Ý'; |
|
| 805 | - $replace[]='ÿ'; $search[]='ÿ'; |
|
| 806 | - $replace[]='Ÿ'; $search[]='Ÿ'; |
|
| 807 | - $chaine = str_replace($search, $replace, $chaine); |
|
| 682 | + $replace[] = '...'; $search[] = '…'; |
|
| 683 | + $replace[] = "'"; $search[] = '‘'; |
|
| 684 | + $replace[] = "'"; $search[] = '’'; |
|
| 685 | + $replace[] = '-'; $search[] = '•'; // $replace[] = '•'; |
|
| 686 | + $replace[] = '—'; $search[] = '—'; |
|
| 687 | + $replace[] = '-'; $search[] = '–'; |
|
| 688 | + $replace[] = '-'; $search[] = '­'; |
|
| 689 | + $replace[] = '"'; $search[] = '"'; |
|
| 690 | + $replace[] = '&'; $search[] = '&'; |
|
| 691 | + $replace[] = 'ˆ'; $search[] = 'ˆ'; |
|
| 692 | + $replace[] = '¡'; $search[] = '¡'; |
|
| 693 | + $replace[] = '¦'; $search[] = '¦'; |
|
| 694 | + $replace[] = '¨'; $search[] = '¨'; |
|
| 695 | + $replace[] = '¯'; $search[] = '¯'; |
|
| 696 | + $replace[] = '´'; $search[] = '´'; |
|
| 697 | + $replace[] = '¸'; $search[] = '¸'; |
|
| 698 | + $replace[] = '¿'; $search[] = '¿'; |
|
| 699 | + $replace[] = '˜'; $search[] = '˜'; |
|
| 700 | + $replace[] = "'"; $search[] = '‘'; // $replace[]='‘'; |
|
| 701 | + $replace[] = "'"; $search[] = '’'; // $replace[]='’'; |
|
| 702 | + $replace[] = '‚'; $search[] = '‚'; |
|
| 703 | + $replace[] = "'"; $search[] = '“'; // $replace[]='“'; |
|
| 704 | + $replace[] = "'"; $search[] = '”'; // $replace[]='”'; |
|
| 705 | + $replace[] = '„'; $search[] = '„'; |
|
| 706 | + $replace[] = '‹'; $search[] = '‹'; |
|
| 707 | + $replace[] = '›'; $search[] = '›'; |
|
| 708 | + $replace[] = '<'; $search[] = '<'; |
|
| 709 | + $replace[] = '>'; $search[] = '>'; |
|
| 710 | + $replace[] = '±'; $search[] = '±'; |
|
| 711 | + $replace[] = '«'; $search[] = '«'; |
|
| 712 | + $replace[] = '»'; $search[] = '»'; |
|
| 713 | + $replace[] = '×'; $search[] = '×'; |
|
| 714 | + $replace[] = '÷'; $search[] = '÷'; |
|
| 715 | + $replace[] = '¢'; $search[] = '¢'; |
|
| 716 | + $replace[] = '£'; $search[] = '£'; |
|
| 717 | + $replace[] = '¤'; $search[] = '¤'; |
|
| 718 | + $replace[] = '¥'; $search[] = '¥'; |
|
| 719 | + $replace[] = '§'; $search[] = '§'; |
|
| 720 | + $replace[] = '©'; $search[] = '©'; |
|
| 721 | + $replace[] = '¬'; $search[] = '¬'; |
|
| 722 | + $replace[] = '®'; $search[] = '®'; |
|
| 723 | + $replace[] = '°'; $search[] = '°'; |
|
| 724 | + $replace[] = 'µ'; $search[] = 'µ'; |
|
| 725 | + $replace[] = '¶'; $search[] = '¶'; |
|
| 726 | + $replace[] = '·'; $search[] = '·'; |
|
| 727 | + $replace[] = '†'; $search[] = '†'; |
|
| 728 | + $replace[] = '‡'; $search[] = '‡'; |
|
| 729 | + $replace[] = '‰'; $search[] = '‰'; |
|
| 730 | + $replace[] = 'Euro'; $search[] = '€'; // $replace[]='€' |
|
| 731 | + $replace[] = '¼'; $search[] = '¼'; |
|
| 732 | + $replace[] = '½'; $search[] = '½'; |
|
| 733 | + $replace[] = '¾'; $search[] = '¾'; |
|
| 734 | + $replace[] = '¹'; $search[] = '¹'; |
|
| 735 | + $replace[] = '²'; $search[] = '²'; |
|
| 736 | + $replace[] = '³'; $search[] = '³'; |
|
| 737 | + $replace[] = 'á'; $search[] = 'á'; |
|
| 738 | + $replace[] = 'Á'; $search[] = 'Á'; |
|
| 739 | + $replace[] = 'â'; $search[] = 'â'; |
|
| 740 | + $replace[] = 'Â'; $search[] = 'Â'; |
|
| 741 | + $replace[] = 'à'; $search[] = 'à'; |
|
| 742 | + $replace[] = 'À'; $search[] = 'À'; |
|
| 743 | + $replace[] = 'å'; $search[] = 'å'; |
|
| 744 | + $replace[] = 'Å'; $search[] = 'Å'; |
|
| 745 | + $replace[] = 'ã'; $search[] = 'ã'; |
|
| 746 | + $replace[] = 'Ã'; $search[] = 'Ã'; |
|
| 747 | + $replace[] = 'ä'; $search[] = 'ä'; |
|
| 748 | + $replace[] = 'Ä'; $search[] = 'Ä'; |
|
| 749 | + $replace[] = 'ª'; $search[] = 'ª'; |
|
| 750 | + $replace[] = 'æ'; $search[] = 'æ'; |
|
| 751 | + $replace[] = 'Æ'; $search[] = 'Æ'; |
|
| 752 | + $replace[] = 'ç'; $search[] = 'ç'; |
|
| 753 | + $replace[] = 'Ç'; $search[] = 'Ç'; |
|
| 754 | + $replace[] = 'ð'; $search[] = 'ð'; |
|
| 755 | + $replace[] = 'Ð'; $search[] = 'Ð'; |
|
| 756 | + $replace[] = 'é'; $search[] = 'é'; |
|
| 757 | + $replace[] = 'É'; $search[] = 'É'; |
|
| 758 | + $replace[] = 'ê'; $search[] = 'ê'; |
|
| 759 | + $replace[] = 'Ê'; $search[] = 'Ê'; |
|
| 760 | + $replace[] = 'è'; $search[] = 'è'; |
|
| 761 | + $replace[] = 'È'; $search[] = 'È'; |
|
| 762 | + $replace[] = 'ë'; $search[] = 'ë'; |
|
| 763 | + $replace[] = 'Ë'; $search[] = 'Ë'; |
|
| 764 | + $replace[] = 'ƒ'; $search[] = 'ƒ'; |
|
| 765 | + $replace[] = 'í'; $search[] = 'í'; |
|
| 766 | + $replace[] = 'Í'; $search[] = 'Í'; |
|
| 767 | + $replace[] = 'î'; $search[] = 'î'; |
|
| 768 | + $replace[] = 'Î'; $search[] = 'Î'; |
|
| 769 | + $replace[] = 'ì'; $search[] = 'ì'; |
|
| 770 | + $replace[] = 'Ì'; $search[] = 'Ì'; |
|
| 771 | + $replace[] = 'ï'; $search[] = 'ï'; |
|
| 772 | + $replace[] = 'Ï'; $search[] = 'Ï'; |
|
| 773 | + $replace[] = 'ñ'; $search[] = 'ñ'; |
|
| 774 | + $replace[] = 'Ñ'; $search[] = 'Ñ'; |
|
| 775 | + $replace[] = 'ó'; $search[] = 'ó'; |
|
| 776 | + $replace[] = 'Ó'; $search[] = 'Ó'; |
|
| 777 | + $replace[] = 'ô'; $search[] = 'ô'; |
|
| 778 | + $replace[] = 'Ô'; $search[] = 'Ô'; |
|
| 779 | + $replace[] = 'ò'; $search[] = 'ò'; |
|
| 780 | + $replace[] = 'Ò'; $search[] = 'Ò'; |
|
| 781 | + $replace[] = 'º'; $search[] = 'º'; |
|
| 782 | + $replace[] = 'ø'; $search[] = 'ø'; |
|
| 783 | + $replace[] = 'Ø'; $search[] = 'Ø'; |
|
| 784 | + $replace[] = 'õ'; $search[] = 'õ'; |
|
| 785 | + $replace[] = 'Õ'; $search[] = 'Õ'; |
|
| 786 | + $replace[] = 'ö'; $search[] = 'ö'; |
|
| 787 | + $replace[] = 'Ö'; $search[] = 'Ö'; |
|
| 788 | + $replace[] = 'œ'; $search[] = 'œ'; |
|
| 789 | + $replace[] = 'Œ'; $search[] = 'Œ'; |
|
| 790 | + $replace[] = 'š'; $search[] = 'š'; |
|
| 791 | + $replace[] = 'Š'; $search[] = 'Š'; |
|
| 792 | + $replace[] = 'ß'; $search[] = 'ß'; |
|
| 793 | + $replace[] = 'þ'; $search[] = 'þ'; |
|
| 794 | + $replace[] = 'Þ'; $search[] = 'Þ'; |
|
| 795 | + $replace[] = 'ú'; $search[] = 'ú'; |
|
| 796 | + $replace[] = 'Ú'; $search[] = 'Ú'; |
|
| 797 | + $replace[] = 'û'; $search[] = 'û'; |
|
| 798 | + $replace[] = 'Û'; $search[] = 'Û'; |
|
| 799 | + $replace[] = 'ù'; $search[] = 'ù'; |
|
| 800 | + $replace[] = 'Ù'; $search[] = 'Ù'; |
|
| 801 | + $replace[] = 'ü'; $search[] = 'ü'; |
|
| 802 | + $replace[] = 'Ü'; $search[] = 'Ü'; |
|
| 803 | + $replace[] = 'ý'; $search[] = 'ý'; |
|
| 804 | + $replace[] = 'Ý'; $search[] = 'Ý'; |
|
| 805 | + $replace[] = 'ÿ'; $search[] = 'ÿ'; |
|
| 806 | + $replace[] = 'Ÿ'; $search[] = 'Ÿ'; |
|
| 807 | + $chaine = str_replace($search, $replace, $chaine); |
|
| 808 | 808 | |
| 809 | 809 | return $chaine; |
| 810 | 810 | } |
@@ -821,11 +821,11 @@ discard block |
||
| 821 | 821 | { |
| 822 | 822 | $s = "ÀÁÂÃÄÅÒÓÔÕÖØÈÉÊËÇÌÍÎÏÙÚÛÜŸÑàáâãäåòóôõöøèéêëçìíîïùúûüÿñ '()"; |
| 823 | 823 | $r = 'AAAAAAOOOOOOEEEECIIIIUUUUYNaaaaaaooooooeeeeciiiiuuuuyn----'; |
| 824 | - $content = self::unhtml($content); // First, remove html entities |
|
| 824 | + $content = self::unhtml($content); // First, remove html entities |
|
| 825 | 825 | $content = strtr($content, $s, $r); |
| 826 | 826 | $content = strip_tags($content); |
| 827 | 827 | $content = strtolower($content); |
| 828 | - $content = htmlentities($content); // TODO: Vérifier |
|
| 828 | + $content = htmlentities($content); // TODO: Vérifier |
|
| 829 | 829 | $content = preg_replace('/&([a-zA-Z])(uml|acute|grave|circ|tilde);/', '$1', $content); |
| 830 | 830 | $content = html_entity_decode($content); |
| 831 | 831 | $content = eregi_replace('quot', ' ', $content); |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | $keywords = ''; |
| 841 | 841 | foreach ($words as $word) { |
| 842 | 842 | if (strlen($word) >= $urw) { |
| 843 | - $keywords .= '-' . trim($word); |
|
| 843 | + $keywords .= '-'.trim($word); |
|
| 844 | 844 | } |
| 845 | 845 | } |
| 846 | 846 | if (!$keywords) { |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | $limit = $_SESSION['references_keywords_limit']; |
| 876 | 876 | } else { |
| 877 | 877 | $config_handler = xoops_getHandler('config'); |
| 878 | - $xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH); |
|
| 878 | + $xoopsConfigSearch = & $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH); |
|
| 879 | 879 | $limit = $xoopsConfigSearch['keyword_min']; |
| 880 | 880 | $_SESSION['references_keywords_limit'] = $limit; |
| 881 | 881 | } |
@@ -923,7 +923,7 @@ discard block |
||
| 923 | 923 | if (!isset($config_handler) || !is_object($config_handler)) { |
| 924 | 924 | $config_handler = xoops_getHandler('config'); |
| 925 | 925 | } |
| 926 | - $xoopsConfigMetaFooter =& $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER); |
|
| 926 | + $xoopsConfigMetaFooter = & $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER); |
|
| 927 | 927 | if (isset($xoopsConfigMetaFooter['meta_keywords'])) { |
| 928 | 928 | return $xoopsConfigMetaFooter['meta_keywords']; |
| 929 | 929 | } else { |
@@ -945,10 +945,10 @@ discard block |
||
| 945 | 945 | */ |
| 946 | 946 | public static function uploadFile($indice, $dstpath = XOOPS_UPLOAD_PATH, $mimeTypes = null, $uploadMaxSize = null, $maxWidth = null, $maxHeight = null) |
| 947 | 947 | { |
| 948 | - require_once XOOPS_ROOT_PATH . '/class/uploader.php'; |
|
| 948 | + require_once XOOPS_ROOT_PATH.'/class/uploader.php'; |
|
| 949 | 949 | global $destname; |
| 950 | 950 | if (isset($_POST['xoops_upload_file'])) { |
| 951 | - require_once XOOPS_ROOT_PATH . '/class/uploader.php'; |
|
| 951 | + require_once XOOPS_ROOT_PATH.'/class/uploader.php'; |
|
| 952 | 952 | $fldname = ''; |
| 953 | 953 | $fldname = $_FILES[$_POST['xoops_upload_file'][$indice]]; |
| 954 | 954 | $fldname = get_magic_quotes_gpc() ? stripslashes($fldname['name']) : $fldname['name']; |
@@ -972,7 +972,7 @@ discard block |
||
| 972 | 972 | if ($uploader->upload()) { |
| 973 | 973 | return true; |
| 974 | 974 | } else { |
| 975 | - return _ERRORS . ' ' . htmlentities($uploader->getErrors()); |
|
| 975 | + return _ERRORS.' '.htmlentities($uploader->getErrors()); |
|
| 976 | 976 | } |
| 977 | 977 | } else { |
| 978 | 978 | return htmlentities($uploader->getErrors()); |
@@ -1055,9 +1055,9 @@ discard block |
||
| 1055 | 1055 | $workingBreadcrumb = array(); |
| 1056 | 1056 | if (is_array($path)) { |
| 1057 | 1057 | $moduleName = self::getModuleName(); |
| 1058 | - $workingBreadcrumb[] = "<a href='" . REFERENCES_URL . "' title='" . self::makeHrefTitle($moduleName) . "'>" . $moduleName . '</a>'; |
|
| 1058 | + $workingBreadcrumb[] = "<a href='".REFERENCES_URL."' title='".self::makeHrefTitle($moduleName)."'>".$moduleName.'</a>'; |
|
| 1059 | 1059 | foreach ($path as $url => $title) { |
| 1060 | - $workingBreadcrumb[] = "<a href='" . $url . "'>" . $title . '</a>'; |
|
| 1060 | + $workingBreadcrumb[] = "<a href='".$url."'>".$title.'</a>'; |
|
| 1061 | 1061 | } |
| 1062 | 1062 | $cnt = count($workingBreadcrumb); |
| 1063 | 1063 | for ($i = 0; $i < $cnt; ++$i) { |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | |
| 1097 | 1097 | $complete_tags = array_reverse($complete_tags); |
| 1098 | 1098 | for ($i = 0; $i < count($complete_tags); ++$i) { |
| 1099 | - $string .= '</' . $complete_tags[$i] . '>'; |
|
| 1099 | + $string .= '</'.$complete_tags[$i].'>'; |
|
| 1100 | 1100 | } |
| 1101 | 1101 | } |
| 1102 | 1102 | |
@@ -1117,7 +1117,7 @@ discard block |
||
| 1117 | 1117 | $string = self::close_tags($string); |
| 1118 | 1118 | } |
| 1119 | 1119 | |
| 1120 | - return $string . $etc; |
|
| 1120 | + return $string.$etc; |
|
| 1121 | 1121 | } else { |
| 1122 | 1122 | return $string; |
| 1123 | 1123 | } |
@@ -1149,7 +1149,7 @@ discard block |
||
| 1149 | 1149 | public static function getMimeType($filename) |
| 1150 | 1150 | { |
| 1151 | 1151 | if (function_exists('finfo_open')) { |
| 1152 | - $pathToMagic = REFERENCES_PATH . 'mime/magic'; |
|
| 1152 | + $pathToMagic = REFERENCES_PATH.'mime/magic'; |
|
| 1153 | 1153 | $finfo = new finfo(FILEINFO_MIME, $pathToMagic); |
| 1154 | 1154 | $mimetype = $finfo->file($filename); |
| 1155 | 1155 | finfo_close($finfo); |
@@ -1179,7 +1179,7 @@ discard block |
||
| 1179 | 1179 | sort($xoopsUsersIDs); |
| 1180 | 1180 | if (count($xoopsUsersIDs) > 0) { |
| 1181 | 1181 | $member_handler = xoops_getHandler('user'); |
| 1182 | - $criteria = new Criteria('uid', '(' . implode(',', $xoopsUsersIDs) . ')', 'IN'); |
|
| 1182 | + $criteria = new Criteria('uid', '('.implode(',', $xoopsUsersIDs).')', 'IN'); |
|
| 1183 | 1183 | $criteria->setSort('uid'); |
| 1184 | 1184 | $users = $member_handler->getObjects($criteria, true); |
| 1185 | 1185 | } |
@@ -1217,7 +1217,7 @@ discard block |
||
| 1217 | 1217 | } else { |
| 1218 | 1218 | if ($uid > 0) { |
| 1219 | 1219 | $member_handler = xoops_getHandler('member'); |
| 1220 | - $buffer[$uid] = $member_handler->getGroupsByUser($uid, false); // Renvoie un tableau d'ID (de groupes) |
|
| 1220 | + $buffer[$uid] = $member_handler->getGroupsByUser($uid, false); // Renvoie un tableau d'ID (de groupes) |
|
| 1221 | 1221 | } else { |
| 1222 | 1222 | $buffer[$uid] = array(XOOPS_GROUP_ANONYMOUS); |
| 1223 | 1223 | } |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | $retval = $buffer[$group]; |
| 1245 | 1245 | } else { |
| 1246 | 1246 | $member_handler = xoops_getHandler('member'); |
| 1247 | - $groups = $member_handler->getGroupsByUser($uid, false); // Renvoie un tableau d'ID (de groupes) |
|
| 1247 | + $groups = $member_handler->getGroupsByUser($uid, false); // Renvoie un tableau d'ID (de groupes) |
|
| 1248 | 1248 | $retval = in_array($group, $groups); |
| 1249 | 1249 | $buffer[$group] = $retval; |
| 1250 | 1250 | } |
@@ -1284,7 +1284,7 @@ discard block |
||
| 1284 | 1284 | static $cache = -1; |
| 1285 | 1285 | if ($cache == -1) { |
| 1286 | 1286 | global $xoopsDB; |
| 1287 | - $sql = 'SELECT COUNT(*) FROM ' . $xoopsDB->prefix('groups'); |
|
| 1287 | + $sql = 'SELECT COUNT(*) FROM '.$xoopsDB->prefix('groups'); |
|
| 1288 | 1288 | $result = $xoopsDB->query($sql); |
| 1289 | 1289 | if (!$result) { |
| 1290 | 1290 | return false; |
@@ -1305,7 +1305,7 @@ discard block |
||
| 1305 | 1305 | { |
| 1306 | 1306 | if (!is_dir($folder)) { |
| 1307 | 1307 | mkdir($folder, 0777); |
| 1308 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
| 1308 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
| 1309 | 1309 | } else { |
| 1310 | 1310 | if (!is_writable($folder)) { |
| 1311 | 1311 | chmod($folder, 0777); |
@@ -1326,10 +1326,10 @@ discard block |
||
| 1326 | 1326 | if (strstr($languageFile, $defaultExtension) === false) { |
| 1327 | 1327 | $languageFile .= $defaultExtension; |
| 1328 | 1328 | } |
| 1329 | - if (file_exists($root . 'language' . DIRECTORY_SEPARATOR . $xoopsConfig['language'] . DIRECTORY_SEPARATOR . $languageFile)) { |
|
| 1330 | - require_once $root . 'language' . DIRECTORY_SEPARATOR . $xoopsConfig['language'] . DIRECTORY_SEPARATOR . $languageFile; |
|
| 1329 | + if (file_exists($root.'language'.DIRECTORY_SEPARATOR.$xoopsConfig['language'].DIRECTORY_SEPARATOR.$languageFile)) { |
|
| 1330 | + require_once $root.'language'.DIRECTORY_SEPARATOR.$xoopsConfig['language'].DIRECTORY_SEPARATOR.$languageFile; |
|
| 1331 | 1331 | } else { // Fallback |
| 1332 | - require_once $root . 'language' . DIRECTORY_SEPARATOR . 'english' . DIRECTORY_SEPARATOR . $languageFile; |
|
| 1332 | + require_once $root.'language'.DIRECTORY_SEPARATOR.'english'.DIRECTORY_SEPARATOR.$languageFile; |
|
| 1333 | 1333 | } |
| 1334 | 1334 | } |
| 1335 | 1335 | |
@@ -1367,10 +1367,10 @@ discard block |
||
| 1367 | 1367 | $left = $top = 0; |
| 1368 | 1368 | if (is_array($pictureDimensions)) { |
| 1369 | 1369 | if ($pictureWidth > $param_width) { |
| 1370 | - $left = (int)(($pictureWidth / 2) - ($param_width / 2)); |
|
| 1370 | + $left = (int) (($pictureWidth / 2) - ($param_width / 2)); |
|
| 1371 | 1371 | } |
| 1372 | 1372 | if ($pictureHeight > $param_height) { |
| 1373 | - $top = (int)(($pictureHeight / 2) - ($param_height / 2)); |
|
| 1373 | + $top = (int) (($pictureHeight / 2) - ($param_height / 2)); |
|
| 1374 | 1374 | } |
| 1375 | 1375 | } |
| 1376 | 1376 | $result = $img->crop($left, $top, $param_width, $param_height); |
@@ -1410,7 +1410,7 @@ discard block |
||
| 1410 | 1410 | $selected = " selected = 'selected'"; |
| 1411 | 1411 | } |
| 1412 | 1412 | } |
| 1413 | - $ret[] = '<option value=0' . $selected . '>---</option>'; |
|
| 1413 | + $ret[] = '<option value=0'.$selected.'>---</option>'; |
|
| 1414 | 1414 | } |
| 1415 | 1415 | |
| 1416 | 1416 | foreach ($array as $index => $label) { |
@@ -1424,7 +1424,7 @@ discard block |
||
| 1424 | 1424 | $selected = " selected = 'selected'"; |
| 1425 | 1425 | } |
| 1426 | 1426 | } |
| 1427 | - $ret[] = "<option value=\"" . $index . "\"" . $selected . '>' . $label . '</option>'; |
|
| 1427 | + $ret[] = "<option value=\"".$index."\"".$selected.'>'.$label.'</option>'; |
|
| 1428 | 1428 | } |
| 1429 | 1429 | |
| 1430 | 1430 | return implode("\n", $ret); |
@@ -1446,14 +1446,14 @@ discard block |
||
| 1446 | 1446 | public static function htmlSelect($selectName, $array, $default, $withNull = true, $style = '', $multiple = false, $size = 1, $extra = '') |
| 1447 | 1447 | { |
| 1448 | 1448 | $ret = ''; |
| 1449 | - $ret .= "<select name='" . $selectName . "' id='" . $selectName . "'"; |
|
| 1449 | + $ret .= "<select name='".$selectName."' id='".$selectName."'"; |
|
| 1450 | 1450 | if (xoops_trim($style) != '') { |
| 1451 | - $ret .= " style='" . $style . "' "; |
|
| 1451 | + $ret .= " style='".$style."' "; |
|
| 1452 | 1452 | } |
| 1453 | 1453 | if (xoops_trim($multiple) != '') { |
| 1454 | - $ret .= " multiple = 'multiple' size='" . $size . "' "; |
|
| 1454 | + $ret .= " multiple = 'multiple' size='".$size."' "; |
|
| 1455 | 1455 | } |
| 1456 | - $ret .= $extra . ">\n"; |
|
| 1456 | + $ret .= $extra.">\n"; |
|
| 1457 | 1457 | $ret .= self::htmlSelectOptions($array, $default, $withNull); |
| 1458 | 1458 | $ret .= "</select>\n"; |
| 1459 | 1459 | |
@@ -1528,16 +1528,16 @@ discard block |
||
| 1528 | 1528 | { |
| 1529 | 1529 | global $xoopsDB; |
| 1530 | 1530 | define('REFERENCES_MAINTAIN', true); |
| 1531 | - require self::MODULE_PATH . 'xoops_version.php'; |
|
| 1531 | + require self::MODULE_PATH.'xoops_version.php'; |
|
| 1532 | 1532 | $tables = array(); |
| 1533 | 1533 | foreach ($modversion['tables'] as $table) { |
| 1534 | 1534 | $tables[] = $xoopsDB->prefix($table); |
| 1535 | 1535 | } |
| 1536 | 1536 | if (count($tables) > 0) { |
| 1537 | 1537 | $list = implode(',', $tables); |
| 1538 | - $xoopsDB->queryF('CHECK TABLE ' . $list); |
|
| 1539 | - $xoopsDB->queryF('ANALYZE TABLE ' . $list); |
|
| 1540 | - $xoopsDB->queryF('OPTIMIZE TABLE ' . $list); |
|
| 1538 | + $xoopsDB->queryF('CHECK TABLE '.$list); |
|
| 1539 | + $xoopsDB->queryF('ANALYZE TABLE '.$list); |
|
| 1540 | + $xoopsDB->queryF('OPTIMIZE TABLE '.$list); |
|
| 1541 | 1541 | } |
| 1542 | 1542 | self::updateCache(); |
| 1543 | 1543 | $handlers = references_handler::getInstance(); |