| Current Path : /home/pteabiscqq/www/plugins/system/lab5_cookie_commander/cookie_commander/ |
| Current File : /home/pteabiscqq/www/plugins/system/lab5_cookie_commander/cookie_commander/function.pathing.php |
<?php defined('_JEXEC') or die();
/////////////////////////////////////////////////////////////////////////////////////////////
/**
* Cookie Commander
*
* @author : Lab5 - Dennis Riegelsberger
* @authorUrl : https://lab5.ch
* @copyright : Copyright (C) 2018+ Lab5 - Dennis Riegelsberger. All rights reserved.
* @license : GNU/GPL General Public License version 2 or later
* @project : https://lab5.ch/cookie-commander
* @on JED : https://extensions.joomla.org/extensions/extension/site-management/cookie-control/lab5-cookie-commander/
*
* Built with <3
* Lab5
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* @CHANGELOG :
* * 2020.08.10 : Great overhaul
*/
/////////////////////////////////////////////////////////////////////////////////////////////
if ( self::$this->params->get('cw_on', false )
OR self::$this->params->get('anal_activate_google', false ) OR self::$this->params->get('anal_activate_piwik', false ) ) :
/////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
self::$xstor->getCCLayoutPath = function( $layout = 'default'){
////////////////////////////////////////////////////////////////////////////
$paths = (self::$xstor->getCCPaths)();
$paths->tPath .= '/'.$layout.'.php';
$paths->dPath .= '/'.$layout.'.php';
// echo "\n<br>" . $paths->tPath;
// echo "\n<br>" . $paths->dPath;
if (file_exists($paths->tPath)) return $paths->tPath; // If the template has a layout override use it
elseif (file_exists($paths->dPath)) return $paths->dPath;
return false;
die("\n<br>[Cookie Commander] : Folder / File not found!" );
}; /////////////////////////////////////////////////////////////////////////
// print_r( (self::$xstor->getCCLayoutPath)() ); exit;
////////////////////////////////////////////////////////////////////////////
self::$xstor->getCCPaths = function( ){
////////////////////////////////////////////////////////////////////////////
$template = \JFactory::getApplication()->getTemplate();
$paths = new StdClass();
if( isset(self::$this->template) && self::$this->template ){
$extensiontype = "template";
}elseif( isset(self::$this->_type) && self::$this->_type && isset(self::$this->_name) && self::$this->_name ){
$extensiontype = "plugin";
}else{
die("\n<br>[Cookie Commander] : Extension type could not be evaluated!" );
}
switch( $extensiontype ){
////////////////////////////////////////
//////////////////////
case "plugin":
//////////////////////
// template folder
$tfolder = 'plg_' . self::$this->_type . '_' . self::$this->_name ;
// default folder
$dfolder = self::$this->_type . '/' . self::$this->_name ;
if( self::$this->_name == "lab5_jpowertools" ){
$tfolder .= '/cookie_commander' ;
}
$tPath = JPATH_THEMES . '/' . $template . '/html/' . $tfolder ;
$dPath = JPATH_PLUGINS . '/' . $dfolder . '/cookie_commander/tmpl' ;
break;
//////////////////////
case "template":
//////////////////////
default:
$tPath = JPATH_THEMES . '/' . $template . '/html/cookie_commander' ;
$dPath = JPATH_THEMES . '/' . $template . '/template/cookie_commander/tmpl' ;
break;
////////////////////////////////////////
}
$paths->tPath = $tPath ;
$paths->dPath = $dPath ;
return $paths ;
}; /////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
endif;