Exemple #1
0
 public function displayAccount()
 {
     if (!isset($this->context->cookie->stats_date_from)) {
         $this->context->cookie->stats_date_from = date('Y-m-01');
     }
     if (!isset($this->context->cookie->stats_date_to)) {
         $this->context->cookie->stats_date_to = date('Y-m-t');
     }
     Referrer::refreshCache(array(array('id_referrer' => (int) $this->context->cookie->tracking_id)));
     $referrer = new Referrer((int) $this->context->cookie->tracking_id);
     $this->smarty->assign('referrer', $referrer);
     $this->smarty->assign('datepickerFrom', $this->context->cookie->stats_date_from);
     $this->smarty->assign('datepickerTo', $this->context->cookie->stats_date_to);
     $display_tab = array('uniqs' => $this->l('Unique visitors'), 'visitors' => $this->l('Visitors'), 'visits' => $this->l('Visits'), 'pages' => $this->l('Pages viewed'), 'registrations' => $this->l('Registrations'), 'orders' => $this->l('Orders'), 'base_fee' => $this->l('Base fee'), 'percent_fee' => $this->l('Percent fee'), 'click_fee' => $this->l('Click fee'), 'sales' => $this->l('Sales'), 'cart' => $this->l('Average cart'), 'reg_rate' => $this->l('Registration rate'), 'order_rate' => $this->l('Order rate'));
     $this->smarty->assign('displayTab', $display_tab);
     $products = Product::getSimpleProducts($this->context->language->id);
     $products_array = array();
     foreach ($products as $product) {
         $products_array[] = $product['id_product'];
     }
     $js_files = array();
     $jquery_files = Media::getJqueryPath();
     if (is_array($jquery_files)) {
         $js_files = array_merge($js_files, $jquery_files);
     } else {
         $js_files[] = $jquery_files;
     }
     $jquery_ui_files = Media::getJqueryUIPath('ui.datepicker', 'base', true);
     $js_files = array_merge($js_files, $jquery_ui_files['js']);
     $css_files = $jquery_ui_files['css'];
     $js_files[] = $this->_path . 'js/trackingfront.js';
     $js_tpl_var = array('product_ids' => implode(', ', $products_array), 'referrer_id' => $referrer->id, 'token' => $this->context->cookie->tracking_passwd, 'display_tab' => implode('", "', array_keys($display_tab)));
     $this->smarty->assign(array('js' => $js_files, 'css' => $css_files, 'js_tpl_var' => $js_tpl_var));
     return $this->display(__FILE__, 'views/templates/front/account.tpl');
 }
 /**
  * Add a new javascript file in page header.
  *
  * @param mixed $js_uri
  * @return void
  */
 public function addJquery($version = null, $folder = null, $minifier = true)
 {
     $this->addJS(Media::getJqueryPath($version, $folder, $minifier));
 }
 /**
  * Affichage de la popin TinyMce dans l'admin
  */
 public function displayTinyMcePopup()
 {
     //Liste des pages cms
     $this->context->smarty->assign('cms_categories_html', $this->getCmsLinks());
     //Liste des widgets du module
     $this->context->smarty->assign('widgets_list', $this->getWidgetsList());
     //Token Admin ( celui récupéré automatiquement ne fonctionne pas )
     $cookie = new Cookie('psAdmin');
     $token = Tools::getAdminToken('Wysiwyg' . (int) Tab::getIdFromClassName('Wysiwyg') . (int) $cookie->id_employee);
     $ajax_page = $this->context->link->getAdminLink('module=eicmslinks&controller=Wysiwyg&ajax=1', false);
     $this->context->smarty->assign('js_token', $token);
     $this->context->smarty->assign('ajax_page', $ajax_page);
     $this->context->smarty->assign('admin_dir', Configuration::get('eicmslinks_admin_path'));
     //Js nécessaires au fonctionnement de la popin
     $jquery_files = Media::getJqueryPath();
     $this->context->smarty->assign('jquery_file', $jquery_files[0]);
     $this->context->smarty->assign('js_file', __PS_BASE_URI__ . 'modules/' . $this->name . '/js/tinymce_popup.js');
     $this->context->smarty->assign('css_file', __PS_BASE_URI__ . 'modules/' . $this->name . '/css/tinymce_popup.css');
     //Version de prestashop concernée
     if (_PS_VERSION_ > '1.6') {
         $ps_version = '16';
     } else {
         $ps_version = '15';
     }
     $this->context->smarty->assign('ps_version', $ps_version);
     echo $this->display(__FILE__, 'views/tinymce_popup.tpl');
 }