@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * @author trabis <[email protected]> |
| 25 | 25 | * @version $Id$ |
| 26 | 26 | */ |
| 27 | -require_once \dirname(__DIR__) . '/include/common.php'; |
|
| 27 | +require_once \dirname(__DIR__).'/include/common.php'; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Class GroupPermHandler |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * @author trabis <[email protected]> |
| 26 | 26 | * @version $Id$ |
| 27 | 27 | */ |
| 28 | -require_once \dirname(__DIR__) . '/include/common.php'; |
|
| 28 | +require_once \dirname(__DIR__).'/include/common.php'; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Class RatingHandler |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * @author trabis <[email protected]> |
| 25 | 25 | * @version $Id$ |
| 26 | 26 | */ |
| 27 | -require_once \dirname(__DIR__) . '/include/common.php'; |
|
| 27 | +require_once \dirname(__DIR__).'/include/common.php'; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Class Rating |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * @author The SmartFactory <www.smartfactory.ca> |
| 27 | 27 | * @version $Id$ |
| 28 | 28 | */ |
| 29 | -require_once \dirname(__DIR__) . '/include/common.php'; |
|
| 29 | +require_once \dirname(__DIR__).'/include/common.php'; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Class Category |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | if ($parentObj->notLoaded()) { |
| 134 | 134 | exit; |
| 135 | 135 | } |
| 136 | - $ret = $parentObj->getCategoryPath($withAllLink) . ' > ' . $ret; |
|
| 136 | + $ret = $parentObj->getCategoryPath($withAllLink).' > '.$ret; |
|
| 137 | 137 | } |
| 138 | 138 | $this->_categoryPath = $ret; |
| 139 | 139 | } |
@@ -188,10 +188,10 @@ discard block |
||
| 188 | 188 | public function getCategoryLink($class = false): ?string |
| 189 | 189 | { |
| 190 | 190 | if ($class) { |
| 191 | - return "<a class='$class' href='" . $this->getCategoryUrl() . "'>" . $this->getVar('name') . '</a>'; |
|
| 191 | + return "<a class='$class' href='".$this->getCategoryUrl()."'>".$this->getVar('name').'</a>'; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - return "<a href='" . $this->getCategoryUrl() . "'>" . $this->getVar('name') . '</a>'; |
|
| 194 | + return "<a href='".$this->getCategoryUrl()."'>".$this->getVar('name').'</a>'; |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $category['last_title_link'] = $this->getVar('last_title_link', 'n'); |
| 250 | 250 | } |
| 251 | 251 | if ('blank.png' !== $this->image()) { |
| 252 | - $category['image_path'] = Publisher\Utils::getImageDir('category', false) . $this->image(); |
|
| 252 | + $category['image_path'] = Publisher\Utils::getImageDir('category', false).$this->image(); |
|
| 253 | 253 | } else { |
| 254 | 254 | $category['image_path'] = ''; |
| 255 | 255 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | $category['last_title_link'] = $this->getVar('last_title_link', 'n'); |
| 273 | 273 | } |
| 274 | 274 | if ('blank.png' !== $this->image()) { |
| 275 | - $category['image_path'] = Publisher\Utils::getImageDir('category', false) . $this->image(); |
|
| 275 | + $category['image_path'] = Publisher\Utils::getImageDir('category', false).$this->image(); |
|
| 276 | 276 | } else { |
| 277 | 277 | $category['image_path'] = ''; |
| 278 | 278 | } |
@@ -655,9 +655,9 @@ |
||
| 655 | 655 | 'c.parentid', |
| 656 | 656 | 'ASC' |
| 657 | 657 | )->addOrderBy( |
| 658 | - 'i.categoryid', |
|
| 659 | - 'ASC' |
|
| 660 | - ); |
|
| 658 | + 'i.categoryid', |
|
| 659 | + 'ASC' |
|
| 660 | + ); |
|
| 661 | 661 | if ((int)$cat_id > 0) { |
| 662 | 662 | $qb->andWhere($qb->expr()->eq('i.categoryid', ':catid'))->setParameter(':catid', $cat_id, PDO::PARAM_INT); |
| 663 | 663 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @author The SmartFactory <www.smartfactory.ca> |
| 33 | 33 | * @version $Id$ |
| 34 | 34 | */ |
| 35 | -require_once \dirname(__DIR__) . '/include/common.php'; |
|
| 35 | +require_once \dirname(__DIR__).'/include/common.php'; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Items handler class. |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | // Categories for which user has access |
| 211 | 211 | $categoriesGranted = $this->helper->getPermissionHandler()->getGrantedItems('category_read'); |
| 212 | 212 | if (!empty($categoriesGranted)) { |
| 213 | - $grantedCategories = new Criteria('categoryid', '(' . \implode(',', $categoriesGranted) . ')', 'IN'); |
|
| 213 | + $grantedCategories = new Criteria('categoryid', '('.\implode(',', $categoriesGranted).')', 'IN'); |
|
| 214 | 214 | $criteriaPermissions->add($grantedCategories, 'AND'); |
| 215 | 215 | } else { |
| 216 | 216 | return 0; |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | // Categories for which user has access |
| 358 | 358 | $categoriesGranted = $this->helper->getPermissionHandler()->getGrantedItems('category_read'); |
| 359 | 359 | if (!empty($categoriesGranted)) { |
| 360 | - $grantedCategories = new Criteria('categoryid', '(' . \implode(',', $categoriesGranted) . ')', 'IN'); |
|
| 360 | + $grantedCategories = new Criteria('categoryid', '('.\implode(',', $categoriesGranted).')', 'IN'); |
|
| 361 | 361 | $criteriaPermissions->add($grantedCategories, 'AND'); |
| 362 | 362 | } else { |
| 363 | 363 | return []; |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | if (\is_array($userid) && \count($userid) > 0) { |
| 496 | 496 | $userid = \array_map('\intval', $userid); |
| 497 | 497 | $criteriaUser = new CriteriaCompo(); |
| 498 | - $criteriaUser->add(new Criteria('uid', '(' . \implode(',', $userid) . ')', 'IN'), 'OR'); |
|
| 498 | + $criteriaUser->add(new Criteria('uid', '('.\implode(',', $userid).')', 'IN'), 'OR'); |
|
| 499 | 499 | } elseif (\is_numeric($userid) && $userid > 0) { |
| 500 | 500 | $criteriaUser = new CriteriaCompo(); |
| 501 | 501 | $criteriaUser->add(new Criteria('uid', $userid), 'OR'); |
@@ -506,19 +506,19 @@ discard block |
||
| 506 | 506 | foreach ($queryarray as $iValue) { |
| 507 | 507 | $criteriaKeyword = new CriteriaCompo(); |
| 508 | 508 | if (\in_array('title', $searchin)) { |
| 509 | - $criteriaKeyword->add(new Criteria('title', '%' . $iValue . '%', 'LIKE'), 'OR'); |
|
| 509 | + $criteriaKeyword->add(new Criteria('title', '%'.$iValue.'%', 'LIKE'), 'OR'); |
|
| 510 | 510 | } |
| 511 | 511 | if (\in_array('subtitle', $searchin)) { |
| 512 | - $criteriaKeyword->add(new Criteria('subtitle', '%' . $iValue . '%', 'LIKE'), 'OR'); |
|
| 512 | + $criteriaKeyword->add(new Criteria('subtitle', '%'.$iValue.'%', 'LIKE'), 'OR'); |
|
| 513 | 513 | } |
| 514 | 514 | if (\in_array('body', $searchin)) { |
| 515 | - $criteriaKeyword->add(new Criteria('body', '%' . $iValue . '%', 'LIKE'), 'OR'); |
|
| 515 | + $criteriaKeyword->add(new Criteria('body', '%'.$iValue.'%', 'LIKE'), 'OR'); |
|
| 516 | 516 | } |
| 517 | 517 | if (\in_array('summary', $searchin)) { |
| 518 | - $criteriaKeyword->add(new Criteria('summary', '%' . $iValue . '%', 'LIKE'), 'OR'); |
|
| 518 | + $criteriaKeyword->add(new Criteria('summary', '%'.$iValue.'%', 'LIKE'), 'OR'); |
|
| 519 | 519 | } |
| 520 | 520 | if (\in_array('meta_keywords', $searchin)) { |
| 521 | - $criteriaKeyword->add(new Criteria('meta_keywords', '%' . $iValue . '%', 'LIKE'), 'OR'); |
|
| 521 | + $criteriaKeyword->add(new Criteria('meta_keywords', '%'.$iValue.'%', 'LIKE'), 'OR'); |
|
| 522 | 522 | } |
| 523 | 523 | $criteriaKeywords->add($criteriaKeyword, $andor); |
| 524 | 524 | unset($criteriaKeyword); |
@@ -534,11 +534,11 @@ discard block |
||
| 534 | 534 | if (0 == \count($categoriesGranted)) { |
| 535 | 535 | return $ret; |
| 536 | 536 | } |
| 537 | - $grantedCategories = new Criteria('categoryid', '(' . \implode(',', $categoriesGranted) . ')', 'IN'); |
|
| 537 | + $grantedCategories = new Criteria('categoryid', '('.\implode(',', $categoriesGranted).')', 'IN'); |
|
| 538 | 538 | $criteriaPermissions->add($grantedCategories, 'AND'); |
| 539 | 539 | } elseif (\count($categories) > 0) { |
| 540 | 540 | $criteriaPermissions = new CriteriaCompo(); |
| 541 | - $grantedCategories = new Criteria('categoryid', '(' . \implode(',', $categories) . ')', 'IN'); |
|
| 541 | + $grantedCategories = new Criteria('categoryid', '('.\implode(',', $categories).')', 'IN'); |
|
| 542 | 542 | $criteriaPermissions->add($grantedCategories, 'AND'); |
| 543 | 543 | } |
| 544 | 544 | $criteriaItemsStatus = new CriteriaCompo(); |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | |
| 604 | 604 | $subqb = $this->db2->createXoopsQueryBuilder(); |
| 605 | 605 | $subqb->select('categoryid', 'MAX(datesub) AS date')->fromPrefix('publisher_items', '')->where($subqb->expr()->in('status', $status))->andWhere($subqb->expr()->in('categoryid', $catIds))->groupBy('categoryid'); |
| 606 | - $subquery = '(' . $subqb->getSQL() . ')'; |
|
| 606 | + $subquery = '('.$subqb->getSQL().')'; |
|
| 607 | 607 | |
| 608 | 608 | $qb->from($subquery, 'mo')->joinPrefix('mo', 'publisher_items', 'mi', 'mi.datesub = mo.date'); |
| 609 | 609 | |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | */ |
| 627 | 627 | public function countArticlesByCat($parentid, &$catsCount, $spaces = '', $resultCatCounts = []): int |
| 628 | 628 | { |
| 629 | - $newspaces = $spaces . '--'; |
|
| 629 | + $newspaces = $spaces.'--'; |
|
| 630 | 630 | $thecount = 0; |
| 631 | 631 | foreach ($catsCount[$parentid] as $subCatId => $count) { |
| 632 | 632 | $thecount = $thecount + $count; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * @author The SmartFactory <www.smartfactory.ca> |
| 38 | 38 | * @version $Id$ |
| 39 | 39 | */ |
| 40 | -require_once \dirname(__DIR__) . '/include/common.php'; |
|
| 40 | +require_once \dirname(__DIR__).'/include/common.php'; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Class Item |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | public function wrappage($file_name): string |
| 204 | 204 | { |
| 205 | 205 | $content = ''; |
| 206 | - $page = Publisher\Utils::getUploadDir(true, 'content') . $file_name; |
|
| 206 | + $page = Publisher\Utils::getUploadDir(true, 'content').$file_name; |
|
| 207 | 207 | if (XoopsLoad::fileExists($page)) { |
| 208 | 208 | // this page uses smarty template |
| 209 | 209 | \ob_start(); |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | if ($this->helper->getConfig('item_disp_blocks_summary')) { |
| 258 | 258 | $summary = $this->summary($maxLength, $format, $stripTags); |
| 259 | 259 | if ($summary) { |
| 260 | - $ret = $this->summary() . '<br><br>' . $ret; |
|
| 260 | + $ret = $this->summary().'<br><br>'.$ret; |
|
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | if (!empty($stripTags)) { |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | |
| 389 | 389 | public function getCategoryImagePath(): string |
| 390 | 390 | { |
| 391 | - return Publisher\Utils::getImageDir('category', false) . $this->category()->image(); |
|
| 391 | + return Publisher\Utils::getImageDir('category', false).$this->category()->image(); |
|
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | /** |
@@ -407,35 +407,35 @@ discard block |
||
| 407 | 407 | if (Publisher\Utils::IsUserAdmin() || Publisher\Utils::IsUserAuthor($this) || Publisher\Utils::IsUserModerator($this)) { |
| 408 | 408 | if ($this->helper->getConfig('perm_edit') || Publisher\Utils::IsUserModerator($this) || Publisher\Utils::IsUserAdmin()) { |
| 409 | 409 | // Edit button |
| 410 | - $adminLinks .= "<a href='" . \PUBLISHER_URL . '/submit.php?itemid=' . $this->getVar('itemid') . "'><img src='" . \PUBLISHER_URL . "/images/links/edit.gif'" . " title='" . _CO_PUBLISHER_EDIT . "' alt='" . _CO_PUBLISHER_EDIT . "'></a>"; |
|
| 410 | + $adminLinks .= "<a href='".\PUBLISHER_URL.'/submit.php?itemid='.$this->getVar('itemid')."'><img src='".\PUBLISHER_URL."/images/links/edit.gif'"." title='"._CO_PUBLISHER_EDIT."' alt='"._CO_PUBLISHER_EDIT."'></a>"; |
|
| 411 | 411 | $adminLinks .= ' '; |
| 412 | 412 | } |
| 413 | 413 | if ($this->helper->getConfig('perm_delete') || Publisher\Utils::IsUserModerator($this) || Publisher\Utils::IsUserAdmin()) { |
| 414 | 414 | // Delete button |
| 415 | - $adminLinks .= "<a href='" . \PUBLISHER_URL . '/submit.php?op=del&itemid=' . $this->getVar('itemid') . "'><img src='" . \PUBLISHER_URL . "/images/links/delete.png'" . " title='" . _CO_PUBLISHER_DELETE . "' alt='" . _CO_PUBLISHER_DELETE . "'></a>"; |
|
| 415 | + $adminLinks .= "<a href='".\PUBLISHER_URL.'/submit.php?op=del&itemid='.$this->getVar('itemid')."'><img src='".\PUBLISHER_URL."/images/links/delete.png'"." title='"._CO_PUBLISHER_DELETE."' alt='"._CO_PUBLISHER_DELETE."'></a>"; |
|
| 416 | 416 | $adminLinks .= ' '; |
| 417 | 417 | } |
| 418 | 418 | } |
| 419 | 419 | if ($this->helper->getConfig('perm_clone') || Publisher\Utils::IsUserModerator($this) || Publisher\Utils::IsUserAdmin()) { |
| 420 | 420 | // Duplicate button |
| 421 | - $adminLinks .= "<a href='" . \PUBLISHER_URL . '/submit.php?op=clone&itemid=' . $this->getVar('itemid') . "'><img src='" . \PUBLISHER_URL . "/images/links/clone.gif'" . " title='" . _CO_PUBLISHER_CLONE . "' alt='" . _CO_PUBLISHER_CLONE . "'></a>"; |
|
| 421 | + $adminLinks .= "<a href='".\PUBLISHER_URL.'/submit.php?op=clone&itemid='.$this->getVar('itemid')."'><img src='".\PUBLISHER_URL."/images/links/clone.gif'"." title='"._CO_PUBLISHER_CLONE."' alt='"._CO_PUBLISHER_CLONE."'></a>"; |
|
| 422 | 422 | $adminLinks .= ' '; |
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | // PDF button |
| 426 | 426 | if ($xoops->service('htmltopdf')->isAvailable()) { |
| 427 | - $adminLinks .= "<a href='" . \PUBLISHER_URL . '/makepdf.php?itemid=' . $this->getVar('itemid') . "' rel='nofollow' target='_blank'><img src='" . \PUBLISHER_URL . "/images/links/pdf.gif' title='" . _CO_PUBLISHER_PDF . "' alt='" . _CO_PUBLISHER_PDF . "'></a>"; |
|
| 427 | + $adminLinks .= "<a href='".\PUBLISHER_URL.'/makepdf.php?itemid='.$this->getVar('itemid')."' rel='nofollow' target='_blank'><img src='".\PUBLISHER_URL."/images/links/pdf.gif' title='"._CO_PUBLISHER_PDF."' alt='"._CO_PUBLISHER_PDF."'></a>"; |
|
| 428 | 428 | $adminLinks .= ' '; |
| 429 | 429 | } |
| 430 | 430 | // Print button |
| 431 | - $adminLinks .= "<a href='" . Publisher\Utils::seoGenUrl('print', $this->getVar('itemid'), $this->getVar('short_url')) . "' rel='nofollow' target='_blank'><img src='" . \PUBLISHER_URL . "/images/links/print.gif' title='" . _CO_PUBLISHER_PRINT . "' alt='" . _CO_PUBLISHER_PRINT . "'></a>"; |
|
| 431 | + $adminLinks .= "<a href='".Publisher\Utils::seoGenUrl('print', $this->getVar('itemid'), $this->getVar('short_url'))."' rel='nofollow' target='_blank'><img src='".\PUBLISHER_URL."/images/links/print.gif' title='"._CO_PUBLISHER_PRINT."' alt='"._CO_PUBLISHER_PRINT."'></a>"; |
|
| 432 | 432 | $adminLinks .= ' '; |
| 433 | 433 | // Email button |
| 434 | 434 | if ($xoops->isActiveModule('tellafriend')) { |
| 435 | 435 | $subject = \sprintf(_CO_PUBLISHER_INTITEMFOUND, $xoops->getConfig('sitename')); |
| 436 | 436 | $subject = $this->_convert_for_japanese($subject); |
| 437 | 437 | $maillink = Publisher\Utils::tellafriend($subject); |
| 438 | - $adminLinks .= '<a href="' . $maillink . '"><img src="' . \PUBLISHER_URL . '/images/links/friend.gif" title="' . _CO_PUBLISHER_MAIL . '" alt="' . _CO_PUBLISHER_MAIL . '"></a>'; |
|
| 438 | + $adminLinks .= '<a href="'.$maillink.'"><img src="'.\PUBLISHER_URL.'/images/links/friend.gif" title="'._CO_PUBLISHER_MAIL.'" alt="'._CO_PUBLISHER_MAIL.'"></a>'; |
|
| 439 | 439 | $adminLinks .= ' '; |
| 440 | 440 | } |
| 441 | 441 | |
@@ -454,19 +454,19 @@ discard block |
||
| 454 | 454 | $tags['MODULE_NAME'] = $this->helper->getModule()->getVar('name'); |
| 455 | 455 | $tags['ITEM_NAME'] = $this->title(); |
| 456 | 456 | $tags['CATEGORY_NAME'] = $this->getCategoryName(); |
| 457 | - $tags['CATEGORY_URL'] = \PUBLISHER_URL . '/category.php?categoryid=' . $this->getVar('categoryid'); |
|
| 457 | + $tags['CATEGORY_URL'] = \PUBLISHER_URL.'/category.php?categoryid='.$this->getVar('categoryid'); |
|
| 458 | 458 | $tags['ITEM_BODY'] = $this->body(); |
| 459 | 459 | $tags['DATESUB'] = $this->datesub(); |
| 460 | 460 | foreach ($notifications as $notification) { |
| 461 | 461 | switch ($notification) { |
| 462 | 462 | case \_PUBLISHER_NOT_ITEM_PUBLISHED: |
| 463 | - $tags['ITEM_URL'] = \PUBLISHER_URL . '/item.php?itemid=' . $this->getVar('itemid'); |
|
| 463 | + $tags['ITEM_URL'] = \PUBLISHER_URL.'/item.php?itemid='.$this->getVar('itemid'); |
|
| 464 | 464 | $notificationHandler->triggerEvent('global', 0, 'published', $tags, [], $this->helper->getModule()->getVar('mid')); |
| 465 | 465 | $notificationHandler->triggerEvent('category', $this->getVar('categoryid'), 'published', $tags, [], $this->helper->getModule()->getVar('mid')); |
| 466 | 466 | $notificationHandler->triggerEvent('item', $this->getVar('itemid'), 'approved', $tags, [], $this->helper->getModule()->getVar('mid')); |
| 467 | 467 | break; |
| 468 | 468 | case \_PUBLISHER_NOT_ITEM_SUBMITTED: |
| 469 | - $tags['WAITINGFILES_URL'] = \PUBLISHER_URL . '/admin/item.php?itemid=' . $this->getVar('itemid'); |
|
| 469 | + $tags['WAITINGFILES_URL'] = \PUBLISHER_URL.'/admin/item.php?itemid='.$this->getVar('itemid'); |
|
| 470 | 470 | $notificationHandler->triggerEvent('global', 0, 'submitted', $tags, [], $this->helper->getModule()->getVar('mid')); |
| 471 | 471 | $notificationHandler->triggerEvent('category', $this->getVar('categoryid'), 'submitted', $tags, [], $this->helper->getModule()->getVar('mid')); |
| 472 | 472 | break; |
@@ -500,10 +500,10 @@ discard block |
||
| 500 | 500 | public function getItemLink($class = false, $maxsize = 0): ?string |
| 501 | 501 | { |
| 502 | 502 | if ($class) { |
| 503 | - return '<a class=' . $class . ' href="' . $this->getItemUrl() . '">' . $this->title($maxsize) . '</a>'; |
|
| 503 | + return '<a class='.$class.' href="'.$this->getItemUrl().'">'.$this->title($maxsize).'</a>'; |
|
| 504 | 504 | } |
| 505 | 505 | |
| 506 | - return '<a href="' . $this->getItemUrl() . '">' . $this->title($maxsize) . '</a>'; |
|
| 506 | + return '<a href="'.$this->getItemUrl().'">'.$this->title($maxsize).'</a>'; |
|
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | public function getWhoAndWhen(): string |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | $imageObjs = []; |
| 584 | 584 | if (\count($images_ids) > 0) { |
| 585 | 585 | $imageHandler = Images::getInstance()->getHandlerImages(); |
| 586 | - $criteria = new CriteriaCompo(new Criteria('image_id', '(' . \implode(',', $images_ids) . ')', 'IN')); |
|
| 586 | + $criteria = new CriteriaCompo(new Criteria('image_id', '('.\implode(',', $images_ids).')', 'IN')); |
|
| 587 | 587 | $imageObjs = $imageHandler->getObjects($criteria, true); |
| 588 | 588 | unset($criteria); |
| 589 | 589 | } |
@@ -698,12 +698,12 @@ discard block |
||
| 698 | 698 | if (\is_object($images['main'])) { |
| 699 | 699 | /* @var \ImagesImage $image */ |
| 700 | 700 | $image = $images['main']; |
| 701 | - $dimensions = \getimagesize(XoopsBaseConfig::get('root-path') . '/uploads/' . $image->getVar('image_name')); |
|
| 701 | + $dimensions = \getimagesize(XoopsBaseConfig::get('root-path').'/uploads/'.$image->getVar('image_name')); |
|
| 702 | 702 | $item['image_width'] = $dimensions[0]; |
| 703 | 703 | $item['image_height'] = $dimensions[1]; |
| 704 | - $item['image_path'] = XoopsBaseConfig::get('url') . '/uploads/' . $image->getVar('image_name'); |
|
| 704 | + $item['image_path'] = XoopsBaseConfig::get('url').'/uploads/'.$image->getVar('image_name'); |
|
| 705 | 705 | // pass this on since some consumers build custom thumbnails |
| 706 | - $item['image_vpath'] = 'uploads/' . $image->getVar('image_name'); |
|
| 706 | + $item['image_vpath'] = 'uploads/'.$image->getVar('image_name'); |
|
| 707 | 707 | $item['image_thumb'] = Xoops::getInstance()->service('thumbnail')->getImgUrl($item['image_vpath'], 0, 180)->getValue(); |
| 708 | 708 | $item['image_name'] = $image->getVar('image_nicename'); |
| 709 | 709 | } |
@@ -722,11 +722,11 @@ discard block |
||
| 722 | 722 | $i = 0; |
| 723 | 723 | /* @var \ImagesImage $image */ |
| 724 | 724 | foreach ($images['others'] as $image) { |
| 725 | - $dimensions = \getimagesize(XoopsBaseConfig::get('root-path') . '/uploads/' . $image->getVar('image_name')); |
|
| 725 | + $dimensions = \getimagesize(XoopsBaseConfig::get('root-path').'/uploads/'.$image->getVar('image_name')); |
|
| 726 | 726 | $item['images'][$i]['width'] = $dimensions[0]; |
| 727 | 727 | $item['images'][$i]['height'] = $dimensions[1]; |
| 728 | - $item['images'][$i]['path'] = XoopsBaseConfig::get('url') . '/uploads/' . $image->getVar('image_name'); |
|
| 729 | - $item['images'][$i]['thumb'] = $thumbService->getImgUrl('uploads/' . $image->getVar('image_name'), 240, 0)->getValue(); |
|
| 728 | + $item['images'][$i]['path'] = XoopsBaseConfig::get('url').'/uploads/'.$image->getVar('image_name'); |
|
| 729 | + $item['images'][$i]['thumb'] = $thumbService->getImgUrl('uploads/'.$image->getVar('image_name'), 240, 0)->getValue(); |
|
| 730 | 730 | $item['images'][$i]['name'] = $image->getVar('image_nicename'); |
| 731 | 731 | ++$i; |
| 732 | 732 | } |
@@ -744,9 +744,9 @@ discard block |
||
| 744 | 744 | { |
| 745 | 745 | $color = $this->helper->getConfig('format_highlight_color'); |
| 746 | 746 | if (0 !== \mb_strpos($color, '#')) { |
| 747 | - $color = '#' . $color; |
|
| 747 | + $color = '#'.$color; |
|
| 748 | 748 | } |
| 749 | - $pre = '<span style="font-weight: bolder; background-color: ' . $color . ';">'; |
|
| 749 | + $pre = '<span style="font-weight: bolder; background-color: '.$color.';">'; |
|
| 750 | 750 | $post = '</span>'; |
| 751 | 751 | |
| 752 | 752 | return Highlighter::apply($keywords, $content, $pre, $post); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @author The SmartFactory <www.smartfactory.ca> |
| 30 | 30 | * @version $Id$ |
| 31 | 31 | */ |
| 32 | -require_once \dirname(__DIR__) . '/include/common.php'; |
|
| 32 | +require_once \dirname(__DIR__).'/include/common.php'; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Categories handler class. |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | if (!Publisher\Utils::IsUserAdmin()) { |
| 161 | 161 | $categoriesGranted = $this->helper->getPermissionHandler()->getGrantedItems('category_read'); |
| 162 | 162 | if (\count($categoriesGranted) > 0) { |
| 163 | - $criteria->add(new Criteria('categoryid', '(' . \implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 163 | + $criteria->add(new Criteria('categoryid', '('.\implode(',', $categoriesGranted).')', 'IN')); |
|
| 164 | 164 | } else { |
| 165 | 165 | return $ret; |
| 166 | 166 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | for ($j = 0; $j < $level; ++$j) { |
| 191 | 191 | $spaces .= '--'; |
| 192 | 192 | } |
| 193 | - $theresult[$category['categoryid']] = $spaces . $category['name']; |
|
| 193 | + $theresult[$category['categoryid']] = $spaces.$category['name']; |
|
| 194 | 194 | if (isset($cat_array[$category['categoryid']])) { |
| 195 | 195 | $level = $level + 1; |
| 196 | 196 | foreach ($cat_array[$category['categoryid']] as $cat) { |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | if (!Publisher\Utils::IsUserAdmin()) { |
| 211 | 211 | $categoriesGranted = $this->helper->getPermissionHandler()->getGrantedItems('item_submit'); |
| 212 | 212 | if (\count($categoriesGranted) > 0) { |
| 213 | - $criteria->add(new Criteria('categoryid', '(' . \implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 213 | + $criteria->add(new Criteria('categoryid', '('.\implode(',', $categoriesGranted).')', 'IN')); |
|
| 214 | 214 | } else { |
| 215 | 215 | return $ret; |
| 216 | 216 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | if (!Publisher\Utils::IsUserAdmin()) { |
| 251 | 251 | $categoriesGranted = $this->helper->getPermissionHandler()->getGrantedItems('category_read'); |
| 252 | 252 | if (\count($categoriesGranted) > 0) { |
| 253 | - $criteria->add(new Criteria('categoryid', '(' . \implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 253 | + $criteria->add(new Criteria('categoryid', '('.\implode(',', $categoriesGranted).')', 'IN')); |
|
| 254 | 254 | } else { |
| 255 | 255 | return $ret; |
| 256 | 256 | } |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | if (!Publisher\Utils::IsUserAdmin()) { |
| 295 | 295 | $categoriesGranted = $this->helper->getPermissionHandler()->getGrantedItems('category_read'); |
| 296 | 296 | if (\count($categoriesGranted) > 0) { |
| 297 | - $criteria->add(new Criteria('categoryid', '(' . \implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 297 | + $criteria->add(new Criteria('categoryid', '('.\implode(',', $categoriesGranted).')', 'IN')); |
|
| 298 | 298 | } else { |
| 299 | 299 | return 0; |
| 300 | 300 | } |
@@ -315,12 +315,12 @@ discard block |
||
| 315 | 315 | public function &getSubCats($categories): array |
| 316 | 316 | { |
| 317 | 317 | $xoops = Xoops::getInstance(); |
| 318 | - $criteria = new CriteriaCompo(new Criteria('parentid', '(' . \implode(',', \array_keys($categories)) . ')', 'IN')); |
|
| 318 | + $criteria = new CriteriaCompo(new Criteria('parentid', '('.\implode(',', \array_keys($categories)).')', 'IN')); |
|
| 319 | 319 | $ret = []; |
| 320 | 320 | if (!Publisher\Utils::IsUserAdmin()) { |
| 321 | 321 | $categoriesGranted = $this->helper->getPermissionHandler()->getGrantedItems('category_read'); |
| 322 | 322 | if (\count($categoriesGranted) > 0) { |
| 323 | - $criteria->add(new Criteria('categoryid', '(' . \implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 323 | + $criteria->add(new Criteria('categoryid', '('.\implode(',', $categoriesGranted).')', 'IN')); |
|
| 324 | 324 | } else { |
| 325 | 325 | return $ret; |
| 326 | 326 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | use Xoops\Module\Plugin\PluginAbstract; |
| 29 | 29 | use XoopsModules\Publisher; |
| 30 | 30 | |
| 31 | -require_once \dirname(\dirname(__DIR__)) . '/include/common.php'; |
|
| 31 | +require_once \dirname(\dirname(__DIR__)).'/include/common.php'; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Class NotificationsPlugin |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | if ('category' === $category) { |
| 59 | 59 | // Assume we have a valid category id |
| 60 | - $sql = 'SELECT name, short_url FROM ' . $xoopsDB->prefix('publisher_categories') . ' WHERE categoryid = ' . $item_id; |
|
| 60 | + $sql = 'SELECT name, short_url FROM '.$xoopsDB->prefix('publisher_categories').' WHERE categoryid = '.$item_id; |
|
| 61 | 61 | $result = $xoopsDB->query($sql); // TODO: error check |
| 62 | 62 | $result_array = $xoopsDB->fetchArray($result); |
| 63 | 63 | $item['name'] = $result_array['name']; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | if ('item' === $category) { |
| 70 | 70 | // Assume we have a valid story id |
| 71 | - $sql = 'SELECT title, short_url FROM ' . $xoopsDB->prefix('publisher_items') . ' WHERE itemid = ' . $item_id; |
|
| 71 | + $sql = 'SELECT title, short_url FROM '.$xoopsDB->prefix('publisher_items').' WHERE itemid = '.$item_id; |
|
| 72 | 72 | $result = $xoopsDB->query($sql); // TODO: error check |
| 73 | 73 | $result_array = $xoopsDB->fetchArray($result); |
| 74 | 74 | $item['name'] = $result_array['title']; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $hightlight_key = ''; |
| 70 | 70 | } else { |
| 71 | 71 | $keywords = \implode('+', $queryarray); |
| 72 | - $hightlight_key = '&keywords=' . $keywords; |
|
| 72 | + $hightlight_key = '&keywords='.$keywords; |
|
| 73 | 73 | } |
| 74 | 74 | $itemsObjs = $helper->getItemHandler()->getItemsFromSearch($queryarray, $andor, $limit, $offset, $userid, $categories, $sortby, $searchin, $extra); |
| 75 | 75 | $withCategoryPath = $helper->getConfig('search_cat_path'); |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | foreach ($itemsObjs as $obj) { |
| 80 | 80 | $item['image'] = 'images/item_icon.gif'; |
| 81 | 81 | $item['link'] = $obj->getItemUrl(); |
| 82 | - $item['link'] .= (!empty($hightlight_key) && (false === \mb_strpos($item['link'], '.php?'))) ? '?' . \ltrim($hightlight_key, '&') : $hightlight_key; |
|
| 82 | + $item['link'] .= (!empty($hightlight_key) && (false === \mb_strpos($item['link'], '.php?'))) ? '?'.\ltrim($hightlight_key, '&') : $hightlight_key; |
|
| 83 | 83 | if ($withCategoryPath) { |
| 84 | - $item['title'] = $obj->getCategoryPath(false) . ' > ' . $obj->title(); |
|
| 84 | + $item['title'] = $obj->getCategoryPath(false).' > '.$obj->title(); |
|
| 85 | 85 | } else { |
| 86 | 86 | $item['title'] = $obj->title(); |
| 87 | 87 | } |