| Server IP : 54.36.91.62 / Your IP : 216.73.217.111 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/annonces/plugins/djcatalog2/jlexreview/ |
Upload File : |
<?php
/**
* @version 1.0
* @package Content - JLex Review
* @copyright Copyright (C) 2013 joomla-extensions.info. All rights reserved.
* @license GNU/GPL or later
* @author JLEX team
*/
defined ( '_JEXEC' ) or die ( 'Restricted access' );
jimport ( 'joomla.filesystem.file' );
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\CMSPlugin;
class plgDJCatalog2JLexReview extends CMSPlugin {
public function __construct(&$subject, $config = array())
{
parent::__construct ( $subject, $config );
$this->loadLanguage ();
}
public function onAfterDJCatalog2DisplayTitle(&$row, &$params, $page = 0, $context = 'item') {
$option = 'djcatalog2';
$factory = JPATH_ROOT . '/components/com_jlexreview/load.php';
if (! File::exists ( $factory ))
return '';
require_once $factory;
$html = '<div class="djc_jlexreview_top"><div class="template-reviews-link">';
$html.= '<a class="modal" rel="{handler: \'adopt\', target: \'template-reviews\', size: {x: 800, y: \'100%\'}, '
.'onOpen: function() { initTemplateReviews(); window.addEvent(\'resize\', function(){ this.resize({x: (window.getSize().x > 800 ? 800 : window.getSize().x - 100), y: window.getSize().y - 100}, true); '
.'var reviewsInner = document.id(\'sbox-content\').getElement(\'.template-reviews\'); '
.'reviewsInner.setStyle(\'width\', this.size.x); '
.'reviewsInner.setStyle(\'height\', this.size.y); }.bind(this) ); '
.'window.fireEvent(\'resize\'); }, '
.'onClose: function() { window.location.reload() }}" >';
preg_match('/data-count="(\d+)"/', $html, $match);
$count = isset($match[1]) ? $match[1] : 0;
$html.= 'Reviews ('.$count.')</a>';
$html.= JLexReviewLoad::quick_init ( $option, $row->id );
$html.= '</div></div>';
return $html;
}
public function onAfterDJCatalog2DisplayContent(&$row, &$params, $page = 0, $context = 'item') {
Joomla\CMS\HTML\HTMLHelper::_ ( 'behavior.keepalive' ); // Keep session
$option = 'djcatalog2';
$factory = JPATH_ROOT . '/components/com_jlexreview/load.php';
if (! File::exists ( $factory ))
return '';
$id = Factory::getApplication()->input->getInt( 'id' );
if ($id != $row->id)
return '';
require_once $factory;
$html = '<div class="djc_jlexreview_bottom"><div id="template-reviews" class="template-reviews" style="position: relative;">';
$html.= JLexReviewLoad::init ( $row->name, $option, $row->id );
$html.= '</div></div>';
return $html;
}
}