protected function beforeRender() { // dump($this->context); $this->template->id_category = null; $this->template->id_menu_item = null; $this['header']['css']->addFile('reset.css'); // $this['header']['css']->addFile('default.css'); $this['header']['css']->addFile('h.css'); $this['header']['css']->addFile('article.css'); $this['header']['css']->addFile('attachment.css'); $this['header']['css']->addFile('gallery.css'); $this['header']['css']->addFile('modal-dialog.css'); $this['header']['css']->addFile('paginator.css'); $this['header']['css']->addFile('components/ContactForm/contact-form.css'); $this['header']['css']->addFile('delivery-form.css'); $this['header']['css']->addFile('msg.css'); $this['header']['css']->addFile('cart.css'); $this['header']['css']->addFile('sharepost.css'); $this['header']['css']->addFile('../jscripts/jquery/custom-theme/jquery-ui-1.8.13.custom.css'); $this['header']['css']->addFile('/screen.css'); $this['header']['css']->addFile('/login-dialog.css'); $this['header']['css']->addFile('/flash-msg.css'); // sekcia pre adminou, ktory maju moznost upravy aj na fronte // if($this->user->isLoggedIn() AND $this->user->isAllowed('cms','edit')){ // $this['header']['css']->addFile('adminBar/admin-bar.css'); // } // <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'> // $this['header']->addCssFile('http://fonts.googleapis.com/css?family=Oswald'); $header = $this->getHttpRequest()->getHeaders(); if (strstr(@$header['user-agent'], 'MSIE 7')) { $this['header']['css']->addFile('ie.css'); } $this['header']['js']->addFile('jquery/dropdown/js/superfish.js'); $this['header']['css']->addFile('../jscripts/jquery/dropdown/css/superfish.css'); // $this['header']['css']->addFile('../jscripts/jquery/jquery.treeview/jquery.treeview.css'); $this['header']['js']->addFile('jquery/prettyPhoto/js/jquery.prettyPhoto.js'); $this['header']['css']->addFile('../jscripts/jquery/prettyPhoto/css/prettyPhoto.css'); $this['header']['js']->addFile('jquery/In-Field-Labels/src/jquery.infieldlabel.min.js'); $this['header']['js']->addFile('jquery/relatedselects/jquery.relatedselects.js'); // $this['header']['css']->addFile('../jscripts/jquery/bubblepopup/jquery.bubblepopup.v2.3.1.css'); // $this['header']['js']->addFile('jquery/bubblepopup/jquery.bubblepopup.v2.3.1.min.js'); $this['header']['js']->addFile('jquery/orbit_slider/jquery.orbit-1.2.3.min.js'); $this['header']['css']->addFile('../jscripts/jquery/orbit_slider/orbit-1.2.3.css'); $this['header']['js']->addFile('jquery/jquery_news_ticker/includes/jquery.ticker.js'); $this['header']['css']->addFile('../jscripts/jquery/jquery_news_ticker/styles/ticker-style.css'); $this['header']['js']->addFile('loader.js'); if ($this->context->parameters['GOOGLE_ANALYTICS']['ID'] != '') { $this['header']->addJscript("\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', '" . $this->context->parameters['GOOGLE_ANALYTICS']['ID'] . "']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n"); } $this->template->eshop_category = array(); $this->template->eshop_category = CategoryModel::getTreeAssoc($this->id_lang); $page = $this->getService('Page'); $this->template->mainmenu = $page->getAssoc($this->id_lang); /* * zistenie ci je nieco v akcii ak nieje nezobrazi sa tlacidlo * - bude sa cachovat spolu s modelom product */ $count = ProductModel::loadCache('sale_count'); // var_dump($count); // exit; if ($count === null) { $count = ProductModel::saveCache('sale_count', count(Front_SearchPresenter::getQuery()->where('product.sale = 1')->groupBy('id_product'))); } $this->template->is_sale = $count > 0 ? true : false; }