public function saveTpl() { $this->siteparas->saveTpl(); $this->getParasFile(); $adminController = new AdminController(); $adminController->publishStaticIndex(); }
public function login() { $view = new ViewModel('admin/login'); if (isset($_SESSION['user']) && $_SESSION['user'] != 'admin') { $view->assign('user', $_SESSION['user']); header('Location: yourAccount'); return; } if (isset($_POST['user']) && $_POST['user'] == 'admin') { $admin = new AdminController(); $admin->login(); } if (isset($_POST['user'])) { $customer = new CustomerModel(); $logged = $customer->selectWithPassword($_POST['user'], $_POST['pass']); if (!$logged) { $view->assign('message-type', 'error'); $view->assign('message', 'Błędne dane'); $view->display(); return; } $_SESSION['user'] = $_POST['user']; $view->assign('user', $_SESSION['user']); $view->setTemplate('customer/index'); header('Location: yourAccount'); } $view->display(); }
function route($controller, $query) { $controllers = array("News", "Contact", "Admin"); if (in_array(@$controller, $controllers)) { switch ($controller) { case "News": $myController = new NewsController($query); break; case "Contact": $myController = new ContactController($query); break; case "Admin": $myController = new AdminController($query); break; } $myController->render($query); } else { $myController = new NewsController('News'); $myController->render($query); if (@$controller != null) { $message = "Site which you want to connect does not exists"; echo "<script type='text/javascript'>alert('{$message}');</script>"; } } }
public static function dispatch(&$request) { session_start(); if (isset($request["page"])) { switch ($request["page"]) { case "login": $controller = new BaseController(); $controller->handle_input($request); break; case "cliente": $controller = new ClienteController(); if (isset($_SESSION[BaseController::role]) && $_SESSION[BaseController::role] != User::Cliente) { self::write403(); } $controller->handle_input($request); break; case "admin": $controller = new AdminController(); if (isset($_SESSION[BaseController::role]) && $_SESSION[BaseController::role] != User::Admin) { self::write403(); } $controller->handle_input($request); break; default: self::write404(); break; } } else { self::write404(); } // include 'php/view/master.php'; }
public function __construct() { $this->bootstrap = true; $this->table = 'order_invoice'; $this->className = 'OrderInvoice'; $this->addRowAction('view'); $this->context = Context::getContext(); $this->_select = '`id_order_invoice` AS `id_invoice`, `id_order_invoice` AS `outstanding`, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, c.`outstanding_allow_amount`, r.`color`, rl.`name` AS `risk`'; $this->_join = 'LEFT JOIN `' . _DB_PREFIX_ . 'orders` o ON (o.`id_order` = a.`id_order`) LEFT JOIN `' . _DB_PREFIX_ . 'customer` c ON (c.`id_customer` = o.`id_customer`) LEFT JOIN `' . _DB_PREFIX_ . 'risk` r ON (r.`id_risk` = c.`id_risk`) LEFT JOIN `' . _DB_PREFIX_ . 'risk_lang` rl ON (r.`id_risk` = rl.`id_risk` AND rl.`id_lang` = ' . (int) $this->context->language->id . ')'; $this->_where = 'AND number > 0'; $risks = array(); foreach (Risk::getRisks() as $risk) { $risks[$risk->id] = $risk->name; } $this->fields_list = array('number' => array('title' => $this->l('Invoice')), 'date_add' => array('title' => $this->l('Date'), 'type' => 'date', 'align' => 'right', 'filter_key' => 'a!date_add'), 'customer' => array('title' => $this->l('Customer'), 'filter_key' => 'customer', 'tmpTableFilter' => true), 'company' => array('title' => $this->l('Company'), 'align' => 'center'), 'risk' => array('title' => $this->l('Risk'), 'align' => 'center', 'orderby' => false, 'type' => 'select', 'color' => 'color', 'list' => $risks, 'filter_key' => 'r!id_risk', 'filter_type' => 'int'), 'outstanding_allow_amount' => array('title' => $this->l('Outstanding Allow'), 'align' => 'center', 'prefix' => '<b>', 'suffix' => '</b>', 'type' => 'price'), 'outstanding' => array('title' => $this->l('Current Outstanding'), 'align' => 'center', 'callback' => 'printOutstandingCalculation', 'orderby' => false, 'search' => false), 'id_invoice' => array('title' => $this->l('Invoice'), 'align' => 'center', 'callback' => 'printPDFIcons', 'orderby' => false, 'search' => false)); parent::__construct(); }
public function initContent() { $this->errors[] = Tools::displayError('Controller not found'); $tpl_vars['controller'] = Tools::getvalue('controllerUri', Tools::getvalue('controller')); $this->context->smarty->assign($tpl_vars); parent::initContent(); }
public function initContent() { if ((empty($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') && 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) { $this->errors[] = Tools::displayError('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).'); } else { $warningSslMessage = Tools::displayError('SSL is activated. Please connect using the following url to log in in secure mode (https).'); $warningSslMessage .= '<a href="https://' . Tools::safeOutput(Tools::getServerName()) . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">https://' . Tools::safeOutput(Tools::getServerName()) . Tools::safeOutput($_SERVER['REQUEST_URI']) . '</a>'; $this->context->smarty->assign(array('warningSslMessage' => $warningSslMessage)); } } if (file_exists(_PS_ADMIN_DIR_ . '/../install') || file_exists(_PS_ADMIN_DIR_ . '/../admin')) { $this->context->smarty->assign(array('randomNb' => rand(100, 999), 'wrong_folder_name' => true)); } // 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)); } $this->setMedia(); $this->initHeader(); parent::initContent(); $this->initFooter(); }
public function initPageHeaderToolbar() { if (empty($this->display)) { $this->page_header_toolbar_btn['new_order_message'] = array('href' => self::$currentIndex . '&addorder_message&token=' . $this->token, 'desc' => $this->l('Add new order message'), 'icon' => 'process-icon-new'); } parent::initPageHeaderToolbar(); }
public function initContent() { $this->errors[] = $this->trans('Controller not found', array(), 'Admin.Notifications.Error'); $tpl_vars['controller'] = Tools::getvalue('controllerUri', Tools::getvalue('controller')); $this->context->smarty->assign($tpl_vars); parent::initContent(); }
function init() { parent::init(); if (true !== YII_DEBUG) { exit('access deny!'); } }
public function __construct() { parent::__construct(); $this->load->model('customer_rent_model'); $this->load->model('customer_express_rule_model'); $this->load->model('customer_express_rule_item_model'); }
public function createTemplate($tpl_name) { if (file_exists($this->getTemplatePath() . $this->override_folder . $tpl_name) && $this->viewAccess()) { return $this->context->smarty->createTemplate($this->getTemplatePath() . $this->override_folder . $tpl_name, $this->context->smarty); } return parent::createTemplate($tpl_name); }
function __construct($view_class = null) { if ($view_class === null) { $view_class = "BlogAdminViewSocieties"; } parent::__construct($view_class); }
public function update($id) { $rules = array('name' => 'required', 'description' => 'required', 'title' => 'required', 'route' => 'required', 'menu_image' => 'mimes:jpeg,bmp,png'); $validator = Validator::make(Input::all(), $rules); // process the login if ($validator->fails()) { return Redirect::to('admin/admin_menu/' . $id . '/edit')->withErrors($validator)->withInput(); } else { // store $filename = ""; if (Input::hasFile('menu_image')) { if (Input::file('menu_image')->isValid()) { Input::file('menu_image')->move(AdminController::imagePath()); $filename = Input::file('menu_image')->getClientOriginalName(); } } $adminMenu = new AdministrationMenu(); $adminMenu->name = Input::get('name'); $adminMenu->description = Input::get('description'); if ($filename !== "") { $adminMenu->image = AdminController::imagePath() . $filename; } $adminMenu->title = Input::get('title'); $adminMenu->route = Input::get('route'); $adminMenu->save(); // redirect Session::flash('message', 'Successfully updated admin_menu!'); return Redirect::to('admin/admin_menu'); } }
public function __construct() { $this->className = 'Configuration'; $this->table = 'configuration'; parent::__construct(); $this->fields_options = array('general' => array('title' => $this->l('General'), 'icon' => 'tab-preferences', 'fields' => array('PS_SHOP_ENABLE' => array('title' => $this->l('Enable Shop'), 'desc' => $this->l('Activate or deactivate your shop. It is a good idea to 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 the 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' => '')), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'))); }
public function __construct() { $this->className = 'Configuration'; $this->table = 'configuration'; parent::__construct(); $this->fields_options = array('products' => array('title' => $this->l('Products (general)'), 'fields' => array('PS_CATALOG_MODE' => array('title' => $this->l('Catalog mode'), 'desc' => $this->l('When active, all shopping features will be disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_COMPARATOR_MAX_ITEM' => array('title' => $this->l('Product comparison'), 'desc' => $this->l('Set the maximum number of products that can be selected for comparison.') . ' ' . $this->l('Set to "0" to disable this feature.'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), 'PS_NB_DAYS_NEW_PRODUCT' => array('title' => $this->l('Number of days for which the product is considered \'new\''), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'type' => 'text'), 'PS_CART_REDIRECT' => array('title' => $this->l('Redirect after adding product to cart'), 'desc' => $this->l('Only for non-AJAX versions of the cart.'), 'cast' => 'intval', 'show' => true, 'required' => false, 'type' => 'radio', 'validation' => 'isBool', 'choices' => array(0 => $this->l('Previous page'), 1 => $this->l('Cart summary'))), 'PS_PRODUCT_SHORT_DESC_LIMIT' => array('title' => $this->l('Max size of short description'), 'desc' => $this->l('Set the maximum size of product short description (in characters).'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'suffix' => $this->l('characters')), 'PS_QTY_DISCOUNT_ON_COMBINATION' => array('title' => $this->l('Quantity discounts based on'), 'desc' => $this->l('How to calculate quantity discounts'), 'cast' => 'intval', 'show' => true, 'required' => false, 'type' => 'radio', 'validation' => 'isBool', 'choices' => array(0 => $this->l('Products:'), 1 => $this->l('Combinations'))))), 'order_by_pagination' => array('title' => $this->l('Pagination'), 'fields' => array('PS_PRODUCTS_PER_PAGE' => array('title' => $this->l('Products per page'), 'desc' => $this->l('Number of products displayed per page. Default is 10.'), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'type' => 'text'), 'PS_PRODUCTS_ORDER_BY' => array('title' => $this->l('Default order by'), 'desc' => $this->l('The order in which products are displayed in the product list.'), 'type' => 'select', 'list' => array(array('id' => '0', 'name' => $this->l('Product name')), array('id' => '1', 'name' => $this->l('Product price')), array('id' => '2', 'name' => $this->l('Product add date')), array('id' => '3', 'name' => $this->l('Product modified date')), array('id' => '4', 'name' => $this->l('Position inside category')), array('id' => '5', 'name' => $this->l('Manufacturer')), array('id' => '6', 'name' => $this->l('Product quantity'))), 'identifier' => 'id'), 'PS_PRODUCTS_ORDER_WAY' => array('title' => $this->l('Default order method'), 'desc' => $this->l('Default order method for product list'), 'type' => 'select', 'list' => array(array('id' => '0', 'name' => $this->l('Ascending')), array('id' => '1', 'name' => $this->l('Descending'))), 'identifier' => 'id'))), 'fo_product_page' => array('title' => $this->l('Product page'), 'fields' => array('PS_DISPLAY_QTIES' => array('title' => $this->l('Display available quantities on the product page'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_LAST_QTIES' => array('title' => $this->l('Display remaining quantities when the qty is lower than'), 'desc' => $this->l('Set to "0" to disable this feature.'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), 'PS_DISPLAY_JQZOOM' => array('title' => $this->l('Enable JqZoom instead of Thickbox on the product page'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_DISP_UNAVAILABLE_ATTR' => array('title' => $this->l('Display unavailable product attributes on the product page'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_ATTRIBUTE_CATEGORY_DISPLAY' => array('title' => $this->l('Display the "add to cart" button when a product has attributes'), 'desc' => $this->l('Display or hide the "add to cart" button on category pages for products that have attributes forcing customers to see product details.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'))), 'stock' => array('title' => $this->l('Products stock'), 'fields' => array('PS_ORDER_OUT_OF_STOCK' => array('title' => $this->l('Allow ordering of out-of-stock products'), 'desc' => $this->l('Add to cart button is hidden when a product is unavailable'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool'), 'PS_STOCK_MANAGEMENT' => array('title' => $this->l('Enable stock management'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool', 'js' => array('on' => 'onchange="stockManagementActivationAuthorization()"', 'off' => 'onchange="stockManagementActivationAuthorization()"')), 'PS_ADVANCED_STOCK_MANAGEMENT' => array('title' => $this->l('Enable advanced-stock management'), 'desc' => $this->l('Allows you to manage physical stock, warehouses and supply orders.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL)), 'bottom' => '<script type="text/javascript">stockManagementActivationAuthorization();</script>', 'submit' => array())); }
public function beforeFilter() { AuthComponent::$sessionKey = 'Auth.admins'; parent::beforeFilter(); $view_flg = array('0' => '非表示', '1' => '表示'); $this->set('view_flg', $view_flg); }
/** * Store constructor * * @return void **/ function __construct () { parent::__construct(); if (!empty($_GET['id'])) { wp_enqueue_script('jquery-ui-draggable'); wp_enqueue_script('suggest'); wp_enqueue_script('postbox'); if ( user_can_richedit() ) { wp_enqueue_script('editor'); wp_enqueue_script('quicktags'); add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 20 ); } ecart_enqueue_script('colorbox'); ecart_enqueue_script('editors'); ecart_enqueue_script('scalecrop'); ecart_enqueue_script('calendar'); ecart_enqueue_script('product-editor'); ecart_enqueue_script('priceline'); ecart_enqueue_script('ocupload'); ecart_enqueue_script('swfupload'); ecart_enqueue_script('ecart-swfupload-queue'); do_action('ecart_product_editor_scripts'); add_action('admin_head',array(&$this,'layout')); } elseif (!empty($_GET['f']) && $_GET['f'] == 'i') { do_action('ecart_inventory_manager_scripts'); add_action('admin_print_scripts',array(&$this,'inventory_cols')); } else add_action('admin_print_scripts',array(&$this,'columns')); add_action('load-ecart_page_ecart-products',array(&$this,'workflow')); do_action('ecart_product_admin_scripts'); // Load the search model for indexing require_once(ECART_MODEL_PATH."/Search.php"); new ContentParser(); add_action('ecart_product_saved',array(&$this,'index'),99,1); }
/** * Categorize constructor * * @return void **/ function __construct () { parent::__construct(); if (!empty($_GET['id']) && !isset($_GET['a'])) { wp_enqueue_script('postbox'); if ( user_can_richedit() ) { wp_enqueue_script('editor'); wp_enqueue_script('quicktags'); add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 20 ); } ecart_enqueue_script('colorbox'); ecart_enqueue_script('editors'); ecart_enqueue_script('category-editor'); ecart_enqueue_script('priceline'); ecart_enqueue_script('ocupload'); ecart_enqueue_script('swfupload'); ecart_enqueue_script('ecart-swfupload-queue'); do_action('ecart_category_editor_scripts'); add_action('admin_head',array(&$this,'layout')); } elseif (!empty($_GET['a']) && $_GET['a'] == 'arrange') { ecart_enqueue_script('category-arrange'); do_action('ecart_category_arrange_scripts'); add_action('admin_print_scripts',array(&$this,'arrange_cols')); } elseif (!empty($_GET['a']) && $_GET['a'] == 'products') { ecart_enqueue_script('products-arrange'); do_action('ecart_category_products_arrange_scripts'); add_action('admin_print_scripts',array(&$this,'products_cols')); } else add_action('admin_print_scripts',array(&$this,'columns')); do_action('ecart_category_admin_scripts'); add_action('load-ecart_page_ecart-categories',array(&$this,'workflow')); }
function edit($parameter) { $this->page_template_id = $this->getPTIFromId($parameter); $this->set('page_template_id', $this->page_template_id); $this->loadSubnav($parameter); parent::edit($parameter); }
/** 初始化 @param void @return void */ function init() { parent::init(); //db 实例化 $this->category = new CategoryModel(); $this->modeldata = new ModeldataModel(); }
public function __construct() { parent::__construct(); $this->load->model(array("Mcategory", "Mnews")); $this->load->library(array("session")); $user = $this->session->userdata("username"); }
public function __construct() { parent::__construct(); $this->load->model('customer_model'); $this->load->model('customer_number_model'); $this->load->model('file_upload_model'); }
public function _initialize() { parent::_initialize(); if (C('WEIMINGPIAN') == "0") { $this->error("微名片以经关闭"); } }
/** * Inject the models. * @param User $user * @param Role $role * @param Permission $permission */ public function __construct(User $user, Role $role, Permission $permission) { parent::__construct(); $this->user = $user; $this->role = $role; $this->permission = $permission; }
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 __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')))); } }
/** * Constructs the controller */ public function __construct() { parent::__construct(); // -------------------------------------------------------------------------- $this->load->model('faq/faq_model'); $this->lang->load('admin_faq'); }
function __construct() { parent::__construct('items'); $this->load->library('item_lib'); $this->data['pagetitle'] = $this->lang->line('module_' . strtolower(get_class())); $this->data['pagedescription'] = $this->lang->line('module_items_desc'); }
public function __construct() { parent::__construct(); $this->load->model('area_model'); $this->load->model('express_company_model'); $this->load->model('express_point_model'); }