__construct() публичный Метод

Construct this object by extending the basic Controller class
public __construct ( )
 public function __construct()
 {
     $this->bootstrap = true;
     $this->table = 'offer';
     $this->className = 'AphOffer';
     $this->lang = true;
     $this->explicitSelect = false;
     $this->allow_export = false;
     $this->context = Context::getContext();
     $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'icon' => 'icon-trash', 'confirm' => $this->l('Delete selected items?')));
     parent::__construct();
     $this->_defaultOrderBy = 'date_upd';
     $this->_defaultorderWay = 'DESC';
     $this->imageType = 'jpg';
     $this->max_file_size = (int) (Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1000000);
     $this->max_image_size = (int) Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE');
     // @since 1.5 : translations for tabs
     $this->available_tabs_lang = array('Informations' => $this->l('Informazioni'), 'Seo' => $this->l('SEO'), 'Products' => $this->l('Servizi'), 'Shops' => $this->l('Negozi'), 'Images' => $this->l('Images'));
     $this->available_tabs = array_merge($this->available_tabs, array('Informations' => $this->l('Informazioni'), 'Seo' => $this->l('SEO'), 'Products' => $this->l('Servizi'), 'Shops' => $this->l('Negozi'), 'Images' => $this->l('Immagini')));
     if (Configuration::get('PS_SHOP_DEFAULT') != $this->context->shop->id) {
         unset($this->available_tabs['Seo']);
         unset($this->available_tabs_lang['Seo']);
         unset($this->available_tabs['Shops']);
         unset($this->available_tabs_lang['Shops']);
     }
     $this->fields_list = array();
     $this->fields_list['id_offer'] = array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs', 'type' => 'int');
     $this->fields_list['name'] = array('title' => $this->l('Name'), 'filter_key' => 'b!name');
     $this->fields_list['available'] = array('title' => $this->l('Valida'), 'type' => 'text', 'orderby' => false, 'filter' => false, 'search' => false);
     $this->fields_list['visible'] = array('title' => $this->l('Visibile sul sito'), 'type' => 'text', 'orderby' => false, 'filter' => false, 'search' => false);
     $this->fields_list['new_price'] = array('title' => $this->l('Reduction'), 'type' => 'text', 'orderby' => false, 'filter' => false, 'search' => false);
     $this->fields_list['active'] = array('title' => $this->l('Status'), 'active' => 'status', 'align' => 'text-center', 'type' => 'bool', 'class' => 'fixed-width-sm', 'orderby' => true, 'filter' => true, 'search' => true);
 }
 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'))));
     }
 }
Пример #3
0
 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');
 }
