roxcoder

index.php

Nov 24th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.24 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package Helix3 Framework
  4.  * Template Name - Shaper Helix3
  5.  * @author JoomShaper http://www.joomshaper.com
  6.  * @copyright Copyright (c) 2010 - 2015 JoomShaper
  7.  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
  8. */
  9. //no direct accees
  10. defined ('_JEXEC') or die ('resticted aceess');
  11.  
  12. $doc = JFactory::getDocument();
  13.  
  14. JHtml::_('jquery.framework');
  15. JHtml::_('bootstrap.framework'); //Force load Bootstrap
  16. unset($doc->_scripts[$this->baseurl . '/media/jui/js/bootstrap.min.js']); // Remove joomla core bootstrap
  17.  
  18. // Get Active Menu
  19. $active = JFactory::getApplication()->getMenu()->getActive();
  20. $activeClass = (isset($active->alias)) ? $active->alias : '' ;
  21.  
  22. //Load Helix
  23. $helix3_path = JPATH_PLUGINS.'/system/helix3/core/helix3.php';
  24.  
  25. if (file_exists($helix3_path)) {
  26.     require_once($helix3_path);
  27.     $this->helix3 = helix3::getInstance();
  28. } else {
  29.     die('Please install and activate helix plugin');
  30. }
  31.  
  32. //Coming Soon
  33. if($this->helix3->getParam('comingsoon_mode')) header("Location: ".$this->baseUrl."?tmpl=comingsoon");
  34.  
  35. //Class Classes
  36. $body_classes = '';
  37.  
  38. if($this->helix3->getParam('sticky_header')) {
  39.     $body_classes .= ' sticky-header';
  40. }
  41.  
  42. $body_classes .= ($this->helix3->getParam('boxed_layout', 0)) ? ' layout-boxed' : ' layout-fluid';
  43.  
  44. //Body Background Image
  45. if($bg_image = $this->helix3->getParam('body_bg_image')) {
  46.  
  47.     $body_style  = 'background-image: url(' . JURI::base(true ) . '/' . $bg_image . ');';
  48.     $body_style .= 'background-repeat: '. $this->helix3->getParam('body_bg_repeat') .';';
  49.     $body_style .= 'background-size: '. $this->helix3->getParam('body_bg_size') .';';
  50.     $body_style .= 'background-attachment: '. $this->helix3->getParam('body_bg_attachment') .';';
  51.     $body_style .= 'background-position: '. $this->helix3->getParam('body_bg_position') .';';
  52.     $body_style  = 'body.site {' . $body_style . '}';
  53.  
  54.     $doc->addStyledeclaration( $body_style );
  55. }
  56.  
  57. //Body Font
  58. $webfonts = array();
  59.  
  60. if( $this->params->get('enable_body_font') ) {
  61.     $webfonts['body'] = $this->params->get('body_font');
  62. }
  63.  
  64. //Heading1 Font
  65. if( $this->params->get('enable_h1_font') ) {
  66.     $webfonts['h1'] = $this->params->get('h1_font');
  67. }
  68.  
  69. //Heading2 Font
  70. if( $this->params->get('enable_h2_font') ) {
  71.     $webfonts['h2'] = $this->params->get('h2_font');
  72. }
  73.  
  74. //Heading3 Font
  75. if( $this->params->get('enable_h3_font') ) {
  76.     $webfonts['h3'] = $this->params->get('h3_font');
  77. }
  78.  
  79. //Heading4 Font
  80. if( $this->params->get('enable_h4_font') ) {
  81.     $webfonts['h4'] = $this->params->get('h4_font');
  82. }
  83.  
  84. //Heading5 Font
  85. if( $this->params->get('enable_h5_font') ) {
  86.     $webfonts['h5'] = $this->params->get('h5_font');
  87. }
  88.  
  89. //Heading6 Font
  90. if( $this->params->get('enable_h6_font') ) {
  91.     $webfonts['h6'] = $this->params->get('h6_font');
  92. }
  93.  
  94. //Navigation Font
  95. if( $this->params->get('enable_navigation_font') ) {
  96.     $webfonts['.sp-megamenu-parent'] = $this->params->get('navigation_font');
  97. }
  98.  
  99. //Custom Font
  100. if( $this->params->get('enable_custom_font') && $this->params->get('custom_font_selectors') ) {
  101.     $webfonts[ $this->params->get('custom_font_selectors') ] = $this->params->get('custom_font');
  102. }
  103.  
  104. $this->helix3->addGoogleFont($webfonts);
  105.  
  106. //Custom CSS
  107. if($custom_css = $this->helix3->getParam('custom_css')) {
  108.     $doc->addStyledeclaration( $custom_css );
  109. }
  110.  
  111. //Custom JS
  112. if($custom_js = $this->helix3->getParam('custom_js')) {
  113.     $doc->addScriptdeclaration( $custom_js );
  114. }
  115.  
  116.  
  117. $doc->addScriptdeclaration( "\nvar onePageUrl = '".JURI::base() . "';\n" );
  118.  
  119. ?>
  120. <!DOCTYPE html>
  121. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
  122. <head>
  123.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  124.     <meta name="viewport" content="width=device-width, initial-scale=1">
  125.     <?php
  126.     if($favicon = $this->helix3->getParam('favicon')) {
  127.         $doc->addFavicon( JURI::base(true) . '/' .  $favicon);
  128.     } else {
  129.         $doc->addFavicon( $this->helix3->getTemplateUri() . '/images/favicon.ico' );
  130.     }
  131.     ?>
  132.  
  133.     <jdoc:include type="head" />
  134.    
  135.     <?php
  136.  
  137.     $this->helix3->addCSS('bootstrap.min.css, font-awesome.min.css') // CSS Files
  138.         ->addJS('bootstrap.min.js, jquery.sticky.js, main.js, jquery.nav.js') // JS Files
  139.         ->lessInit()->setLessVariables(array(
  140.             'preset'=>$this->helix3->Preset(),
  141.             'bg_color'=> $this->helix3->PresetParam('_bg'),
  142.             'text_color'=> $this->helix3->PresetParam('_text'),
  143.             'major_color'=> $this->helix3->PresetParam('_major')
  144.             ))
  145.         ->addLess('legacy/bootstrap', 'legacy')
  146.         ->addLess('master', 'template');
  147.  
  148.         //RTL
  149.         if($this->direction=='rtl') {
  150.             $this->helix3->addCSS('bootstrap-rtl.min.css')
  151.             ->addLess('rtl', 'rtl');
  152.         }
  153.  
  154.         $this->helix3->addLess('presets',  'presets/'.$this->helix3->Preset(), array('class'=>'preset'));
  155.        
  156.         //Before Head
  157.         if($before_head = $this->helix3->getParam('before_head')) {
  158.             echo $before_head . "\n";
  159.         }
  160.     ?>
  161. </head>
  162. <body class="<?php echo $this->helix3->bodyClass( $body_classes ) . ' ' . $activeClass; ?>">
  163.     <div class="body-innerwrapper">
  164.         <?php $this->helix3->generatelayout(); ?>
  165.  
  166.         <div class="offcanvas-menu">
  167.             <a href="#" class="close-offcanvas"><i class="fa fa-remove"></i></a>
  168.             <div class="offcanvas-inner">
  169.                 <?php if ($this->helix3->countModules('offcanvas')) { ?>
  170.                     <jdoc:include type="modules" name="offcanvas" style="sp_xhtml" />
  171.                 <?php } else { ?>
  172.                     <p class="alert alert-warning"><?php echo JText::_('HELIX_NO_MODULE_OFFCANVAS'); ?></p>
  173.                 <?php } ?>
  174.             </div>
  175.         </div>
  176.     </div>
  177.     <?php
  178.    
  179.     if($this->params->get('compress_css')) {
  180.         $this->helix3->compressCSS();
  181.     }
  182.  
  183.     if($this->params->get('compress_js')) {
  184.         $this->helix3->compressJS( $this->params->get('exclude_js') );
  185.     }
  186.  
  187.     if($before_body = $this->helix3->getParam('before_body')) {
  188.         echo $before_body . "\n";
  189.     }
  190.  
  191.     ?>
  192.     <jdoc:include type="modules" name="debug" />
  193. </body>
  194. </html>
Advertisement
Add Comment
Please, Sign In to add comment