@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @author XOOPS Development Team |
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | -include_once __DIR__ . '/admin_header.php'; |
|
| 19 | +include_once __DIR__.'/admin_header.php'; |
|
| 20 | 20 | |
| 21 | 21 | xoops_cp_header(); |
| 22 | 22 | |
@@ -25,4 +25,4 @@ discard block |
||
| 25 | 25 | echo $aboutAdmin->addNavigation(basename(__FILE__)); |
| 26 | 26 | echo $aboutAdmin->renderAbout('[email protected]', false); |
| 27 | 27 | |
| 28 | -include_once __DIR__ . '/admin_footer.php'; |
|
| 28 | +include_once __DIR__.'/admin_footer.php'; |
|
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 22 | 22 | |
| 23 | -require_once XOOPS_ROOT_PATH . '/kernel/object.php'; |
|
| 23 | +require_once XOOPS_ROOT_PATH.'/kernel/object.php'; |
|
| 24 | 24 | if (!class_exists('references_XoopsPersistableObjectHandler')) { |
| 25 | - require_once XOOPS_ROOT_PATH . '/modules/references/class/PersistableObjectHandler.php'; |
|
| 25 | + require_once XOOPS_ROOT_PATH.'/modules/references/class/PersistableObjectHandler.php'; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -define('REFERENCES_STATUS_ONLINE', 1); // Articles en ligne |
|
| 29 | -define('REFERENCES_STATUS_OFFLINE', 0); // Articles hors ligne |
|
| 28 | +define('REFERENCES_STATUS_ONLINE', 1); // Articles en ligne |
|
| 29 | +define('REFERENCES_STATUS_OFFLINE', 0); // Articles hors ligne |
|
| 30 | 30 | |
| 31 | 31 | class references_articles extends references_Object |
| 32 | 32 | { |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | public function getOnlinePicture() |
| 88 | 88 | { |
| 89 | 89 | if ($this->isArticleOnline()) { |
| 90 | - return REFERENCES_IMAGES_URL . 'status_online.png'; |
|
| 90 | + return REFERENCES_IMAGES_URL.'status_online.png'; |
|
| 91 | 91 | } else { |
| 92 | - return REFERENCES_IMAGES_URL . 'status_offline.png'; |
|
| 92 | + return REFERENCES_IMAGES_URL.'status_offline.png'; |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | public function pictureExists($indice) |
| 113 | 113 | { |
| 114 | 114 | $return = false; |
| 115 | - $fieldName = 'article_picture' . $indice; |
|
| 116 | - if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . $this->getVar($fieldName))) { |
|
| 115 | + $fieldName = 'article_picture'.$indice; |
|
| 116 | + if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.$this->getVar($fieldName))) { |
|
| 117 | 117 | $return = true; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -128,9 +128,9 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function deletePicture($indice) |
| 130 | 130 | { |
| 131 | - $fieldName = 'article_picture' . $indice; |
|
| 131 | + $fieldName = 'article_picture'.$indice; |
|
| 132 | 132 | if ($this->pictureExists($indice)) { |
| 133 | - @unlink(references_utils::getModuleOption('images_path') . references_utils::getModuleOption('images_path') . $this->getVar($fieldName)); |
|
| 133 | + @unlink(references_utils::getModuleOption('images_path').references_utils::getModuleOption('images_path').$this->getVar($fieldName)); |
|
| 134 | 134 | } |
| 135 | 135 | $this->setVar($fieldName, ''); |
| 136 | 136 | } |
@@ -143,11 +143,11 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function getPictureUrl($indice) |
| 145 | 145 | { |
| 146 | - $fieldName = 'article_picture' . $indice; |
|
| 146 | + $fieldName = 'article_picture'.$indice; |
|
| 147 | 147 | if (xoops_trim($this->getVar($fieldName)) != '' && $this->pictureExists($indice)) { |
| 148 | - return references_utils::getModuleOption('images_url') . '/' . $this->getVar($fieldName); |
|
| 148 | + return references_utils::getModuleOption('images_url').'/'.$this->getVar($fieldName); |
|
| 149 | 149 | } else { |
| 150 | - return REFERENCES_IMAGES_URL . 'blank.gif'; |
|
| 150 | + return REFERENCES_IMAGES_URL.'blank.gif'; |
|
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public function getPicturePath($indice) |
| 161 | 161 | { |
| 162 | - $fieldName = 'article_picture' . $indice; |
|
| 162 | + $fieldName = 'article_picture'.$indice; |
|
| 163 | 163 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 164 | - return references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . $this->getVar($fieldName); |
|
| 164 | + return references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.$this->getVar($fieldName); |
|
| 165 | 165 | } else { |
| 166 | 166 | return ''; |
| 167 | 167 | } |
@@ -175,9 +175,9 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function thumbExists($indice) |
| 177 | 177 | { |
| 178 | - $fieldName = 'article_picture' . $indice; |
|
| 178 | + $fieldName = 'article_picture'.$indice; |
|
| 179 | 179 | $return = false; |
| 180 | - if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName))) { |
|
| 180 | + if (xoops_trim($this->getVar($fieldName)) != '' && file_exists(references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName))) { |
|
| 181 | 181 | $return = true; |
| 182 | 182 | } |
| 183 | 183 | |
@@ -192,11 +192,11 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function getThumbUrl($indice) |
| 194 | 194 | { |
| 195 | - $fieldName = 'article_picture' . $indice; |
|
| 195 | + $fieldName = 'article_picture'.$indice; |
|
| 196 | 196 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 197 | - return references_utils::getModuleOption('images_url') . '/' . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName); |
|
| 197 | + return references_utils::getModuleOption('images_url').'/'.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName); |
|
| 198 | 198 | } else { |
| 199 | - return REFERENCES_IMAGES_URL . 'blank.gif'; |
|
| 199 | + return REFERENCES_IMAGES_URL.'blank.gif'; |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
@@ -208,9 +208,9 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | public function getThumbPath($indice) |
| 210 | 210 | { |
| 211 | - $fieldName = 'article_picture' . $indice; |
|
| 211 | + $fieldName = 'article_picture'.$indice; |
|
| 212 | 212 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 213 | - return references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName); |
|
| 213 | + return references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName); |
|
| 214 | 214 | } else { |
| 215 | 215 | return ''; |
| 216 | 216 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | public function attachmentExists() |
| 225 | 225 | { |
| 226 | 226 | $return = false; |
| 227 | - if (xoops_trim($this->getVar('article_attached_file')) != '' && file_exists(references_utils::getModuleOption('attached_path') . DIRECTORY_SEPARATOR . $this->getVar('article_attached_file'))) { |
|
| 227 | + if (xoops_trim($this->getVar('article_attached_file')) != '' && file_exists(references_utils::getModuleOption('attached_path').DIRECTORY_SEPARATOR.$this->getVar('article_attached_file'))) { |
|
| 228 | 228 | $return = true; |
| 229 | 229 | } |
| 230 | 230 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | public function getAttachmentUrl() |
| 240 | 240 | { |
| 241 | 241 | if (xoops_trim($this->getVar('article_attached_file')) != '' && $this->attachmentExists()) { |
| 242 | - return references_utils::getModuleOption('attached_url') . '/' . $this->getVar('article_attached_file'); |
|
| 242 | + return references_utils::getModuleOption('attached_url').'/'.$this->getVar('article_attached_file'); |
|
| 243 | 243 | } else { |
| 244 | 244 | return ''; |
| 245 | 245 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | public function getAttachmentPath() |
| 254 | 254 | { |
| 255 | 255 | if (xoops_trim($this->getVar('article_attached_file')) != '' && $this->attachmentExists()) { |
| 256 | - return references_utils::getModuleOption('attached_path') . DIRECTORY_SEPARATOR . $this->getVar('article_attached_file'); |
|
| 256 | + return references_utils::getModuleOption('attached_path').DIRECTORY_SEPARATOR.$this->getVar('article_attached_file'); |
|
| 257 | 257 | } else { |
| 258 | 258 | return ''; |
| 259 | 259 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | public function deleteAttachment() |
| 266 | 266 | { |
| 267 | 267 | if ($this->attachmentExists()) { |
| 268 | - @unlink(references_utils::getModuleOption('attached_path') . DIRECTORY_SEPARATOR . $this->getVar('article_attached_file')); |
|
| 268 | + @unlink(references_utils::getModuleOption('attached_path').DIRECTORY_SEPARATOR.$this->getVar('article_attached_file')); |
|
| 269 | 269 | } |
| 270 | 270 | $this->setVar('article_attached_file', ''); |
| 271 | 271 | } |
@@ -278,9 +278,9 @@ discard block |
||
| 278 | 278 | */ |
| 279 | 279 | public function deleteThumb($indice) |
| 280 | 280 | { |
| 281 | - $fieldName = 'article_picture' . $indice; |
|
| 281 | + $fieldName = 'article_picture'.$indice; |
|
| 282 | 282 | if ($this->thumbExists($indice)) { |
| 283 | - @unlink(references_utils::getModuleOption('images_path') . DIRECTORY_SEPARATOR . REFERENCES_THUMBS_PREFIX . $this->getVar($fieldName)); |
|
| 283 | + @unlink(references_utils::getModuleOption('images_path').DIRECTORY_SEPARATOR.REFERENCES_THUMBS_PREFIX.$this->getVar($fieldName)); |
|
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | |
@@ -348,9 +348,9 @@ discard block |
||
| 348 | 348 | public function getUrl($shortVersion = false) |
| 349 | 349 | { |
| 350 | 350 | if (!$shortVersion) { |
| 351 | - return REFERENCES_URL . 'reference.php?article_id=' . $this->getVar('article_id'); |
|
| 351 | + return REFERENCES_URL.'reference.php?article_id='.$this->getVar('article_id'); |
|
| 352 | 352 | } else { |
| 353 | - return 'reference.php?article_id=' . $this->getVar('article_id'); |
|
| 353 | + return 'reference.php?article_id='.$this->getVar('article_id'); |
|
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | 356 | |
@@ -373,11 +373,11 @@ discard block |
||
| 373 | 373 | $ret['article_picture_exists'] = true; |
| 374 | 374 | for ($i = 1; $i <= 10; ++$i) { |
| 375 | 375 | if ($this->pictureExists($i)) { |
| 376 | - $ret['article_picture_url' . $i] = $this->getPictureUrl($i); |
|
| 377 | - $ret['article_picture_path' . $i] = $this->getPicturePath($i); |
|
| 376 | + $ret['article_picture_url'.$i] = $this->getPictureUrl($i); |
|
| 377 | + $ret['article_picture_path'.$i] = $this->getPicturePath($i); |
|
| 378 | 378 | $ret['article_pictures_urls'][] = $this->getPictureUrl($i); |
| 379 | 379 | $ret['article_pictures_paths'][] = $this->getPicturePath($i); |
| 380 | - $fieldName = 'article_picture' . $i . '_text'; |
|
| 380 | + $fieldName = 'article_picture'.$i.'_text'; |
|
| 381 | 381 | if (xoops_trim($this->getVar($fieldName)) != '') { |
| 382 | 382 | $ret['article_pictures_texts'][] = references_utils::makeHrefTitle($this->getVar($fieldName)); |
| 383 | 383 | } else { |
@@ -402,8 +402,8 @@ discard block |
||
| 402 | 402 | $ret['article_thumb_exists'] = true; |
| 403 | 403 | for ($i = 1; $i <= 10; ++$i) { |
| 404 | 404 | if ($this->thumbExists($i)) { |
| 405 | - $ret['article_thumb_url' . $i] = $this->getThumbUrl($i); |
|
| 406 | - $ret['article_thumb_path' . $i] = $this->getThumbPath($i); |
|
| 405 | + $ret['article_thumb_url'.$i] = $this->getThumbUrl($i); |
|
| 406 | + $ret['article_thumb_path'.$i] = $this->getThumbPath($i); |
|
| 407 | 407 | $ret['article_thumbs_urls'][] = $this->getThumbUrl($i); |
| 408 | 408 | $ret['article_thumbs_paths'][] = $this->getThumbPath($i); |
| 409 | 409 | } |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | $gperm_handler = xoops_getHandler('groupperm'); |
| 445 | 445 | $categories = $gperm_handler->getItemIds($permissionsType, $groups, $currentModule->getVar('mid')); |
| 446 | 446 | if (is_array($categories) && count($categories) > 0) { |
| 447 | - $permissions[$permissionsType] = new Criteria('article_category_id', '(' . implode(',', $categories) . ')', 'IN'); |
|
| 447 | + $permissions[$permissionsType] = new Criteria('article_category_id', '('.implode(',', $categories).')', 'IN'); |
|
| 448 | 448 | } else { // Ne peut rien voir |
| 449 | 449 | $permissions[$permissionsType] = new Criteria('article_category_id', '0', '='); |
| 450 | 450 | } |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | $criteria->add(new Criteria('article_online', REFERENCES_STATUS_ONLINE, '=')); |
| 473 | 473 | } |
| 474 | 474 | if (is_array($categoryId) && count($categoryId) > 0) { |
| 475 | - $criteria->add(new Criteria('article_category_id', '(' . implode(',', $categoryId) . ')', 'IN')); |
|
| 475 | + $criteria->add(new Criteria('article_category_id', '('.implode(',', $categoryId).')', 'IN')); |
|
| 476 | 476 | } elseif ($categoryId > 0) { |
| 477 | 477 | $criteria->add(new Criteria('article_category_id', $categoryId, '=')); |
| 478 | 478 | } |
@@ -529,8 +529,8 @@ discard block |
||
| 529 | 529 | public function getDistinctCategoriesIds() |
| 530 | 530 | { |
| 531 | 531 | $ret = array(); |
| 532 | - $sql = 'SELECT distinct(article_category_id) FROM ' . $this->table; |
|
| 533 | - $sql .= ' ' . $this->getPermissionsCategoriesCriteria()->renderWhere(); // Permissions |
|
| 532 | + $sql = 'SELECT distinct(article_category_id) FROM '.$this->table; |
|
| 533 | + $sql .= ' '.$this->getPermissionsCategoriesCriteria()->renderWhere(); // Permissions |
|
| 534 | 534 | $sql .= ' GROUP BY article_category_id ORDER BY article_category_id'; |
| 535 | 535 | $result = $this->db->query($sql); |
| 536 | 536 | if (!$result) { |
@@ -598,17 +598,17 @@ discard block |
||
| 598 | 598 | */ |
| 599 | 599 | public function moveUp($currentId, $currentOrder) |
| 600 | 600 | { |
| 601 | - $sql_plus = 'SELECT article_id FROM ' . $this->table . ' WHERE article_weight = ' . ((int)$currentOrder - 1); |
|
| 601 | + $sql_plus = 'SELECT article_id FROM '.$this->table.' WHERE article_weight = '.((int) $currentOrder - 1); |
|
| 602 | 602 | $res_plus = $this->db->query($sql_plus); |
| 603 | 603 | if ($this->db->getRowsNum($res_plus) == 0) { |
| 604 | 604 | return; |
| 605 | 605 | } |
| 606 | 606 | $row_plus = $this->db->fetchArray($res_plus); |
| 607 | 607 | |
| 608 | - $upd1 = 'UPDATE ' . $this->table . ' SET article_weight = (article_weight + 1) WHERE article_id = ' . $row_plus['article_id']; |
|
| 608 | + $upd1 = 'UPDATE '.$this->table.' SET article_weight = (article_weight + 1) WHERE article_id = '.$row_plus['article_id']; |
|
| 609 | 609 | $this->db->queryF($upd1); |
| 610 | 610 | |
| 611 | - $upd2 = 'UPDATE ' . $this->table . ' SET article_weight = (article_weight - 1) WHERE article_id = ' . (int)$currentId; |
|
| 611 | + $upd2 = 'UPDATE '.$this->table.' SET article_weight = (article_weight - 1) WHERE article_id = '.(int) $currentId; |
|
| 612 | 612 | $this->db->queryF($upd2); |
| 613 | 613 | $this->forceCacheClean(); |
| 614 | 614 | } |
@@ -622,17 +622,17 @@ discard block |
||
| 622 | 622 | */ |
| 623 | 623 | public function moveDown($currentId, $currentOrder) |
| 624 | 624 | { |
| 625 | - $sql_moins = 'SELECT article_id FROM ' . $this->table . ' WHERE article_weight = ' . ((int)$currentOrder + 1); |
|
| 625 | + $sql_moins = 'SELECT article_id FROM '.$this->table.' WHERE article_weight = '.((int) $currentOrder + 1); |
|
| 626 | 626 | $res_moins = $this->db->query($sql_moins); |
| 627 | 627 | if ($this->db->getRowsNum($res_moins) == 0) { |
| 628 | 628 | return; |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | $row_moins = $this->db->fetchArray($res_moins); |
| 632 | - $upd1 = 'UPDATE ' . $this->table . ' SET article_weight = (article_weight - 1) WHERE article_id = ' . $row_moins['article_id']; |
|
| 632 | + $upd1 = 'UPDATE '.$this->table.' SET article_weight = (article_weight - 1) WHERE article_id = '.$row_moins['article_id']; |
|
| 633 | 633 | $this->db->queryF($upd1); |
| 634 | 634 | |
| 635 | - $upd2 = 'UPDATE ' . $this->table . ' SET article_weight =( article_weight + 1) WHERE article_id = ' . (int)$currentId; |
|
| 635 | + $upd2 = 'UPDATE '.$this->table.' SET article_weight =( article_weight + 1) WHERE article_id = '.(int) $currentId; |
|
| 636 | 636 | $this->db->queryF($upd2); |
| 637 | 637 | $this->forceCacheClean(); |
| 638 | 638 | } |
@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 22 | 22 | |
| 23 | -require_once XOOPS_ROOT_PATH . '/kernel/object.php'; |
|
| 23 | +require_once XOOPS_ROOT_PATH.'/kernel/object.php'; |
|
| 24 | 24 | if (!class_exists('references_XoopsPersistableObjectHandler')) { |
| 25 | - require_once XOOPS_ROOT_PATH . '/modules/references/class/PersistableObjectHandler.php'; |
|
| 25 | + require_once XOOPS_ROOT_PATH.'/modules/references/class/PersistableObjectHandler.php'; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | class references_categories extends references_Object |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | public function getUrl($shortVersion = false) |
| 57 | 57 | { |
| 58 | 58 | if (!$shortVersion) { |
| 59 | - return REFERENCES_URL . 'category.php?category_id=' . $this->getVar('category_id'); |
|
| 59 | + return REFERENCES_URL.'category.php?category_id='.$this->getVar('category_id'); |
|
| 60 | 60 | } else { |
| 61 | - return 'category.php?category_id=' . $this->getVar('category_id'); |
|
| 61 | + return 'category.php?category_id='.$this->getVar('category_id'); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $gperm_handler = xoops_getHandler('groupperm'); |
| 109 | 109 | $categories = $gperm_handler->getItemIds($permissionsType, $groups, $currentModule->getVar('mid')); |
| 110 | 110 | if (is_array($categories) && count($categories) > 0) { |
| 111 | - $permissions[$permissionsType] = new Criteria('category_id', '(' . implode(',', $categories) . ')', 'IN'); |
|
| 111 | + $permissions[$permissionsType] = new Criteria('category_id', '('.implode(',', $categories).')', 'IN'); |
|
| 112 | 112 | } else { // Ne peut rien voir |
| 113 | 113 | $permissions[$permissionsType] = new Criteria('category_id', '0', '='); |
| 114 | 114 | } |
@@ -174,8 +174,8 @@ discard block |
||
| 174 | 174 | if (count($categories) == 0) { |
| 175 | 175 | return $ret; |
| 176 | 176 | } |
| 177 | - $jump = REFERENCES_URL . 'category.php?category_id='; |
|
| 178 | - $extra = " onchange='location=\"" . $jump . "\"+this.options[this.selectedIndex].value'"; |
|
| 177 | + $jump = REFERENCES_URL.'category.php?category_id='; |
|
| 178 | + $extra = " onchange='location=\"".$jump."\"+this.options[this.selectedIndex].value'"; |
|
| 179 | 179 | |
| 180 | 180 | return references_utils::htmlSelect($selectName, $categories, $selected, true, '', false, 1, $extra); |
| 181 | 181 | } |