| Server IP : 54.36.91.62 / Your IP : 216.73.217.117 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/voscatalogues/plugins/system/djc2yootheme/ |
Upload File : |
<?php
/**
* @package DJ-Catalog2-Yootheme
* @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://dj-extensions.com
* @author email contact@dj-extensions.com
*/
// No direct access to this file
defined('_JEXEC') or die;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Factory;
use Joomla\CMS\Component\ComponentHelper;
/**
* Script file of HelloWorld module
*/
class plgSystemDjc2yoothemeInstallerScript
{
/**
* Method to install the extension
* $parent is the class calling this method
*
* @return void
*/
function install($parent)
{
$html = '<style type="text/css">
.djex-info { padding: 20px 30px 10px; margin: 0 0 20px 0; background: #e83d57; color: #fff; border: 1px solid #453d38; font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; -webkit-border-radius: 4px; border-radius: 4px; }
.djex-title { text-transform: uppercase; font-weight: bold; font-size: 14px; }
.djex-info a:link, .djex-info a:visited, .djex-info a:hover { color:#fff; text-decoration:underline; font-weight: 600; }
.djex-info img { float: left; margin: 0 30px 10px 0; }
</style>
<div class="djex-info"><img src='.Uri::root().'plugins/system/djc2yootheme/assets/djc2-integration-yootheme.png style="width: 25%;"> <p class="djex-title">Thank you for installing DJC2-YooTheme-Integration plugin!</p>
<p>The DJC2-YooTheme-Integration is an advanced system plugin for your Joomla and YooTheme! It provides dynamic-content support for DJ-Catalog2 component and many more functions.
If you want to learn how to use DJC2-YooTheme-Integration plugin please read <a target="_blank" href="https://support.dj-extensions.com/portal/en/kb/extensions/djcat2-yootheme-integration">Documentation</a> and visit our <a target="_blank" href="https://dj-extensions.com/yootheme/dj-catalog2-integrator ">Product page</a></p>
<p>Check out our other extensions at <a target="_blank" href="https://dj-extensions.com">DJ-Extensions.com</a></p>
<div style="clear:both"></div></div>';
echo $html;
$db = Factory::getDbo();
$db->setQuery("SHOW COLUMNS FROM #__djc2_producers");
$producers_columns = $db->loadColumn(0);
if(!in_array('producer_layout',$producers_columns)){
$query = 'ALTER TABLE `#__djc2_producers` ADD COLUMN `producer_layout` mediumtext';
$db->setQuery($query);
$db->execute();
}
$db->setQuery("SHOW COLUMNS FROM #__djc2_items");
$products_columns = $db->loadColumn(0);
if(!in_array('product_layout',$products_columns)){
$query = 'ALTER TABLE `#__djc2_items` ADD `product_layout` mediumtext';
$db->setQuery($query);
$db->execute();
}
}
/**
* Method to uninstall the extension
* $parent is the class calling this method
*
* @return void
*/
function uninstall($parent)
{
echo '<p>DJC2-YooTheme-Integration has been uninstalled.</p>';
$db = Factory::getDbo();
$query = 'ALTER TABLE `#__djc2_items` DROP COLUMN `product_layout`';
$db->setQuery($query);
$db->execute();
$query = 'ALTER TABLE `#__djc2_producers` DROP COLUMN `producer_layout`';
$db->setQuery($query);
$db->execute();
}
/**
* Method to update the extension
* $parent is the class calling this method
*
* @return void
*/
function update($parent)
{
$html = '<style type="text/css">
.djex-info { padding: 20px 30px 10px; margin: 0 0 20px 0; background: #e83d57; color: #fff; border: 1px solid #453d38; font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; -webkit-border-radius: 4px; border-radius: 4px; }
.djex-title { text-transform: uppercase; font-weight: bold; font-size: 14px; }
.djex-info a:link, .djex-info a:visited, .djex-info a:hover { color:#fff; text-decoration:underline; font-weight: 600; }
.djex-info img { float: left; margin: 0 30px 10px 0; }
</style>
<div class="djex-info"><img src='.Uri::root().'plugins/system/djc2yootheme/assets/djc2-integration-yootheme.png style="width: 25%;"> <p class="djex-title">DJC2-YooTheme-Integration plugin has been updated to version: ' . $parent->getManifest()->version .'</p>
<p>Please read <a target="_blank" href="https://support.dj-extensions.com/portal/en/kb/extensions/djcat2-yootheme-integration">Changelog</a> and visit our <a target="_blank" href="https://dj-extensions.com/yootheme/dj-catalog2-integrator ">Product page</a></p>
<p>Check out our other extensions at <a target="_blank" href="https://dj-extensions.com">DJ-Extensions.com</a></p>
<div style="clear:both"></div></div>';
echo $html;
$db = Factory::getDbo();
$db->setQuery("SHOW COLUMNS FROM #__djc2_producers");
$producers_columns = $db->loadColumn(0);
if(!in_array('producer_layout',$producers_columns)){
$query = 'ALTER TABLE `#__djc2_producers` ADD COLUMN `producer_layout` mediumtext';
$db->setQuery($query);
$db->execute();
}
}
/**
* Method to run before an install/update/uninstall method
* $parent is the class calling this method
* $type is the type of change (install, update or discover_install)
*
* @return void
*/
function preflight($type, $parent)
{
$db = Factory::getDbo();
$db->setQuery("SELECT enabled FROM #__extensions WHERE name = 'yootheme' AND type = 'template' ");
$yootheme_enabled = $db->loadResult();
if($type == 'update' || $type == 'install'){
if ($yootheme_enabled == 0) {
Factory::getApplication()->enqueueMessage(JText::_('Please install YooTheme Builder before installing DJC2-YooTheme-Integration plugin!'));
return false;
}
if (!ComponentHelper::getComponent('com_djcatalog2', true)->enabled)
{
Factory::getApplication()->enqueueMessage(JText::_('Please install DJ-Catalog2 component before installing DJC2-YooTheme-Integration plugin!'));
return false;
}
}
}
/**
* Method to run after an install/update/uninstall method
* $parent is the class calling this method
* $type is the type of change (install, update or discover_install)
*
* @return void
*/
function postflight($type, $parent)
{
{
if($type == 'install'){
$db = Factory::getDbo();
$query = $db->getQuery(true);
$fields = array(
$db->quoteName('enabled') . ' = 1',
);
$conditions = array(
$db->quoteName('element') . ' = ' . $db->quote('djc2yootheme'),
$db->quoteName('type') . ' = ' . $db->quote('plugin')
);
$query->update($db->quoteName('#__extensions'))->set($fields)->where($conditions);
$db->setQuery($query);
$db->execute();
}
}
}
}