Пример #4
0
 /**
  * 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->table = 'group';
        $this->className = 'Group';
        $this->list_id = 'group';
        $this->lang = true;
        $this->addRowAction('edit');
        $this->addRowAction('view');
        $this->addRowAction('delete');
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
        $groups_to_keep = array(Configuration::get('PS_UNIDENTIFIED_GROUP'), Configuration::get('PS_GUEST_GROUP'), Configuration::get('PS_CUSTOMER_GROUP'));
        $this->fields_list = array('id_group' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'name' => array('title' => $this->l('Group name'), 'filter_key' => 'b!name'), 'reduction' => array('title' => $this->l('Discount (%)'), 'align' => 'right', 'type' => 'percent'), 'nb' => array('title' => $this->l('Members'), 'align' => 'center', 'havingFilter' => true), 'show_prices' => array('title' => $this->l('Show prices'), 'align' => 'center', 'type' => 'bool', 'callback' => 'printShowPricesIcon', 'orderby' => false), 'date_add' => array('title' => $this->l('Creation date'), 'type' => 'date', 'align' => 'right'));
        $this->addRowActionSkipList('delete', $groups_to_keep);
        parent::__construct();
        $this->_select .= '(SELECT COUNT(jcg.`id_customer`)
		FROM `' . _DB_PREFIX_ . 'customer_group` jcg
		LEFT JOIN `' . _DB_PREFIX_ . 'customer` jc ON (jc.`id_customer` = jcg.`id_customer`)
		WHERE jc.`deleted` != 1
		' . Shop::addSqlRestriction(Shop::SHARE_CUSTOMER) . '
		AND jcg.`id_group` = a.`id_group`) AS nb';
        $groups = Group::getGroups(Context::getContext()->language->id, true);
        if (Shop::isFeatureActive()) {
            $this->fields_options = array('general' => array('title' => $this->l('Default groups options'), 'fields' => array('PS_UNIDENTIFIED_GROUP' => array('title' => $this->l('Visitors group'), 'desc' => $this->l('The group defined for your un-identified visitors.'), 'cast' => 'intval', 'type' => 'select', 'list' => $groups, 'identifier' => 'id_group'), 'PS_GUEST_GROUP' => array('title' => $this->l('Guests group'), 'desc' => $this->l('The group defined for your identified guest customers (used in guest checkout).'), 'cast' => 'intval', 'type' => 'select', 'list' => $groups, 'identifier' => 'id_group'), 'PS_CUSTOMER_GROUP' => array('title' => $this->l('Customers group'), 'desc' => $this->l('The group defined for your identified registered customers.'), 'cast' => 'intval', 'type' => 'select', 'list' => $groups, 'identifier' => 'id_group')), 'submit' => array('title' => $this->l('Save'))));
        }
    }
 public function __construct()
 {
     $this->table = 'product_attribute';
     $this->className = 'Product';
     $this->multishop_context_group = false;
     parent::__construct();
 }
Пример #7
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('customer_model');
     $this->load->model('customer_number_model');
     $this->load->model('file_upload_model');
 }
 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->table = 'specific_price_rule';
        $this->className = 'SpecificPriceRule';
        $this->lang = false;
        $this->multishop_context = Shop::CONTEXT_ALL;
        /* if $_GET['id_shop'] is transmitted, virtual url can be loaded in config.php, so we wether transmit shop_id in herfs */
        if ($this->id_shop = (int) Tools::getValue('shop_id')) {
            $_GET['id_shop'] = $this->id_shop;
            $_POST['id_shop'] = $this->id_shop;
        }
        $this->list_reduction_type = array('percentage' => $this->l('Percentage'), 'amount' => $this->l('Amount'));
        $this->addRowAction('edit');
        $this->addRowAction('delete');
        $this->context = Context::getContext();
        $this->_select = 's.name shop_name, cu.name currency_name, cl.name country_name, gl.name group_name';
        $this->_join = 'LEFT JOIN ' . _DB_PREFIX_ . 'shop s ON (s.id_shop = a.id_shop)
		LEFT JOIN ' . _DB_PREFIX_ . 'currency cu ON (cu.id_currency = a.id_currency)
		LEFT JOIN ' . _DB_PREFIX_ . 'country_lang cl ON (cl.id_country = a.id_country AND cl.id_lang=' . (int) $this->context->language->id . ')
		LEFT JOIN ' . _DB_PREFIX_ . 'group_lang gl ON (gl.id_group = a.id_group AND gl.id_lang=' . (int) $this->context->language->id . ')';
        $this->_use_found_rows = false;
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
        $this->fields_list = array('id_specific_price_rule' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'name' => array('title' => $this->l('Name'), 'filter_key' => 'a!name', 'width' => 'auto'), 'shop_name' => array('title' => $this->l('Shop'), 'filter_key' => 's!name'), 'currency_name' => array('title' => $this->l('Currency'), 'align' => 'center', 'filter_key' => 'cu!name'), 'country_name' => array('title' => $this->l('Country'), 'align' => 'center', 'filter_key' => 'cl!name'), 'group_name' => array('title' => $this->l('Group'), 'align' => 'center', 'filter_key' => 'gl!name'), 'from_quantity' => array('title' => $this->l('From quantity'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'reduction_type' => array('title' => $this->l('Reduction type'), 'align' => 'center', 'type' => 'select', 'filter_key' => 'a!reduction_type', 'list' => $this->list_reduction_type), 'reduction' => array('title' => $this->l('Reduction'), 'align' => 'center', 'type' => 'decimal', 'class' => 'fixed-width-xs'), 'from' => array('title' => $this->l('Beginning'), 'align' => 'right', 'type' => 'datetime'), 'to' => array('title' => $this->l('End'), 'align' => 'right', 'type' => 'datetime'));
        parent::__construct();
    }
    public function __construct()
    {
        $this->table = 'image_type';
        $this->className = 'ImageType';
        $this->lang = false;
        $this->addRowAction('edit');
        $this->addRowAction('delete');
        $this->fields_list = array('id_image_type' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name'), 'width' => 'auto'), 'width' => array('title' => $this->l('Width'), 'align' => 'right', 'suffix' => ' px', 'width' => 50, 'size' => 5), 'height' => array('title' => $this->l('Height'), 'align' => 'right', 'suffix' => ' px', 'width' => 50, 'size' => 5), 'products' => array('title' => $this->l('Products'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'categories' => array('title' => $this->l('Categories'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'manufacturers' => array('title' => $this->l('Manufacturers'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'suppliers' => array('title' => $this->l('Suppliers'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'scenes' => array('title' => $this->l('Scenes'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'stores' => array('title' => $this->l('Stores'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false));
        // No need to display the old image system migration tool except if product images are in _PS_PROD_IMG_DIR_
        $this->display_move = false;
        $dir = _PS_PROD_IMG_DIR_;
        if (is_dir($dir)) {
            if ($dh = opendir($dir)) {
                while (($file = readdir($dh)) !== false && $this->display_move == false) {
                    if (!is_dir($dir . DIRECTORY_SEPARATOR . $file) && $file[0] != '.' && is_numeric($file[0])) {
                        $this->display_move = true;
                    }
                }
                closedir($dh);
            }
        }
        $this->fields_options = array('images' => array('title' => $this->l('images'), 'icon' => 'tab-orders', 'top' => '', 'bottom' => '', 'description' => $this->l('JPEG images have a small file size and standard quality. PNG images have a larger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.') . '
					<br /><br />' . $this->l('WARNING: This feature may not be compatible with your theme, or with some of your modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issues, turn it off by selecting "Use JPEG".'), 'fields' => array('PS_IMAGE_QUALITY' => array('title' => $this->l('Image quality'), 'show' => true, 'required' => true, 'type' => 'radio', 'choices' => array('jpg' => $this->l('Use JPEG'), 'png' => $this->l('Use PNG only if the base image is in PNG format.'), 'png_all' => $this->l('Use PNG for all images'))), 'PS_JPEG_QUALITY' => array('title' => $this->l('JPEG quality'), 'desc' => $this->l('Ranges from 0 (worst quality, smallest file) to 100 (best quality, biggest file).'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), 'PS_PNG_QUALITY' => array('title' => $this->l('PNG quality'), 'desc' => $this->l('Ranges from 9 (worst quality, smallest file) to 0 (best quality, biggest file).'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text')), 'submit' => array('name' => 'submitImagePreferences')), 'product_images' => array('title' => $this->l('Product images'), 'fields' => array('PS_IMAGE_GENERATION_METHOD' => array('title' => $this->l('Image generated by'), 'validation' => 'isUnsignedId', 'required' => false, 'cast' => 'intval', 'type' => 'select', 'list' => array(array('id' => '0', 'name' => $this->l('Auto')), array('id' => '1', 'name' => $this->l('Width')), array('id' => '2', 'name' => $this->l('Height'))), 'identifier' => 'id', 'visibility' => Shop::CONTEXT_ALL), 'PS_PRODUCT_PICTURE_MAX_SIZE' => array('title' => $this->l('Maximum size of product pictures'), 'desc' => $this->l('The maximum size of pictures uploadable by customers (in Bytes).'), 'validation' => 'isUnsignedInt', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'suffix' => $this->l('Bytes'), 'visibility' => Shop::CONTEXT_ALL), 'PS_PRODUCT_PICTURE_WIDTH' => array('title' => $this->l('Product picture width'), 'desc' => $this->l('The maximum width of pictures uploadable by customers.'), 'validation' => 'isUnsignedInt', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'width' => 'px', 'visibility' => Shop::CONTEXT_ALL), 'PS_PRODUCT_PICTURE_HEIGHT' => array('title' => $this->l('Product picture height'), 'desc' => $this->l('The maximum height of pictures uploadable by customers.'), 'validation' => 'isUnsignedInt', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'height' => 'px', 'visibility' => Shop::CONTEXT_ALL)), 'submit' => array('title' => $this->l('Save   '), 'class' => 'button')));
        if ($this->display_move) {
            $this->fields_options['product_images']['fields']['PS_LEGACY_IMAGES'] = array('title' => $this->l('Use the legacy image filesystem'), 'desc' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL);
        }
        $this->fields_form = array('legend' => array('title' => $this->l('images'), 'image' => '../img/admin/picture.gif'), 'input' => array(array('type' => 'text', 'label' => $this->l('Type name'), 'name' => 'name', 'required' => true, 'desc' => $this->l('Letters and hyphens only (e.g. small, medium, large, extra-large)')), array('type' => 'text', 'label' => $this->l('Width'), 'name' => 'width', 'required' => true, 'size' => 4, 'maxlength' => 5, 'desc' => $this->l('Maximum image width in pixels')), array('type' => 'text', 'label' => $this->l('Height'), 'name' => 'height', 'required' => true, 'size' => 4, 'maxlength' => 5, 'desc' => $this->l('Maximum image height in pixels')), array('type' => 'radio', 'label' => $this->l('Products'), 'name' => 'products', 'required' => false, 'class' => 't', 'is_bool' => true, 'desc' => $this->l('This type will be used for Product images'), 'values' => array(array('id' => 'products_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'products_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'radio', 'label' => $this->l('Categories'), 'name' => 'categories', 'required' => false, 'class' => 't', 'is_bool' => true, 'desc' => $this->l('This type will be applied to Category images.'), 'values' => array(array('id' => 'categories_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'categories_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'radio', 'label' => $this->l('Manufacturers'), 'name' => 'manufacturers', 'required' => false, 'class' => 't', 'is_bool' => true, 'desc' => $this->l('This type will be applied to Manufacturer images.'), 'values' => array(array('id' => 'manufacturers_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'manufacturers_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'radio', 'label' => $this->l('Suppliers'), 'name' => 'suppliers', 'required' => false, 'class' => 't', 'is_bool' => true, 'desc' => $this->l('This type will be used for Supplier images.'), 'values' => array(array('id' => 'suppliers_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'suppliers_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'radio', 'label' => $this->l('Scenes'), 'name' => 'scenes', 'required' => false, 'class' => 't', 'is_bool' => true, 'desc' => $this->l('This type will be used for Scene images.'), 'values' => array(array('id' => 'scenes_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'scenes_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'radio', 'label' => $this->l('Stores'), 'name' => 'stores', 'required' => false, 'class' => 't', 'is_bool' => true, 'desc' => $this->l('This type will be used for Store images.'), 'values' => array(array('id' => 'stores_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'stores_off', 'value' => 0, 'label' => $this->l('Disabled'))))), 'submit' => array('title' => $this->l('Save   '), 'class' => 'button'));
        parent::__construct();
    }
    public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'state';
        $this->className = 'State';
        $this->lang = false;
        $this->requiredDatabase = true;
        $this->addRowAction('edit');
        $this->addRowAction('delete');
        $this->context = Context::getContext();
        if (!Tools::getValue('realedit')) {
            $this->deleted = false;
        }
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')), 'affectzone' => array('text' => $this->l('Assign a new zone')));
        $this->_select = 'z.`name` AS zone, cl.`name` AS country';
        $this->_join = '
		LEFT JOIN `' . _DB_PREFIX_ . 'zone` z ON (z.`id_zone` = a.`id_zone`)
		LEFT JOIN `' . _DB_PREFIX_ . 'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.id_lang = ' . (int) $this->context->language->id . ')';
        $this->_use_found_rows = false;
        $countries_array = $zones_array = array();
        $this->zones = Zone::getZones();
        $this->countries = Country::getCountries($this->context->language->id, false, true, false);
        foreach ($this->zones as $zone) {
            $zones_array[$zone['id_zone']] = $zone['name'];
        }
        foreach ($this->countries as $country) {
            $countries_array[$country['id_country']] = $country['name'];
        }
        $this->fields_list = array('id_state' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'name' => array('title' => $this->l('Name'), 'filter_key' => 'a!name'), 'iso_code' => array('title' => $this->l('ISO code'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'zone' => array('title' => $this->l('Zone'), 'type' => 'select', 'list' => $zones_array, 'filter_key' => 'z!id_zone', 'filter_type' => 'int', 'order_key' => 'zone'), 'country' => array('title' => $this->l('Country'), 'type' => 'select', 'list' => $countries_array, 'filter_key' => 'cl!id_country', 'filter_type' => 'int', 'order_key' => 'country'), 'active' => array('title' => $this->l('Enabled'), 'active' => 'status', 'filter_key' => 'a!active', 'align' => 'center', 'type' => 'bool', 'orderby' => false, 'class' => 'fixed-width-sm'));
        parent::__construct();
    }
Пример #12
0
 public function __construct()
 {
     $this->bootstrap = true;
     $this->multishop_context = Shop::CONTEXT_ALL;
     $this->table = 'translations';
     parent::__construct();
 }
 public function __construct()
 {
     $this->bootstrap = true;
     $this->is_cms = true;
     $this->table = 'cms_category';
     $this->list_id = 'cms_category';
     $this->className = 'CMSCategory';
     $this->lang = true;
     $this->addRowAction('view');
     $this->addRowAction('edit');
     $this->addRowAction('delete');
     $this->_orderBy = 'position';
     $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
     $this->tpl_list_vars['icon'] = 'icon-folder-close';
     $this->tpl_list_vars['title'] = $this->l('Categories');
     $this->fields_list = array('id_cms_category' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'name' => array('title' => $this->l('Name'), 'width' => 'auto', 'callback' => 'hideCMSCategoryPosition', 'callback_object' => 'CMSCategory'), 'description' => array('title' => $this->l('Description'), 'maxlength' => 90, 'orderby' => false), 'position' => array('title' => $this->l('Position'), 'filter_key' => 'position', 'align' => 'center', 'class' => 'fixed-width-sm', 'position' => 'position'), 'active' => array('title' => $this->l('Displayed'), 'class' => 'fixed-width-sm', 'active' => 'status', 'align' => 'center', 'type' => 'bool', 'orderby' => false));
     // The controller can't be call directly
     // In this case, AdminCmsContentController::getCurrentCMSCategory() is null
     if (!AdminCmsContentController::getCurrentCMSCategory()) {
         $this->redirect_after = '?controller=AdminCmsContent&token=' . Tools::getAdminTokenLite('AdminCmsContent');
         $this->redirect();
     }
     $this->cms_category = AdminCmsContentController::getCurrentCMSCategory();
     $this->_where = ' AND `id_parent` = ' . (int) $this->cms_category->id;
     $this->_select = 'position ';
     parent::__construct();
 }
    public function __construct()
    {
        $this->table = 'alias';
        $this->className = 'Alias';
        $this->lang = false;
        parent::__construct();
        // Alias fields
        $this->addRowAction('edit');
        $this->addRowAction('delete');
        if (!Tools::getValue('realedit')) {
            $this->deleted = false;
        }
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
        $this->fields_list = array('alias' => array('title' => $this->l('Aliases'), 'width' => 'auto'), 'search' => array('title' => $this->l('Search'), 'width' => 100), 'active' => array('title' => $this->l('Status'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false));
        // Search options
        $current_file_name = array_reverse(explode('/', $_SERVER['SCRIPT_NAME']));
        $cron_url = Tools::getHttpHost(true, true) . __PS_BASE_URI__ . substr($_SERVER['SCRIPT_NAME'], strlen(__PS_BASE_URI__), -strlen($current_file_name['0'])) . 'searchcron.php?full=1&token=' . substr(_COOKIE_KEY_, 34, 8);
        list($total, $indexed) = Db::getInstance()->getRow('SELECT COUNT(*) as "0", SUM(product_shop.indexed) as "1" FROM ' . _DB_PREFIX_ . 'product p ' . Shop::addSqlAssociation('product', 'p'));
        $this->fields_options = array('indexation' => array('title' => $this->l('Indexation'), 'icon' => 'search', 'info' => $this->l('The "indexed" products have been analyzed by PrestaShop and will appear in the results of the Front Office search.') . '<br />
						' . $this->l('Indexed products:') . ' <b>' . (int) $indexed . ' / ' . (int) $total . '</b>.
						</p>
						<p>' . $this->l('Building the product index can take a few minutes or more.') . $this->l('If your server stops the process before it ends, you can resume the indexation by clicking "Add missing products."') . '</p>
						-&gt; <a href="searchcron.php?token=' . substr(_COOKIE_KEY_, 34, 8) . '&redirect=1" class="bold">' . $this->l('Add missing products to index.') . '</a><br />
						-&gt; <a href="searchcron.php?full=1&token=' . substr(_COOKIE_KEY_, 34, 8) . '&redirect=1" class="bold">' . $this->l('Re-build entire index.') . '</a><br /><br />
						' . $this->l('You can set a cron job that will rebuild your index using the following URL:') . ' <a href="' . $cron_url . '">' . $cron_url . '</a>', 'fields' => array('PS_SEARCH_INDEXATION' => array('title' => $this->l('Indexation'), 'validation' => 'isBool', 'type' => 'bool', 'cast' => 'intval', 'desc' => $this->l('Enable automatic indexation of the products. If you enable this feature, the products will be indexed in the search automatically when they are saved, but if the feature is disabled, you will have to index the products manually by using the links provided in this fieldset.')))), 'search' => array('title' => $this->l('Search'), 'icon' => 'search', 'fields' => array('PS_SEARCH_AJAX' => array('title' => $this->l('Ajax search'), 'validation' => 'isBool', 'type' => 'bool', 'cast' => 'intval', 'desc' => $this->l('Enable ajax search for your visitors.') . '<br />' . $this->l('With ajax search, the first 10 products matching the user query will appear in real time below the input field.')), 'PS_INSTANT_SEARCH' => array('title' => $this->l('Instant search'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'desc' => $this->l('Enable instant search for your visitors.') . '<br />' . $this->l('With instant search, the results will appear immediately as the user writes a query.')), 'PS_SEARCH_MINWORDLEN' => array('title' => $this->l('Minimum word length (in characters)'), 'desc' => $this->l('Only words this size or larger will be indexed.'), 'size' => 4, 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_BLACKLIST' => array('title' => $this->l('Blacklisted words'), 'size' => 35, 'validation' => 'isGenericName', 'desc' => $this->l('Please enter the words separated by a "|".'), 'type' => 'textLang')), 'submit' => array()), 'relevance' => array('title' => $this->l('Weight'), 'icon' => 'weight', 'info' => $this->l('The "weight" represents its importance and relevance for the ranking of the products when try a new search.') . '<br />
						' . $this->l('A word with a weight of 8 will have 4 times more value than a word with a weight of 2.') . '<br /><br />
						' . $this->l('That\'s why we advise to set a greater weight for words which appear in the name or reference of a product than the ones in the description. Thus, the search results will be as precise and relevant as possible.'), 'fields' => array('PS_SEARCH_WEIGHT_PNAME' => array('title' => $this->l('Product name weight'), 'size' => 4, 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_REF' => array('title' => $this->l('Reference weight'), 'size' => 4, 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_SHORTDESC' => array('title' => $this->l('Short description weight'), 'size' => 4, 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_DESC' => array('title' => $this->l('Description weight'), 'size' => 4, 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_CNAME' => array('title' => $this->l('Category weight'), 'size' => 4, 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_MNAME' => array('title' => $this->l('Manufacturer weight'), 'size' => 4, 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_TAG' => array('title' => $this->l('Tags weight'), 'size' => 4, 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_ATTRIBUTE' => array('title' => $this->l('Attributes weight'), 'size' => 4, 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_FEATURE' => array('title' => $this->l('Features weight'), 'size' => 4, 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'))));
    }
 public function __construct()
 {
     $this->table = 'employee';
     $this->className = 'Employee';
     $this->lang = false;
     $this->addRowAction('edit');
     $this->addRowAction('delete');
     $this->context = Context::getContext();
     $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
     /*
     check if there are more than one superAdmin
     if it's the case then we can delete a superAdmin
     */
     $super_admin = Employee::countProfile(_PS_ADMIN_PROFILE_, true);
     if ($super_admin == 1) {
         $super_admin_array = Employee::getEmployeesByProfile(_PS_ADMIN_PROFILE_, true);
         $super_admin_id = array();
         foreach ($super_admin_array as $key => $val) {
             $super_admin_id[] = $val['id_employee'];
         }
         $this->addRowActionSkipList('delete', $super_admin_id);
     }
     $profiles = Profile::getProfiles($this->context->language->id);
     if (!$profiles) {
         $this->errors[] = Tools::displayError('No profile');
     } else {
         foreach ($profiles as $profile) {
             $this->profiles_array[$profile['name']] = $profile['name'];
         }
     }
     $this->fields_list = array('id_employee' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'lastname' => array('title' => $this->l('Last name'), 'width' => 'auto'), 'firstname' => array('title' => $this->l('First name'), 'width' => 130), 'email' => array('title' => $this->l('E-mail address'), 'width' => 180), 'profile' => array('title' => $this->l('Profile'), 'width' => 90, 'type' => 'select', 'list' => $this->profiles_array, 'filter_key' => 'pl!name'), 'active' => array('title' => $this->l('Can log in'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'width' => 30));
     $this->fields_options = array('general' => array('title' => $this->l('Employee options'), 'fields' => array('PS_PASSWD_TIME_BACK' => array('title' => $this->l('Password regeneration'), 'desc' => $this->l('Security: minimum time to wait between two password changes'), 'cast' => 'intval', 'size' => 5, 'type' => 'text', 'suffix' => ' ' . $this->l('minutes'), 'visibility' => Shop::CONTEXT_ALL), 'PS_BO_ALLOW_EMPLOYEE_FORM_LANG' => array('title' => $this->l('Memorize language used in Admin panel forms'), 'desc' => $this->l('Allow employees to select a specific language for Admin panel forms'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'value', 'list' => array('0' => array('value' => 0, 'name' => $this->l('No')), '1' => array('value' => 1, 'name' => $this->l('Yes'))), 'visibility' => Shop::CONTEXT_ALL)), 'submit' => array()));
     $path = _PS_ADMIN_DIR_ . '/themes/';
     foreach (scandir($path) as $theme) {
         if ($theme[0] != '.' && is_dir($path . $theme) && file_exists($path . $theme . '/css/admin.css')) {
             $this->themes[] = $theme;
         }
     }
     $home_tab = Tab::getInstanceFromClassName('adminHome');
     $this->tabs_list[$home_tab->id] = array('name' => $home_tab->name[$this->context->language->id], 'id_tab' => $home_tab->id, 'children' => array(array('id_tab' => $home_tab->id, 'name' => $home_tab->name[$this->context->language->id])));
     foreach (Tab::getTabs($this->context->language->id, 0) as $tab) {
         if (Tab::checkTabRights($tab['id_tab'])) {
             $this->tabs_list[$tab['id_tab']] = $tab;
             foreach (Tab::getTabs($this->context->language->id, $tab['id_tab']) as $children) {
                 if (Tab::checkTabRights($children['id_tab'])) {
                     $this->tabs_list[$tab['id_tab']]['children'][] = $children;
                 }
             }
         }
     }
     parent::__construct();
     // An employee can edit its own profile
     if ($this->context->employee->id == Tools::getValue('id_employee')) {
         $this->tabAccess['view'] = '1';
         if (!$this->tabAccess['edit']) {
             $this->restrict_edition = true;
         }
         $this->tabAccess['edit'] = '1';
     }
 }
    public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'image_type';
        $this->className = 'ImageType';
        $this->lang = false;
        $this->addRowAction('edit');
        $this->addRowAction('delete');
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
        $this->fields_list = array('id_image_type' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'name' => array('title' => $this->l('Name')), 'width' => array('title' => $this->l('Width'), 'suffix' => ' px'), 'height' => array('title' => $this->l('Height'), 'suffix' => ' px'), 'products' => array('title' => $this->l('Products'), 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'categories' => array('title' => $this->l('Categories'), 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'manufacturers' => array('title' => $this->l('Manufacturers'), 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'suppliers' => array('title' => $this->l('Suppliers'), 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'stores' => array('title' => $this->l('Stores'), 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false));
        // Scenes tab has been removed by default from the installation, but may still exists in updates
        if (Tab::getIdFromClassName('AdminScenes')) {
            $this->fields_list['scenes'] = array('title' => $this->l('Scenes'), 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false);
        }
        // No need to display the old image system migration tool except if product images are in _PS_PROD_IMG_DIR_
        $this->display_move = false;
        $dir = _PS_PROD_IMG_DIR_;
        if (is_dir($dir)) {
            if ($dh = opendir($dir)) {
                while (($file = readdir($dh)) !== false && $this->display_move == false) {
                    if (!is_dir($dir . DIRECTORY_SEPARATOR . $file) && $file[0] != '.' && is_numeric($file[0])) {
                        $this->display_move = true;
                    }
                }
                closedir($dh);
            }
        }
        $this->fields_options = array('images' => array('title' => $this->l('Images generation options'), 'icon' => 'icon-picture', 'top' => '', 'bottom' => '', 'description' => $this->l('JPEG images have a small file size and standard quality. PNG images have a larger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.') . '
					<br /><br />' . $this->l('WARNING: This feature may not be compatible with your theme, or with some of your modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issues, turn it off by selecting "Use JPEG".'), 'fields' => array('PS_IMAGE_QUALITY' => array('title' => $this->l('Image format'), 'show' => true, 'required' => true, 'type' => 'radio', 'choices' => array('jpg' => $this->l('Use JPEG.'), 'png' => $this->l('Use PNG only if the base image is in PNG format.'), 'png_all' => $this->l('Use PNG for all images.'))), 'PS_JPEG_QUALITY' => array('title' => $this->l('JPEG compression'), 'hint' => $this->l('Ranges from 0 (worst quality, smallest file) to 100 (best quality, biggest file).') . ' ' . $this->l('Recommended: 90.'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), 'PS_PNG_QUALITY' => array('title' => $this->l('PNG compression'), 'hint' => $this->l('PNG compression is lossless: unlike JPG, you do not lose image quality with a high compression ratio. However, photographs will compress very badly.') . ' ' . $this->l('Ranges from 0 (biggest file) to 9 (smallest file, slowest decompression).') . ' ' . $this->l('Recommended: 7.'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), 'PS_IMAGE_GENERATION_METHOD' => array('title' => $this->l('Generate images based on one side of the source image'), 'validation' => 'isUnsignedId', 'required' => false, 'cast' => 'intval', 'type' => 'select', 'list' => array(array('id' => '0', 'name' => $this->l('Automatic (longest side)')), array('id' => '1', 'name' => $this->l('Width')), array('id' => '2', 'name' => $this->l('Height'))), 'identifier' => 'id', 'visibility' => Shop::CONTEXT_ALL), 'PS_PRODUCT_PICTURE_MAX_SIZE' => array('title' => $this->l('Maximum file size of product customization pictures'), 'hint' => $this->l('The maximum file size of pictures that customers can upload to customize a product (in bytes).'), 'validation' => 'isUnsignedInt', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'suffix' => $this->l('bytes'), 'visibility' => Shop::CONTEXT_ALL), 'PS_PRODUCT_PICTURE_WIDTH' => array('title' => $this->l('Product picture width'), 'hint' => $this->l('Width of product customization pictures that customers can upload (in pixels).'), 'validation' => 'isUnsignedInt', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'width' => 'px', 'suffix' => $this->l('pixels'), 'visibility' => Shop::CONTEXT_ALL), 'PS_PRODUCT_PICTURE_HEIGHT' => array('title' => $this->l('Product picture height'), 'hint' => $this->l('Height of product customization pictures that customers can upload (in pixels).'), 'validation' => 'isUnsignedInt', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'height' => 'px', 'suffix' => $this->l('pixels'), 'visibility' => Shop::CONTEXT_ALL), 'PS_HIGHT_DPI' => array('type' => 'bool', 'title' => $this->l('Generate high resolution images'), 'required' => false, 'is_bool' => true, 'hint' => $this->l('This will generate an additional file for each image (thus doubling your total amount of images). Resolution of these images will be twice higher.'), 'desc' => $this->l('Enable to optimize the display of your images on high pixel density screens.'), 'visibility' => Shop::CONTEXT_ALL)), 'submit' => array('title' => $this->l('Save'))));
        if ($this->display_move) {
            $this->fields_options['product_images']['fields']['PS_LEGACY_IMAGES'] = array('title' => $this->l('Use the legacy image filesystem'), 'hint' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL);
        }
        $this->fields_form = array('legend' => array('title' => $this->l('Image type'), 'icon' => 'icon-picture'), 'input' => array(array('type' => 'text', 'label' => $this->l('Name for the image type'), 'name' => 'name', 'required' => true, 'hint' => $this->l('Letters, underscores and hyphens only (e.g. "small_custom", "cart_medium", "large", "thickbox_extra-large").')), array('type' => 'text', 'label' => $this->l('Width'), 'name' => 'width', 'required' => true, 'maxlength' => 5, 'suffix' => $this->l('pixels'), 'hint' => $this->l('Maximum image width in pixels.')), array('type' => 'text', 'label' => $this->l('Height'), 'name' => 'height', 'required' => true, 'maxlength' => 5, 'suffix' => $this->l('pixels'), 'hint' => $this->l('Maximum image height in pixels.')), array('type' => 'switch', 'label' => $this->l('Products'), 'name' => 'products', 'required' => false, 'is_bool' => true, 'hint' => $this->l('This type will be used for Product images.'), 'values' => array(array('id' => 'products_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'products_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'switch', 'label' => $this->l('Categories'), 'name' => 'categories', 'required' => false, 'class' => 't', 'is_bool' => true, 'hint' => $this->l('This type will be used for Category images.'), 'values' => array(array('id' => 'categories_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'categories_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'switch', 'label' => $this->l('Manufacturers'), 'name' => 'manufacturers', 'required' => false, 'is_bool' => true, 'hint' => $this->l('This type will be used for Manufacturer images.'), 'values' => array(array('id' => 'manufacturers_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'manufacturers_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'switch', 'label' => $this->l('Suppliers'), 'name' => 'suppliers', 'required' => false, 'is_bool' => true, 'hint' => $this->l('This type will be used for Supplier images.'), 'values' => array(array('id' => 'suppliers_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'suppliers_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'switch', 'label' => $this->l('Scenes'), 'name' => 'scenes', 'required' => false, 'class' => 't', 'is_bool' => true, 'hint' => $this->l('This type will be used for Scene images.'), 'values' => array(array('id' => 'scenes_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'scenes_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'switch', 'label' => $this->l('Stores'), 'name' => 'stores', 'required' => false, 'is_bool' => true, 'hint' => $this->l('This type will be used for Store images.'), 'values' => array(array('id' => 'stores_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'stores_off', 'value' => 0, 'label' => $this->l('Disabled'))))), 'submit' => array('title' => $this->l('Save')));
        parent::__construct();
    }
Пример #17
0
	/**
	 * 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'));
	}
    public function __construct()
    {
        $this->bootstrap = true;
        if (Configuration::get('PS_LOG_EMAILS')) {
            $this->table = 'mail';
            $this->className = 'Mail';
            $this->lang = false;
            $this->noLink = true;
            $this->list_no_link = true;
            $this->explicitSelect = true;
            $this->addRowAction('delete');
            $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
            foreach (Language::getLanguages() as $language) {
                $languages[$language['id_lang']] = $language['name'];
            }
            $this->fields_list = array('id_mail' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'recipient' => array('title' => $this->l('Recipient')), 'template' => array('title' => $this->l('Template')), 'language' => array('title' => $this->l('Language'), 'type' => 'select', 'color' => 'color', 'list' => $languages, 'filter_key' => 'a!id_lang', 'filter_type' => 'int', 'order_key' => 'language'), 'subject' => array('title' => $this->l('Subject')), 'date_add' => array('title' => $this->l('Sent'), 'type' => 'datetime'));
            $this->_select .= 'l.name as language';
            $this->_join .= ' LEFT JOIN ' . _DB_PREFIX_ . 'lang l ON (a.id_lang = l.id_lang)';
            $this->_use_found_rows = false;
        }
        parent::__construct();
        foreach (Contact::getContacts($this->context->language->id) as $contact) {
            $arr[] = array('email_message' => $contact['id_contact'], 'name' => $contact['name']);
        }
        $this->fields_options = array('email' => array('title' => $this->l('Email'), 'icon' => 'icon-envelope', 'fields' => array('PS_MAIL_EMAIL_MESSAGE' => array('title' => $this->l('Send email to'), 'desc' => $this->l('Where customers send messages from the order page.'), 'validation' => 'isUnsignedId', 'type' => 'select', 'cast' => 'intval', 'identifier' => 'email_message', 'list' => $arr), 'PS_MAIL_METHOD' => array('title' => '', 'validation' => 'isGenericName', 'type' => 'radio', 'required' => true, 'choices' => array(3 => $this->l('Never send emails (may be useful for testing purposes)'), 2 => $this->l('Set my own SMTP parameters (for advanced users ONLY)'))), 'PS_MAIL_TYPE' => array('title' => '', 'validation' => 'isGenericName', 'type' => 'radio', 'required' => true, 'choices' => array(Mail::TYPE_HTML => $this->l('Send email in HTML format'), Mail::TYPE_TEXT => $this->l('Send email in text format'), Mail::TYPE_BOTH => $this->l('Both'))), 'PS_LOG_EMAILS' => array('title' => $this->l('Log Emails'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'))), 'smtp' => array('title' => $this->l('Email'), 'fields' => array('PS_MAIL_DOMAIN' => array('title' => $this->l('Mail domain name'), 'hint' => $this->l('Fully qualified domain name (keep this field empty if you don\'t know).'), 'empty' => true, 'validation' => 'isUrl', 'type' => 'text'), 'PS_MAIL_SERVER' => array('title' => $this->l('SMTP server'), 'hint' => $this->l('IP address or server name (e.g. smtp.mydomain.com).'), 'validation' => 'isGenericName', 'type' => 'text'), 'PS_MAIL_USER' => array('title' => $this->l('SMTP username'), 'hint' => $this->l('Leave blank if not applicable.'), 'validation' => 'isGenericName', 'type' => 'text'), 'PS_MAIL_PASSWD' => array('title' => $this->l('SMTP password'), 'hint' => $this->l('Leave blank if not applicable.'), 'validation' => 'isAnything', 'type' => 'password', 'autocomplete' => false), 'PS_MAIL_SMTP_ENCRYPTION' => array('title' => $this->l('Encryption'), 'hint' => $this->l('Use an encrypt protocol'), 'desc' => extension_loaded('openssl') ? '' : '/!\\ ' . $this->l('SSL does not seem to be available on your server.'), 'type' => 'select', 'cast' => 'strval', 'identifier' => 'mode', 'list' => array(array('mode' => 'off', 'name' => $this->l('None')), array('mode' => 'tls', 'name' => $this->l('TLS')), array('mode' => 'ssl', 'name' => $this->l('SSL')))), 'PS_MAIL_SMTP_PORT' => array('title' => $this->l('Port'), 'hint' => $this->l('Port number to use.'), 'validation' => 'isInt', 'type' => 'text', 'cast' => 'intval', 'class' => 'fixed-width-sm')), 'submit' => array('title' => $this->l('Save'))), 'test' => array('title' => $this->l('Test your email configuration'), 'hide_multishop_checkbox' => true, 'fields' => array('PS_SHOP_EMAIL' => array('title' => $this->l('Send a test email to'), 'type' => 'text', 'id' => 'testEmail', 'no_multishop_checkbox' => true)), 'bottom' => '<div class="row"><div class="col-lg-9 col-lg-offset-3">
					<div class="alert" id="mailResultCheck" style="display:none;"></div>
				</div></div>', 'buttons' => array(array('title' => $this->l('Send a test email'), 'icon' => 'process-icon-envelope', 'name' => 'btEmailTest', 'js' => 'verifyMail()', 'class' => 'btn btn-default pull-right'))));
        if (!defined('_PS_HOST_MODE_')) {
            $this->fields_options['email']['fields']['PS_MAIL_METHOD']['choices'][1] = $this->l('Use PHP\'s mail() function (recommended; works in most cases)');
        }
        ksort($this->fields_options['email']['fields']['PS_MAIL_METHOD']['choices']);
    }
    public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'cms';
        $this->list_id = 'cms';
        $this->className = 'CMS';
        $this->lang = true;
        $this->addRowAction('edit');
        $this->addRowAction('delete');
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
        $this->fields_list = array('id_cms' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'link_rewrite' => array('title' => $this->l('URL')), 'meta_title' => array('title' => $this->l('Title'), 'filter_key' => 'b!meta_title'), 'position' => array('title' => $this->l('Position'), 'filter_key' => 'position', 'align' => 'center', 'class' => 'fixed-width-sm', 'position' => 'position'), 'active' => array('title' => $this->l('Displayed'), 'align' => 'center', 'active' => 'status', 'class' => 'fixed-width-sm', 'type' => 'bool', 'orderby' => false));
        // The controller can't be call directly
        // In this case, AdminCmsContentController::getCurrentCMSCategory() is null
        if (!AdminCmsContentController::getCurrentCMSCategory()) {
            $this->redirect_after = '?controller=AdminCmsContent&token=' . Tools::getAdminTokenLite('AdminCmsContent');
            $this->redirect();
        }
        $this->_category = AdminCmsContentController::getCurrentCMSCategory();
        $this->tpl_list_vars['icon'] = 'icon-folder-close';
        $this->tpl_list_vars['title'] = sprintf($this->l('Pages in category "%s"'), $this->_category->name[Context::getContext()->employee->id_lang]);
        $this->_join = '
		LEFT JOIN `' . _DB_PREFIX_ . 'cms_category` c ON (c.`id_cms_category` = a.`id_cms_category`)';
        $this->_select = 'a.position ';
        $this->_where = ' AND c.id_cms_category = ' . (int) $this->_category->id;
        parent::__construct();
    }
Пример #20
0
 /**
  * Constructs the controller
  */
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------------------------------------
     $this->load->model('faq/faq_model');
     $this->lang->load('admin_faq');
 }
 public function __construct()
 {
     $this->table = 'delivery';
     $this->context = Context::getContext();
     $this->fields_options = array('general' => array('title' => $this->l('Delivery slip options'), 'fields' => array('PS_DELIVERY_PREFIX' => array('title' => $this->l('Delivery prefix:'), 'desc' => $this->l('Prefix used for delivery slips'), 'size' => 6, 'type' => 'textLang'), 'PS_DELIVERY_NUMBER' => array('title' => $this->l('Delivery number:'), 'desc' => $this->l('The next delivery slip will begin with this number and then increase with each additional slip.'), 'size' => 6, 'cast' => 'intval', 'type' => 'text')), 'submit' => array()));
     parent::__construct();
 }
Пример #22
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('area_model');
     $this->load->model('express_company_model');
     $this->load->model('express_point_model');
 }
Пример #23
0
    public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'cart';
        $this->className = 'Cart';
        $this->lang = false;
        $this->explicitSelect = true;
        $this->addRowAction('view');
        $this->addRowAction('delete');
        $this->allow_export = true;
        $this->_orderWay = 'DESC';
        $this->_select = 'CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) `customer`, a.id_cart total, ca.name carrier, 
		IF (IFNULL(o.id_order, \'' . $this->l('Non ordered') . '\') = \'' . $this->l('Non ordered') . '\', IF(TIME_TO_SEC(TIMEDIFF(\'' . pSQL(date('Y-m-d H:i:00', time())) . '\', a.`date_add`)) > 86400, \'' . $this->l('Abandoned cart') . '\', \'' . $this->l('Non ordered') . '\'), o.id_order) id_order, IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest';
        $this->_join = 'LEFT JOIN ' . _DB_PREFIX_ . 'customer c ON (c.id_customer = a.id_customer)
		LEFT JOIN ' . _DB_PREFIX_ . 'currency cu ON (cu.id_currency = a.id_currency)
		LEFT JOIN ' . _DB_PREFIX_ . 'carrier ca ON (ca.id_carrier = a.id_carrier)
		LEFT JOIN ' . _DB_PREFIX_ . 'orders o ON (o.id_cart = a.id_cart)
		LEFT JOIN `' . _DB_PREFIX_ . 'connections` co ON (a.id_guest = co.id_guest AND TIME_TO_SEC(TIMEDIFF(\'' . pSQL(date('Y-m-d H:i:00', time())) . '\', co.`date_add`)) < 1800)';
        if (Tools::getValue('action') && Tools::getValue('action') == 'filterOnlyAbandonedCarts') {
            $this->_having = 'id_order = \'' . $this->l('Abandoned cart') . '\'';
        }
        $this->fields_list = array('id_cart' => array('title' => $this->l('ID'), 'align' => 'text-center', 'class' => 'fixed-width-xs'), 'id_order' => array('title' => $this->l('Order ID'), 'align' => 'text-center', 'badge_danger' => true), 'customer' => array('title' => $this->l('Customer'), 'filter_key' => 'c!lastname'), 'total' => array('title' => $this->l('Total'), 'callback' => 'getOrderTotalUsingTaxCalculationMethod', 'orderby' => false, 'search' => false, 'align' => 'text-right', 'badge_success' => true), 'carrier' => array('title' => $this->l('Carrier'), 'align' => 'text-center', 'callback' => 'replaceZeroByShopName', 'filter_key' => 'ca!name'), 'date_add' => array('title' => $this->l('Date'), 'align' => 'text-right', 'type' => 'datetime', 'filter_key' => 'a!date_add'), 'id_guest' => array('title' => $this->l('Online'), 'align' => 'text-center', 'type' => 'bool', 'havingFilter' => true, 'icon' => array(0 => 'icon-', 1 => 'icon-user')));
        $this->shopLinkType = 'shop';
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
        parent::__construct();
    }
 public function __construct()
 {
     $this->bootstrap = true;
     $this->table = 'invoice';
     parent::__construct();
     $this->fields_options = array('general' => array('title' => $this->l('Invoice options'), 'fields' => array('PS_INVOICE' => array('title' => $this->l('Enable invoices'), 'desc' => $this->l('If enabled, your customers will be able to receive an invoice for their purchase(s).'), 'cast' => 'intval', 'type' => 'bool'), 'PS_INVOICE_TAXES_BREAKDOWN' => array('title' => $this->l('Enable the breakdown of taxes on the invoice'), 'desc' => $this->l('Show a breakdown of taxes by tax rate on the invoice when there are several taxes combined.'), 'cast' => 'intval', 'type' => 'bool'), 'PS_INVOICE_PREFIX' => array('title' => $this->l('Invoice prefix'), 'desc' => $this->l('Prefix used for invoice name (e.g. IN00001).'), 'size' => 6, 'type' => 'textLang'), 'PS_INVOICE_START_NUMBER' => array('title' => $this->l('Invoice number'), 'desc' => sprintf($this->l('The next invoice will begin with this number, and then increase with each additional invoice. Set to 0 if you want to keep the current number (which is #%s).'), Order::getLastInvoiceNumber() + 1), 'size' => 6, 'type' => 'text', 'cast' => 'intval'), 'PS_INVOICE_FREE_TEXT' => array('title' => $this->l('Footer text'), 'desc' => $this->l('This text will appear at the bottom of the invoice.'), 'size' => 50, 'type' => 'textLang'), 'PS_INVOICE_MODEL' => array('title' => $this->l('Invoice model'), 'desc' => $this->l('Choose an invoice model.'), 'type' => 'select', 'identifier' => 'value', 'list' => $this->getInvoicesModels()), 'PS_PDF_USE_CACHE' => array('title' => $this->l('Use the disk as cache for PDF invoices'), 'desc' => $this->l('Saves memory but slows down the rendering process.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'))));
 }
 public function __construct()
 {
     $this->bootstrap = true;
     $this->context = Context::getContext();
     $this->table = 'customer_thread';
     $this->className = 'CustomerThread';
     $this->lang = false;
     $contact_array = array();
     $contacts = Contact::getContacts($this->context->language->id);
     foreach ($contacts as $contact) {
         $contact_array[$contact['id_contact']] = $contact['name'];
     }
     $language_array = array();
     $languages = Language::getLanguages();
     foreach ($languages as $language) {
         $language_array[$language['id_lang']] = $language['name'];
     }
     $icon_array = array('open' => array('class' => 'icon-circle text-success', 'alt' => $this->l('Open')), 'closed' => array('class' => 'icon-circle text-danger', 'alt' => $this->l('Closed')), 'pending1' => array('class' => 'icon-circle text-warning', 'alt' => $this->l('Pending 1')), 'pending2' => array('class' => 'icon-circle text-warning', 'alt' => $this->l('Pending 2')));
     $status_array = array();
     foreach ($icon_array as $k => $v) {
         $status_array[$k] = $v['alt'];
     }
     $this->fields_list = array('id_customer_thread' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'customer' => array('title' => $this->l('Customer'), 'filter_key' => 'customer', 'tmpTableFilter' => true), 'email' => array('title' => $this->l('Email'), 'filter_key' => 'a!email'), 'contact' => array('title' => $this->l('Type'), 'type' => 'select', 'list' => $contact_array, 'filter_key' => 'cl!id_contact', 'filter_type' => 'int'), 'language' => array('title' => $this->l('Language'), 'type' => 'select', 'list' => $language_array, 'filter_key' => 'l!id_lang', 'filter_type' => 'int'), 'status' => array('title' => $this->l('Status'), 'type' => 'select', 'list' => $status_array, 'icon' => $icon_array, 'align' => 'center', 'filter_key' => 'a!status', 'filter_type' => 'string'), 'employee' => array('title' => $this->l('Employee'), 'filter_key' => 'employee', 'tmpTableFilter' => true), 'messages' => array('title' => $this->l('Messages'), 'filter_key' => 'messages', 'tmpTableFilter' => true, 'maxlength' => 40), 'date_upd' => array('title' => $this->l('Last message'), 'havingFilter' => true, 'type' => 'datetime'));
     $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
     $this->shopLinkType = 'shop';
     $this->fields_options = array('contact' => array('title' => $this->l('Contact options'), 'fields' => array('PS_CUSTOMER_SERVICE_FILE_UPLOAD' => array('title' => $this->l('Allow file uploading'), 'hint' => $this->l('Allow customers to upload files using the contact page.'), 'type' => 'bool'), 'PS_CUSTOMER_SERVICE_SIGNATURE' => array('title' => $this->l('Default message'), 'hint' => $this->l('Please fill out the message fields that appear by default when you answer a thread on the customer service page.'), 'type' => 'textareaLang', 'lang' => true)), 'submit' => array('title' => $this->l('Save'))), 'general' => array('title' => $this->l('Customer service options'), 'fields' => array('PS_SAV_IMAP_URL' => array('title' => $this->l('IMAP URL'), 'hint' => $this->l('URL for your IMAP server (ie.: mail.server.com).'), 'type' => 'text'), 'PS_SAV_IMAP_PORT' => array('title' => $this->l('IMAP port'), 'hint' => $this->l('Port to use to connect to your IMAP server.'), 'type' => 'text', 'defaultValue' => 143), 'PS_SAV_IMAP_USER' => array('title' => $this->l('IMAP user'), 'hint' => $this->l('User to use to connect to your IMAP server.'), 'type' => 'text'), 'PS_SAV_IMAP_PWD' => array('title' => $this->l('IMAP password'), 'hint' => $this->l('Password to use to connect your IMAP server.'), 'type' => 'text'), 'PS_SAV_IMAP_DELETE_MSG' => array('title' => $this->l('Delete messages'), 'hint' => $this->l('Delete messages after synchronization. If you do not enable this option, the synchronization will take more time.'), 'type' => 'bool'), 'PS_SAV_IMAP_CREATE_THREADS' => array('title' => $this->l('Create new threads'), 'hint' => $this->l('Create new threads for unrecognized emails.'), 'type' => 'bool'), 'PS_SAV_IMAP_OPT_NORSH' => array('title' => $this->l('IMAP options') . ' (/norsh)', 'type' => 'bool', 'hint' => $this->l('Do not use RSH or SSH to establish a preauthenticated IMAP sessions.')), 'PS_SAV_IMAP_OPT_SSL' => array('title' => $this->l('IMAP options') . ' (/ssl)', 'type' => 'bool', 'hint' => $this->l('Use the Secure Socket Layer (TLS/SSL) to encrypt the session.')), 'PS_SAV_IMAP_OPT_VALIDATE-CERT' => array('title' => $this->l('IMAP options') . ' (/validate-cert)', 'type' => 'bool', 'hint' => $this->l('Validate certificates from the TLS/SSL server.')), 'PS_SAV_IMAP_OPT_NOVALIDATE-CERT' => array('title' => $this->l('IMAP options') . ' (/novalidate-cert)', 'type' => 'bool', 'hint' => $this->l('Do not validate certificates from the TLS/SSL server. This is only needed if a server uses self-signed certificates.')), 'PS_SAV_IMAP_OPT_TLS' => array('title' => $this->l('IMAP options') . ' (/tls)', 'type' => 'bool', 'hint' => $this->l('Force use of start-TLS to encrypt the session, and reject connection to servers that do not support it.')), 'PS_SAV_IMAP_OPT_NOTLS' => array('title' => $this->l('IMAP options') . ' (/notls)', 'type' => 'bool', 'hint' => $this->l('Do not use start-TLS to encrypt the session, even with servers that support it.'))), 'submit' => array('title' => $this->l('Save'))));
     parent::__construct();
 }
 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 __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 __construct()
 {
     $this->bootstrap = true;
     $this->table = 'delivery';
     parent::__construct();
     $this->fields_options = array('general' => array('title' => $this->trans('Delivery slip options', array(), 'Admin.OrdersCustomers.Feature'), 'fields' => array('PS_DELIVERY_PREFIX' => array('title' => $this->trans('Delivery prefix', array(), 'Admin.OrdersCustomers.Feature'), 'desc' => $this->trans('Prefix used for delivery slips.', array(), 'Admin.OrdersCustomers.Help'), 'type' => 'textLang'), 'PS_DELIVERY_NUMBER' => array('title' => $this->trans('Delivery number', array(), 'Admin.OrdersCustomers.Feature'), 'desc' => $this->trans('The next delivery slip will begin with this number and then increase with each additional slip.', array(), 'Admin.OrdersCustomers.Help'), 'cast' => 'intval', 'type' => 'text'), 'PS_PDF_IMG_DELIVERY' => array('title' => $this->trans('Enable product image', array(), 'Admin.OrdersCustomers.Feature'), 'hint' => $this->trans('Adds an image before product name on Delivery-slip', array(), 'Admin.OrdersCustomers.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')), 'submit' => array('title' => $this->trans('Save', array(), 'Admin.Actions'))));
 }
Пример #29
0
    public function __construct()
    {
        $this->bootstrap = true;
        $this->required_database = true;
        $this->required_fields = array('company', 'address2', 'postcode', 'other', 'phone', 'phone_mobile', 'vat_number', 'dni');
        $this->table = 'address';
        $this->className = 'Address';
        $this->lang = false;
        $this->addressType = 'customer';
        $this->explicitSelect = true;
        $this->context = Context::getContext();
        $this->addRowAction('edit');
        $this->addRowAction('delete');
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
        $this->allow_export = true;
        if (!Tools::getValue('realedit')) {
            $this->deleted = true;
        }
        $countries = Country::getCountries($this->context->language->id);
        foreach ($countries as $country) {
            $this->countries_array[$country['id_country']] = $country['name'];
        }
        $this->fields_list = array('id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'firstname' => array('title' => $this->l('First Name'), 'filter_key' => 'a!firstname'), 'lastname' => array('title' => $this->l('Last Name'), 'filter_key' => 'a!lastname'), 'address1' => array('title' => $this->l('Address')), 'postcode' => array('title' => $this->l('Zip/Postal Code'), 'align' => 'right'), 'city' => array('title' => $this->l('City')), 'country' => array('title' => $this->l('Country'), 'type' => 'select', 'list' => $this->countries_array, 'filter_key' => 'cl!id_country'));
        parent::__construct();
        $this->_select = 'cl.`name` as country';
        $this->_join = '
			LEFT JOIN `' . _DB_PREFIX_ . 'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = ' . (int) $this->context->language->id . ')
			LEFT JOIN `' . _DB_PREFIX_ . 'customer` c ON a.id_customer = c.id_customer
		';
        $this->_where = 'AND a.id_customer != 0 ' . Shop::addSqlRestriction(Shop::SHARE_CUSTOMER, 'c');
    }
    public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'alias';
        $this->className = 'Alias';
        $this->lang = false;
        parent::__construct();
        // Alias fields
        $this->addRowAction('edit');
        $this->addRowAction('delete');
        if (!Tools::getValue('realedit')) {
            $this->deleted = false;
        }
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
        $this->fields_list = array('alias' => array('title' => $this->l('Aliases')), 'search' => array('title' => $this->l('Search')), 'active' => array('title' => $this->l('Status'), 'class' => 'fixed-width-sm', 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false));
        // Search options
        $current_file_name = array_reverse(explode('/', $_SERVER['SCRIPT_NAME']));
        $cron_url = Tools::getHttpHost(true, true) . __PS_BASE_URI__ . basename(_PS_ADMIN_DIR_) . '/searchcron.php?full=1&token=' . substr(_COOKIE_KEY_, 34, 8);
        list($total, $indexed) = Db::getInstance()->getRow('SELECT COUNT(*) as "0", SUM(product_shop.indexed) as "1" FROM ' . _DB_PREFIX_ . 'product p ' . Shop::addSqlAssociation('product', 'p') . ' WHERE product_shop.`visibility` IN ("both", "search") AND product_shop.`active` = 1');
        $this->fields_options = array('indexation' => array('title' => $this->l('Indexing'), 'icon' => 'icon-cogs', 'info' => '<p>' . $this->l('The "indexed" products have been analyzed by PrestaShop and will appear in the results of a Front Office search.') . '<br />
						' . $this->l('Indexed products') . ' <strong>' . (int) $indexed . ' / ' . (int) $total . '</strong>.
						</p>
						<p>' . $this->l('Building the product index may take a few minutes.') . $this->l('If your server stops before the process ends, you can resume the indexing by clicking "Add missing products."') . '</p>
						<a href="searchcron.php?token=' . substr(_COOKIE_KEY_, 34, 8) . '&amp;redirect=1" class="btn-link"><i class="icon-external-link-sign"></i> ' . $this->l('Add missing products to the index.') . '</a><br />
						<a href="searchcron.php?full=1&amp;token=' . substr(_COOKIE_KEY_, 34, 8) . '&amp;redirect=1" class="btn-link"><i class="icon-external-link-sign"></i> ' . $this->l('Re-build the entire index.') . '</a><br /><br />
						' . $this->l('You can set a cron job that will rebuild your index using the following URL:') . ' <a href="' . Tools::safeOutput($cron_url) . '"><i class="icon-external-link-sign"></i> ' . Tools::safeOutput($cron_url) . '</a>', 'fields' => array('PS_SEARCH_INDEXATION' => array('title' => $this->l('Indexing'), 'validation' => 'isBool', 'type' => 'bool', 'cast' => 'intval', 'desc' => $this->l('Enable the automatic indexing of products. If you enable this feature, the products will be indexed in the search automatically when they are saved. If the feature is disabled, you will have to index products manually by using the links provided in the field set.'))), 'submit' => array('title' => $this->l('Save'))), 'search' => array('title' => $this->l('Search'), 'icon' => 'icon-search', 'fields' => array('PS_SEARCH_AJAX' => array('title' => $this->l('Ajax search'), 'validation' => 'isBool', 'type' => 'bool', 'cast' => 'intval', 'hint' => array($this->l('Enable ajax search for your visitors.'), $this->l('With ajax search, the first 10 products matching the user query will appear in real time below the input field.'))), 'PS_INSTANT_SEARCH' => array('title' => $this->l('Instant search'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'hint' => array($this->l('Enable instant search for your visitors?'), $this->l('With instant search, the results will appear immediately as the user writes a query.'))), 'PS_SEARCH_MINWORDLEN' => array('title' => $this->l('Minimum word length (in characters)'), 'hint' => $this->l('Only words this size or larger will be indexed.'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_BLACKLIST' => array('title' => $this->l('Blacklisted words'), 'validation' => 'isGenericName', 'hint' => $this->l('Please enter the index words separated by a "|".'), 'type' => 'textLang')), 'submit' => array('title' => $this->l('Save'))), 'relevance' => array('title' => $this->l('Weight'), 'icon' => 'icon-cogs', 'info' => $this->l('The "weight" represents its importance and relevance for the ranking of the products when completing a new search.') . '<br />
						' . $this->l('A word with a weight of eight will have four times more value than a word with a weight of two.') . '<br /><br />
						' . $this->l('We advise you to set a greater weight for words which appear in the name or reference of a product. This will allow the search results to be as precise and relevant as possible.') . '<br /><br />
						' . $this->l('Setting a weight to 0 will exclude that field from search index. Re-build of the entire index is required when changing to or from 0'), 'fields' => array('PS_SEARCH_WEIGHT_PNAME' => array('title' => $this->l('Product name weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_REF' => array('title' => $this->l('Reference weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_SHORTDESC' => array('title' => $this->l('Short description weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_DESC' => array('title' => $this->l('Description weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_CNAME' => array('title' => $this->l('Category weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_MNAME' => array('title' => $this->l('Manufacturer weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_TAG' => array('title' => $this->l('Tags weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_ATTRIBUTE' => array('title' => $this->l('Attributes weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_FEATURE' => array('title' => $this->l('Features weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval')), 'submit' => array('title' => $this->l('Save'))));
    }