本文整理汇总了PHP中AdminController::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::__construct方法的具体用法?PHP AdminController::__construct怎么用?PHP AdminController::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminController
的用法示例。
在下文中一共展示了AdminController::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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);
}
示例2: __construct
public function __construct()
{
$this->bootstrap = true;
$this->className = 'Configuration';
$this->table = 'configuration';
parent::__construct();
// Prevent classes which extend AdminPreferences to load useless data
if (get_class($this) == 'AdminPreferencesController') {
$round_mode = array(array('value' => PS_ROUND_HALF_UP, 'name' => $this->trans('Round up away from zero, when it is half way there (recommended)', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_DOWN, 'name' => $this->trans('Round down towards zero, when it is half way there', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_EVEN, 'name' => $this->trans('Round towards the next even value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_ODD, 'name' => $this->trans('Round towards the next odd value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_UP, 'name' => $this->trans('Round up to the nearest value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_DOWN, 'name' => $this->trans('Round down to the nearest value', array(), 'Admin.ShopParameters.Feature')));
$activities1 = array(0 => $this->trans('-- Please choose your main activity --', array(), 'Install'), 2 => $this->trans('Animals and Pets', array(), 'Install'), 3 => $this->trans('Art and Culture', array(), 'Install'), 4 => $this->trans('Babies', array(), 'Install'), 5 => $this->trans('Beauty and Personal Care', array(), 'Install'), 6 => $this->trans('Cars', array(), 'Install'), 7 => $this->trans('Computer Hardware and Software', array(), 'Install'), 8 => $this->trans('Download', array(), 'Install'), 9 => $this->trans('Fashion and accessories', array(), 'Install'), 10 => $this->trans('Flowers, Gifts and Crafts', array(), 'Install'), 11 => $this->trans('Food and beverage', array(), 'Install'), 12 => $this->trans('HiFi, Photo and Video', array(), 'Install'), 13 => $this->trans('Home and Garden', array(), 'Install'), 14 => $this->trans('Home Appliances', array(), 'Install'), 15 => $this->trans('Jewelry', array(), 'Install'), 1 => $this->trans('Lingerie and Adult', array(), 'Install'), 16 => $this->trans('Mobile and Telecom', array(), 'Install'), 17 => $this->trans('Services', array(), 'Install'), 18 => $this->trans('Shoes and accessories', array(), 'Install'), 19 => $this->trans('Sport and Entertainment', array(), 'Install'), 20 => $this->trans('Travel', array(), 'Install'));
$activities2 = array();
foreach ($activities1 as $value => $name) {
$activities2[] = array('value' => $value, 'name' => $name);
}
$fields = array('PS_SSL_ENABLED' => array('title' => $this->trans('Enable SSL', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('If you own an SSL certificate for your shop\'s domain name, you can activate SSL encryption (https://) for customer account identification and order processing.', array(), 'Admin.ShopParameters.Help'), 'hint' => $this->trans('If you want to enable SSL on all the pages of your shop, activate the "Enable on all the pages" option below.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'));
$fields['PS_SSL_ENABLED_EVERYWHERE'] = array('title' => $this->trans('Enable SSL on all pages', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('When enabled, all the pages of your shop will be SSL-secured.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'disabled' => Tools::getValue('PS_SSL_ENABLED', Configuration::get('PS_SSL_ENABLED')) ? false : true);
$fields = array_merge($fields, array('PS_TOKEN_ENABLE' => array('title' => $this->trans('Increase front office security', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable or disable token in the Front Office to improve PrestaShop\'s security.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL), 'PS_ALLOW_HTML_IFRAME' => array('title' => $this->trans('Allow iframes on HTML fields', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Allow iframes on text fields like product description. We recommend that you leave this option disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_USE_HTMLPURIFIER' => array('title' => $this->trans('Use HTMLPurifier Library', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Clean the HTML content on text fields. We recommend that you leave this option enabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->trans('Round mode', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('You can choose among 6 different ways of rounding prices. "Round up away from zero ..." is the recommended behavior.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PS_ROUND_TYPE' => array('title' => $this->trans('Round type', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('You can choose when to round prices: either on each item, each line or the total (of an invoice, for example).', array(), 'Admin.ShopParameters.Help'), 'cast' => 'intval', 'type' => 'select', 'list' => array(array('name' => $this->trans('Round on each item', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_ITEM), array('name' => $this->trans('Round on each line', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_LINE), array('name' => $this->trans('Round on the total', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_TOTAL)), 'identifier' => 'id'), 'PS_PRICE_DISPLAY_PRECISION' => array('title' => $this->trans('Number of decimals', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Choose how many decimals you want to display', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'type' => 'text', 'class' => 'fixed-width-xxl'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->trans('Display brands and suppliers', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable brands and suppliers pages on your front office even when their respective modules are disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_BEST_SELLERS' => array('title' => $this->trans('Display best sellers', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable best sellers page on your front office even when its respective module is disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MULTISHOP_FEATURE_ACTIVE' => array('title' => $this->trans('Enable Multistore', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('The multistore feature allows you to manage several e-shops with one Back Office. If this feature is enabled, a "Multistore" page will be available in the "Advanced Parameters" menu.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL), 'PS_SHOP_ACTIVITY' => array('title' => $this->trans('Main Shop Activity', array(), 'Admin.ShopParameters.Feature'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $activities2, 'identifier' => 'value')));
// No HTTPS activation if you haven't already.
if (!Tools::usingSecureMode() && !Configuration::get('PS_SSL_ENABLED')) {
$fields['PS_SSL_ENABLED']['type'] = 'disabled';
$fields['PS_SSL_ENABLED']['disabled'] = '<a class="btn btn-link" href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->trans('Please click here to check if your shop supports HTTPS.', array(), 'Admin.ShopParameters.Feature') . '</a>';
}
$this->fields_options = array('general' => array('title' => $this->trans('General', array(), 'Admin.Global'), 'icon' => 'icon-cogs', 'fields' => $fields, 'submit' => array('title' => $this->trans('Save', array(), 'Admin.Actions'))));
}
}
示例3: strtolower
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: __construct
/**
* 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;
}
示例5: __construct
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'))));
}
}
示例6: __construct
public function __construct()
{
$this->table = 'product_attribute';
$this->className = 'Product';
$this->multishop_context_group = false;
parent::__construct();
}
示例7: __construct
public function __construct()
{
parent::__construct();
$this->load->model('customer_model');
$this->load->model('customer_number_model');
$this->load->model('file_upload_model');
}
示例8: __construct
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();
}
示例9: __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();
}
示例10: __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();
}
示例11: __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: __construct
public function __construct()
{
$this->bootstrap = true;
$this->multishop_context = Shop::CONTEXT_ALL;
$this->table = 'translations';
parent::__construct();
}
示例13: __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();
}
示例14: __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>
-> <a href="searchcron.php?token=' . substr(_COOKIE_KEY_, 34, 8) . '&redirect=1" class="bold">' . $this->l('Add missing products to index.') . '</a><br />
-> <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'))));
}
示例15: __construct
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';
}
}