Example #1
0
 /**
  * Load Assets which are require for quick2cart.
  *
  * @return  null.
  *
  * @since   12.2
  */
 public static function loadQuicartAssetFiles()
 {
     // Load js assets
     jimport('joomla.filesystem.file');
     $tjStrapperPath = JPATH_SITE . '/media/techjoomla_strapper/tjstrapper.php';
     if (JFile::exists($tjStrapperPath)) {
         require_once $tjStrapperPath;
         TjStrapper::loadTjAssets('com_quick2cart');
     }
 }
Example #2
0
 /**
  * Adding required JS files
  */
 public function onAfterRoute()
 {
     $document = JFactory::getDocument();
     $app = JFactory::getApplication();
     // Return if called from backend EXCEPT FOR INSTALLER
     if ($app->getName() != 'site') {
         $jinput = JFactory::getApplication()->input;
         $option = $jinput->get("option");
         if ($option == "com_installer") {
             $document->addStyleSheet(JUri::root(true) . '/media/techjoomla_strapper/css/bootstrap.min.css');
         } else {
             if ($option == "com_quick2cart" && $this->_exits_q2c()) {
                 $this->_loadHelperFiles();
             }
         }
         return;
     }
     // IF Q2C NOT EXIST
     if (!$this->_exits_q2c()) {
         return;
     }
     if (!defined('TJ_QTC_MULTI_LOAD')) {
         $this->_loadHelperFiles();
         $document = JFactory::getDocument();
         /*bootstrap related*/
         $comparams = JComponentHelper::getParams('com_quick2cart');
         //$document->addStyleSheet(JUri::root().'components/com_quick2cart/assets/css/quick2cart_style.css' );
         $document->addStyleSheet(JUri::root(true) . '/components/com_quick2cart/assets/css/quick2cart.css');
         // Now we are usng common tjassetloader plg so removed
         //include_once JPATH_ROOT.'/media/techjoomla_strapper/strapper.php';
         //TjAkeebaStrapper::bootstrap();
         // Loading tj strapper
         jimport('joomla.filesystem.file');
         $tjStrapperPath = JPATH_SITE . '/media/techjoomla_strapper/tjstrapper.php';
         if (JFile::exists($tjStrapperPath)) {
             require_once $tjStrapperPath;
             TjStrapper::loadTjAssets('com_quick2cart');
         }
         //FOR J3.X. some template require to load bootstrap file so LOAD IT
         $laod_boostrap = $comparams->get('loadBootstrap');
         if (!empty($laod_boostrap)) {
             $document->addStyleSheet(JUri::root(true) . '/media/jui/css/bootstrap.min.css');
         }
         /*bootstrap related*/
         //  vm: for " No 'Access-Control-Allow-Origin'"
         $reqURI = JUri::root();
         // If host have wwww, but Config doesn't.
         if (isset($_SERVER['HTTP_HOST'])) {
             if (substr_count($_SERVER['HTTP_HOST'], "www.") != 0 && substr_count($reqURI, "www.") == 0) {
                 $reqURI = str_replace("://", "://www.", $reqURI);
             } else {
                 if (substr_count($_SERVER['HTTP_HOST'], "www.") == 0 && substr_count($reqURI, "www.") != 0) {
                     // host do not have 'www' but Config does
                     $reqURI = str_replace("www.", "", $reqURI);
                 }
             }
         }
         //$document->addScript(JUri::root().'components/com_quick2cart/assets/js/jquery-1.7.1.min.js');
         //$document->addScript(JUri::root().'components/com_quick2cart/assets/js/order.js');
         $js = "var qtc_token = '" . JSession::getFormToken() . "';\n\t\t\tvar qtc_base_url = '" . $reqURI . "';";
         $document->addScriptDeclaration($js);
         define('TJ_QTC_MULTI_LOAD', 1);
     }
 }
Example #3
0
 * @link     http://www.techjoomla.com
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
if (!defined('DS')) {
    define('DS', DIRECTORY_SEPARATOR);
}
jimport('joomla.filesystem.folder');
$doc = JFactory::getDocument();
if (JFolder::exists(JPATH_ROOT . '/components/com_socialads')) {
    // Load js assets
    jimport('joomla.filesystem.file');
    $tjStrapperPath = JPATH_SITE . '/media/techjoomla_strapper/tjstrapper.php';
    if (JFile::exists($tjStrapperPath)) {
        require_once $tjStrapperPath;
        TjStrapper::loadTjAssets('com_socialads');
    }
    // Load CSS & JS resources.
    if (JVERSION > '3.0') {
        require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php";
        $laod_boostrap = $socialads_config['load_bootstrap'];
        if (!empty($laod_boostrap)) {
            // Load bootstrap CSS and JS.
            JHtml::_('bootstrap.loadcss');
            JHtml::_('bootstrap.framework');
        }
    }
    /*@ Need to check
    	 * $namespace_js = JUri::root().'media'.DS.'techjoomla_strapper'.DS.'js'.DS.'namespace.js';
    		$flg=0;
    		foreach($doc->_scripts as $name=>$ar)
Example #4
0
    JHtml::_('behavior.tooltip');
} else {
    // Define wrapper class
    define('TJFIELDS_WRAPPER_CLASS', "tjfields-wrapper");
    // Tabstate
    JHtml::_('behavior.tabstate');
    // Other
    JHtml::_('behavior.tooltip');
    // Bootstrap tooltip and chosen js
    JHtml::_('bootstrap.tooltip');
    JHtml::_('behavior.multiselect');
    JHtml::_('formbehavior.chosen', 'select');
}
// Load techjoomla strapper
if (file_exists(JPATH_ROOT . '/media/techjoomla_strapper/tjstrapper.php')) {
    require_once JPATH_ROOT . '/media/techjoomla_strapper/tjstrapper.php';
    TjStrapper::loadTjAssets('com_tjfields');
}
$document = JFactory::getDocument();
$document->addStyleSheet(JUri::base() . 'components/com_tjfields/assets/css/tjfields.css');
// Include helper file
$helperPath = dirname(__FILE__) . '/helpers/tjfields.php';
if (!class_exists('TjfieldsHelper')) {
    JLoader::register('TjfieldsHelper', $helperPath);
    JLoader::load('TjfieldsHelper');
}
// Include dependancies
jimport('joomla.application.component.controller');
$controller = JControllerLegacy::getInstance('Tjfields');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();