primo commit
This commit is contained in:
77
plugins/system/tabulizercsslegacy/tabulizercsslegacy.php
Normal file
77
plugins/system/tabulizercsslegacy/tabulizercsslegacy.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 6.2.6 tabulizer $
|
||||
* @package tabulizer
|
||||
* @copyright Copyright © 2011 - All rights reserved.
|
||||
* @license GNU/GPL
|
||||
* @author Dimitrios Mourloukos
|
||||
* @author mail info@alterora.gr
|
||||
* @website www.tabulizer.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport( 'joomla.plugin.plugin' );
|
||||
|
||||
if(!defined('DS')){define('DS',DIRECTORY_SEPARATOR);}
|
||||
|
||||
|
||||
class plgSystemtabulizercsslegacy extends JPlugin
|
||||
{
|
||||
function __construct(& $subject, $config) {
|
||||
parent::__construct($subject, $config);
|
||||
$this->loadLanguage();
|
||||
}
|
||||
|
||||
function onAfterRoute() {
|
||||
$JApplication=JFactory::getApplication();
|
||||
|
||||
if(!$JApplication->isAdmin()) {
|
||||
# add all css files in folder
|
||||
$cssfiles = array();
|
||||
$relative_dir = $this->params->get('csspath');
|
||||
|
||||
// remove starting slash, if needed
|
||||
$first_char = substr($relative_dir, 0, 1);
|
||||
if (($first_char == '/') || ($first_char == '\\')) {
|
||||
$relative_dir = substr($relative_dir, 1);
|
||||
}
|
||||
|
||||
// add missing ending slash, if needed
|
||||
$last_char = substr($relative_dir, -1);
|
||||
if (($last_char != '/') && ($last_char != '\\')) {
|
||||
$relative_dir .= '/';
|
||||
}
|
||||
|
||||
$dir = JPATH_ROOT .DIRECTORY_SEPARATOR. $relative_dir;
|
||||
if (is_dir($dir)) {
|
||||
if ($dh = opendir($dir)) {
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if (is_file($dir . $file)) {
|
||||
if (preg_match('/().css$/',$file)) {
|
||||
$cssfiles[] = $relative_dir . $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!empty($cssfiles)) {
|
||||
$doc=JFactory::getDocument();
|
||||
foreach ($cssfiles as $cssfile) {
|
||||
$doc->addStyleSheet($cssfile);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
31
plugins/system/tabulizercsslegacy/tabulizercsslegacy.xml
Normal file
31
plugins/system/tabulizercsslegacy/tabulizercsslegacy.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="plugin" version="1.5" group="system" method="upgrade">
|
||||
<name>System - Tabulizer CSS Legacy</name>
|
||||
<creationDate>2019-01-17</creationDate>
|
||||
<copyright>Copyright (C) 2011. All rights reserved.</copyright>
|
||||
<license>GNU General Public License</license>
|
||||
<author>Dimitrios Mourloukos</author>
|
||||
<authorEmail>info@alterora.gr</authorEmail>
|
||||
<authorUrl>www.tabulizer.gr</authorUrl>
|
||||
<version>6.2.6</version>
|
||||
|
||||
<description>PLG_TABULIZERCSSLEGACY_INSTALLATION_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename plugin="tabulizercsslegacy">tabulizercsslegacy.php</filename>
|
||||
</files>
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/en-GB.plg_system_tabulizercsslegacy.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.plg_system_tabulizercsslegacy.sys.ini</language>
|
||||
</languages>
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic" label="basic">
|
||||
<field type="spacer" default="" />
|
||||
<field name="csspath" type="text" size="40" default="templates/tabulizer/legacy/css" label="PLG_TABULIZERCSSLEGACY_CSSPATH_LABEL" description="PLG_TABULIZERCSSLEGACY_CSSPATH_DESCRIPTION" />
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
<params>
|
||||
<param name="csspath" type="text" size="40" default="templates/tabulizer/legacy/css" label="PLG_TABULIZERCSSLEGACY_CSSPATH_LABEL" description="PLG_TABULIZERCSSLEGACY_CSSPATH_DESCRIPTION" />
|
||||
</params>
|
||||
</extension>
|
||||
Reference in New Issue
Block a user