public function display()
 {
     require_once dirname(__FILE__) . '../../../../modules/designerpreview/defines.inc.php';
     Tools::safePostVars();
     // assign css_files and js_files at the very last time
     if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) {
         // CSS compressor management
         if (Configuration::get('PS_CSS_THEME_CACHE')) {
             $this->css_files = Media::cccCSS($this->css_files);
         }
         //JS compressor management
         if (Configuration::get('PS_JS_THEME_CACHE') && !$this->useMobileTheme()) {
             $this->js_files = Media::cccJs($this->js_files);
         }
     }
     $this->context->smarty->assign(array('css_files' => $this->css_files, 'errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer));
     if ((int) implode(explode('.', _PS_VERSION_)) > 1606) {
         // For versions > 1.6.0.6
         $this->context->smarty->assign(array('js_files' => $this->getLayout() && (bool) Configuration::get('PS_JS_DEFER') ? array() : $this->js_files, 'js_defer' => (bool) Configuration::get('PS_JS_DEFER')));
     } else {
         $this->context->smarty->assign(array('js_files' => $this->getLayout() ? array() : $this->js_files));
     }
     $live_edit_content = '';
     // Don't use live edit if on mobile device
     if (!$this->useMobileTheme() && $this->checkLiveEditAccess()) {
         $live_edit_content = $this->getLiveEditFooter();
     }
     $layout = $this->getLayout();
     if ($layout) {
         if ($this->template) {
             $this->context->smarty->assign('template', $this->context->smarty->fetch($this->template) . $live_edit_content);
         } else {
             ob_start();
             $this->displayContent();
             $template = ob_get_contents();
             ob_clean();
             $this->context->smarty->assign('template', $template . $live_edit_content);
         }
         $this->smartyOutputContent($layout);
     } else {
         Tools::displayAsDeprecated('layout.tpl is missing in your theme directory');
         if ($this->display_header) {
             $this->smartyOutputContent(getThemeDir() . 'header.tpl');
         }
         if ($this->template) {
             $this->smartyOutputContent($this->template);
         } else {
             // For retrocompatibility with 1.4 controller
             $this->displayContent();
         }
         if ($this->display_footer) {
             $this->smartyOutputContent(getThemeDir() . 'footer.tpl');
         }
     }
     return true;
 }
예제 #2
0
 public function display()
 {
     Tools::safePostVars();
     // assign css_files and js_files at the very last time
     if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) {
         // CSS compressor management
         if (Configuration::get('PS_CSS_THEME_CACHE')) {
             $this->css_files = Media::cccCSS($this->css_files);
         }
         //JS compressor management
         if (Configuration::get('PS_JS_THEME_CACHE') && !$this->useMobileTheme()) {
             $this->js_files = Media::cccJs($this->js_files);
         }
     }
     $this->context->smarty->assign(array('css_files' => $this->css_files, 'js_files' => $this->getLayout() && (bool) Configuration::get('PS_JS_DEFER') ? array() : $this->js_files, 'js_defer' => (bool) Configuration::get('PS_JS_DEFER'), 'errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer));
     $layout = $this->getLayout();
     if ($layout) {
         if ($this->template) {
             $template = $this->context->smarty->fetch($this->template);
         } else {
             ob_start();
             $this->displayContent();
             $template = ob_get_contents();
             ob_clean();
         }
         $template = $this->context->smarty->assign('template', $template);
         $this->smartyOutputContent($layout);
     } else {
         Tools::displayAsDeprecated('layout.tpl is missing in your theme directory');
         if ($this->display_header) {
             $this->smartyOutputContent(_PS_THEME_DIR_ . 'header.tpl');
         }
         if ($this->template) {
             $this->smartyOutputContent($this->template);
         } else {
             // For retrocompatibility with 1.4 controller
             $this->displayContent();
         }
         if ($this->display_footer) {
             $this->smartyOutputContent(_PS_THEME_DIR_ . 'footer.tpl');
         }
     }
     return true;
 }
예제 #3
0
 public function display()
 {
     Tools::safePostVars();
     // assign css_files and js_files at the very last time
     if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) {
         // CSS compressor management
         if (Configuration::get('PS_CSS_THEME_CACHE')) {
             $this->css_files = Media::cccCSS($this->css_files);
         }
         //JS compressor management
         if (Configuration::get('PS_JS_THEME_CACHE')) {
             $this->js_files = Media::cccJs($this->js_files);
         }
     }
     $this->context->smarty->assign('css_files', $this->css_files);
     $this->context->smarty->assign('js_files', array_unique($this->js_files));
     $this->context->smarty->assign(array('errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer));
     $live_edit_content = '';
     // Don't use live edit if on mobile device
     if (!$this->context->getMobileDevice() && $this->checkLiveEditAccess()) {
         $live_edit_content = $this->getLiveEditFooter();
     }
     $layout = $this->getLayout();
     if ($layout) {
         if ($this->template) {
             $this->context->smarty->assign('template', $this->context->smarty->fetch($this->template) . $live_edit_content);
         } else {
             ob_start();
             $this->displayContent();
             $template = ob_get_contents();
             ob_clean();
             $this->context->smarty->assign('template', $template . $live_edit_content);
         }
         $this->smartyOutputContent($layout);
     } else {
         // BEGIN - 1.4 retrocompatibility - will be removed in 1.6
         Tools::displayAsDeprecated('layout.tpl is missing in your theme directory');
         if ($this->display_header) {
             $this->smartyOutputContent(_PS_THEME_DIR_ . 'header.tpl');
         }
         if ($this->template) {
             $this->smartyOutputContent($this->template);
         } else {
             // For retrocompatibility with 1.4 controller
             $this->displayContent();
         }
         if ($this->display_footer) {
             $this->smartyOutputContent(_PS_THEME_DIR_ . 'footer.tpl');
         }
         // END - 1.4 retrocompatibility - will be removed in 1.6
     }
     return true;
 }
예제 #4
0
 public function display()
 {
     Tools::safePostVars();
     // assign css_files and js_files at the very last time
     if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) {
         // CSS compressor management
         if (Configuration::get('PS_CSS_THEME_CACHE')) {
             $this->css_files = Media::cccCSS($this->css_files);
         }
         //JS compressor management
         if (Configuration::get('PS_JS_THEME_CACHE')) {
             $this->js_files = Media::cccJs($this->js_files);
         }
     }
     $this->context->smarty->assign('css_files', $this->css_files);
     $this->context->smarty->assign('js_files', array_unique($this->js_files));
     $this->context->smarty->assign(array('errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer));
     // Don't use live edit if on mobile device
     if ($this->context->getMobileDevice() == false && Tools::isSubmit('live_edit')) {
         $this->context->smarty->assign('live_edit', $this->getLiveEditFooter());
     }
     $layout = $this->getLayout();
     if ($layout) {
         if ($this->template) {
             $this->context->smarty->assign('template', $this->context->smarty->fetch($this->template));
         } else {
             ob_start();
             $this->displayContent();
             $template = ob_get_contents();
             ob_clean();
             $this->context->smarty->assign('template', $template);
         }
         $this->smartyOutputContent($layout);
     } else {
         // BEGIN - 1.4 retrocompatibility - will be removed in 1.6
         Tools::displayAsDeprecated('layout.tpl is missing in your theme directory');
         if ($this->display_header) {
             $this->smartyOutputContent(_PS_THEME_DIR_ . 'header.tpl');
         }
         if ($this->template) {
             $this->smartyOutputContent($this->template);
         } else {
             // For retrocompatibility with 1.4 controller
             $this->displayContent();
         }
         if ($this->display_footer) {
             $this->smartyOutputContent(_PS_THEME_DIR_ . 'footer.tpl');
         }
         // live edit
         if (Tools::isSubmit('live_edit') && ($ad = Tools::getValue('ad')) && Tools::getAdminToken('AdminModulesPositions' . (int) Tab::getIdFromClassName('AdminModulesPositions') . (int) Tools::getValue('id_employee'))) {
             $this->context->smarty->assign(array('ad' => $ad, 'live_edit' => true));
             $this->smartyOutputContent(_PS_ALL_THEMES_DIR_ . 'live_edit.tpl');
         }
         // END - 1.4 retrocompatibility - will be removed in 1.6
     }
     return true;
 }
예제 #5
0
 public function display()
 {
     Tools::safePostVars();
     // Automatically add js files from js/autoload directory in the template
     if (@filemtime($this->getThemeDir() . 'js/autoload/')) {
         foreach (scandir($this->getThemeDir() . 'js/autoload/', 0) as $file) {
             if (preg_match('/^[^.].*\\.js$/', $file)) {
                 $this->addJS($this->getThemeDir() . 'js/autoload/' . $file);
             }
         }
     }
     // Automatically add css files from css/autoload directory in the template
     if (@filemtime($this->getThemeDir() . 'css/autoload/')) {
         foreach (scandir($this->getThemeDir() . 'css/autoload', 0) as $file) {
             if (preg_match('/^[^.].*\\.css$/', $file)) {
                 $this->addCSS($this->getThemeDir() . 'css/autoload/' . $file);
             }
         }
     }
     // assign css_files and js_files at the very last time
     if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) {
         // CSS compressor management
         if (Configuration::get('PS_CSS_THEME_CACHE')) {
             $this->css_files = Media::cccCSS($this->css_files);
         }
         //JS compressor management
         if (Configuration::get('PS_JS_THEME_CACHE') && !$this->useMobileTheme()) {
             $this->js_files = Media::cccJs($this->js_files);
         }
     }
     $this->context->smarty->assign(array('css_files' => $this->css_files, 'js_files' => array(), 'errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer));
     $live_edit_content = '';
     // Don't use live edit if on mobile theme
     if (!$this->useMobileTheme() && $this->checkLiveEditAccess()) {
         $live_edit_content = $this->getLiveEditFooter();
     }
     $layout = $this->getLayout();
     if ($layout) {
         if ($this->template) {
             $this->context->smarty->assign('template', $this->context->smarty->fetch($this->template) . $live_edit_content);
         } else {
             ob_start();
             $this->displayContent();
             $template = ob_get_contents();
             ob_clean();
             $this->context->smarty->assign('template', $template . $live_edit_content);
         }
         $this->smartyOutputContent($layout);
     } else {
         Tools::displayAsDeprecated('layout.tpl is missing in your theme directory');
         if ($this->display_header) {
             $this->smartyOutputContent(_PS_THEME_DIR_ . 'header.tpl');
         }
         if ($this->template) {
             $this->smartyOutputContent($this->template);
         } else {
             // For retrocompatibility with 1.4 controller
             $this->displayContent();
         }
         if ($this->display_footer) {
             $this->smartyOutputContent(_PS_THEME_DIR_ . 'footer.tpl');
         }
     }
     return true;
 }