public function __construct() { $this->bootstrap = true; $this->className = 'Configuration'; $this->table = 'configuration'; parent::__construct(); // Prevent classes which extend AdminPreferences to load useless data if (get_class($this) == 'AdminPreferencesController') { $round_mode = array(array('value' => PS_ROUND_HALF_UP, 'name' => $this->trans('Round up away from zero, when it is half way there (recommended)', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_DOWN, 'name' => $this->trans('Round down towards zero, when it is half way there', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_EVEN, 'name' => $this->trans('Round towards the next even value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_ODD, 'name' => $this->trans('Round towards the next odd value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_UP, 'name' => $this->trans('Round up to the nearest value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_DOWN, 'name' => $this->trans('Round down to the nearest value', array(), 'Admin.ShopParameters.Feature'))); $activities1 = array(0 => $this->trans('-- Please choose your main activity --', array(), 'Install'), 2 => $this->trans('Animals and Pets', array(), 'Install'), 3 => $this->trans('Art and Culture', array(), 'Install'), 4 => $this->trans('Babies', array(), 'Install'), 5 => $this->trans('Beauty and Personal Care', array(), 'Install'), 6 => $this->trans('Cars', array(), 'Install'), 7 => $this->trans('Computer Hardware and Software', array(), 'Install'), 8 => $this->trans('Download', array(), 'Install'), 9 => $this->trans('Fashion and accessories', array(), 'Install'), 10 => $this->trans('Flowers, Gifts and Crafts', array(), 'Install'), 11 => $this->trans('Food and beverage', array(), 'Install'), 12 => $this->trans('HiFi, Photo and Video', array(), 'Install'), 13 => $this->trans('Home and Garden', array(), 'Install'), 14 => $this->trans('Home Appliances', array(), 'Install'), 15 => $this->trans('Jewelry', array(), 'Install'), 1 => $this->trans('Lingerie and Adult', array(), 'Install'), 16 => $this->trans('Mobile and Telecom', array(), 'Install'), 17 => $this->trans('Services', array(), 'Install'), 18 => $this->trans('Shoes and accessories', array(), 'Install'), 19 => $this->trans('Sport and Entertainment', array(), 'Install'), 20 => $this->trans('Travel', array(), 'Install')); $activities2 = array(); foreach ($activities1 as $value => $name) { $activities2[] = array('value' => $value, 'name' => $name); } $fields = array('PS_SSL_ENABLED' => array('title' => $this->trans('Enable SSL', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('If you own an SSL certificate for your shop\'s domain name, you can activate SSL encryption (https://) for customer account identification and order processing.', array(), 'Admin.ShopParameters.Help'), 'hint' => $this->trans('If you want to enable SSL on all the pages of your shop, activate the "Enable on all the pages" option below.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0')); $fields['PS_SSL_ENABLED_EVERYWHERE'] = array('title' => $this->trans('Enable SSL on all pages', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('When enabled, all the pages of your shop will be SSL-secured.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'disabled' => Tools::getValue('PS_SSL_ENABLED', Configuration::get('PS_SSL_ENABLED')) ? false : true); $fields = array_merge($fields, array('PS_TOKEN_ENABLE' => array('title' => $this->trans('Increase front office security', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable or disable token in the Front Office to improve PrestaShop\'s security.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL), 'PS_ALLOW_HTML_IFRAME' => array('title' => $this->trans('Allow iframes on HTML fields', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Allow iframes on text fields like product description. We recommend that you leave this option disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_USE_HTMLPURIFIER' => array('title' => $this->trans('Use HTMLPurifier Library', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Clean the HTML content on text fields. We recommend that you leave this option enabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->trans('Round mode', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('You can choose among 6 different ways of rounding prices. "Round up away from zero ..." is the recommended behavior.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PS_ROUND_TYPE' => array('title' => $this->trans('Round type', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('You can choose when to round prices: either on each item, each line or the total (of an invoice, for example).', array(), 'Admin.ShopParameters.Help'), 'cast' => 'intval', 'type' => 'select', 'list' => array(array('name' => $this->trans('Round on each item', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_ITEM), array('name' => $this->trans('Round on each line', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_LINE), array('name' => $this->trans('Round on the total', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_TOTAL)), 'identifier' => 'id'), 'PS_PRICE_DISPLAY_PRECISION' => array('title' => $this->trans('Number of decimals', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Choose how many decimals you want to display', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'type' => 'text', 'class' => 'fixed-width-xxl'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->trans('Display brands and suppliers', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable brands and suppliers pages on your front office even when their respective modules are disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_BEST_SELLERS' => array('title' => $this->trans('Display best sellers', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable best sellers page on your front office even when its respective module is disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MULTISHOP_FEATURE_ACTIVE' => array('title' => $this->trans('Enable Multistore', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('The multistore feature allows you to manage several e-shops with one Back Office. If this feature is enabled, a "Multistore" page will be available in the "Advanced Parameters" menu.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL), 'PS_SHOP_ACTIVITY' => array('title' => $this->trans('Main Shop Activity', array(), 'Admin.ShopParameters.Feature'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $activities2, 'identifier' => 'value'))); // No HTTPS activation if you haven't already. if (!Tools::usingSecureMode() && !Configuration::get('PS_SSL_ENABLED')) { $fields['PS_SSL_ENABLED']['type'] = 'disabled'; $fields['PS_SSL_ENABLED']['disabled'] = '<a class="btn btn-link" href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->trans('Please click here to check if your shop supports HTTPS.', array(), 'Admin.ShopParameters.Feature') . '</a>'; } $this->fields_options = array('general' => array('title' => $this->trans('General', array(), 'Admin.Global'), 'icon' => 'icon-cogs', 'fields' => $fields, 'submit' => array('title' => $this->trans('Save', array(), 'Admin.Actions')))); } }
public function __construct() { $this->name = 'megaboxs'; $this->arrHook = array('displayMegaboxs', 'displayFooter', 'displayHomeBottomColumn', 'displayBottomColumn', 'hookdisplayHome', 'displayLeftColumn', 'displayRightColumn'); $this->arrLayout = array('default' => $this->l('Default')); $this->arrMenuType = array('link' => $this->l('Link'), 'image' => $this->l('Image'), 'html' => $this->l('Custom HTML'), 'module' => $this->l('Module')); $this->arrFlickrFeedapi = array('photos_public.gne' => $this->l('Public photos & video'), 'photos_friends.gne' => $this->l('Friends photostream'), 'photos_faves.gne' => $this->l('Public favorites from a user'), 'groups_discuss.gne' => $this->l('Group discussions'), 'groups_pool.gne' => $this->l('Group pools'), 'forums.gne' => $this->l('Forum discussions'), 'activity.gne' => $this->l('Recent activity on your photostream'), 'photos_comments.gne' => $this->l('Recent comments you made')); $this->arrGroupType = array('link' => $this->l('Link'), 'product' => $this->l('Product'), 'module' => $this->l('Module'), 'html' => $this->l('Html'), 'contact' => $this->l('Contact form'), 'twitter_feed' => $this->l('Twitter feed'), 'flickr_feed' => $this->l('Flickr feed'), 'store_map' => $this->l('Store map')); $this->arrProductOrderBy = array('seller' => $this->l('Seller'), 'price' => $this->l('Price'), 'discount' => $this->l('Discount'), 'date_add' => $this->l('Add Date'), 'position' => $this->l('Position'), 'review' => $this->l('Review'), 'view' => $this->l('View'), 'rate' => $this->l('Rates')); $this->arrProductOrderWay = array('asc' => $this->l('Ascending'), 'desc' => $this->l('Descending')); $this->arrProductOnCondition = array('all' => $this->l('All'), 'new' => $this->l('New'), 'used' => $this->l('Used'), 'refurbished' => $this->l('Refurbished')); $this->arrProductOnSale = array('2' => $this->l('All'), '0' => $this->l('No'), '1' => $this->l('Yes')); $this->arrProductOnNew = array('2' => $this->l('All'), '0' => $this->l('No'), '1' => $this->l('Yes')); $this->arrProductOnDiscount = array('2' => $this->l('All'), '0' => $this->l('No'), '1' => $this->l('Yes')); $this->arrProductType = array('auto' => $this->l('Auto'), 'manual' => $this->l('Manual')); $this->arrCol = array('0' => $this->l('None'), '1' => $this->l('Col 1'), '2' => $this->l('Col 2'), '3' => $this->l('Col 3'), '4' => $this->l('Col 4'), '5' => $this->l('Col 5'), '6' => $this->l('Col 6'), '7' => $this->l('Col 7'), '8' => $this->l('Col 8'), '9' => $this->l('Col 9'), '10' => $this->l('Col 10'), '11' => $this->l('Col 11'), '12' => $this->l('Col 12')); $this->secure_key = Tools::encrypt($this->name); $this->pathImage = dirname(__FILE__) . '/images/'; if (Tools::usingSecureMode()) { $this->liveImage = _PS_BASE_URL_SSL_ . __PS_BASE_URI__ . 'modules/' . $this->name . '/images/'; } else { $this->liveImage = _PS_BASE_URL_ . __PS_BASE_URI__ . 'modules/' . $this->name . '/images/'; } $this->tab = 'front_office_features'; $this->version = '1.0'; $this->author = 'OVIC-SOFT'; $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Mega boxs Module'); $this->description = $this->l('Mega boxs Module'); $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); $this->datas = dirname(__FILE__) . '/datas/'; }
public function __construct() { global $cookie; $this->className = 'Configuration'; $this->table = 'configuration'; $max_upload = (int) ini_get('upload_max_filesize'); $max_post = (int) ini_get('post_max_size'); $upload_mb = min($max_upload, $max_post); $timezones = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT name FROM ' . _DB_PREFIX_ . 'timezone'); $taxes[] = array('id' => 0, 'name' => $this->l('None')); foreach (Tax::getTaxes((int) $cookie->id_lang) as $tax) { $taxes[] = array('id' => $tax['id_tax'], 'name' => $tax['name']); } $order_process_type = array(array('value' => PS_ORDER_PROCESS_STANDARD, 'name' => $this->l('Standard (5 steps)')), array('value' => PS_ORDER_PROCESS_OPC, 'name' => $this->l('One page checkout'))); $round_mode = array(array('value' => PS_ROUND_UP, 'name' => $this->l('superior')), array('value' => PS_ROUND_DOWN, 'name' => $this->l('inferior')), array('value' => PS_ROUND_HALF, 'name' => $this->l('classical'))); $cms_tab = array(0 => array('id' => 0, 'name' => $this->l('None'))); foreach (CMS::listCms($cookie->id_lang) as $cms_file) { $cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']); } $this->_fieldsGeneral = array('PS_SHOP_ENABLE' => array('title' => $this->l('Enable Shop'), 'desc' => $this->l('Activate or deactivate your shop. Deactivate your shop while you perform maintenance on it. Please note that the webservice will not be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MAINTENANCE_IP' => array('title' => $this->l('Maintenance IP'), 'desc' => $this->l('IP addresses allowed to access the Front Office even if shop is disabled. Use a comma to separate them (e.g., 42.24.4.2,127.0.0.1,99.98.97.96)'), 'validation' => 'isGenericName', 'type' => 'maintenance_ip', 'size' => 30, 'default' => ''), 'PS_SSL_ENABLED' => array('title' => $this->l('Enable SSL'), 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_COOKIE_CHECKIP' => array('title' => $this->l('Check IP on the cookie'), 'desc' => $this->l('Check the IP address of the cookie in order to avoid your cookie being stolen'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_COOKIE_LIFETIME_FO' => array('title' => $this->l('Lifetime of the Front Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), 'PS_COOKIE_LIFETIME_BO' => array('title' => $this->l('Lifetime of the Back Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), 'PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token on the Front Office in order to improve PrestaShop security'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_HELPBOX' => array('title' => $this->l('Back Office help boxes'), 'desc' => $this->l('Enable yellow help boxes which are displayed under form fields in the Back Office'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_ORDER_PROCESS_TYPE' => array('title' => $this->l('Order process type'), 'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $order_process_type, 'identifier' => 'value'), 'PS_GUEST_CHECKOUT_ENABLED' => array('title' => $this->l('Enable guest checkout'), 'desc' => $this->l('Your guest can make an order without registering'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CONDITIONS' => array('title' => $this->l('Terms of service'), 'desc' => $this->l('Require customers to accept or decline terms of service before processing the order'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'js' => array('on' => 'onchange="changeCMSActivationAuthorization()"', 'off' => 'onchange="changeCMSActivationAuthorization()"')), 'PS_CONDITIONS_CMS_ID' => array('title' => $this->l('Conditions of use of CMS page'), 'desc' => $this->l('Choose the Conditions of use of CMS page'), 'validation' => 'isInt', 'type' => 'select', 'list' => $cms_tab, 'identifier' => 'id', 'cast' => 'intval'), 'PS_GIFT_WRAPPING' => array('title' => $this->l('Offer gift-wrapping'), 'desc' => $this->l('Suggest gift-wrapping to customer and possibility of leaving a message'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_GIFT_WRAPPING_PRICE' => array('title' => $this->l('Gift-wrap pricing'), 'desc' => $this->l('Set a price for gift-wrapping'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price'), 'PS_GIFT_WRAPPING_TAX' => array('title' => $this->l('Gift-wrapping tax'), 'desc' => $this->l('Set a tax for gift-wrapping'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $taxes, 'identifier' => 'id'), 'PS_ATTACHMENT_MAXIMUM_SIZE' => array('title' => $this->l('Maximum attachment size'), 'desc' => $this->l('Set the maximum size of attached files (in Megabytes ).') . ' ' . $this->l('Maximum:') . ' ' . ((int) str_replace('M', '', ini_get('post_max_size')) > (int) str_replace('M', '', ini_get('upload_max_filesize')) ? ini_get('upload_max_filesize') : ini_get('post_max_size')), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '2'), 'PS_RECYCLABLE_PACK' => array('title' => $this->l('Offer recycled packaging'), 'desc' => $this->l('Suggest recycled packaging to customer'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CART_FOLLOWING' => array('title' => $this->l('Save cart content and re-display it at login'), 'desc' => $this->l('Recall and display contents of shopping cart following customer login'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round superior; always round inferior, or classic rounding'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PRESTASTORE_LIVE' => array('title' => $this->l('Automatically check for module updates'), 'desc' => $this->l('New modules and updates are displayed on the modules page'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_HIDE_OPTIMIZATION_TIPS' => array('title' => $this->l('Hide optimization tips'), 'desc' => $this->l('Hide optimization tips on the back office homepage'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Display manufacturers and suppliers list even if corresponding blocks are disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_FORCE_SMARTY_2' => array('title' => $this->l('Use Smarty 2 instead of 3'), 'desc' => $this->l('Enable if your theme is incompatible with Smarty 3 (you should update your theme, since Smarty 2 will be unsupported from PrestaShop v1.5)'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_LIMIT_UPLOAD_FILE_VALUE' => array('title' => $this->l('Limit upload file value'), 'desc' => $this->l('Define the limit upload for a downloadable product, this value has to be inferior or equal to your server\'s maximum upload file ') . sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'limit', 'default' => '1'), 'PS_LIMIT_UPLOAD_IMAGE_VALUE' => array('title' => $this->l('Limit upload image value'), 'desc' => $this->l('Define the limit upload for an image, this value has to be inferior or equal to your server\'s maximum upload file ') . sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'limit', 'default' => '1')); if (function_exists('date_default_timezone_set')) { $this->_fieldsGeneral['PS_TIMEZONE'] = array('title' => $this->l('Time Zone:'), 'validation' => 'isAnything', 'type' => 'select', 'list' => $timezones, 'identifier' => 'name'); } // No HTTPS activation if you haven't already. if (!Tools::usingSecureMode() && !_PS_SSL_ENABLED_) { $this->_fieldsGeneral['PS_SSL_ENABLED']['type'] = 'disabled'; $this->_fieldsGeneral['PS_SSL_ENABLED']['disabled'] = '<a href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->l('Please click here to use HTTPS protocol before enabling SSL.') . '</a>'; } parent::__construct(); }
public function __construct() { $this->name = 'megamenus'; $this->arrHook = array('displayVerticalMenu', 'displayHorizontalMenu', 'displayLeftColumn', 'displayTopColumn', 'displayMegamenuLeft', 'displayMegamenuRight'); $this->arrLayout = array('vertical_left' => $this->l('Vertical Left'), 'horizontal_top' => $this->l('Horizontal Top')); $this->arrMenuType = array('link' => $this->l('Link'), 'image' => $this->l('Image'), 'html' => $this->l('Custom HTML'), 'module' => $this->l('Module')); $this->arrGroupType = array('link' => $this->l('Link'), 'product' => $this->l('Product'), 'module' => $this->l('Module')); $this->arrProductOrderBy = array('seller' => $this->l('Seller'), 'price' => $this->l('Price'), 'discount' => $this->l('Discount'), 'date_add' => $this->l('Add Date'), 'position' => $this->l('Position'), 'review' => $this->l('Review'), 'rate' => $this->l('Rates')); $this->arrProductOrderWay = array('asc' => $this->l('Ascending'), 'desc' => $this->l('Descending')); $this->arrProductOnCondition = array('all' => $this->l('All'), 'new' => $this->l('New'), 'used' => $this->l('Used'), 'refurbished' => $this->l('Refurbished')); $this->arrProductOnSale = array('2' => $this->l('All'), '0' => $this->l('No'), '1' => $this->l('Yes')); $this->arrProductOnNew = array('2' => $this->l('All'), '0' => $this->l('No'), '1' => $this->l('Yes')); $this->arrProductOnDiscount = array('2' => $this->l('All'), '0' => $this->l('No'), '1' => $this->l('Yes')); $this->arrProductType = array('auto' => $this->l('Auto'), 'manual' => $this->l('Manual')); $this->arrCol = array('0' => $this->l('None'), '1' => $this->l('Col 1'), '2' => $this->l('Col 2'), '3' => $this->l('Col 3'), '4' => $this->l('Col 4'), '5' => $this->l('Col 5'), '6' => $this->l('Col 6'), '7' => $this->l('Col 7'), '8' => $this->l('Col 8'), '9' => $this->l('Col 9'), '10' => $this->l('Col 10'), '11' => $this->l('Col 11'), '12' => $this->l('Col 12')); $this->secure_key = Tools::encrypt($this->name); $this->pathImage = dirname(__FILE__) . '/images/'; if (Tools::usingSecureMode()) { $this->liveImage = _PS_BASE_URL_SSL_ . __PS_BASE_URI__ . 'modules/' . $this->name . '/images/'; } else { $this->liveImage = _PS_BASE_URL_ . __PS_BASE_URI__ . 'modules/' . $this->name . '/images/'; } $this->tab = 'front_office_features'; $this->version = '2.0'; $this->author = 'OVIC-SOFT'; $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Mega menus Module'); $this->description = $this->l('Mega menus Module'); $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); $this->datas = dirname(__FILE__) . '/datas/'; }
public function __construct() { $this->bootstrap = true; $this->context = Context::getContext(); $this->className = 'Configuration'; $this->table = 'configuration'; // Prevent classes which extend AdminPreferences to load useless data if (get_class($this) == 'AdminPreferencesController') { $round_mode = array(array('value' => PS_ROUND_UP, 'name' => $this->l('superior')), array('value' => PS_ROUND_DOWN, 'name' => $this->l('inferior')), array('value' => PS_ROUND_HALF, 'name' => $this->l('classical'))); $activities1 = array(0 => $this->l('-- Please choose your main activity --'), 2 => $this->l('Animals and Pets'), 3 => $this->l('Art and Culture'), 4 => $this->l('Babies'), 5 => $this->l('Beauty and Personal Care'), 6 => $this->l('Cars'), 7 => $this->l('Computer Hardware and Software'), 8 => $this->l('Download'), 9 => $this->l('Fashion and accessories'), 10 => $this->l('Flowers, Gifts and Crafts'), 11 => $this->l('Food and beverage'), 12 => $this->l('HiFi, Photo and Video'), 13 => $this->l('Home and Garden'), 14 => $this->l('Home Appliances'), 15 => $this->l('Jewelry'), 1 => $this->l('Lingerie and Adult'), 16 => $this->l('Mobile and Telecom'), 17 => $this->l('Services'), 18 => $this->l('Shoes and accessories'), 19 => $this->l('Sport and Entertainment'), 20 => $this->l('Travel')); $activities2 = array(); foreach ($activities1 as $value => $name) { $activities2[] = array('value' => $value, 'name' => $name); } $fields = array('PS_SSL_ENABLED' => array('title' => $this->l('Enable SSL'), 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0')); if (Tools::getValue('PS_SSL_ENABLED', Configuration::get('PS_SSL_ENABLED'))) { $fields['PS_SSL_ENABLED_EVERYWHERE'] = array('title' => $this->l('Force the SSL on all the pages'), 'desc' => $this->l('Force all your store to use SSL.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'); } $fields = array_merge($fields, array('PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token in the Front Office to improve PrestaShop\'s security.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL), 'PS_ALLOW_HTML_IFRAME' => array('title' => $this->l('Allow iframes on HTML fields'), 'desc' => $this->l('Allow iframes on text fields like product description. We recommend that you leave this option disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_USE_HTMLPURIFIER' => array('title' => $this->l('Use HTMLPurifier Library'), 'desc' => $this->l('Clean the HTML content on text fields. We recommend that you leave this option enabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round up, always round down or classic rounding (up if > .5, down if < .5).'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Enable suppliers and manufacturers pages on your Front Office even when their respective modules are disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_BEST_SELLERS' => array('title' => $this->l('Display best sellers'), 'desc' => $this->l('Enable best sellers page on your Front Office even when it\'s respective module is disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MULTISHOP_FEATURE_ACTIVE' => array('title' => $this->l('Enable Multistore'), 'desc' => $this->l('The multistore feature allows you to manage several e-shops with one Back Office. If this feature is enabled, a "Multistore" page will be available in the "Advanced Parameters" menu.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL), 'PS_SHOP_ACTIVITY' => array('title' => $this->l('Main Shop Activity'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $activities2, 'identifier' => 'value'))); // No HTTPS activation if you haven't already. if (!Tools::usingSecureMode() && !Configuration::get('PS_SSL_ENABLED')) { $fields['PS_SSL_ENABLED']['type'] = 'disabled'; $fields['PS_SSL_ENABLED']['disabled'] = '<a class="btn btn-link" href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->l('Please click here to use HTTPS protocol before enabling SSL.') . '</a>'; } $this->fields_options = array('general' => array('title' => $this->l('General'), 'icon' => 'icon-cogs', 'fields' => $fields, 'submit' => array('title' => $this->l('Save')))); } parent::__construct(); }
public function init() { if (parent::$initialized) { return; } $ret = parent::init(); // This override is part of the cloudcache module, so the cloudcache.php file exists require_once dirname(__FILE__) . '/../../modules/cloudcache/cloudcache.php'; // As parent::init() set the parent::$initialized flag, all below will be done only once. $module = new CloudCache(); if (!$module->active || !Configuration::get('CLOUDCACHE_API_ACTIVE')) { return $ret; } // Use global because 1.4 only, 1.5 is in an other file global $smarty; $assignArray = array('img_ps_dir' => _PS_IMG_, 'img_cat_dir' => _THEME_CAT_DIR_, 'img_lang_dir' => _THEME_LANG_DIR_, 'img_prod_dir' => _THEME_PROD_DIR_, 'img_manu_dir' => _THEME_MANU_DIR_, 'img_sup_dir' => _THEME_SUP_DIR_, 'img_ship_dir' => _THEME_SHIP_DIR_, 'img_store_dir' => _THEME_STORE_DIR_, 'img_col_dir' => _THEME_COL_DIR_, 'img_dir' => _THEME_IMG_DIR_, 'css_dir' => _THEME_CSS_DIR_, 'js_dir' => _THEME_JS_DIR_, 'pic_dir' => _THEME_PROD_PIC_DIR_); $httHost = Tools::getHttpHost(); $useSSL = isset($this->ssl) && $this->ssl && Configuration::get('PS_SSL_ENABLED') && Tools::usingSecureMode() ? true : false; $protocol_content = $useSSL ? 'https://' : 'http://'; foreach ($assignArray as $assignKey => $assignValue) { if (substr($assignValue, 0, 1) == '/' || $protocol_content == 'https://') { $smarty->assign($assignKey, $protocol_content . Tools::getMediaServer($assignValue) . $assignValue); } else { $smarty->assign($assignKey, $assignValue); } } return $ret; }
function content_56a4d3ac4bfc77_48271231($_smarty_tpl) { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('favorite_products_url_add' => preg_replace("%(?<!\\\\)'%", "\\'", $_smarty_tpl->tpl_vars['link']->value->getModuleLink('favoriteproducts', 'actions', array('process' => 'add'), Tools::usingSecureMode()))), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('favorite_products_url_remove' => preg_replace("%(?<!\\\\)'%", "\\'", $_smarty_tpl->tpl_vars['link']->value->getModuleLink('favoriteproducts', 'actions', array('process' => 'remove'), Tools::usingSecureMode()))), $_smarty_tpl); if (isset($_GET['id_product'])) { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('favorite_products_id_product' => intval($_GET['id_product'])), $_smarty_tpl); } }
private static function _selectProtocol(&$url) { $useSSL = Configuration::get('PS_SSL_ENABLED') && Tools::usingSecureMode(); if (preg_match('#(.*)\\.' . Configuration::get('CLOUDCACHE_API_COMPANY_ID') . '\\.netdna-cdn.com$#', $url, $matches) && $useSSL) { $url = $matches[1] . '-' . Configuration::get('CLOUDCACHE_API_COMPANY_ID') . '.netdna-ssl.com'; } return $useSSL ? 'https://' : 'http://'; }
/** * _hookAll has to be called in each hookXXX methods. This is made to avoid code duplication. * * @param mixed $params * @return void */ private function _hookCommon($params) { global $smarty; $smarty->assign('ENT_QUOTES', ENT_QUOTES); $smarty->assign('search_ssl', (int) Tools::usingSecureMode()); $smarty->assign('ajaxsearch', Configuration::get('PS_SEARCH_AJAX')); $smarty->assign('instantsearch', Configuration::get('PS_INSTANT_SEARCH')); return true; }
function content_569352d8b26b20_05748756($_smarty_tpl) { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('isMobile' => $_smarty_tpl->tpl_vars['mobile_device']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('baseDir' => $_smarty_tpl->tpl_vars['content_dir']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('baseUri' => $_smarty_tpl->tpl_vars['base_uri']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('static_token' => $_smarty_tpl->tpl_vars['static_token']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('token' => $_smarty_tpl->tpl_vars['token']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('priceDisplayPrecision' => $_smarty_tpl->tpl_vars['priceDisplayPrecision']->value * $_smarty_tpl->tpl_vars['currency']->value->decimals), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('priceDisplayMethod' => $_smarty_tpl->tpl_vars['priceDisplay']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('roundMode' => $_smarty_tpl->tpl_vars['roundMode']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('isLogged' => intval($_smarty_tpl->tpl_vars['is_logged']->value)), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('isGuest' => intval($_smarty_tpl->tpl_vars['is_guest']->value)), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('page_name' => htmlspecialchars($_smarty_tpl->tpl_vars['page_name']->value, ENT_QUOTES, 'UTF-8', true)), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('contentOnly' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval($_smarty_tpl->tpl_vars['content_only']->value)), $_smarty_tpl); if (isset($_smarty_tpl->tpl_vars['cookie']->value->id_lang)) { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('id_lang' => intval($_smarty_tpl->tpl_vars['cookie']->value->id_lang)), $_smarty_tpl); } $_smarty_tpl->smarty->_tag_stack[] = array('addJsDefL', array('name' => 'FancyboxI18nClose')); $_block_repeat = true; echo $_smarty_tpl->smarty->registered_plugins['block']['addJsDefL'][0][0]->addJsDefL(array('name' => 'FancyboxI18nClose'), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); echo smartyTranslate(array('s' => 'Close'), $_smarty_tpl); $_block_content = ob_get_clean(); $_block_repeat = false; echo $_smarty_tpl->smarty->registered_plugins['block']['addJsDefL'][0][0]->addJsDefL(array('name' => 'FancyboxI18nClose'), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); $_smarty_tpl->smarty->_tag_stack[] = array('addJsDefL', array('name' => 'FancyboxI18nNext')); $_block_repeat = true; echo $_smarty_tpl->smarty->registered_plugins['block']['addJsDefL'][0][0]->addJsDefL(array('name' => 'FancyboxI18nNext'), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); echo smartyTranslate(array('s' => 'Next'), $_smarty_tpl); $_block_content = ob_get_clean(); $_block_repeat = false; echo $_smarty_tpl->smarty->registered_plugins['block']['addJsDefL'][0][0]->addJsDefL(array('name' => 'FancyboxI18nNext'), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); $_smarty_tpl->smarty->_tag_stack[] = array('addJsDefL', array('name' => 'FancyboxI18nPrev')); $_block_repeat = true; echo $_smarty_tpl->smarty->registered_plugins['block']['addJsDefL'][0][0]->addJsDefL(array('name' => 'FancyboxI18nPrev'), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); echo smartyTranslate(array('s' => 'Previous'), $_smarty_tpl); $_block_content = ob_get_clean(); $_block_repeat = false; echo $_smarty_tpl->smarty->registered_plugins['block']['addJsDefL'][0][0]->addJsDefL(array('name' => 'FancyboxI18nPrev'), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('usingSecureMode' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval(Tools::usingSecureMode())), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('ajaxsearch' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval(Configuration::get('PS_SEARCH_AJAX'))), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('instantsearch' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval(Configuration::get('PS_INSTANT_SEARCH'))), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('quickView' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval($_smarty_tpl->tpl_vars['quick_view']->value)), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('displayList' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval(Configuration::get('PS_GRID_PRODUCT'))), $_smarty_tpl); }
public function initContent() { if (!Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) { // You can uncomment these lines if you want to force https even from localhost and automatically redirect // header('HTTP/1.1 301 Moved Permanently'); // header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']); // exit(); $clientIsMaintenanceOrLocal = in_array(Tools::getRemoteAddr(), array_merge(array('127.0.0.1'), explode(',', Configuration::get('PS_MAINTENANCE_IP')))); // If ssl is enabled, https protocol is required. Exception for maintenance and local (127.0.0.1) IP if ($clientIsMaintenanceOrLocal) { $warningSslMessage = Tools::displayError('SSL is activated. However, your IP is allowed to enter unsecure mode for maintenance or local IP issues.'); } else { $url = 'https://' . Tools::safeOutput(Tools::getServerName()) . Tools::safeOutput($_SERVER['REQUEST_URI']); $warningSslMessage = sprintf(Translate::ppTags(Tools::displayError('SSL is activated. Please connect using the following link to [1]log into secure mode (https://)[/1]', false), array('<a href="%s">')), $url); } $this->context->smarty->assign('warningSslMessage', $warningSslMessage); } if (file_exists(_PS_ADMIN_DIR_ . '/../install')) { $this->context->smarty->assign('wrong_install_name', true); } if (basename(_PS_ADMIN_DIR_) == 'admin' && file_exists(_PS_ADMIN_DIR_ . '/../admin/')) { $rand = 'admin' . sprintf('%03d', rand(0, 999)) . Tools::strtolower(Tools::passwdGen(6)) . '/'; if (@rename(_PS_ADMIN_DIR_ . '/../admin/', _PS_ADMIN_DIR_ . '/../' . $rand)) { Tools::redirectAdmin('../' . $rand); } else { $this->context->smarty->assign(array('wrong_folder_name' => true)); } } else { $rand = basename(_PS_ADMIN_DIR_) . '/'; } $this->context->smarty->assign(array('randomNb' => $rand, 'adminUrl' => Tools::getCurrentUrlProtocolPrefix() . Tools::getShopDomain() . __PS_BASE_URI__ . $rand)); // Redirect to admin panel if (Tools::isSubmit('redirect') && Validate::isControllerName(Tools::getValue('redirect'))) { $this->context->smarty->assign('redirect', Tools::getValue('redirect')); } else { $tab = new Tab((int) $this->context->employee->default_tab); $this->context->smarty->assign('redirect', $this->context->link->getAdminLink($tab->class_name)); } if ($nb_errors = count($this->errors)) { $this->context->smarty->assign(array('errors' => $this->errors, 'nbErrors' => $nb_errors, 'shop_name' => Tools::safeOutput(Configuration::get('PS_SHOP_NAME')), 'disableDefaultErrorOutPut' => true)); } if ($email = Tools::getValue('email')) { $this->context->smarty->assign('email', $email); } if ($password = Tools::getValue('password')) { $this->context->smarty->assign('password', $password); } $this->setMedia(); $this->initHeader(); parent::initContent(); $this->initFooter(); //force to disable modals $this->context->smarty->assign('modals', null); }
/** * _hookAll has to be called in each hookXXX methods. This is made to avoid code duplication. * * @param mixed $params * @return void */ private function _hookCommon($params) { global $smarty; $smarty->assign('ENT_QUOTES', ENT_QUOTES); $smarty->assign('search_ssl', (int) Tools::usingSecureMode()); $ajaxSearch = (int) Configuration::get('PS_SEARCH_AJAX'); $smarty->assign('ajaxsearch', $ajaxSearch); $instantSearch = (int) Configuration::get('PS_INSTANT_SEARCH'); $smarty->assign(array('instantsearch' => $instantSearch, 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order')); if ($ajaxSearch) { Tools::addCSS(_PS_CSS_DIR_ . 'jquery.autocomplete.css'); Tools::addJS(_PS_JS_DIR_ . 'jquery/jquery.autocomplete.js'); } Tools::addCSS(_THEME_CSS_DIR_ . 'product_list.css'); Tools::addCSS($this->_path . 'blocksearch.css', 'all'); return true; }
public function __construct() { $this->context = Context::getContext(); $this->className = 'Configuration'; $this->table = 'configuration'; // Prevent classes which extend AdminPreferences to load useless data if (get_class($this) == 'AdminPreferencesController') { $round_mode = array(array('value' => PS_ROUND_UP, 'name' => $this->l('superior')), array('value' => PS_ROUND_DOWN, 'name' => $this->l('inferior')), array('value' => PS_ROUND_HALF, 'name' => $this->l('classical'))); $fields = array('PS_SSL_ENABLED' => array('title' => $this->l('Enable SSL'), 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token on the Front Office in order to improve PrestaShop security'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL), 'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round superior; always round inferior, or classic rounding'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Display suppliers and manufacturers lists even if corresponding blocks are disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MULTISHOP_FEATURE_ACTIVE' => array('title' => $this->l('Enable Multistore'), 'desc' => $this->l('Multistore feature allows you to manage several shops with one back-office. If this feature is enabled, a "Multistore" page will be available in the "Advanced Parameters" menu.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL)); // No HTTPS activation if you haven't already. if (!Tools::usingSecureMode() && !Configuration::get('PS_SSL_ENABLED')) { $fields['PS_SSL_ENABLED']['type'] = 'disabled'; $fields['PS_SSL_ENABLED']['disabled'] = '<a href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->l('Please click here to use HTTPS protocol before enabling SSL.') . '</a>'; } $this->fields_options = array('general' => array('title' => $this->l('General'), 'icon' => 'tab-preferences', 'fields' => $fields, 'submit' => array('title' => $this->l(' Save '), 'class' => 'button'))); } parent::__construct(); }
public function __construct() { $this->name = 'customparallax'; $this->arrLayout = array('default' => $this->l('Default layout'), 'newsletter' => $this->l('Newsletter parallax'), 'section' => $this->l('Section layout')); $this->arrType = array('html' => 'Html', 'module' => 'Module'); $this->pathImage = dirname(__FILE__) . '/images/'; if (Tools::usingSecureMode()) { $this->liveImage = _PS_BASE_URL_SSL_ . __PS_BASE_URI__ . 'modules/' . $this->name . '/images/'; } else { $this->liveImage = _PS_BASE_URL_ . __PS_BASE_URI__ . 'modules/' . $this->name . '/images/'; } $this->secure_key = Tools::encrypt('03f7f2dd252d299bca5180ac51ddddbf:' . $this->name); self::$sameDatas = dirname(__FILE__) . '/samedatas/'; $this->tab = 'front_office_features'; $this->version = '2.0'; $this->author = 'OVIC-SOFT'; $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Custom Parallax module'); $this->description = $this->l('Custom Parallax module'); $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); }
function content_530ff8eb595d17_88242252($_smarty_tpl) { if (!is_callable('smarty_modifier_escape')) { include '/Applications/MAMP/htdocs/prestashop/tools/smarty/plugins/modifier.escape.php'; } echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('baseDir' => $_smarty_tpl->tpl_vars['content_dir']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('baseUri' => $_smarty_tpl->tpl_vars['base_uri']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('static_token' => $_smarty_tpl->tpl_vars['static_token']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('token' => $_smarty_tpl->tpl_vars['token']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('priceDisplayPrecision' => $_smarty_tpl->tpl_vars['priceDisplayPrecision']->value * $_smarty_tpl->tpl_vars['currency']->value->decimals), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('priceDisplayMethod' => $_smarty_tpl->tpl_vars['priceDisplay']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('roundMode' => $_smarty_tpl->tpl_vars['roundMode']->value), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('logged' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval($_smarty_tpl->tpl_vars['logged']->value)), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('page_name' => smarty_modifier_escape($_smarty_tpl->tpl_vars['page_name']->value, 'html', 'UTF-8')), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('contentOnly' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval($_smarty_tpl->tpl_vars['content_only']->value)), $_smarty_tpl); if (isset($_smarty_tpl->tpl_vars['cookie']->value->id_lang)) { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('id_lang' => intval($_smarty_tpl->tpl_vars['cookie']->value->id_lang)), $_smarty_tpl); } echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('usingSecureMode' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval(Tools::usingSecureMode())), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('ajaxsearch' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval(Configuration::get('PS_SEARCH_AJAX'))), $_smarty_tpl); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['addJsDef'][0][0]->addJsDef(array('instantsearch' => $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['boolval'][0][0]->boolval(Configuration::get('PS_INSTANT_SEARCH'))), $_smarty_tpl); }
public function initContent() { if (Tools::getValue('iqit_fronteditor_token') && Tools::getValue('iqit_fronteditor_token') == $this->module->getFrontEditorToken() && Tools::getIsset('id_employee') && $this->module->checkEnvironment()) { parent::initContent(); $content = Configuration::get($this->module->config_name . '_content'); $content_format = array(); $content_front = array(); $admin_link = _PS_BASE_URL_ . __PS_BASE_URI__ . Tools::getValue('admin_webpath') . '/'; if ($content) { $content_format = $this->module->buildSubmenuTree(json_decode($content, true), false); $content_front = $this->module->buildSubmenuTree(json_decode($content, true), true); } $languages = Language::getLanguages(); foreach ($languages as $k => $language) { $languages[$k]['is_default'] = (int) ($language['id_lang'] == $this->context->language->id); } $this->context->smarty->assign(array('submenu_content' => htmlentities($content, ENT_COMPAT, 'UTF-8'), 'submenu_content_format' => $content_format, 'content_front' => $content_front, 'defaultFormLanguage' => $this->context->language->id, 'languages' => $languages, 'admin_link' => $admin_link, 'manufacturers_select' => $this->module->renderManufacturersSelect(), 'custom_html_select' => $this->module->renderCustomHtmlSelect(), 'available_modules' => $this->module->getAvailableModules(), 'categories_select' => $this->module->renderCategoriesSelect(false), 'id_language' => $this->context->language->id)); Media::addJsDef(array('admin_fronteditor_ajax_urlf' => $admin_link)); Media::addJsDef(array('search_url_editor' => $this->context->link->getPageLink('search', Tools::usingSecureMode()))); $this->setTemplate('fronteditor.tpl'); } else { Tools::redirect('index.php'); } }
public function init() { /* * Globals are DEPRECATED as of version 1.5. * Use the Context to access objects instead. * Example: $this->context->cart */ global $useSSL, $cookie, $smarty, $cart, $iso, $defaultCountry, $protocol_link, $protocol_content, $link, $css_files, $js_files, $currency; if (self::$initialized) { return; } self::$initialized = true; parent::init(); // If current URL use SSL, set it true (used a lot for module redirect) if (Tools::usingSecureMode()) { $useSSL = true; } // For compatibility with globals, DEPRECATED as of version 1.5 $css_files = $this->css_files; $js_files = $this->js_files; // If we call a SSL controller without SSL or a non SSL controller with SSL, we redirect with the right protocol if (Configuration::get('PS_SSL_ENABLED') && $_SERVER['REQUEST_METHOD'] != 'POST' && $this->ssl != Tools::usingSecureMode()) { header('HTTP/1.1 301 Moved Permanently'); header('Cache-Control: no-cache'); if ($this->ssl) { header('Location: ' . Tools::getShopDomainSsl(true) . $_SERVER['REQUEST_URI']); } else { header('Location: ' . Tools::getShopDomain(true) . $_SERVER['REQUEST_URI']); } exit; } if ($this->ajax) { $this->display_header = false; $this->display_footer = false; } // if account created with the 2 steps register process, remove 'accoun_created' from cookie if (isset($this->context->cookie->account_created)) { $this->context->smarty->assign('account_created', 1); unset($this->context->cookie->account_created); } ob_start(); // Init cookie language // @TODO This method must be moved into switchLanguage Tools::setCookieLanguage($this->context->cookie); $protocol_link = Configuration::get('PS_SSL_ENABLED') || Tools::usingSecureMode() ? 'https://' : 'http://'; $useSSL = isset($this->ssl) && $this->ssl && Configuration::get('PS_SSL_ENABLED') || Tools::usingSecureMode() ? true : false; $protocol_content = $useSSL ? 'https://' : 'http://'; $link = new Link($protocol_link, $protocol_content); $this->context->link = $link; if ($id_cart = (int) $this->recoverCart()) { $this->context->cookie->id_cart = (int) $id_cart; } if ($this->auth && !$this->context->customer->isLogged($this->guestAllowed)) { Tools::redirect('index.php?controller=authentication' . ($this->authRedirection ? '&back=' . $this->authRedirection : '')); } /* Theme is missing */ if (!is_dir(_PS_THEME_DIR_)) { throw new PrestaShopException(sprintf(Tools::displayError('Current theme unavailable "%s". Please check your theme directory name and permissions.'), basename(rtrim(_PS_THEME_DIR_, '/\\')))); } if (Configuration::get('PS_GEOLOCATION_ENABLED')) { if (($newDefault = $this->geolocationManagement($this->context->country)) && Validate::isLoadedObject($newDefault)) { $this->context->country = $newDefault; } } $currency = Tools::setCurrency($this->context->cookie); if (isset($_GET['logout']) || $this->context->customer->logged && Customer::isBanned($this->context->customer->id)) { $this->context->customer->logout(); Tools::redirect(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null); } elseif (isset($_GET['mylogout'])) { $this->context->customer->mylogout(); Tools::redirect(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null); } /* Cart already exists */ if ((int) $this->context->cookie->id_cart) { $cart = new Cart($this->context->cookie->id_cart); if ($cart->OrderExists()) { unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS); $this->context->cookie->check_cgv = false; } elseif (intval(Configuration::get('PS_GEOLOCATION_ENABLED')) && !in_array(strtoupper($this->context->cookie->iso_code_country), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))) && $cart->nbProducts() && intval(Configuration::get('PS_GEOLOCATION_NA_BEHAVIOR')) != -1 && !FrontController::isInWhitelistForGeolocation() && !in_array($_SERVER['SERVER_NAME'], array('localhost', '127.0.0.1'))) { unset($this->context->cookie->id_cart, $cart); } elseif ($this->context->cookie->id_customer != $cart->id_customer || $this->context->cookie->id_lang != $cart->id_lang || $currency->id != $cart->id_currency) { if ($this->context->cookie->id_customer) { $cart->id_customer = (int) $this->context->cookie->id_customer; } $cart->id_lang = (int) $this->context->cookie->id_lang; $cart->id_currency = (int) $currency->id; $cart->update(); } /* Select an address if not set */ if (isset($cart) && (!isset($cart->id_address_delivery) || $cart->id_address_delivery == 0 || !isset($cart->id_address_invoice) || $cart->id_address_invoice == 0) && $this->context->cookie->id_customer) { $to_update = false; if (!isset($cart->id_address_delivery) || $cart->id_address_delivery == 0) { $to_update = true; $cart->id_address_delivery = (int) Address::getFirstCustomerAddressId($cart->id_customer); } if (!isset($cart->id_address_invoice) || $cart->id_address_invoice == 0) { $to_update = true; $cart->id_address_invoice = (int) Address::getFirstCustomerAddressId($cart->id_customer); } if ($to_update) { $cart->update(); } } } if (!isset($cart) || !$cart->id) { $cart = new Cart(); $cart->id_lang = (int) $this->context->cookie->id_lang; $cart->id_currency = (int) $this->context->cookie->id_currency; $cart->id_guest = (int) $this->context->cookie->id_guest; $cart->id_shop_group = (int) $this->context->shop->id_shop_group; $cart->id_shop = $this->context->shop->id; if ($this->context->cookie->id_customer) { $cart->id_customer = (int) $this->context->cookie->id_customer; $cart->id_address_delivery = (int) Address::getFirstCustomerAddressId($cart->id_customer); $cart->id_address_invoice = $cart->id_address_delivery; } else { $cart->id_address_delivery = 0; $cart->id_address_invoice = 0; } // Needed if the merchant want to give a free product to every visitors $this->context->cart = $cart; CartRule::autoAddToCart($this->context); } else { $this->context->cart = $cart; } /* get page name to display it in body id */ // Are we in a payment module $module_name = ''; if (Validate::isModuleName(Tools::getValue('module'))) { $module_name = Tools::getValue('module'); } if (!empty($this->page_name)) { $page_name = $this->page_name; } elseif (!empty($this->php_self)) { $page_name = $this->php_self; } elseif (Tools::getValue('fc') == 'module' && $module_name != '' && Module::getInstanceByName($module_name) instanceof PaymentModule) { $page_name = 'module-payment-submit'; } elseif (preg_match('#^' . preg_quote($this->context->shop->physical_uri, '#') . 'modules/([a-zA-Z0-9_-]+?)/(.*)$#', $_SERVER['REQUEST_URI'], $m)) { $page_name = 'module-' . $m[1] . '-' . str_replace(array('.php', '/'), array('', '-'), $m[2]); } else { $page_name = Dispatcher::getInstance()->getController(); $page_name = preg_match('/^[0-9]/', $page_name) ? 'page_' . $page_name : $page_name; } $this->context->smarty->assign(Meta::getMetaTags($this->context->language->id, $page_name)); $this->context->smarty->assign('request_uri', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI']))); /* Breadcrumb */ $navigationPipe = Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>'; $this->context->smarty->assign('navigationPipe', $navigationPipe); // Automatically redirect to the canonical URL if needed if (!empty($this->php_self) && !Tools::getValue('ajax')) { $this->canonicalRedirection($this->context->link->getPageLink($this->php_self, $this->ssl, $this->context->language->id)); } Product::initPricesComputation(); $display_tax_label = $this->context->country->display_tax_label; if (isset($cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) && $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) { $infos = Address::getCountryAndState((int) $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $country = new Country((int) $infos['id_country']); $this->context->country = $country; if (Validate::isLoadedObject($country)) { $display_tax_label = $country->display_tax_label; } } $languages = Language::getLanguages(true, $this->context->shop->id); $meta_language = array(); foreach ($languages as $lang) { $meta_language[] = $lang['iso_code']; } $compared_products = array(); if (Configuration::get('PS_COMPARATOR_MAX_ITEM') && isset($this->context->cookie->id_compare)) { $compared_products = CompareProduct::getCompareProducts($this->context->cookie->id_compare); } $this->context->smarty->assign(array('mobile_device' => $this->context->getMobileDevice(), 'link' => $link, 'cart' => $cart, 'currency' => $currency, 'cookie' => $this->context->cookie, 'page_name' => $page_name, 'hide_left_column' => !$this->display_column_left, 'hide_right_column' => !$this->display_column_right, 'base_dir' => _PS_BASE_URL_ . __PS_BASE_URI__, 'base_dir_ssl' => $protocol_link . Tools::getShopDomainSsl() . __PS_BASE_URI__, 'content_dir' => $protocol_content . Tools::getHttpHost() . __PS_BASE_URI__, 'base_uri' => $protocol_content . Tools::getHttpHost() . __PS_BASE_URI__ . (!Configuration::get('PS_REWRITING_SETTINGS') ? 'index.php' : ''), 'tpl_dir' => _PS_THEME_DIR_, 'modules_dir' => _MODULE_DIR_, 'mail_dir' => _MAIL_DIR_, 'lang_iso' => $this->context->language->iso_code, 'come_from' => Tools::getHttpHost(true, true) . Tools::htmlentitiesUTF8(str_replace(array('\'', '\\'), '', urldecode($_SERVER['REQUEST_URI']))), 'cart_qties' => (int) $cart->nbProducts(), 'currencies' => Currency::getCurrencies(), 'languages' => $languages, 'meta_language' => implode(',', $meta_language), 'priceDisplay' => Product::getTaxCalculationMethod((int) $this->context->cookie->id_customer), 'is_logged' => (bool) $this->context->customer->isLogged(), 'is_guest' => (bool) $this->context->customer->isGuest(), 'add_prod_display' => (int) Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'shop_name' => Configuration::get('PS_SHOP_NAME'), 'roundMode' => (int) Configuration::get('PS_PRICE_ROUND_MODE'), 'use_taxes' => (int) Configuration::get('PS_TAX'), 'show_taxes' => (int) (Configuration::get('PS_TAX_DISPLAY') == 1 && (int) Configuration::get('PS_TAX')), 'display_tax_label' => (bool) $display_tax_label, 'vat_management' => (int) Configuration::get('VATNUMBER_MANAGEMENT'), 'opc' => (bool) Configuration::get('PS_ORDER_PROCESS_TYPE'), 'PS_CATALOG_MODE' => (bool) Configuration::get('PS_CATALOG_MODE') || !(bool) Group::getCurrent()->show_prices, 'b2b_enable' => (bool) Configuration::get('PS_B2B_ENABLE'), 'request' => $link->getPaginationLink(false, false, false, true), 'PS_STOCK_MANAGEMENT' => Configuration::get('PS_STOCK_MANAGEMENT'), 'quick_view' => (bool) Configuration::get('PS_QUICK_VIEW'), 'shop_phone' => Configuration::get('PS_SHOP_PHONE'), 'compared_products' => is_array($compared_products) ? $compared_products : array(), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'))); // Add the tpl files directory for mobile if ($this->useMobileTheme()) { $this->context->smarty->assign(array('tpl_mobile_uri' => _PS_THEME_MOBILE_DIR_)); } // Deprecated $this->context->smarty->assign(array('id_currency_cookie' => (int) $currency->id, 'logged' => $this->context->customer->isLogged(), 'customerName' => $this->context->customer->logged ? $this->context->cookie->customer_firstname . ' ' . $this->context->cookie->customer_lastname : false)); $assign_array = array('img_ps_dir' => _PS_IMG_, 'img_cat_dir' => _THEME_CAT_DIR_, 'img_lang_dir' => _THEME_LANG_DIR_, 'img_prod_dir' => _THEME_PROD_DIR_, 'img_manu_dir' => _THEME_MANU_DIR_, 'img_sup_dir' => _THEME_SUP_DIR_, 'img_ship_dir' => _THEME_SHIP_DIR_, 'img_store_dir' => _THEME_STORE_DIR_, 'img_col_dir' => _THEME_COL_DIR_, 'img_dir' => _THEME_IMG_DIR_, 'css_dir' => _THEME_CSS_DIR_, 'js_dir' => _THEME_JS_DIR_, 'pic_dir' => _THEME_PROD_PIC_DIR_); // Add the images directory for mobile if ($this->useMobileTheme()) { $assign_array['img_mobile_dir'] = _THEME_MOBILE_IMG_DIR_; } // Add the CSS directory for mobile if ($this->useMobileTheme()) { $assign_array['css_mobile_dir'] = _THEME_MOBILE_CSS_DIR_; } foreach ($assign_array as $assign_key => $assign_value) { if (substr($assign_value, 0, 1) == '/' || $protocol_content == 'https://') { $this->context->smarty->assign($assign_key, $protocol_content . Tools::getMediaServer($assign_value) . $assign_value); } else { $this->context->smarty->assign($assign_key, $assign_value); } } /* * These shortcuts are DEPRECATED as of version 1.5. * Use the Context to access objects instead. * Example: $this->context->cart */ self::$cookie = $this->context->cookie; self::$cart = $cart; self::$smarty = $this->context->smarty; self::$link = $link; $defaultCountry = $this->context->country; $this->displayMaintenancePage(); if ($this->restrictedCountry) { $this->displayRestrictedCountryPage(); } if (Tools::isSubmit('live_edit') && !$this->checkLiveEditAccess()) { Tools::redirect('index.php?controller=404'); } $this->iso = $iso; $this->context->cart = $cart; $this->context->currency = $currency; }
private function calculHookCommon($params) { $this->smarty->assign(array('ENT_QUOTES' => ENT_QUOTES, 'search_ssl' => Tools::usingSecureMode(), 'ajaxsearch' => Configuration::get('PS_SEARCH_AJAX'), 'instantsearch' => Configuration::get('PS_INSTANT_SEARCH'), 'self' => dirname(__FILE__))); return true; }
private function calculHookCommon($params) { $this->smarty->assign(array('ENT_QUOTES' => ENT_QUOTES, 'search_ssl' => Tools::usingSecureMode(), 'instantsearch' => Configuration::get('PS_INSTANT_SEARCH'), 'form_link' => $this->context->link->getModuleLink('tmblocksearch', 'search'), 'self' => dirname(__FILE__), 'category_html' => $this->getHtmlCategories())); return true; }
protected function getCacheId($name = null, $hook = '') { $cache_array = array($name !== null ? $name : $this->name, $hook, date('Ymd'), (int) Tools::usingSecureMode(), (int) $this->context->shop->id_shop_url, (int) Group::getCurrent()->id, (int) $this->context->language->id, (int) $this->context->currency->id, (int) $this->context->country->id, !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443); return implode('|', $cache_array); }
protected function getCacheId($name = null) { parent::getCacheId($name); $page_name = in_array($this->page_name, array('category', 'supplier', 'manufacturer', 'cms', 'product')) ? $this->page_name : 'index'; return 'blocktopmenu|' . (int) Tools::usingSecureMode() . '|' . $page_name . '|' . (int) $this->context->shop->id . '|' . implode(', ', $this->user_groups) . '|' . (int) $this->context->language->id . '|' . (int) Tools::getValue('id_category') . '|' . (int) Tools::getValue('id_manufacturer') . '|' . (int) Tools::getValue('id_supplier') . '|' . (int) Tools::getValue('id_cms') . '|' . (int) Tools::getValue('id_product'); }
public static function getMediaServer($filename) { if (self::$_cache_nb_media_servers === null && defined('_MEDIA_SERVER_1_') && defined('_MEDIA_SERVER_2_') && defined('_MEDIA_SERVER_3_')) { if (_MEDIA_SERVER_1_ == '') { self::$_cache_nb_media_servers = 0; } elseif (_MEDIA_SERVER_2_ == '') { self::$_cache_nb_media_servers = 1; } elseif (_MEDIA_SERVER_3_ == '') { self::$_cache_nb_media_servers = 2; } else { self::$_cache_nb_media_servers = 3; } } if (self::$_cache_nb_media_servers && ($id_media_server = abs(crc32($filename)) % self::$_cache_nb_media_servers + 1)) { return constant('_MEDIA_SERVER_' . $id_media_server . '_'); } return Tools::usingSecureMode() ? Tools::getShopDomainSSL() : Tools::getShopDomain(); }
private function calculHookCommon($params) { $categories_selector = Configuration::get('iqitsearch_categories'); if ($categories_selector) { $range = ''; $maxdepth = (int) Configuration::get('iqitsearch_depth'); $homecat = (int) Configuration::get('PS_HOME_CATEGORY'); if ($homecat == 0) { $homecat = (int) Configuration::get('PS_ROOT_CATEGORY'); } $resultIds = array(); $resultParents = array(); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT c.id_parent, c.id_category, cl.name FROM `' . _DB_PREFIX_ . 'category` c INNER JOIN `' . _DB_PREFIX_ . 'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = ' . (int) $this->context->language->id . Shop::addSqlRestrictionOnLang('cl') . ') INNER JOIN `' . _DB_PREFIX_ . 'category_shop` cs ON (cs.`id_category` = c.`id_category` AND cs.`id_shop` = ' . (int) $this->context->shop->id . ') WHERE (c.`active` = 1 OR c.`id_category` = ' . (int) $homecat . ') AND c.`id_category` != ' . (int) Configuration::get('PS_ROOT_CATEGORY') . ' ' . ((int) $maxdepth != 0 ? ' AND `level_depth` <= ' . (int) $maxdepth : '') . ' AND c.id_category IN ( SELECT id_category FROM `' . _DB_PREFIX_ . 'category_group` WHERE `id_group` IN (' . pSQL(implode(', ', Customer::getGroupsStatic((int) $this->context->customer->id))) . ') ) ORDER BY `level_depth` ASC, cs.`position` ASC'); foreach ($result as &$row) { $resultParents[$row['id_parent']][] =& $row; $resultIds[$row['id_category']] =& $row; } $blockCategTree = $this->getTree($resultParents, $resultIds, $maxdepth, $homecat); $this->smarty->assign('blockCategTree', $blockCategTree); } $this->smarty->assign(array('ENT_QUOTES' => ENT_QUOTES, 'search_ssl' => Tools::usingSecureMode(), 'ajaxsearch' => Configuration::get('PS_SEARCH_AJAX'), 'instantsearch' => Configuration::get('PS_INSTANT_SEARCH'), 'self' => dirname(__FILE__))); return true; }
function content_530ff8eb84ec89_22258543($_smarty_tpl) { if (!is_callable('smarty_modifier_escape')) { include '/Applications/MAMP/htdocs/prestashop/tools/smarty/plugins/modifier.escape.php'; } if (!is_callable('smarty_function_implode')) { include '/Applications/MAMP/htdocs/prestashop/tools/smarty/plugins/function.implode.php'; } ?> <!DOCTYPE HTML> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7 " lang="<?php echo $_smarty_tpl->tpl_vars['lang_iso']->value; ?> "><![endif]--> <!--[if IE 7]><html class="no-js lt-ie9 lt-ie8 ie7" lang="<?php echo $_smarty_tpl->tpl_vars['lang_iso']->value; ?> "><![endif]--> <!--[if IE 8]><html class="no-js lt-ie9 ie8" lang="<?php echo $_smarty_tpl->tpl_vars['lang_iso']->value; ?> "><![endif]--> <!--[if gt IE 8]> <html class="no-js ie9" lang="<?php echo $_smarty_tpl->tpl_vars['lang_iso']->value; ?> "><![endif]--> <html lang="<?php echo $_smarty_tpl->tpl_vars['lang_iso']->value; ?> "> <head> <meta charset="utf-8" /> <title><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['meta_title']->value, 'html', 'UTF-8'); ?> </title> <?php if (isset($_smarty_tpl->tpl_vars['meta_description']->value) && $_smarty_tpl->tpl_vars['meta_description']->value) { ?> <meta name="description" content="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['meta_description']->value, 'html', 'UTF-8'); ?> " /> <?php } if (isset($_smarty_tpl->tpl_vars['meta_keywords']->value) && $_smarty_tpl->tpl_vars['meta_keywords']->value) { ?> <meta name="keywords" content="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['meta_keywords']->value, 'html', 'UTF-8'); ?> " /> <?php } ?> <meta name="generator" content="PrestaShop" /> <meta name="robots" content="<?php if (isset($_smarty_tpl->tpl_vars['nobots']->value)) { ?> no<?php } ?> index,<?php if (isset($_smarty_tpl->tpl_vars['nofollow']->value) && $_smarty_tpl->tpl_vars['nofollow']->value) { ?> no<?php } ?> follow" /> <meta name="viewport" content="width=device-width, minimum-scale=0.25, maximum-scale=1.6, initial-scale=1.0" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <link rel="icon" type="image/vnd.microsoft.icon" href="<?php echo $_smarty_tpl->tpl_vars['favicon_url']->value; ?> ?<?php echo $_smarty_tpl->tpl_vars['img_update_time']->value; ?> " /> <link rel="shortcut icon" type="image/x-icon" href="<?php echo $_smarty_tpl->tpl_vars['favicon_url']->value; ?> ?<?php echo $_smarty_tpl->tpl_vars['img_update_time']->value; ?> " /> <?php if (isset($_smarty_tpl->tpl_vars['css_files']->value)) { ?> <?php $_smarty_tpl->tpl_vars['media'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['media']->_loop = false; $_smarty_tpl->tpl_vars['css_uri'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['css_files']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['media']->key => $_smarty_tpl->tpl_vars['media']->value) { $_smarty_tpl->tpl_vars['media']->_loop = true; $_smarty_tpl->tpl_vars['css_uri']->value = $_smarty_tpl->tpl_vars['media']->key; ?> <link rel="stylesheet" href="<?php echo $_smarty_tpl->tpl_vars['css_uri']->value; ?> " type="text/css" media="<?php echo $_smarty_tpl->tpl_vars['media']->value; ?> " /> <?php } } ?> <?php echo $_smarty_tpl->tpl_vars['HOOK_HEADER']->value; ?> <link rel="stylesheet" href="http<?php if (Tools::usingSecureMode()) { ?> s<?php } ?> ://fonts.googleapis.com/css?family=Open+Sans:300,600" type="text/css" media="all" /> <!--[if IE 8]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <![endif]--> </head> <body<?php if (isset($_smarty_tpl->tpl_vars['page_name']->value)) { ?> id="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['page_name']->value, 'html', 'UTF-8'); ?> "<?php } ?> class="<?php if (isset($_smarty_tpl->tpl_vars['page_name']->value)) { echo smarty_modifier_escape($_smarty_tpl->tpl_vars['page_name']->value, 'html', 'UTF-8'); } if (isset($_smarty_tpl->tpl_vars['body_classes']->value) && count($_smarty_tpl->tpl_vars['body_classes']->value)) { ?> <?php echo smarty_function_implode(array('value' => $_smarty_tpl->tpl_vars['body_classes']->value, 'separator' => ' '), $_smarty_tpl); } if ($_smarty_tpl->tpl_vars['hide_left_column']->value) { ?> hide-left-column<?php } if ($_smarty_tpl->tpl_vars['hide_right_column']->value) { ?> hide-right-column<?php } if ($_smarty_tpl->tpl_vars['content_only']->value) { ?> content_only<?php } ?> lang_<?php echo $_smarty_tpl->tpl_vars['lang_iso']->value; ?> "> <?php if (!$_smarty_tpl->tpl_vars['content_only']->value) { ?> <?php if (isset($_smarty_tpl->tpl_vars['restricted_country_mode']->value) && $_smarty_tpl->tpl_vars['restricted_country_mode']->value) { ?> <div id="restricted-country"> <p><?php echo smartyTranslate(array('s' => 'You cannot place a new order from your country.'), $_smarty_tpl); ?> <span class="bold"><?php echo $_smarty_tpl->tpl_vars['geolocation_country']->value; ?> </span></p> </div> <?php } ?> <div id="page"> <div class="header-container"> <header id="header" style="background-image: url('http://4.bp.blogspot.com/-furh5ftHxic/T3s6-6lgfFI/AAAAAAAAAWw/HcU4uhY8On4/s1600/cannabis_wallpaper_z3ctx1.jpg');-webkit-background-size: 100% 100%;-moz-background-size: 100% 100%;-o-background-size: 100% 100%;background-size: 100% 100%;-moz-border-image: url(bg-image.png) 0;"> <div class="banner"> <div class="container"> <div class="row"> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h' => "displayBanner"), $_smarty_tpl); ?> </div> </div> </div> <div class="nav"> <div class="container"> <div class="row"> <nav><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h' => "displayNav"), $_smarty_tpl); ?> </nav> </div> </div> </div> <div> <div class="container"> <div class="row"> <div id="header_logo"> <a href="<?php echo $_smarty_tpl->tpl_vars['base_dir']->value; ?> " title="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['shop_name']->value, 'html', 'UTF-8'); ?> "> <img class="logo img-responsive" src="<?php echo $_smarty_tpl->tpl_vars['logo_url']->value; ?> " alt="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['shop_name']->value, 'html', 'UTF-8'); ?> "<?php if ($_smarty_tpl->tpl_vars['logo_image_width']->value) { ?> width="<?php echo $_smarty_tpl->tpl_vars['logo_image_width']->value; ?> "<?php } if ($_smarty_tpl->tpl_vars['logo_image_height']->value) { ?> height="<?php echo $_smarty_tpl->tpl_vars['logo_image_height']->value; ?> "<?php } ?> /> </a> </div> <?php if (isset($_smarty_tpl->tpl_vars['HOOK_TOP']->value)) { echo $_smarty_tpl->tpl_vars['HOOK_TOP']->value; } ?> </div> </div> </div> </header> </div> <div class="columns-container"> <div id="columns" class="container"> <?php if ($_smarty_tpl->tpl_vars['page_name']->value != 'index' && $_smarty_tpl->tpl_vars['page_name']->value != 'pagenotfound') { ?> <?php echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['tpl_dir']->value . "./breadcrumb.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0); ?> <?php } ?> <div class="row"> <div id="top_column" class="center_column col-xs-12 col-sm-12"> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h' => "displayTopColumn"), $_smarty_tpl); ?> </div> </div> <div class="row"> <?php if (isset($_smarty_tpl->tpl_vars['left_column_size']->value) && !empty($_smarty_tpl->tpl_vars['left_column_size']->value)) { ?> <div id="left_column" class="column col-xs-12 col-sm-3"> <?php echo $_smarty_tpl->tpl_vars['HOOK_LEFT_COLUMN']->value; ?> </div> <?php } ?> <div id="center_column" class="center_column col-xs-12 col-sm-<?php echo 12 - $_smarty_tpl->tpl_vars['left_column_size']->value - $_smarty_tpl->tpl_vars['right_column_size']->value; ?> "> <?php } }
public function getContent() { global $cookie; $html = ''; if (Tools::isSubmit('SubmitFilter')) { if (!Tools::getValue('layered_tpl_name')) { $html .= ' <div class="error"> <span style="float:right"> <a href="" id="hideError"><img src="../img/admin/close.png" alt="X"></a> </span> <img src="../img/admin/error2.png">' . $this->l('Filter template name required (cannot be empty)') . ' </div>'; } else { if (isset($_POST['id_layered_filter']) && $_POST['id_layered_filter']) { Db::getInstance()->execute('DELETE FROM ' . _DB_PREFIX_ . 'layered_filter WHERE id_layered_filter = ' . (int) Tools::getValue('id_layered_filter')); $this->buildLayeredCategories(); } if (Tools::getValue('scope') == 1) { Db::getInstance()->execute('TRUNCATE TABLE ' . _DB_PREFIX_ . 'layered_filter'); $categories = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT id_category FROM ' . _DB_PREFIX_ . 'category'); foreach ($categories as $category) { $_POST['categoryBox'][] = (int) $category['id_category']; } } $id_layered_filter = (int) $_POST['id_layered_filter']; if (!$id_layered_filter) { $id_layered_filter = (int) Db::getInstance()->Insert_ID(); } $shop_list = array(); if (isset($_POST['checkBoxShopAsso_layered_filter'])) { foreach ($_POST['checkBoxShopAsso_layered_filter'] as $id_shop => $row) { $assos[] = array('id_object' => (int) $id_layered_filter, 'id_shop' => (int) $id_shop); $shop_list[] = (int) $id_shop; } } else { $shop_list = array(Context::getContext()->shop->id); } if (count($_POST['categoryBox'])) { /* Clean categoryBox before use */ if (isset($_POST['categoryBox']) && is_array($_POST['categoryBox'])) { foreach ($_POST['categoryBox'] as &$category_box_tmp) { $category_box_tmp = (int) $category_box_tmp; } } $filter_values = array(); foreach ($_POST['categoryBox'] as $idc) { $filter_values['categories'][] = (int) $idc; } $filter_values['shop_list'] = $shop_list; $values = false; foreach ($_POST['categoryBox'] as $id_category_layered) { foreach ($_POST as $key => $value) { if (substr($key, 0, 17) == 'layered_selection' && $value == 'on') { $values = true; $type = 0; $limit = 0; if (Tools::getValue($key . '_filter_type')) { $type = Tools::getValue($key . '_filter_type'); } if (Tools::getValue($key . '_filter_show_limit')) { $limit = Tools::getValue($key . '_filter_show_limit'); } $filter_values[$key] = array('filter_type' => (int) $type, 'filter_show_limit' => (int) $limit); } } } Db::getInstance()->execute('DELETE FROM ' . _DB_PREFIX_ . 'layered_filter_shop WHERE `id_layered_filter` = ' . (int) $id_layered_filter); if (isset($assos)) { foreach ($assos as $asso) { Db::getInstance()->execute('INSERT INTO ' . _DB_PREFIX_ . 'layered_filter_shop (`id_layered_filter`, `id_shop`) VALUES(' . $id_layered_filter . ', ' . (int) $asso['id_shop'] . ')'); } } $values_to_insert = array('name' => pSQL(Tools::getValue('layered_tpl_name')), 'filters' => pSQL(serialize($filter_values)), 'n_categories' => (int) count($filter_values['categories']), 'date_add' => date('Y-m-d H:i:s')); if (isset($_POST['id_layered_filter']) && $_POST['id_layered_filter']) { $values_to_insert['id_layered_filter'] = (int) Tools::getValue('id_layered_filter'); } Db::getInstance()->autoExecute(_DB_PREFIX_ . 'layered_filter', $values_to_insert, 'INSERT'); $this->buildLayeredCategories(); $html .= '<div class="conf">' . $this->l('Your filter') . ' "' . Tools::safeOutput(Tools::getValue('layered_tpl_name')) . '" ' . (isset($_POST['id_layered_filter']) && $_POST['id_layered_filter'] ? $this->l('was updated successfully.') : $this->l('was added successfully.')) . '</div>'; } } } else { if (Tools::isSubmit('submitLayeredSettings')) { Configuration::updateValue('PS_LAYERED_HIDE_0_VALUES', (int) Tools::getValue('ps_layered_hide_0_values')); Configuration::updateValue('PS_LAYERED_SHOW_QTIES', (int) Tools::getValue('ps_layered_show_qties')); Configuration::updateValue('PS_LAYERED_FULL_TREE', (int) Tools::getValue('ps_layered_full_tree')); Configuration::updateValue('PS_LAYERED_FILTER_PRICE_USETAX', (int) Tools::getValue('ps_layered_filter_price_usetax')); Configuration::updateValue('PS_LAYERED_FILTER_CATEGORY_DEPTH', (int) Tools::getValue('ps_layered_filter_category_depth')); Configuration::updateValue('PS_LAYERED_FILTER_INDEX_QTY', (int) Tools::getValue('ps_layered_filter_index_availability')); Configuration::updateValue('PS_LAYERED_FILTER_INDEX_CDT', (int) Tools::getValue('ps_layered_filter_index_condition')); Configuration::updateValue('PS_LAYERED_FILTER_INDEX_MNF', (int) Tools::getValue('ps_layered_filter_index_manufacturer')); Configuration::updateValue('PS_LAYERED_FILTER_INDEX_CAT', (int) Tools::getValue('ps_layered_filter_index_category')); $html .= ' <div class="conf">' . $this->l('Settings saved successfully') . '</div>'; } else { if (isset($_GET['deleteFilterTemplate'])) { $layered_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT filters FROM ' . _DB_PREFIX_ . 'layered_filter WHERE id_layered_filter = ' . (int) $_GET['id_layered_filter']); if ($layered_values) { Db::getInstance()->execute('DELETE FROM ' . _DB_PREFIX_ . 'layered_filter WHERE id_layered_filter = ' . (int) $_GET['id_layered_filter'] . ' LIMIT 1'); $this->buildLayeredCategories(); $html .= ' <div class="conf">' . $this->l('Filter template deleted, categories updated (reverted to default Filter template).') . ' </div>'; } else { $html .= ' <div class="error"> <img src="../img/admin/error.png" alt="" title="" /> ' . $this->l('Filter template not found') . ' </div>'; } } } } $html .= ' <div id="ajax-message-ok" class="conf ajax-message" style="display: none"> <span class="message"></span> </div> <div id="ajax-message-ko" class="error ajax-message" style="display: none"> <span class="message"></span> </div> <h2>' . $this->l('Layered navigation') . '</h2> <fieldset class="width4"> <legend><img src="../img/admin/cog.gif" alt="" />' . $this->l('Indexes and caches') . '</legend> <span id="indexing-warning" style="display: none; color:red; font-weight: bold">' . $this->l('Indexing is in progress. Please do not leave this page') . '<br/><br/></span>'; if (!Configuration::getGlobalValue('PS_LAYERED_INDEXED')) { $html .= ' <script type="text/javascript"> $(document).ready(function() { $(\'#url-indexer\').click(); $(\'#full-index\').click(); }); </script>'; } $category_ist = array(); foreach (Db::getInstance()->executeS('SELECT id_category FROM `' . _DB_PREFIX_ . 'category`') as $category) { if ($category['id_category'] != 1) { $category_ist[] = $category['id_category']; } } $domain = Tools::getProtocol(Tools::usingSecureMode()) . $_SERVER['HTTP_HOST']; $html .= ' <a class="bold ajaxcall-recurcive" style="width: 250px; text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" href="' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-price-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '">' . $this->l('Index all missing prices') . '</a> <br /> <a class="bold ajaxcall-recurcive" style="width: 250px; text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" id="full-index" href="' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-price-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '&full=1">' . $this->l('Rebuild entire price index') . '</a> <br /> <a class="bold ajaxcall" id="attribute-indexer" rel="attribute" style="width: 250px; text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" id="full-index" href="' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-attribute-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '">' . $this->l('Build attribute index') . '</a> <br /> <a class="bold ajaxcall" id="url-indexer" rel="price" style="width: 250px; text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" id="full-index" href="' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-url-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '&truncate=1">' . $this->l('Build URL index') . '</a> <br /> <br /> ' . $this->l('You can set a cron job that will rebuild price index using the following URL:') . '<br /><b>' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-price-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '&full=1</b> <br /> ' . $this->l('You can set a cron job that will rebuild URL index using the following URL:') . '<br /><b>' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-url-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '&truncate=1</b> <br /> ' . $this->l('You can set a cron job that will rebuild attribute index using the following URL:') . '<br /><b>' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-attribute-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '</b> <br /><br /> ' . $this->l('A nightly rebuild is recommended.') . ' <script type="text/javascript"> $(\'.ajaxcall\').click(function() { if (this.legend == undefined) this.legend = $(this).html(); if (this.running == undefined) this.running = false; if (this.running == true) return false; $(\'.ajax-message\').hide(); this.running = true; if (typeof(this.restartAllowed) == \'undefined\' || this.restartAllowed) { $(this).html(this.legend+\' ' . addslashes($this->l('(in progress)')) . '\'); $(\'#indexing-warning\').show(); } this.restartAllowed = false; var type = $(this).attr(\'rel\'); $.ajax({ url: this.href+\'&ajax=1\', context: this, dataType: \'json\', cache: \'false\', success: function(res) { this.running = false; this.restartAllowed = true; $(\'#indexing-warning\').hide(); $(this).html(this.legend); if (type == \'price\') $(\'#ajax-message-ok span\').html(\'' . addslashes($this->l('URL indexation finished')) . '\'); else $(\'#ajax-message-ok span\').html(\'' . addslashes($this->l('Attribute indexation finished')) . '\'); $(\'#ajax-message-ok\').show(); return; }, error: function(res) { this.restartAllowed = true; $(\'#indexing-warning\').hide(); if (type == \'price\') $(\'#ajax-message-ko span\').html(\'' . addslashes($this->l('URL indexation failed')) . '\'); else $(\'#ajax-message-ko span\').html(\'' . addslashes($this->l('Attribute indexation failed')) . '\'); $(\'#ajax-message-ko\').show(); $(this).html(this.legend); this.running = false; } }); return false; }); $(\'.ajaxcall-recurcive\').each(function(it, elm) { $(elm).click(function() { if (this.cursor == undefined) this.cursor = 0; if (this.legend == undefined) this.legend = $(this).html(); if (this.running == undefined) this.running = false; if (this.running == true) return false; $(\'.ajax-message\').hide(); this.running = true; if (typeof(this.restartAllowed) == \'undefined\' || this.restartAllowed) { $(this).html(this.legend+\' ' . addslashes($this->l('(in progress)')) . '\'); $(\'#indexing-warning\').show(); } this.restartAllowed = false; $.ajax({ url: this.href+\'&ajax=1&cursor=\'+this.cursor, context: this, dataType: \'json\', cache: \'false\', success: function(res) { this.running = false; if (res.result) { this.cursor = 0; $(\'#indexing-warning\').hide(); $(this).html(this.legend); $(\'#ajax-message-ok span\').html(\'' . addslashes($this->l('Price indexation finished')) . '\'); $(\'#ajax-message-ok\').show(); return; } this.cursor = parseInt(res.cursor); $(this).html(this.legend+\' ' . addslashes($this->l('(in progress, %s products price to index)')) . '\'.replace(\'%s\', res.count)); $(this).click(); }, error: function(res) { this.restartAllowed = true; $(\'#indexing-warning\').hide(); $(\'#ajax-message-ko span\').html(\'' . addslashes($this->l('Price indexation failed')) . '\'); $(\'#ajax-message-ko\').show(); $(this).html(this.legend); this.cursor = 0; this.running = false; } }); return false; }); }); </script> </fieldset> <br /> <fieldset class="width4"> <legend><img src="../img/admin/cog.gif" alt="" />' . $this->l('Existing filter templates') . '</legend>'; $filters_templates = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT * FROM ' . _DB_PREFIX_ . 'layered_filter ORDER BY date_add DESC'); if (count($filters_templates)) { $html .= '<p>' . count($filters_templates) . ' ' . $this->l('filter templates are configured:') . '</p> <table id="table-filter-templates" class="table" style="width: 700px;"> <tr> <th>' . $this->l('ID') . '</th> <th>' . $this->l('Name') . '</th> <th>' . $this->l('Categories') . '</th> <th>' . $this->l('Created on') . '</th> <th>' . $this->l('Actions') . '</th> </tr>'; foreach ($filters_templates as $filters_template) { /* Clean request URI first */ $_SERVER['REQUEST_URI'] = preg_replace('/&deleteFilterTemplate=[0-9]*&id_layered_filter=[0-9]*/', '', $_SERVER['REQUEST_URI']); $html .= ' <tr> <td>' . (int) $filters_template['id_layered_filter'] . '</td> <td style="text-align: left; padding-left: 10px; width: 270px;">' . $filters_template['name'] . '</td> <td style="text-align: center;">' . (int) $filters_template['n_categories'] . '</td> <td>' . Tools::displayDate($filters_template['date_add'], null, true) . '</td> <td> <a href="#" onclick="return updElements(' . ($filters_template['n_categories'] ? 0 : 1) . ', ' . (int) $filters_template['id_layered_filter'] . ');"> <img src="../img/admin/edit.gif" alt="" title="' . $this->l('Edit') . '" /></a> <a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&deleteFilterTemplate=1&id_layered_filter=' . (int) $filters_template['id_layered_filter'] . '" onclick="return confirm(\'' . addslashes(sprintf($this->l('Delete filter template #%d?'), (int) $filters_template['id_layered_filter'])) . '\');"> <img src="../img/admin/delete.gif" alt="" title="' . $this->l('Delete') . '" /></a> </td> </tr>'; } $html .= ' </table>'; } else { $html .= $this->l('No filter template found.'); } $html .= ' </fieldset><br /> <fieldset class="width4"> <legend><img src="../img/admin/cog.gif" alt="" />' . $this->l('Build your own filter template') . '</legend> <link rel="stylesheet" href="' . _PS_CSS_DIR_ . 'jquery-ui-1.8.10.custom.css" /> <style type="text/css"> #error-filter-name { display: none; } #layered_container_left ul, #layered_container_right ul { list-style-type: none; padding-left: 0px; } .ui-effects-transfer { border: 1px solid #CCC; } .ui-state-highlight { height: 1.5em; line-height: 1.2em; } ul#selected_filters, #layered_container_right ul { list-style-type: none; margin: 0; padding: 0; } ul#selected_filters li, #layered_container_right ul li { width: 326px; font-size: 11px; padding: 8px 9px 7px 20px; height: 14px; margin-bottom: 5px; } ul#selected_filters li span.ui-icon { position: absolute; margin-top: -2px; margin-left: -18px; } #layered_container_right ul li span { display: none; } #layered_container_right ul li { padding-left: 8px; position: relative; } #layered_container_left ul li { cursor: move; position: relative; } #layered-cat-counter { display: none; } #layered-step-2, #layered-step-3 { display: none; } #layered-step-2 h3 { margin-top: 0; } #table-filter-templates tr th, #table-filter-templates tr td { text-align: center; } .filter_type { width: 70px; position: absolute; right: 53px; top: 5px;} .filter_show_limit { position: absolute; width: 40px; right: 5px; top: 5px; } #layered-step-3 .alert { width: auto; } #fancybox-content { height: 400px !important; overflow: auto !important; } </style> <form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post" onsubmit="return checkForm();">'; $html .= ' <h2>' . $this->l('Step 1/3 - Select categories') . '</h2> <p style="margin-top: 20px;"> <span style="color: #585A69;display: block;float: left;font-weight: bold;text-align: right;width: 200px;" >' . $this->l('Use this template for:') . '</span> <input type="radio" id="scope_1" name="scope" value="1" style="margin-left: 15px;" onclick="$(\'#error-treeview\').hide(); $(\'#layered-step-2\').show(); updElements(1, 0);" /> <label for="scope_1" style="float: none;">' . $this->l('All categories') . '</label> <input type="radio" id="scope_2" name="scope" value="2" style="margin-left: 15px;" class="layered-category-selection" onclick="$(\'label a#inline\').click(); $(\'#layered-step-2\').show();" /> <style> .link { color: black; cursor: pointer; text-decoration: underline; } .link:hover { color: gray; } </style> <label for="scope_2" style="float: none;"><a id="inline" href="#layered-categories-selection" style="text-decoration: underline;"></a>' . preg_replace('/\\*([^*]+)\\*/Usi', '<span class="link">$1</span>', $this->l('*Specific* categories')) . ' (<span id="layered-cat-counter"></span> ' . $this->l('selected') . ')</label> </p>'; $shops = Shop::getShops(true, null, true); if (count($shops) > 1) { $helper = new HelperForm(); $helper->id = null; $helper->table = 'layered_filter'; $helper->identifier = 'id_layered_filter'; if (Shop::isFeatureActive()) { $html .= '<span style="color: #585A69;display: block;float: left;font-weight: bold;text-align: right;width: 200px;" >' . $this->l('Choose shop association:') . '</span>'; $html .= '<div id="shop_association" style="width: 300px;margin-left: 215px;">' . $helper->renderAssoShop() . '</div>'; } } $html .= ' <div id="error-treeview" class="error" style="display: none;"> <img src="../img/admin/error2.png" alt="" /> ' . $this->l('Please select at least one specific category or select "All categories".') . ' </div> <div style="display: none;"> <div id="layered-categories-selection" style="padding: 10px; text-align: left;"> <h2>' . $this->l('Categories using this template') . '</h2> <ol style="padding-left: 20px;"> <li>' . $this->l('Select one ore more category using this filter template') . '</li> <li>' . $this->l('Press "Save this selection" or close the window to save') . '</li> </ol>'; $selected_cat = array(); // Translations are not automatic for the moment ;) if (Shop::getContext() == Shop::CONTEXT_SHOP) { $root_category = Category::getRootCategory(); $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name); } else { $root_category = array('id_category' => '0', 'name' => $this->l('Root')); } $helper = new Helper(); $html .= $helper->renderCategoryTree(null, $selected_cat, 'categoryBox'); $html .= ' <br /> <center><input type="button" class="button" value="' . $this->l('Save this selection') . '" onclick="$.fancybox.close();" /></center> </div> </div> <div id="layered-step-2"> <hr size="1" noshade /> <h2>' . $this->l('Step 2/3 - Select filters') . '</h2> <div id="layered_container"> <div id="layered_container_left" style="width: 360px; float: left; height: 200px; overflow-y: auto;"> <h3>' . $this->l('Selected filters') . ' <span id="num_sel_filters">(0)</span></h3> <p id="no-filters">' . $this->l('No filters selected yet.') . '</p> <ul id="selected_filters"></ul> </div> <div id="layered-ajax-refresh"> ' . $this->ajaxCallBackOffice() . ' </div> </div> <div class="clear"></div> <hr size="1" noshade />'; $this->context->controller->addJQueryPlugin('fancybox'); $this->context->controller->addJQueryUI('ui.sortable'); $this->context->controller->addJQueryUI('ui.draggable'); $this->context->controller->addJQueryUI('effects.transfer'); $id_lang = Context::getContext()->cookie->id_lang; $html .= ' <script type="text/javascript"> function updLayCounters(showAlert) { $(\'#num_sel_filters\').html(\'(\'+$(\'ul#selected_filters\').find(\'li\').length+\')\'); $(\'#num_avail_filters\').html(\'(\'+$(\'#layered_container_right ul\').find(\'li\').length+\')\'); if ($(\'ul#selected_filters\').find(\'li\').length >= 1) { $(\'#layered-step-3\').show(); $(\'#layered-step-3 .alert\').hide(); } else { if (showAlert) $(\'#layered-step-3\').show(); else $(\'#layered-step-3\').hide(); $(\'#layered-step-3 .alert\').show(); } } function updPositions() { $(\'#layered_container_left li\').each(function(idx) { $(this).find(\'span.position\').html(parseInt(1+idx)+\'. \'); }); } function updCatCounter() { $(\'#layered-cat-counter\').html($(\'#categories-treeview\').find(\'input:checked\').length); $(\'#layered-cat-counter\').show(); } function updHeight() { $(\'#layered_container_left\').css(\'height\', 30+(1+$(\'#layered_container_left\').find(\'li\').length)*34); $(\'#layered_container_right\').css(\'height\', 30+(1+$(\'#layered_container_right\').find(\'li\').length)*34); } function updElements(all, id_layered_filter) { if ($(\'#error-treeview\').is(\':hidden\')) $(\'#layered-step-2\').show(); else $(\'#layered-step-2\').hide(); $(\'#layered-ajax-refresh\').css(\'background-color\', \'black\'); $(\'#layered-ajax-refresh\').css(\'opacity\', \'0.2\'); $(\'#layered-ajax-refresh\').html(\'<div style="margin: 0 auto; padding: 10px; text-align: center;">\' +\'<img src="../img/admin/ajax-loader-big.gif" alt="" /><br /><p style="color: white;">' . addslashes($this->l('Loading...')) . '</p></div>\'); $.ajax( { type: \'POST\', url: \'' . __PS_BASE_URI__ . '\' + \'modules/blocklayered/blocklayered-ajax-back.php\', data: \'layered_token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '&id_lang=' . $id_lang . '&\' +(all ? \'\' : $(\'input[name="categoryBox[]"]\').serialize()+\'&\') +(id_layered_filter ? \'id_layered_filter=\'+parseInt(id_layered_filter) : \'\') +\'&base_folder=' . urlencode(_PS_ADMIN_DIR_) . '\', success: function(result) { $(\'#layered-ajax-refresh\').css(\'background-color\', \'transparent\'); $(\'#layered-ajax-refresh\').css(\'opacity\', \'1\'); $(\'#layered-ajax-refresh\').html(result); $(\'#layered_container_right li input\').each(function() { if ($(\'#layered_container_left\').find(\'input[id="\'+$(this).attr(\'id\')+\'"]\').length > 0) $(this).parent().remove(); }); updHeight(); updLayCounters(true); } }); return false; } function checkForm() { if ($(\'#layered_tpl_name\').val() == \'\') { $(\'#error-filter-name\').show(); return false; } else if ($(\'#scope_1\').attr(\'checked\') && $(\'#n_existing\').val() > 0) if (!confirm(\'' . addslashes($this->l('You selected -All categories-, all existing filter templates will be deleted, OK?')) . '\')) return false; return true; } function launch() { $(\'#layered_container input\').live(\'click\', function () { if ($(this).parent().hasClass(\'layered_right\')) { $(\'p#no-filters\').hide(); $(this).parent().css(\'background\', \'url("../img/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png") repeat-x scroll 50% 50% #FDF5CE\'); $(this).parent().removeClass(\'layered_right\'); $(this).parent().addClass(\'layered_left\'); $(this).effect(\'transfer\', { to: $(\'#layered_container_left ul#selected_filters\') }, 300, function() { $(this).parent().appendTo(\'ul#selected_filters\'); updLayCounters(false); updHeight(); updPositions(); }); } else { $(this).parent().css(\'background\', \'url("../img/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png") repeat-x scroll 50% 50% #F6F6F6\'); $(this).effect(\'transfer\', { to: $(\'#layered_container_right ul#all_filters\') }, 300, function() { $(this).parent().removeClass(\'layered_left\'); $(this).parent().addClass(\'layered_right\'); $(this).parent().appendTo(\'ul#all_filters\'); updLayCounters(true); updHeight(); updPositions(); if ($(\'#layered_container_left ul\').length == 0) $(\'p#no-filters\').show(); }); } enableSortable(); }); $(\'label a#inline\').fancybox({ \'hideOnContentClick\': false, \'onClosed\': function() { lock_treeview_hidding = false; $(\'#categories-treeview\').parent().parent().hide(); updCatCounter(); if ($(\'#categories-treeview\').find(\'input:checked\').length == 0) $(\'#error-treeview\').show(); else $(\'#error-treeview\').hide(); updElements(0, 0); }, \'onComplete\': function() { lock_treeview_hidding = true; $(\'#categories-treeview\').parent().parent().show(); if($($(\'#categories-treeview li\')[0]).attr(\'cleaned\')) return; if($($(\'#categories-treeview li\')[0]).attr(\'cleaned\', true)) $($(\'#categories-treeview li\')[0]).removeClass(\'static\'); $($(\'#categories-treeview li span\')[0]).trigger(\'click\'); $($(\'#categories-treeview li\')[0]).children(\'div\').remove(); $($(\'#categories-treeview li\')[0]). removeClass(\'collapsable lastCollapsable\'). addClass(\'last static\'); $(\'.hitarea\').live(\'click\', function(it) { $(this).parent().find(\'> .category_label\').click(); }); } }); updHeight(); updLayCounters(false); updPositions(); updCatCounter(); enableSortable(); } function enableSortable() { $(function() { $(\'ul#selected_filters\').sortable({ axis: \'y\', update: function() { updPositions(); }, placeholder: \'ui-state-highlight\' }); $(\'ul#selected_filters\').disableSelection(); }); } $(document).ready(function() { launch(); }); </script> </div> <div id="layered-step-3"> <div id="error-filter-name" class="error"> <img src="../img/admin/error.png" alt="" title="" />' . $this->l('Errors:') . ' <ul> <li>' . $this->l('Filter template name required (cannot be empty)') . '</li> </ul> </div> <h2>' . $this->l('Step 3/3 - Name your template') . '</h2> <p>' . $this->l('Template name:') . ' <input type="text" id="layered_tpl_name" onkeyup="if ($(this).val() != \'\') { $(\'#error-filter-name\').hide(); } else { $(\'#error-filter-name\').show(); }" name="layered_tpl_name" maxlength="64" value="' . sprintf($this->l('My template %s'), date('Y-m-d')) . '" style="width: 200px; font-size: 11px;" /> <span style="font-size: 10px; font-style: italic;">(' . $this->l('only as a reminder') . ')</span></p> <hr size="1" noshade /> <p class="alert">' . $this->l('No filters selected, the blocklayered will be disable for the categories seleted.') . '</p> <br /> <center><input type="submit" class="button" name="SubmitFilter" value="' . $this->l('Save this filter template') . '" /></center> </div> <input type="hidden" name="id_layered_filter" id="id_layered_filter" value="0" /> <input type="hidden" name="n_existing" id="n_existing" value="' . (int) count($filters_templates) . '" /> </form> </fieldset><br /> <fieldset class="width4"> <legend><img src="../img/admin/cog.gif" alt="" /> ' . $this->l('Configuration') . '</legend> <form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post"> <table border="0" style="font-size: 11px; width: 100%; margin: 0 auto;" class="table"> <tr> <th style="text-align: center;">' . $this->l('Option') . '</th> <th style="text-align: center; width: 200px;">' . $this->l('Value') . '</th> </tr> <tr> <td style="text-align: right;">' . $this->l('Hide filter values with no product is matching') . '</td> <td style="text-align: center;"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /> ' . $this->l('Yes') . ' <input type="radio" name="ps_layered_hide_0_values" value="1" ' . (Configuration::get('PS_LAYERED_HIDE_0_VALUES') ? 'checked="checked"' : '') . ' /> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" style="margin-left: 10px;" /> ' . $this->l('No') . ' <input type="radio" name="ps_layered_hide_0_values" value="0" ' . (!Configuration::get('PS_LAYERED_HIDE_0_VALUES') ? 'checked="checked"' : '') . ' /> </td> </tr> <tr> <td style="text-align: right;">' . $this->l('Show the number of matching products') . '</td> <td style="text-align: center;"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /> ' . $this->l('Yes') . ' <input type="radio" name="ps_layered_show_qties" value="1" ' . (Configuration::get('PS_LAYERED_SHOW_QTIES') ? 'checked="checked"' : '') . ' /> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" style="margin-left: 10px;" /> ' . $this->l('No') . ' <input type="radio" name="ps_layered_show_qties" value="0" ' . (!Configuration::get('PS_LAYERED_SHOW_QTIES') ? 'checked="checked"' : '') . ' /> </td> </tr> <tr> <td style="text-align: right;">' . $this->l('Show products from subcategories') . '</td> <td style="text-align: center;"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /> ' . $this->l('Yes') . ' <input type="radio" name="ps_layered_full_tree" value="1" ' . (Configuration::get('PS_LAYERED_FULL_TREE') ? 'checked="checked"' : '') . ' /> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" style="margin-left: 10px;" /> ' . $this->l('No') . ' <input type="radio" name="ps_layered_full_tree" value="0" ' . (!Configuration::get('PS_LAYERED_FULL_TREE') ? 'checked="checked"' : '') . ' /> </td> </tr> <tr style="text-align: center;"> <td style="text-align: right;">' . $this->l('Category filter depth (0 for no limits, 1 by default)') . '</td> <td> <input type="text" name="ps_layered_filter_category_depth" value="' . (Configuration::get('PS_LAYERED_FILTER_CATEGORY_DEPTH') !== false ? Configuration::get('PS_LAYERED_FILTER_CATEGORY_DEPTH') : 1) . '" /> </td> </tr> <tr style="text-align: center;"> <td style="text-align: right;">' . $this->l('Use tax to filter price') . '</td> <td> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /> ' . $this->l('Yes') . ' <input type="radio" name="ps_layered_filter_price_usetax" value="1" ' . (Configuration::get('PS_LAYERED_FILTER_PRICE_USETAX') ? 'checked="checked"' : '') . ' /> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" style="margin-left: 10px;" /> ' . $this->l('No') . ' <input type="radio" name="ps_layered_filter_price_usetax" value="0" ' . (!Configuration::get('PS_LAYERED_FILTER_PRICE_USETAX') ? 'checked="checked"' : '') . ' /> </td> </tr> <tr style="text-align: center;"> <td style="text-align: right;">' . $this->l('Allow indexing robots (google, yahoo, bing, ...) to use condition filter') . '</td> <td> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /> ' . $this->l('Yes') . ' <input type="radio" name="ps_layered_filter_index_condition" value="1" ' . (Configuration::get('PS_LAYERED_FILTER_INDEX_CDT') ? 'checked="checked"' : '') . ' /> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" style="margin-left: 10px;" /> ' . $this->l('No') . ' <input type="radio" name="ps_layered_filter_index_condition" value="0" ' . (!Configuration::get('PS_LAYERED_FILTER_INDEX_CDT') ? 'checked="checked"' : '') . ' /> </td> </tr> <tr style="text-align: center;"> <td style="text-align: right;">' . $this->l('Allow indexing robots (google, yahoo, bing, ...) to use availability filter') . '</td> <td> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /> ' . $this->l('Yes') . ' <input type="radio" name="ps_layered_filter_index_availability" value="1" ' . (Configuration::get('PS_LAYERED_FILTER_INDEX_QTY') ? 'checked="checked"' : '') . ' /> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" style="margin-left: 10px;" /> ' . $this->l('No') . ' <input type="radio" name="ps_layered_filter_index_availability" value="0" ' . (!Configuration::get('PS_LAYERED_FILTER_INDEX_QTY') ? 'checked="checked"' : '') . ' /> </td> </tr> <tr style="text-align: center;"> <td style="text-align: right;">' . $this->l('Allow indexing robots (google, yahoo, bing, ...) to use manufacturer filter') . '</td> <td> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /> ' . $this->l('Yes') . ' <input type="radio" name="ps_layered_filter_index_manufacturer" value="1" ' . (Configuration::get('PS_LAYERED_FILTER_INDEX_MNF') ? 'checked="checked"' : '') . ' /> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" style="margin-left: 10px;" /> ' . $this->l('No') . ' <input type="radio" name="ps_layered_filter_index_manufacturer" value="0" ' . (!Configuration::get('PS_LAYERED_FILTER_INDEX_MNF') ? 'checked="checked"' : '') . ' /> </td> </tr> <tr style="text-align: center;"> <td style="text-align: right;">' . $this->l('Allow indexing robots (google, yahoo, bing, ...) to use category filter') . '</td> <td> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '" /> ' . $this->l('Yes') . ' <input type="radio" name="ps_layered_filter_index_category" value="1" ' . (Configuration::get('PS_LAYERED_FILTER_INDEX_CAT') ? 'checked="checked"' : '') . ' /> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '" style="margin-left: 10px;" /> ' . $this->l('No') . ' <input type="radio" name="ps_layered_filter_index_category" value="0" ' . (!Configuration::get('PS_LAYERED_FILTER_INDEX_CAT') ? 'checked="checked"' : '') . ' /> </td> </tr> </table> <p style="text-align: center;"><input type="submit" class="button" name="submitLayeredSettings" value="' . $this->l('Save configuration') . '" /></p> </form> </fieldset>'; return $html; }
function content_5613965468f363_56470708($_smarty_tpl) { if (!is_callable('smarty_function_implode')) { include '/home/oobox/domains/oobox.stronazen.pl/public_html/xiaomipl/tools/smarty/plugins/function.implode.php'; } ?> <!DOCTYPE HTML> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"<?php if (isset($_smarty_tpl->tpl_vars['language_code']->value) && $_smarty_tpl->tpl_vars['language_code']->value) { ?> lang="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language_code']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> ><![endif]--> <!--[if IE 7]><html class="no-js lt-ie9 lt-ie8 ie7"<?php if (isset($_smarty_tpl->tpl_vars['language_code']->value) && $_smarty_tpl->tpl_vars['language_code']->value) { ?> lang="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language_code']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> ><![endif]--> <!--[if IE 8]><html class="no-js lt-ie9 ie8"<?php if (isset($_smarty_tpl->tpl_vars['language_code']->value) && $_smarty_tpl->tpl_vars['language_code']->value) { ?> lang="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language_code']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> ><![endif]--> <!--[if gt IE 8]> <html class="no-js ie9"<?php if (isset($_smarty_tpl->tpl_vars['language_code']->value) && $_smarty_tpl->tpl_vars['language_code']->value) { ?> lang="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language_code']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> ><![endif]--> <html<?php if (isset($_smarty_tpl->tpl_vars['language_code']->value) && $_smarty_tpl->tpl_vars['language_code']->value) { ?> lang="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language_code']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> > <head> <meta charset="utf-8" /> <title><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['meta_title']->value, ENT_QUOTES, 'UTF-8', true); ?> </title> <?php if (isset($_smarty_tpl->tpl_vars['meta_description']->value) && $_smarty_tpl->tpl_vars['meta_description']->value) { ?> <meta name="description" content="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['meta_description']->value, ENT_QUOTES, 'UTF-8', true); ?> " /> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['meta_keywords']->value) && $_smarty_tpl->tpl_vars['meta_keywords']->value) { ?> <meta name="keywords" content="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['meta_keywords']->value, ENT_QUOTES, 'UTF-8', true); ?> " /> <?php } ?> <meta name="generator" content="PrestaShop" /> <meta name="robots" content="<?php if (isset($_smarty_tpl->tpl_vars['nobots']->value)) { ?> no<?php } ?> index,<?php if (isset($_smarty_tpl->tpl_vars['nofollow']->value) && $_smarty_tpl->tpl_vars['nofollow']->value) { ?> no<?php } ?> follow" /> <meta name="viewport" content="width=device-width, minimum-scale=0.25, maximum-scale=1.6, initial-scale=1.0" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <link rel="icon" type="image/vnd.microsoft.icon" href="<?php echo $_smarty_tpl->tpl_vars['favicon_url']->value; ?> ?<?php echo $_smarty_tpl->tpl_vars['img_update_time']->value; ?> " /> <link rel="shortcut icon" type="image/x-icon" href="<?php echo $_smarty_tpl->tpl_vars['favicon_url']->value; ?> ?<?php echo $_smarty_tpl->tpl_vars['img_update_time']->value; ?> " /> <?php if (isset($_smarty_tpl->tpl_vars['css_files']->value)) { ?> <?php $_smarty_tpl->tpl_vars['media'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['media']->_loop = false; $_smarty_tpl->tpl_vars['css_uri'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['css_files']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['media']->key => $_smarty_tpl->tpl_vars['media']->value) { $_smarty_tpl->tpl_vars['media']->_loop = true; $_smarty_tpl->tpl_vars['css_uri']->value = $_smarty_tpl->tpl_vars['media']->key; ?> <link rel="stylesheet" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['css_uri']->value, ENT_QUOTES, 'UTF-8', true); ?> " type="text/css" media="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['media']->value, ENT_QUOTES, 'UTF-8', true); ?> " /> <?php } ?> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['js_defer']->value) && !$_smarty_tpl->tpl_vars['js_defer']->value && isset($_smarty_tpl->tpl_vars['js_files']->value) && isset($_smarty_tpl->tpl_vars['js_def']->value)) { ?> <?php echo $_smarty_tpl->tpl_vars['js_def']->value; ?> <?php $_smarty_tpl->tpl_vars['js_uri'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['js_uri']->_loop = false; $_from = $_smarty_tpl->tpl_vars['js_files']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['js_uri']->key => $_smarty_tpl->tpl_vars['js_uri']->value) { $_smarty_tpl->tpl_vars['js_uri']->_loop = true; ?> <script type="text/javascript" src="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['js_uri']->value, ENT_QUOTES, 'UTF-8', true); ?> "></script> <?php } ?> <?php } ?> <?php echo $_smarty_tpl->tpl_vars['HOOK_HEADER']->value; ?> <link rel="stylesheet" href="http<?php if (Tools::usingSecureMode()) { ?> s<?php } ?> ://fonts.googleapis.com/css?family=Open+Sans:300,600&subset=latin,latin-ext" type="text/css" media="all" /> <link href="<?php echo $_smarty_tpl->tpl_vars['css_dir']->value; ?> style.css" rel="stylesheet" type="text/css" /> <!--[if IE 8]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <![endif]--> </head> <body<?php if (isset($_smarty_tpl->tpl_vars['page_name']->value)) { ?> id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['page_name']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> class="<?php if (isset($_smarty_tpl->tpl_vars['page_name']->value)) { echo htmlspecialchars($_smarty_tpl->tpl_vars['page_name']->value, ENT_QUOTES, 'UTF-8', true); } if (isset($_smarty_tpl->tpl_vars['body_classes']->value) && count($_smarty_tpl->tpl_vars['body_classes']->value)) { ?> <?php echo smarty_function_implode(array('value' => $_smarty_tpl->tpl_vars['body_classes']->value, 'separator' => ' '), $_smarty_tpl); } if ($_smarty_tpl->tpl_vars['hide_left_column']->value) { ?> hide-left-column<?php } else { ?> show-left-column<?php } if ($_smarty_tpl->tpl_vars['hide_right_column']->value) { ?> hide-right-column<?php } else { ?> show-right-column<?php } if (isset($_smarty_tpl->tpl_vars['content_only']->value) && $_smarty_tpl->tpl_vars['content_only']->value) { ?> content_only<?php } ?> lang_<?php echo $_smarty_tpl->tpl_vars['lang_iso']->value; ?> "> <?php if (!isset($_smarty_tpl->tpl_vars['content_only']->value) || !$_smarty_tpl->tpl_vars['content_only']->value) { ?> <?php if (isset($_smarty_tpl->tpl_vars['restricted_country_mode']->value) && $_smarty_tpl->tpl_vars['restricted_country_mode']->value) { ?> <div id="restricted-country"> <p><?php echo smartyTranslate(array('s' => 'You cannot place a new order from your country.'), $_smarty_tpl); if (isset($_smarty_tpl->tpl_vars['geolocation_country']->value) && $_smarty_tpl->tpl_vars['geolocation_country']->value) { ?> <span class="bold"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['geolocation_country']->value, ENT_QUOTES, 'UTF-8', true); ?> </span><?php } ?> </p> </div> <?php } ?> <div id="page"> <div class="header-container"> <header id="header"> <?php $_smarty_tpl->_capture_stack[0][] = array('displayBanner', null, null); ob_start(); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h' => 'displayBanner'), $_smarty_tpl); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if (Smarty::$_smarty_vars['capture']['displayBanner']) { ?> <div class="banner"> <div class="container"> <div class="row"> <?php echo Smarty::$_smarty_vars['capture']['displayBanner']; ?> </div> </div> </div> <?php } ?> <?php $_smarty_tpl->_capture_stack[0][] = array('displayNav', null, null); ob_start(); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h' => 'displayNav'), $_smarty_tpl); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if (Smarty::$_smarty_vars['capture']['displayNav']) { ?> <div class="nav"> <div class="container"> <div class="row"> <nav><?php echo Smarty::$_smarty_vars['capture']['displayNav']; ?> </nav> </div> </div> </div> <?php } ?> <div> <div class="container"> <div class="row"> <div id="header_logo"> <a href="<?php if (isset($_smarty_tpl->tpl_vars['force_ssl']->value) && $_smarty_tpl->tpl_vars['force_ssl']->value) { echo $_smarty_tpl->tpl_vars['base_dir_ssl']->value; } else { echo $_smarty_tpl->tpl_vars['base_dir']->value; } ?> " title="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shop_name']->value, ENT_QUOTES, 'UTF-8', true); ?> "> <img class="logo img-responsive" src="<?php echo $_smarty_tpl->tpl_vars['logo_url']->value; ?> " alt="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shop_name']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php if (isset($_smarty_tpl->tpl_vars['logo_image_width']->value) && $_smarty_tpl->tpl_vars['logo_image_width']->value) { ?> width="<?php echo $_smarty_tpl->tpl_vars['logo_image_width']->value; ?> "<?php } if (isset($_smarty_tpl->tpl_vars['logo_image_height']->value) && $_smarty_tpl->tpl_vars['logo_image_height']->value) { ?> height="<?php echo $_smarty_tpl->tpl_vars['logo_image_height']->value; ?> "<?php } ?> /> </a> </div> <?php if (isset($_smarty_tpl->tpl_vars['HOOK_TOP']->value)) { echo $_smarty_tpl->tpl_vars['HOOK_TOP']->value; } ?> </div> </div> </div> </header> </div> <div class="columns-container"> <div id="columns" class="container"> <?php if ($_smarty_tpl->tpl_vars['page_name']->value != 'index' && $_smarty_tpl->tpl_vars['page_name']->value != 'pagenotfound') { ?> <?php echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['tpl_dir']->value . "./breadcrumb.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php } ?> <div id="slider_row" class="row"> <?php $_smarty_tpl->_capture_stack[0][] = array('displayTopColumn', null, null); ob_start(); echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h' => 'displayTopColumn'), $_smarty_tpl); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if (Smarty::$_smarty_vars['capture']['displayTopColumn']) { ?> <div id="top_column" class="center_column col-xs-12 col-sm-12"><?php echo Smarty::$_smarty_vars['capture']['displayTopColumn']; ?> </div> <?php } ?> </div> <div class="row"> <?php if (isset($_smarty_tpl->tpl_vars['left_column_size']->value) && !empty($_smarty_tpl->tpl_vars['left_column_size']->value)) { ?> <div id="left_column" class="column col-xs-12 col-sm-<?php echo intval($_smarty_tpl->tpl_vars['left_column_size']->value); ?> "><?php echo $_smarty_tpl->tpl_vars['HOOK_LEFT_COLUMN']->value; ?> </div> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['left_column_size']->value) && isset($_smarty_tpl->tpl_vars['right_column_size']->value)) { $_smarty_tpl->tpl_vars['cols'] = new Smarty_variable(12 - $_smarty_tpl->tpl_vars['left_column_size']->value - $_smarty_tpl->tpl_vars['right_column_size']->value, null, 0); } else { $_smarty_tpl->tpl_vars['cols'] = new Smarty_variable(12, null, 0); } ?> <div id="center_column" class="center_column col-xs-12 col-sm-<?php echo intval($_smarty_tpl->tpl_vars['cols']->value); ?> "> <?php } }
private function _displayForm() { if (Tools::usingSecureMode()) { $domain = Tools::getShopDomainSsl(true); } else { $domain = Tools::getShopDomain(true); } $this->_html .= ' <form action="' . Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']) . '" method="post"> <div style="margin:0 0 20px 0;"> <input type="checkbox" name="GSITEMAP_ALL_PRODUCTS" id="GSITEMAP_ALL_PRODUCTS" style="vertical-align: middle;" value="1" ' . (Configuration::get('GSITEMAP_ALL_PRODUCTS') ? 'checked="checked"' : '') . ' /> <label class="t" for="GSITEMAP_ALL_PRODUCTS">' . $this->l('Sitemap also includes products from inactive categories') . '</label> </div> <div style="margin:0 0 20px 0;"> <input type="checkbox" name="GSITEMAP_ALL_CMS" id="GSITEMAP_ALL_CMS" style="vertical-align: middle;" value="1" ' . (Configuration::get('GSITEMAP_ALL_CMS') ? 'checked="checked"' : '') . ' /> <label class="t" for="GSITEMAP_ALL_CMS">' . $this->l('Sitemap also includes CMS pages which are not in a CMS block') . '</label> </div> <input name="btnSubmit" class="button" type="submit" value="' . (!file_exists(GSITEMAP_FILE) ? $this->l('Generate sitemap file') : $this->l('Update sitemap file')) . '" /> </form><br /> <h2>' . $this->l('Use cron job to re-build the sitemap:') . '</h2> <p> <b>' . $domain . __PS_BASE_URI__ . 'modules/gsitemap/gsitemap-cron.php?&token=' . substr(Tools::encrypt('gsitemap/cron'), 0, 10) . '&GSITEMAP_ALL_CMS=' . (int) Configuration::get('GSITEMAP_ALL_CMS') . '&GSITEMAP_ALL_PRODUCTS=' . (int) Configuration::get('GSITEMAP_ALL_PRODUCTS') . '</b> </p>'; }
public function displayForm($order_states, $features, $attribute_groups, $neteven_feature_categories) { $customizable_fields = array(); if (Gateway::getConfig('CUSTOMIZABLE_FIELDS')) { foreach (explode('¤', Gateway::getConfig('CUSTOMIZABLE_FIELDS')) as $customizable_field) { $customizable_fields[] = explode('|', $customizable_field); } } $carriers = Carrier::getCarriers((int) $this->context->cookie->id_lang); $this->context->smarty->assign(array('SHIPPING_CARRIER_FRANCE' => Tools::safeOutput(Tools::getValue('SHIPPING_CARRIER_FRANCE', Gateway::getConfig('SHIPPING_CARRIER_FRANCE'))), 'SHIPPING_ZONE_FRANCE' => Tools::safeOutput(Tools::getValue('SHIPPING_ZONE_FRANCE', Gateway::getConfig('SHIPPING_ZONE_FRANCE'))), 'SHIPPING_CARRIER_INTERNATIONAL' => Tools::safeOutput(Tools::getValue('SHIPPING_CARRIER_INTERNATIONAL', Gateway::getConfig('SHIPPING_CARRIER_INTERNATIONAL'))), 'SHIPPING_ZONE_INTERNATIONAL' => Tools::safeOutput(Tools::getValue('SHIPPING_ZONE_INTERNATIONAL', Gateway::getConfig('SHIPPING_ZONE_INTERNATIONAL'))), 'carriers' => $carriers, 'order_states' => $order_states, 'features' => $features, 'module_path' => $this->_path, 'module_display_name' => $this->displayName, 'attribute_groups' => $attribute_groups, 'neteven_feature_categories' => $neteven_feature_categories, 'default_currency' => new Currency((int) Configuration::get('PS_CURRENCY_DEFAULT')), 'format_images' => ImageType::getImagesTypes('products'), 'cron_feature_url' => Tools::getProtocol(Tools::usingSecureMode()) . $_SERVER['HTTP_HOST'] . __PS_BASE_URI__ . 'modules/' . $this->name . $this->feature_url, 'cron_order_url' => Tools::getProtocol(Tools::usingSecureMode()) . $_SERVER['HTTP_HOST'] . __PS_BASE_URI__ . 'modules/' . $this->name . $this->order_url, 'cron_product_url' => Tools::getProtocol(Tools::usingSecureMode()) . $_SERVER['HTTP_HOST'] . __PS_BASE_URI__ . 'modules/' . $this->name . $this->product_url, 'customizable_fields' => $customizable_fields, 'neteven_token' => Tools::encrypt(Configuration::get('PS_SHOP_NAME')), 'NETEVEN_LOGIN' => Tools::safeOutput(Tools::getValue('NETEVEN_LOGIN', Gateway::getConfig('NETEVEN_LOGIN'))), 'NETEVEN_PASSWORD' => Tools::safeOutput(Tools::getValue('NETEVEN_PASSWORD', Gateway::getConfig('NETEVEN_PASSWORD'))), 'SYNCHRONISATION_ORDER' => (int) Gateway::getConfig('SYNCHRONISATION_ORDER'), 'SYNCHRONISATION_PRODUCT' => (int) Gateway::getConfig('SYNCHRONISATION_PRODUCT'), 'DEFAULT_BRAND' => Tools::safeOutput(Tools::getValue('DEFAULT_BRAND', Gateway::getConfig('DEFAULT_BRAND'))), 'SHIPPING_DELAY' => Tools::safeOutput(Tools::getValue('SHIPPING_DELAY', Gateway::getConfig('SHIPPING_DELAY'))), 'IMAGE_TYPE_NAME' => Gateway::getConfig('IMAGE_TYPE_NAME'), 'COMMENT' => Tools::safeOutput(Tools::getValue('COMMENT', Gateway::getConfig('COMMENT'))), 'SHIPPING_PRICE_LOCAL' => Tools::safeOutput(Tools::getValue('SHIPPING_PRICE_LOCAL', Gateway::getConfig('SHIPPING_PRICE_LOCAL'))), 'SHIPPING_PRICE_INTERNATIONAL' => Tools::safeOutput(Tools::getValue('SHIPPING_PRICE_INTERNATIONAL', Gateway::getConfig('SHIPPING_PRICE_INTERNATIONAL'))), 'SHIPPING_BY_PRODUCT' => (int) Gateway::getConfig('SHIPPING_BY_PRODUCT'), 'SHIPPING_BY_PRODUCT_FIELDNAME' => Tools::safeOutput(Tools::getValue('SHIPPING_BY_PRODUCT_FIELDNAME', Gateway::getConfig('SHIPPING_BY_PRODUCT_FIELDNAME'))), 'ID_ORDER_STATE_NETEVEN' => (int) Gateway::getConfig('ID_ORDER_STATE_NETEVEN'), 'NETEVEN_URL' => Tools::safeOutput(Tools::getValue('NETEVEN_URL', Gateway::getConfig('NETEVEN_URL'))), 'NETEVEN_NS' => Tools::safeOutput(Tools::getValue('NETEVEN_NS', Gateway::getConfig('NETEVEN_NS'))), 'MAIL_LIST_ALERT' => Tools::safeOutput(Tools::getValue('MAIL_LIST_ALERT', Gateway::getConfig('MAIL_LIST_ALERT'))), 'DEBUG' => (int) Gateway::getConfig('DEBUG'), 'SEND_REQUEST_BY_EMAIL' => (int) Gateway::getConfig('SEND_REQUEST_BY_EMAIL'), 'TYPE_SKU' => (int) (Gateway::getConfig('TYPE_SKU') !== false) ? Gateway::getConfig('TYPE_SKU') : 'reference')); return $this->display(__FILE__, 'views/templates/admin/nqgatewayneteven.tpl'); }
function content_564ed807b80b73_25874949($_smarty_tpl) { if (!is_callable('smarty_function_implode')) { include 'E:\\Project\\htdocs\\pf_fshow_quickstart\\tools\\smarty\\plugins\\function.implode.php'; } ?> <!DOCTYPE HTML> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"<?php if (isset($_smarty_tpl->tpl_vars['language_code']->value) && $_smarty_tpl->tpl_vars['language_code']->value) { ?> lang="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language_code']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> ><![endif]--> <!--[if IE 7]><html class="no-js lt-ie9 lt-ie8 ie7"<?php if (isset($_smarty_tpl->tpl_vars['language_code']->value) && $_smarty_tpl->tpl_vars['language_code']->value) { ?> lang="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language_code']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> ><![endif]--> <!--[if IE 8]><html class="no-js lt-ie9 ie8"<?php if (isset($_smarty_tpl->tpl_vars['language_code']->value) && $_smarty_tpl->tpl_vars['language_code']->value) { ?> lang="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language_code']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> ><![endif]--> <!--[if gt IE 8]> <html class="no-js ie9"<?php if (isset($_smarty_tpl->tpl_vars['language_code']->value) && $_smarty_tpl->tpl_vars['language_code']->value) { ?> lang="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language_code']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> ><![endif]--> <html<?php if (isset($_smarty_tpl->tpl_vars['language_code']->value) && $_smarty_tpl->tpl_vars['language_code']->value) { ?> lang="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['language_code']->value, ENT_QUOTES, 'UTF-8', true); ?> " <?php } ?> dir="<?php echo $_smarty_tpl->tpl_vars['LANG_DIRECTION']->value; ?> " class="<?php echo $_smarty_tpl->tpl_vars['LANG_DIRECTION']->value; ?> "> <head> <meta charset="utf-8" /> <title><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['meta_title']->value, ENT_QUOTES, 'UTF-8', true); ?> </title> <?php if (isset($_smarty_tpl->tpl_vars['meta_description']->value) && $_smarty_tpl->tpl_vars['meta_description']->value) { ?> <meta name="description" content="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['meta_description']->value, ENT_QUOTES, 'UTF-8', true); ?> " /> <?php } if (isset($_smarty_tpl->tpl_vars['meta_keywords']->value) && $_smarty_tpl->tpl_vars['meta_keywords']->value) { ?> <meta name="keywords" content="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['meta_keywords']->value, ENT_QUOTES, 'UTF-8', true); ?> " /> <?php } ?> <meta name="generator" content="PrestaShop" /> <meta name="robots" content="<?php if (isset($_smarty_tpl->tpl_vars['nobots']->value)) { ?> no<?php } ?> index,<?php if (isset($_smarty_tpl->tpl_vars['nofollow']->value) && $_smarty_tpl->tpl_vars['nofollow']->value) { ?> no<?php } ?> follow" /> <meta name="viewport" content="width=device-width, minimum-scale=0.25, maximum-scale=1.6, initial-scale=1.0" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <link rel="icon" type="image/vnd.microsoft.icon" href="<?php echo $_smarty_tpl->tpl_vars['favicon_url']->value; ?> ?<?php echo $_smarty_tpl->tpl_vars['img_update_time']->value; ?> " /> <link rel="shortcut icon" type="image/x-icon" href="<?php echo $_smarty_tpl->tpl_vars['favicon_url']->value; ?> ?<?php echo $_smarty_tpl->tpl_vars['img_update_time']->value; ?> " /> <?php if (isset($_smarty_tpl->tpl_vars['css_files']->value)) { ?> <?php $_smarty_tpl->tpl_vars['media'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['media']->_loop = false; $_smarty_tpl->tpl_vars['css_uri'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['css_files']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['media']->key => $_smarty_tpl->tpl_vars['media']->value) { $_smarty_tpl->tpl_vars['media']->_loop = true; $_smarty_tpl->tpl_vars['css_uri']->value = $_smarty_tpl->tpl_vars['media']->key; ?> <?php if (preg_match("#global#", $_smarty_tpl->tpl_vars['css_uri']->value)) { ?> <link rel="stylesheet" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['css_uri']->value, ENT_QUOTES, 'UTF-8', true); ?> " id="global-style" type="text/css" media="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['media']->value, ENT_QUOTES, 'UTF-8', true); ?> " /> <?php } else { ?> <link rel="stylesheet" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['css_uri']->value, ENT_QUOTES, 'UTF-8', true); ?> " type="text/css" media="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['media']->value, ENT_QUOTES, 'UTF-8', true); ?> " /> <?php } ?> <?php } } if (isset($_smarty_tpl->tpl_vars['js_defer']->value) && !$_smarty_tpl->tpl_vars['js_defer']->value && isset($_smarty_tpl->tpl_vars['js_files']->value) && isset($_smarty_tpl->tpl_vars['js_def']->value)) { ?> <?php echo $_smarty_tpl->tpl_vars['js_def']->value; ?> <?php $_smarty_tpl->tpl_vars['js_uri'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['js_uri']->_loop = false; $_from = $_smarty_tpl->tpl_vars['js_files']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['js_uri']->key => $_smarty_tpl->tpl_vars['js_uri']->value) { $_smarty_tpl->tpl_vars['js_uri']->_loop = true; ?> <script type="text/javascript" src="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['js_uri']->value, ENT_QUOTES, 'UTF-8', true); ?> "></script> <?php } } ?> <?php echo $_smarty_tpl->tpl_vars['HOOK_HEADER']->value; ?> <link rel="stylesheet" href="http<?php if (Tools::usingSecureMode()) { ?> s<?php } ?> ://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700&subset=latin,latin-ext" type="text/css" media="all" /> <link href='http<?php if (Tools::usingSecureMode()) { ?> s<?php } ?> ://fonts.googleapis.com/css?family=Roboto+Condensed:400,700' rel='stylesheet' type='text/css'/> <link href='http<?php if (Tools::usingSecureMode()) { ?> s<?php } ?> ://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'/> <!--[if IE 8]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <![endif]--> </head> <body<?php if (isset($_smarty_tpl->tpl_vars['page_name']->value)) { ?> id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['page_name']->value, ENT_QUOTES, 'UTF-8', true); ?> "<?php } ?> class="<?php if (isset($_smarty_tpl->tpl_vars['page_name']->value)) { echo htmlspecialchars($_smarty_tpl->tpl_vars['page_name']->value, ENT_QUOTES, 'UTF-8', true); } if (isset($_smarty_tpl->tpl_vars['body_classes']->value) && count($_smarty_tpl->tpl_vars['body_classes']->value)) { ?> <?php echo smarty_function_implode(array('value' => $_smarty_tpl->tpl_vars['body_classes']->value, 'separator' => ' '), $_smarty_tpl); } if ($_smarty_tpl->tpl_vars['hide_left_column']->value) { ?> hide-left-column<?php } if ($_smarty_tpl->tpl_vars['hide_right_column']->value) { ?> hide-right-column<?php } if (isset($_smarty_tpl->tpl_vars['content_only']->value) && $_smarty_tpl->tpl_vars['content_only']->value) { ?> content_only<?php } ?> lang_<?php echo $_smarty_tpl->tpl_vars['lang_iso']->value; ?> layout-<?php echo $_smarty_tpl->tpl_vars['DEFAUTL_LAYOUT']->value; ?> " > <?php if (!isset($_smarty_tpl->tpl_vars['content_only']->value) || !$_smarty_tpl->tpl_vars['content_only']->value) { ?> <?php if (isset($_smarty_tpl->tpl_vars['restricted_country_mode']->value) && $_smarty_tpl->tpl_vars['restricted_country_mode']->value) { ?> <div id="restricted-country"> <p><?php echo smartyTranslate(array('s' => 'You cannot place a new order from your country.'), $_smarty_tpl); ?> <span class="bold"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['geolocation_country']->value, ENT_QUOTES, 'UTF-8', true); ?> </span></p> </div> <?php } ?> <div id="page"> <div class="banner hidden-xs hidden-sm"> <div class="container"> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h' => "displayBanner"), $_smarty_tpl); ?> </div> </div> <?php if (!isset($_smarty_tpl->tpl_vars['header_cp']->value)) { ?> <?php $_smarty_tpl->tpl_vars['header_cp'] = new Smarty_variable(Configuration::get('PTS_CP_HEADER'), null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['header_cp']->value && file_exists((string) $_smarty_tpl->tpl_vars['CURRENT_THEMEDIR']->value . "./sub/headers/" . (string) $_smarty_tpl->tpl_vars['header_cp']->value . "/" . (string) $_smarty_tpl->tpl_vars['header_cp']->value . ".tpl")) { ?> <?php echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['CURRENT_THEMEDIR']->value . "./sub/headers/" . (string) $_smarty_tpl->tpl_vars['header_cp']->value . "/" . (string) $_smarty_tpl->tpl_vars['header_cp']->value . ".tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('page_name_skin' => $_smarty_tpl->tpl_vars['page_name']->value), 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['page_name']->value != 'index' && $_smarty_tpl->tpl_vars['page_name']->value != 'pagenotfound') { ?> <div id="breadcrumb"> <?php echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['tpl_dir']->value . "./breadcrumb.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> </div> <?php } ?> <?php if (Configuration::get('PTS_CP_ENABLE_PBUILDER') && isset($_smarty_tpl->tpl_vars['PTS_PAGEBUILDER_ACTIVED']->value) && $_smarty_tpl->tpl_vars['PTS_PAGEBUILDER_ACTIVED']->value && $_smarty_tpl->tpl_vars['PTS_PAGEBUILDER_FULL']->value) { ?> <div id="columns" class="pagebuilder-content <?php echo $_smarty_tpl->tpl_vars['header_cp']->value; ?> "> <?php echo $_smarty_tpl->tpl_vars['PTS_PAGEBUILDER_CONTENT']->value; ?> <?php } else { ?> <?php if ($_smarty_tpl->tpl_vars['page_name']->value == 'index') { ?> <div id="pts-slideshow" class="slideshow"> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h' => "displayslideshow"), $_smarty_tpl); ?> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['page_name']->value == 'index') { ?> <div id="pts-promotion-top" class="promotion-top"> <div class="container"> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h' => "displaypromotetop"), $_smarty_tpl); ?> </div> </div> <?php } ?> <div id="columns" class="offcanvas-siderbars"> <?php if ($_smarty_tpl->tpl_vars['page_name']->value == 'index') { ?> <div id="top_column" class="top_column "> <div class="container"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0][0]->smartyHook(array('h' => "displayTopColumn"), $_smarty_tpl); ?> </div> </div> <?php } ?> <div class="main-content"> <div class="main-content-inner"> <div class="container"> <div class="row"> <?php if (isset($_smarty_tpl->tpl_vars['left_column_size']->value) && !empty($_smarty_tpl->tpl_vars['left_column_size']->value)) { ?> <div id="left_column" class="sidebar column col-xs-12 col-sm-12 col-md-<?php echo intval($_smarty_tpl->tpl_vars['left_column_size']->value); ?> col-lg-<?php echo intval($_smarty_tpl->tpl_vars['left_column_size']->value); ?> offcanvas-sidebar"> <?php echo $_smarty_tpl->tpl_vars['HOOK_LEFT_COLUMN']->value; ?> </div> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['left_column_size']->value) && isset($_smarty_tpl->tpl_vars['right_column_size']->value)) { $_smarty_tpl->tpl_vars['cols'] = new Smarty_variable(12 - $_smarty_tpl->tpl_vars['left_column_size']->value - $_smarty_tpl->tpl_vars['right_column_size']->value, null, 0); } else { $_smarty_tpl->tpl_vars['cols'] = new Smarty_variable(12, null, 0); } ?> <div id="center_column" class="center_column col-xs-12 col-sm-12 col-md-<?php echo intval($_smarty_tpl->tpl_vars['cols']->value); ?> col-lg-<?php echo intval($_smarty_tpl->tpl_vars['cols']->value); ?> "> <div id="content"> <?php } ?> <?php } }
/** * Init context and dependencies, handles POST and GET */ public function init() { // Has to be removed for the next Prestashop version global $currentIndex; parent::init(); if (Tools::getValue('ajax')) { $this->ajax = '1'; } /* Server Params */ $protocol_link = Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://'; $protocol_content = Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://'; $this->context->link = new Link($protocol_link, $protocol_content); if (isset($_GET['logout'])) { $this->context->employee->logout(); } if (isset(Context::getContext()->cookie->last_activity)) { if ($this->context->cookie->last_activity + 900 < time()) { $this->context->employee->logout(); } else { $this->context->cookie->last_activity = time(); } } if ($this->controller_name != 'AdminLogin' && (!isset($this->context->employee) || !$this->context->employee->isLoggedBack())) { if (isset($this->context->employee)) { $this->context->employee->logout(); } $email = false; if (Tools::getValue('email') && Validate::isEmail(Tools::getValue('email'))) { $email = Tools::getValue('email'); } Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin') . (!isset($_GET['logout']) && $this->controller_name != 'AdminNotFound' && Tools::getValue('controller') ? '&redirect=' . $this->controller_name : '') . ($email ? '&email=' . $email : '')); } // Set current index $current_index = 'index.php' . (($controller = Tools::getValue('controller')) ? '?controller=' . $controller : ''); if ($back = Tools::getValue('back')) { $current_index .= '&back=' . urlencode($back); } self::$currentIndex = $current_index; $currentIndex = $current_index; if ((int) Tools::getValue('liteDisplaying')) { $this->display_header = false; $this->display_footer = false; $this->content_only = false; $this->lite_display = true; } if ($this->ajax && method_exists($this, 'ajaxPreprocess')) { $this->ajaxPreProcess(); } $this->context->smarty->assign(array('table' => $this->table, 'current' => self::$currentIndex, 'token' => $this->token, 'host_mode' => defined('_PS_HOST_MODE_') ? 1 : 0, 'stock_management' => (int) Configuration::get('PS_STOCK_MANAGEMENT'))); if ($this->display_header) { $this->context->smarty->assign('displayBackOfficeHeader', Hook::exec('displayBackOfficeHeader', array())); } $this->context->smarty->assign(array('displayBackOfficeTop' => Hook::exec('displayBackOfficeTop', array()), 'submit_form_ajax' => (int) Tools::getValue('submitFormAjax'))); Employee::setLastConnectionDate($this->context->employee->id); $this->initProcess(); $this->initBreadcrumbs(); $this->initModal(); }