@@ -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'])) { |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | 'pearErrorMode' |
| 315 | 315 | ); |
| 316 | 316 | if (in_array($name, $availableOptions)) { |
| 317 | - $property = '_' . $name; |
|
| 317 | + $property = '_'.$name; |
|
| 318 | 318 | $this->$property = $value; |
| 319 | 319 | } |
| 320 | 320 | } |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | 'counter' => $this->_memoryCachingCounter, |
| 512 | 512 | 'array' => $this->_memoryCachingArray |
| 513 | 513 | ); |
| 514 | - $data = serialize($array); |
|
| 514 | + $data = serialize($array); |
|
| 515 | 515 | $this->save($data, $id, $group); |
| 516 | 516 | } |
| 517 | 517 | } |
@@ -623,9 +623,9 @@ discard block |
||
| 623 | 623 | public function _cleanDir($dir, $group = false, $mode = 'ingroup') |
| 624 | 624 | { |
| 625 | 625 | if ($this->_fileNameProtection) { |
| 626 | - $motif = $group ? 'cache_' . md5($group) . '_' : 'cache_'; |
|
| 626 | + $motif = $group ? 'cache_'.md5($group).'_' : 'cache_'; |
|
| 627 | 627 | } else { |
| 628 | - $motif = $group ? 'cache_' . $group . '_' : 'cache_'; |
|
| 628 | + $motif = $group ? 'cache_'.$group.'_' : 'cache_'; |
|
| 629 | 629 | } |
| 630 | 630 | if ($this->_memoryCaching) { |
| 631 | 631 | foreach ($this->_memoryCachingArray as $key => $v) { |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | while ($file = readdir($dh)) { |
| 646 | 646 | if (($file !== '.') && ($file !== '..')) { |
| 647 | 647 | if (substr($file, 0, 6) === 'cache_') { |
| 648 | - $file2 = $dir . $file; |
|
| 648 | + $file2 = $dir.$file; |
|
| 649 | 649 | if (is_file($file2)) { |
| 650 | 650 | switch (substr($mode, 0, 9)) { |
| 651 | 651 | case 'old': |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | } |
| 677 | 677 | } |
| 678 | 678 | if (is_dir($file2) and ($this->_hashedDirectoryLevel > 0)) { |
| 679 | - $result = ($result and $this->_cleanDir($file2 . '/', $group, $mode)); |
|
| 679 | + $result = ($result and $this->_cleanDir($file2.'/', $group, $mode)); |
|
| 680 | 680 | } |
| 681 | 681 | } |
| 682 | 682 | } |
@@ -712,19 +712,19 @@ discard block |
||
| 712 | 712 | public function _setFileName($id, $group) |
| 713 | 713 | { |
| 714 | 714 | if ($this->_fileNameProtection) { |
| 715 | - $suffix = 'cache_' . md5($group) . '_' . md5($id); |
|
| 715 | + $suffix = 'cache_'.md5($group).'_'.md5($id); |
|
| 716 | 716 | } else { |
| 717 | - $suffix = 'cache_' . $group . '_' . $id; |
|
| 717 | + $suffix = 'cache_'.$group.'_'.$id; |
|
| 718 | 718 | } |
| 719 | 719 | $root = $this->_cacheDir; |
| 720 | 720 | if ($this->_hashedDirectoryLevel > 0) { |
| 721 | 721 | $hash = md5($suffix); |
| 722 | 722 | for ($i = 0; $i < $this->_hashedDirectoryLevel; ++$i) { |
| 723 | - $root = $root . 'cache_' . substr($hash, 0, $i + 1) . '/'; |
|
| 723 | + $root = $root.'cache_'.substr($hash, 0, $i + 1).'/'; |
|
| 724 | 724 | } |
| 725 | 725 | } |
| 726 | 726 | $this->_fileName = $suffix; |
| 727 | - $this->_file = $root . $suffix; |
|
| 727 | + $this->_file = $root.$suffix; |
|
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 | /** |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | $hash = md5($this->_fileName); |
| 791 | 791 | $root = $this->_cacheDir; |
| 792 | 792 | for ($i = 0; $i < $this->_hashedDirectoryLevel; ++$i) { |
| 793 | - $root = $root . 'cache_' . substr($hash, 0, $i + 1) . '/'; |
|
| 793 | + $root = $root.'cache_'.substr($hash, 0, $i + 1).'/'; |
|
| 794 | 794 | if (!(@is_dir($root))) { |
| 795 | 795 | @mkdir($root, $this->_hashedDirectoryUmask); |
| 796 | 796 | } |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | return true; |
| 817 | 817 | } |
| 818 | 818 | |
| 819 | - return $this->raiseError('Cache_Lite : Unable to write cache file : ' . $this->_file, -1); |
|
| 819 | + return $this->raiseError('Cache_Lite : Unable to write cache file : '.$this->_file, -1); |
|
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | /** |
@@ -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 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | { |
| 36 | 36 | $handlersNames = array('references_articles', 'references_categories'); |
| 37 | 37 | foreach ($handlersNames as $handlerName) { |
| 38 | - $internalName = 'h_' . $handlerName; |
|
| 38 | + $internalName = 'h_'.$handlerName; |
|
| 39 | 39 | $this->$internalName = xoops_getModuleHandler($handlerName, REFERENCES_DIRNAME); |
| 40 | 40 | } |
| 41 | 41 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | class references_registryfile |
| 23 | 23 | { |
| 24 | - public $filename; // Nom du fichier � traiter |
|
| 24 | + public $filename; // Nom du fichier � traiter |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Access the only instance of this class |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function setfile($fichier = null) |
| 50 | 50 | { |
| 51 | 51 | if ($fichier) { |
| 52 | - $this->filename = XOOPS_UPLOAD_PATH . DIRECTORY_SEPARATOR . $fichier; |
|
| 52 | + $this->filename = XOOPS_UPLOAD_PATH.DIRECTORY_SEPARATOR.$fichier; |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | if (!$fichier) { |
| 60 | 60 | $fw = $this->filename; |
| 61 | 61 | } else { |
| 62 | - $fw = XOOPS_UPLOAD_PATH . DIRECTORY_SEPARATOR . $fichier; |
|
| 62 | + $fw = XOOPS_UPLOAD_PATH.DIRECTORY_SEPARATOR.$fichier; |
|
| 63 | 63 | } |
| 64 | 64 | if (file_exists($fw)) { |
| 65 | 65 | return file_get_contents($fw); |
@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | if (!$fichier) { |
| 75 | 75 | $fw = $this->filename; |
| 76 | 76 | } else { |
| 77 | - $fw = XOOPS_UPLOAD_PATH . DIRECTORY_SEPARATOR . $fichier; |
|
| 77 | + $fw = XOOPS_UPLOAD_PATH.DIRECTORY_SEPARATOR.$fichier; |
|
| 78 | 78 | } |
| 79 | 79 | if (file_exists($fw)) { |
| 80 | 80 | @unlink($fw); |
| 81 | 81 | } |
| 82 | - $fp = fopen($fw, 'w') || exit('Error, impossible to create the file ' . $this->filename); |
|
| 82 | + $fp = fopen($fw, 'w') || exit('Error, impossible to create the file '.$this->filename); |
|
| 83 | 83 | fwrite($fp, $content); |
| 84 | 84 | fclose($fp); |
| 85 | 85 | |
@@ -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 | // }}} |
@@ -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 |
@@ -24,15 +24,15 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @param integer $category_id Le numéro de la catégorie |
| 26 | 26 | */ |
| 27 | -require __DIR__ . '/header.php'; |
|
| 27 | +require __DIR__.'/header.php'; |
|
| 28 | 28 | $xoopsOption['template_main'] = 'references_category.tpl'; |
| 29 | -require XOOPS_ROOT_PATH . '/header.php'; |
|
| 29 | +require XOOPS_ROOT_PATH.'/header.php'; |
|
| 30 | 30 | |
| 31 | -$baseurl = REFERENCES_URL . basename(__FILE__); |
|
| 31 | +$baseurl = REFERENCES_URL.basename(__FILE__); |
|
| 32 | 32 | $limit = references_utils::getModuleOption('items_index_page'); |
| 33 | 33 | $start = $index = 0; |
| 34 | 34 | |
| 35 | -$category_id = isset($_GET['category_id']) ? (int)$_GET['category_id'] : 0; |
|
| 35 | +$category_id = isset($_GET['category_id']) ? (int) $_GET['category_id'] : 0; |
|
| 36 | 36 | if ($category_id == 0) { |
| 37 | 37 | header('Location: index.php', true, 301); |
| 38 | 38 | exit; |
@@ -61,18 +61,18 @@ discard block |
||
| 61 | 61 | $xoopsTpl->assign('use_rss', references_utils::getModuleOption('use_rss')); |
| 62 | 62 | |
| 63 | 63 | // MooTools |
| 64 | -$xoTheme->addScript(REFERENCES_JS_URL . 'js/mootools.js'); |
|
| 65 | -$xoTheme->addScript(REFERENCES_JS_URL . 'js/mootools-1.2-more.js'); |
|
| 66 | -if (isset($xoopsConfig) && file_exists(REFERENCES_PATH . 'language/' . $xoopsConfig['language'] . '/slimbox.js')) { |
|
| 67 | - $xoTheme->addScript(REFERENCES_URL . 'language/' . $xoopsConfig['language'] . '/slimbox.js'); |
|
| 64 | +$xoTheme->addScript(REFERENCES_JS_URL.'js/mootools.js'); |
|
| 65 | +$xoTheme->addScript(REFERENCES_JS_URL.'js/mootools-1.2-more.js'); |
|
| 66 | +if (isset($xoopsConfig) && file_exists(REFERENCES_PATH.'language/'.$xoopsConfig['language'].'/slimbox.js')) { |
|
| 67 | + $xoTheme->addScript(REFERENCES_URL.'language/'.$xoopsConfig['language'].'/slimbox.js'); |
|
| 68 | 68 | } else { |
| 69 | - $xoTheme->addScript(REFERENCES_JS_URL . 'js/slimbox.js'); |
|
| 69 | + $xoTheme->addScript(REFERENCES_JS_URL.'js/slimbox.js'); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | $categoriesSelect = $h_references_categories->getCategoriesSelect('categoriesSelect', $category->getVar('category_id')); |
| 73 | 73 | $xoopsTpl->assign('categoriesSelect', $categoriesSelect); |
| 74 | -$xoTheme->addStylesheet(REFERENCES_JS_URL . 'css/slimbox.css'); |
|
| 75 | -$xoTheme->addStylesheet(REFERENCES_JS_URL . 'css/accordion.css'); |
|
| 74 | +$xoTheme->addStylesheet(REFERENCES_JS_URL.'css/slimbox.css'); |
|
| 75 | +$xoTheme->addStylesheet(REFERENCES_JS_URL.'css/accordion.css'); |
|
| 76 | 76 | |
| 77 | 77 | // **************************************************************************************************************************** |
| 78 | 78 | $xoopsTpl->assign('thumbsWidth', references_utils::getModuleOption('thumbs_width')); |
@@ -89,6 +89,6 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | $xoopsTpl->assign('isAdmin', references_utils::isAdmin()); |
| 92 | -$title = $category->getVar('category_title', 'n') . ' - ' . $xoopsModule->name(); |
|
| 92 | +$title = $category->getVar('category_title', 'n').' - '.$xoopsModule->name(); |
|
| 93 | 93 | references_utils::setMetas($title, $title); |
| 94 | -require XOOPS_ROOT_PATH . '/footer.php'; |
|
| 94 | +require XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -18,5 +18,5 @@ |
||
| 18 | 18 | * |
| 19 | 19 | * **************************************************************************** |
| 20 | 20 | */ |
| 21 | -require __DIR__ . '/header.php'; |
|
| 22 | -require XOOPS_ROOT_PATH . '/modules/tag/list.tag.php'; |
|
| 21 | +require __DIR__.'/header.php'; |
|
| 22 | +require XOOPS_ROOT_PATH.'/modules/tag/list.tag.php'; |
|