本文整理汇总了PHP中Shop::getContext方法的典型用法代码示例。如果您正苦于以下问题:PHP Shop::getContext方法的具体用法?PHP Shop::getContext怎么用?PHP Shop::getContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shop
的用法示例。
在下文中一共展示了Shop::getContext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->table = 'smart_blog_comment';
$this->className = 'Blogcomment';
$this->module = 'smartblog';
$this->context = Context::getContext();
$this->bootstrap = true;
if (Shop::isFeatureActive()) {
Shop::addTableAssociation($this->table, array('type' => 'shop'));
}
parent::__construct();
$this->fields_list = array('id_smart_blog_comment' => array('title' => $this->l('Id'), 'width' => 50, 'type' => 'text'), 'email' => array('title' => $this->l('Email'), 'width' => 50, 'type' => 'text', 'lang' => true), 'meta_title' => array('title' => $this->l('Post Title'), 'filter_key' => 'smp!meta_title', 'align' => 'center'), 'name' => array('title' => $this->l('Name'), 'width' => 150, 'type' => 'text'), 'content' => array('title' => $this->l('Comment'), 'width' => 200, 'type' => 'text', 'callback' => 'getCommentClean'), 'created' => array('title' => $this->l('Date'), 'width' => 60, 'type' => 'text', 'lang' => true), 'active' => array('title' => $this->l('Status'), 'width' => '70', 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false));
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'icon' => 'icon-trash', 'confirm' => $this->l('Delete selected items?')));
$this->_join = ' LEFT JOIN ' . _DB_PREFIX_ . 'smart_blog_comment_shop sbs ON a.id_smart_blog_comment=sbs.id_smart_blog_comment && sbs.id_shop IN(' . implode(',', Shop::getContextListShopID()) . ')';
$this->_join .= ' LEFT JOIN ' . _DB_PREFIX_ . 'smart_blog_post_lang smp ON a.id_post=smp.id_smart_blog_post and smp.id_lang = ' . (int) Context::getContext()->language->id;
$this->_select = 'sbs.id_shop';
$this->_defaultOrderBy = 'a.id_smart_blog_comment';
$this->_defaultOrderWay = 'DESC';
$this->_select = 'smp.meta_title';
//$this->_defaultOrderBy = 'a.id_smart_blog_comment';
if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP) {
$this->_group = 'GROUP BY a.id_smart_blog_comment';
}
parent::__construct();
}
示例2: init
public function init()
{
if ($cms_rewrite = Tools::getValue('cms_rewrite')) {
$sql = 'SELECT l.`id_cms`
FROM `' . _DB_PREFIX_ . 'cms_lang` l
LEFT JOIN `' . _DB_PREFIX_ . 'cms_shop` s ON (l.`id_cms` = s.`id_cms`)
WHERE l.`link_rewrite` = \'' . pSQL(str_replace('.html', '', $cms_rewrite)) . '\'';
if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) {
$sql .= ' AND s.`id_shop` = ' . (int) Shop::getContextShopID();
}
$id_cms = (int) Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
if ($id_cms > 0) {
$_GET['id_cms'] = $id_cms;
}
} elseif ($cms_category_rewrite = Tools::getValue('cms_category_rewrite')) {
$sql = 'SELECT `id_cms_category`
FROM `' . _DB_PREFIX_ . 'cms_category_lang`
WHERE `link_rewrite` = \'' . pSQL($cms_category_rewrite) . '\'';
if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) {
$sql .= ' AND s.`id_shop` = ' . (int) Shop::getContextShopID();
}
$id_cms_category = (int) Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
if ($id_cms_category > 0) {
$_GET['id_cms_category'] = $id_cms_category;
}
}
parent::init();
}
示例3: init
public function init()
{
if ($product_rewrite = Tools::getValue('product_rewrite')) {
$url_id_pattern = '/.*?([0-9]+)\\-([a-zA-Z0-9-]*)(\\.html)?/';
$lang_id = (int) Context::getContext()->language->id;
$sql = 'SELECT `id_product`
FROM `' . _DB_PREFIX_ . 'product_lang`
WHERE `link_rewrite` = \'' . pSQL(str_replace('.html', '', $product_rewrite)) . '\' AND `id_lang` = ' . $lang_id;
if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) {
$sql .= ' AND `id_shop` = ' . (int) Shop::getContextShopID();
}
$id_product = (int) Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
if ($id_product > 0) {
$_GET['id_product'] = $id_product;
} elseif (preg_match($url_id_pattern, $this->request_uri, $url_parts)) {
$sql = 'SELECT `id_product`
FROM `' . _DB_PREFIX_ . 'product_lang`
WHERE `id_product` = \'' . pSQL($url_parts[1]) . '\' AND `id_lang` = ' . $lang_id;
if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) {
$sql .= ' AND `id_shop` = ' . (int) Shop::getContextShopID();
}
$id_product = (int) Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
if ($id_product > 0) {
$_GET['id_product'] = $id_product;
}
}
}
parent::init();
}
示例4: getContent
public function getContent()
{
$output = '<p class="info">' . $this->l('On some versions you could have to disable Cache, save, open your shop home page, than go back and enable it:') . '<br><br>' . sprintf('%s -> %s -> %s', $this->l('Advanced Parameters'), $this->l('Performance'), $this->l('Clear Smarty cache')) . '<br>' . sprintf('%s -> %s -> %s -> %s', $this->l('Preferences'), $this->l('SEO and URLs'), $this->l('Set userfriendly URL off'), $this->l('Save')) . '<br>' . sprintf('%s -> %s -> %s -> %s', $this->l('Preferences'), $this->l('SEO and URLs'), $this->l('Set userfriendly URL on'), $this->l('Save')) . '<br>' . '</p>';
$sql = 'SELECT * FROM `' . _DB_PREFIX_ . 'product_lang`
WHERE `link_rewrite`
IN (SELECT `link_rewrite` FROM `' . _DB_PREFIX_ . 'product_lang`
GROUP BY `link_rewrite`, `id_lang`
HAVING count(`link_rewrite`) > 1)';
if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) {
$sql .= ' AND `id_shop` = ' . (int) Shop::getContextShopID();
}
if ($res = Db::getInstance()->ExecuteS($sql)) {
$err = $this->l('You need to fix duplicate URL entries:') . '<br>';
foreach ($res as $row) {
$lang = $this->context->language->getLanguage($row['id_lang']);
$err .= $row['name'] . ' (' . $row['id_product'] . ') - ' . $row['link_rewrite'] . '<br>';
$shop = $this->context->shop->getShop($lang['id_shop']);
$err .= $this->l('Language: ') . $lang['name'] . '<br>' . $this->l('Shop: ') . $shop['name'] . '<br><br>';
}
$output .= $this->displayWarning($err);
} else {
$output .= $this->displayConfirmation($this->l('Nice. You have no duplicate URL entry.'));
}
return '<div class="panel">' . $output . '</div>';
}
示例5: updateNewMessages
public static function updateNewMessages($id_shop = null)
{
$context = Context::getContext();
if ($id_shop == null && Shop::getContext() == Shop::CONTEXT_SHOP) {
$id_shop = Shop::getContextShopID();
}
if ($id_shop > 0) {
if (($mf_employee = Db::getInstance()->getRow('SELECT id_employee, id_last_new_message, id_first_new_message FROM `' . _DB_PREFIX_ . 'mf_employee` WHERE `id_shop`=' . (int) $id_shop . ' AND `id_employee` = ' . (int) $context->employee->id)) != false) {
$id_last_new_message = Db::getInstance()->getValue('SELECT IFNULL(MAX(`' . self::$definition['primary'] . '`), 0)
FROM `' . _DB_PREFIX_ . self::$definition['table'] . '` WHERE `id_shop`=' . (int) $id_shop);
if ($id_last_new_message > $mf_employee['id_last_new_message']) {
$id_first_new_message = $mf_employee['id_last_new_message'];
} else {
$id_first_new_message = $mf_employee['id_first_new_message'];
}
return Db::getInstance()->execute('
UPDATE `' . _DB_PREFIX_ . 'mf_employee`
SET `id_last_new_message` = ' . (int) $id_last_new_message . ',
`id_first_new_message`=' . (int) $id_first_new_message . '
WHERE `id_shop`=' . (int) $id_shop . ' AND `id_employee` = ' . (int) $context->employee->id);
} else {
return Db::getInstance()->execute('
INSERT INTO `' . _DB_PREFIX_ . 'mf_employee`
(`id_last_new_message`, `id_first_new_message`, `id_employee`, `id_shop`) VALUES ((
SELECT IFNULL(MAX(`' . self::$definition['primary'] . '`), 0)
FROM `' . _DB_PREFIX_ . self::$definition['table'] . '`
), 0, ' . (int) $context->employee->id . ', ' . (int) $id_shop . ')');
}
}
}
示例6: init
public function init()
{
if (Tools::getValue('supplier_rewrite')) {
$name_supplier = str_replace('-', '%', Tools::getValue('supplier_rewrite'));
//
// TODO:: need to core update Prestashop code and
// DB for link_rewrite for suppliers
// Should we use the Mysql FullText Index Search ??
//
$sql = 'SELECT sp.`id_supplier`
FROM `' . _DB_PREFIX_ . 'supplier` sp
LEFT JOIN `' . _DB_PREFIX_ . 'supplier_shop` s ON (sp.`id_supplier` = s.`id_supplier`)
WHERE sp.`name` LIKE \'' . $name_supplier . '\'';
if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) {
$sql .= ' AND s.`id_shop` = ' . (int) Shop::getContextShopID();
}
$id_supplier = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
if ($id_supplier > 0) {
$_GET['id_supplier'] = $id_supplier;
} else {
//TODO: Do we need to send 404?
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
}
}
parent::init();
}
示例7: getRenderedShopList
/**
* Render shop list
*
* @return string
*/
public function getRenderedShopList()
{
if (!Shop::isFeatureActive() || Shop::getTotalShops(false, null) < 2) {
return '';
}
$shop_context = Shop::getContext();
$context = Context::getContext();
$tree = Shop::getTree();
if ($shop_context == Shop::CONTEXT_ALL || $context->controller->multishop_context_group == false && $shop_context == Shop::CONTEXT_GROUP) {
$current_shop_value = '';
$current_shop_name = Translate::getAdminTranslation('All shops');
} elseif ($shop_context == Shop::CONTEXT_GROUP) {
$current_shop_value = 'g-' . Shop::getContextShopGroupID();
$current_shop_name = sprintf(Translate::getAdminTranslation('%s group'), $tree[Shop::getContextShopGroupID()]['name']);
} else {
$current_shop_value = 's-' . Shop::getContextShopID();
foreach ($tree as $group_id => $group_data) {
foreach ($group_data['shops'] as $shop_id => $shop_data) {
if ($shop_id == Shop::getContextShopID()) {
$current_shop_name = $shop_data['name'];
break;
}
}
}
}
$tpl = $this->createTemplate('helpers/shops_list/list.tpl');
$tpl->assign(array('tree' => $tree, 'current_shop_name' => $current_shop_name, 'current_shop_value' => $current_shop_value, 'multishop_context' => $context->controller->multishop_context, 'multishop_context_group' => $context->controller->multishop_context_group, 'is_shop_context' => $context->controller->multishop_context & Shop::CONTEXT_SHOP, 'is_group_context' => $context->controller->multishop_context & Shop::CONTEXT_GROUP, 'shop_context' => $shop_context, 'url' => $_SERVER['REQUEST_URI'] . ($_SERVER['QUERY_STRING'] ? '&' : '?') . 'setShopContext='));
return $tpl->fetch();
}
示例8: delete
/**
* @see ObjectModel::delete()
*/
public function delete()
{
if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) {
$result = Db::getInstance()->executeS('SELECT id_product_attribute FROM ' . _DB_PREFIX_ . 'product_attribute_combination WHERE id_attribute = ' . (int) $this->id);
$products = array();
foreach ($result as $row) {
$combination = new Combination($row['id_product_attribute']);
$newRequest = Db::getInstance()->executeS('SELECT id_product, default_on FROM ' . _DB_PREFIX_ . 'product_attribute WHERE id_product_attribute = ' . (int) $row['id_product_attribute']);
foreach ($newRequest as $value) {
if ($value['default_on'] == 1) {
$products[] = $value['id_product'];
}
}
$combination->delete();
}
foreach ($products as $product) {
$result = Db::getInstance()->executeS('SELECT id_product_attribute FROM ' . _DB_PREFIX_ . 'product_attribute WHERE id_product = ' . (int) $product . ' LIMIT 1');
foreach ($result as $row) {
if (Validate::isLoadedObject($product = new Product((int) $product))) {
$product->deleteDefaultAttributes();
$product->setDefaultAttribute($row['id_product_attribute']);
}
}
}
// Delete associated restrictions on cart rules
CartRule::cleanProductRuleIntegrity('attributes', $this->id);
/* Reinitializing position */
$this->cleanPositions((int) $this->id_attribute_group);
}
$return = parent::delete();
if ($return) {
Hook::exec('actionAttributeDelete', array('id_attribute' => $this->id));
}
return $return;
}
示例9: getContent
public function getContent()
{
$output = '';
$output .= '<div style="display:block;" class="hint">
On some versions you have to disable Cache save than open your shop home page than go back and enable it.<br/>
Advanced Parameters > Performance > Clear Smarty cache<br /><br/>
Go to back office -> Preferences -> SEO and URLs -> Set userfriendly URL off -> Save<br />
Go to back office -> Preferences -> SEO and URLs -> Set userfriendly URL on -> Save<br />
</div><br />';
$sql = 'SELECT * FROM `' . _DB_PREFIX_ . 'product_lang`
WHERE `link_rewrite`
IN (SELECT `link_rewrite` FROM `' . _DB_PREFIX_ . 'product_lang`
GROUP BY `link_rewrite`, `id_lang`
HAVING count(`link_rewrite`) > 1)';
if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) {
$sql .= ' AND `id_shop` = ' . (int) Shop::getContextShopID();
}
if ($results = Db::getInstance()->ExecuteS($sql)) {
$output .= 'You need to fix duplicate URL entries<br/>';
foreach ($results as $row) {
$language_info = $this->context->language->getLanguage($row['id_lang']);
$output .= $row['name'] . ' (' . $row['id_product'] . ') - ' . $row['link_rewrite'] . '<br/>';
$shop_info = $this->context->shop->getShop($language_info['id_shop']);
$output .= 'Language:' . $language_info['name'] . '<br /> Shop:' . $shop_info['name'] . '<br/><br/>';
}
} else {
$output .= 'Nice you don\'t have any duplicate URL entries.';
}
return $output;
}
示例10: __construct
public function __construct()
{
$this->required_database = true;
$this->required_fields = array('newsletter', 'optin');
$this->table = 'customer';
$this->className = 'Customer';
$this->lang = false;
$this->deleted = 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?')));
$this->context = Context::getContext();
$this->default_form_language = $this->context->language->id;
$genders = array();
$genders_icon = array('default' => 'unknown.gif');
foreach (Gender::getGenders() as $gender) {
$gender_file = 'genders/' . $gender->id . '.jpg';
if (file_exists(_PS_IMG_DIR_ . $gender_file)) {
$genders_icon[$gender->id] = '../' . $gender_file;
} else {
$genders_icon[$gender->id] = $gender->name;
}
$genders[$gender->id] = $gender->name;
}
$this->fields_list = array('id_customer' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 20), 'id_gender' => array('title' => $this->l('Gender'), 'width' => 70, 'align' => 'center', 'icon' => $genders_icon, 'orderby' => false, 'type' => 'select', 'list' => $genders, 'filter_key' => 'a!id_gender'), 'lastname' => array('title' => $this->l('Last Name'), 'width' => 'auto'), 'firstname' => array('title' => $this->l('First name'), 'width' => 'auto'), 'email' => array('title' => $this->l('E-mail address'), 'width' => 140), 'age' => array('title' => $this->l('Age'), 'width' => 20, 'search' => false, 'align' => 'center'), 'active' => array('title' => $this->l('Enabled'), 'width' => 70, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false), 'newsletter' => array('title' => $this->l('News.'), 'width' => 70, 'align' => 'center', 'type' => 'bool', 'callback' => 'printNewsIcon', 'orderby' => false), 'optin' => array('title' => $this->l('Opt.'), 'width' => 70, 'align' => 'center', 'type' => 'bool', 'callback' => 'printOptinIcon', 'orderby' => false), 'date_add' => array('title' => $this->l('Registration'), 'width' => 150, 'type' => 'date', 'align' => 'right'), 'connect' => array('title' => $this->l('Last visit'), 'width' => 100, 'type' => 'datetime', 'search' => false, 'havingFilter' => true));
$this->shopLinkType = 'shop';
$this->shopShareDatas = Shop::SHARE_CUSTOMER;
parent::__construct();
// Check if we can add a customer
if (Shop::isFeatureActive() && (Shop::getContext() == Shop::CONTEXT_ALL || Shop::getContext() == Shop::CONTEXT_GROUP)) {
$this->can_add_customer = false;
}
}
示例11: initContent
public function initContent()
{
if (!$this->viewAccess()) {
$this->errors[] = Tools::displayError('You do not have permission to view this.');
} elseif (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP) {
$this->displayInformation($this->l('You can only display the page in a shop context.'));
} elseif (!$this->module->isModuleConfigurationCompleted()) {
$this->errors[] = Tools::displayError('Mediafinanz module has not been configured for this shop');
} else {
$this->getLanguages();
$this->initToolbar();
$this->initTabModuleList();
$this->toolbar_title[0] = $this->l('Inkasso');
$this->page_header_toolbar_title = $this->l('Inkasso');
if ($this->display == 'createClaims') {
$this->content .= $this->renderCreateClaimsList();
} elseif ($this->display == 'viewMessages') {
$this->toolbar_title[0] = $this->l('Messages');
$this->page_header_toolbar_title = $this->l('Messages');
$this->content .= $this->renderViewMessagesList();
} elseif ($this->display == 'edit' || $this->display == 'add') {
if (!$this->loadObject(true)) {
return;
}
$this->content .= $this->renderForm();
} elseif ($this->display == 'view') {
// Some controllers use the view action without an object
if ($this->className) {
$this->loadObject(true);
}
$this->content .= $this->renderView();
} elseif ($this->display == 'details') {
$this->content .= $this->renderDetails();
} elseif (!$this->ajax) {
$this->toolbar_title[] = $this->l('Claims') . ' ' . $this->l('Last update:') . ' ' . Configuration::get('MEDIAFINANZ_LASTSTATUSUPDATE');
$this->content .= $this->renderModulesList();
if (_PS_VERSION_ >= '1.6.0.0') {
$this->content .= $this->renderKpis();
}
$this->content .= $this->renderNewMessagesList();
$this->content .= $this->renderList();
$this->content .= $this->renderOptions();
// if we have to display the required fields form
if ($this->required_database) {
$this->content .= $this->displayRequiredFields();
}
}
}
$this->toolbar_title[0] = $this->l('Inkasso');
if (_PS_VERSION_ >= '1.6.0.0') {
$this->initPageHeaderToolbar();
}
$this->context->smarty->assign(array('content' => $this->content, 'lite_display' => $this->lite_display, 'url_post' => self::$currentIndex . '&token=' . $this->token));
if (_PS_VERSION_ >= '1.6.0.0') {
$this->context->smarty->assign(array('show_page_header_toolbar' => $this->show_page_header_toolbar, 'page_header_toolbar_title' => $this->page_header_toolbar_title, 'title' => $this->page_header_toolbar_title, 'toolbar_btn' => $this->page_header_toolbar_btn, 'page_header_toolbar_btn' => $this->page_header_toolbar_btn));
}
}
示例12: getCurrentSiteId
public function getCurrentSiteId()
{
$currentShopId = Shop::getContext('shop');
$jsites = unserialize(base64_decode($this->get('sites')));
if (isset($jsites[$currentShopId]['site_id'])) {
return $jsites[$currentShopId]['site_id'];
}
return false;
}
示例13: init
public function init()
{
// No cache for auto-refresh uploaded logo
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
parent::init();
$this->can_display_themes = !Shop::isFeatureActive() || Shop::getContext() == Shop::CONTEXT_SHOP ? true : false;
$this->fields_options = array('theme' => array('title' => sprintf($this->l('Select theme for shop %s'), $this->context->shop->name), 'description' => !$this->can_display_themes ? $this->l('You must select a shop from the above list if you want to select a theme') : '', 'fields' => array('theme_for_shop' => array('type' => 'theme', 'themes' => Theme::getThemes(), 'id_theme' => $this->context->shop->id_theme, 'can_display_themes' => $this->can_display_themes, 'no_multishop_checkbox' => true))), 'appearance' => array('title' => $this->l('Appearance'), 'icon' => 'email', 'fields' => array('PS_LOGO' => array('title' => $this->l('Header logo'), 'desc' => $this->l('Will appear on main page'), 'type' => 'file', 'thumb' => _PS_IMG_ . Configuration::get('PS_LOGO') . '?date=' . time()), 'PS_LOGO_MAIL' => array('title' => $this->l('Mail logo'), 'desc' => (Configuration::get('PS_LOGO_MAIL') === false ? '<span class="light-warning">' . $this->l('Warning: No e-mail logo defined, the header logo is used instead.') . '</span><br />' : '') . $this->l('Will appear on e-mail headers. If undefined, the Header logo will be used'), 'type' => 'file', 'thumb' => Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_ . Configuration::get('PS_LOGO_MAIL')) ? _PS_IMG_ . Configuration::get('PS_LOGO_MAIL') . '?date=' . time() : _PS_IMG_ . Configuration::get('PS_LOGO') . '?date=' . time()), 'PS_LOGO_INVOICE' => array('title' => $this->l('Invoice logo'), 'desc' => (Configuration::get('PS_LOGO_INVOICE') === false ? '<span class="light-warning">' . $this->l('Warning: No invoice logo defined, the header logo is used instead.') . '</span><br />' : '') . $this->l('Will appear on invoice headers. If undefined, the Header logo will be used'), 'type' => 'file', 'thumb' => Configuration::get('PS_LOGO_INVOICE') !== false && file_exists(_PS_IMG_DIR_ . Configuration::get('PS_LOGO_INVOICE')) ? _PS_IMG_ . Configuration::get('PS_LOGO_INVOICE') . '?date=' . time() : _PS_IMG_ . Configuration::get('PS_LOGO') . '?date=' . time()), 'PS_FAVICON' => array('title' => $this->l('Favicon'), 'hint' => $this->l('Only ICO format allowed'), 'desc' => $this->l('Will appear in the address bar of your web browser'), 'type' => 'file', 'thumb' => _PS_IMG_ . Configuration::get('PS_FAVICON') . '?date=' . time()), 'PS_STORES_ICON' => array('title' => $this->l('Store icon'), 'hint' => $this->l('Only GIF format allowed'), 'desc' => $this->l('Will appear on the store locator (inside Google Maps)') . '<br />' . $this->l('Suggested size: 30x30, Transparent GIF'), 'type' => 'file', 'thumb' => _PS_IMG_ . Configuration::get('PS_STORES_ICON') . '?date=' . time()), 'PS_NAVIGATION_PIPE' => array('title' => $this->l('Navigation pipe'), 'desc' => $this->l('Used for navigation path inside categories/product'), 'cast' => 'strval', 'type' => 'text', 'size' => 20), 'PS_ALLOW_MOBILE_DEVICE' => array('title' => $this->l('Enable mobile theme'), 'desc' => $this->l('Allows visitors browsing on a mobile device or on a touchpad, to have a light version of website'), 'type' => 'radio', 'required' => true, 'validation' => 'isGenericName', 'choices' => array(0 => $this->l('I want to disable it'), 1 => $this->l('I want to enable it only on mobiles devices'), 2 => $this->l('I want to enable it only on touchpads'), 3 => $this->l('I want to enable it on mobile and touchpad devices')))), 'submit' => array('title' => $this->l('Save'), 'class' => 'button')));
$this->fields_list = array('id_theme' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 20), 'name' => array('title' => $this->l('Name'), 'width' => 'auto'), 'directory' => array('title' => $this->l('Directory'), 'width' => 'auto'));
}
示例14: init
public function init()
{
// No cache for auto-refresh uploaded logo
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
parent::init();
$this->can_display_themes = !Shop::isFeatureActive() || Shop::getContext() == Shop::CONTEXT_SHOP ? true : false;
$this->fields_options = array('theme' => array('title' => sprintf($this->l('Select a theme for shop %s'), $this->context->shop->name), 'description' => !$this->can_display_themes ? $this->l('You must select a shop from the above list if you wish to choose a theme.') : '', 'fields' => array('theme_for_shop' => array('type' => 'theme', 'themes' => Theme::getThemes(), 'id_theme' => $this->context->shop->id_theme, 'can_display_themes' => $this->can_display_themes, 'no_multishop_checkbox' => true)), 'submit' => array('title' => $this->l('Save'))), 'appearance' => array('title' => $this->l('Appearance'), 'icon' => 'icon-html5', 'fields' => array('PS_LOGO' => array('title' => $this->l('Header logo'), 'hint' => $this->l('Will appear on main page. Recommended height: 52px. Maximum height on default theme: 65px.'), 'type' => 'file', 'name' => 'PS_LOGO', 'thumb' => _PS_IMG_ . Configuration::get('PS_LOGO') . '?date=' . time()), 'PS_LOGO_MOBILE' => array('title' => $this->l('Header logo for mobile'), 'desc' => (Configuration::get('PS_LOGO_MOBILE') === false ? '<span class="light-warning">' . $this->l('Warning: No mobile logo has been defined. The header logo will be used instead.') . '</span><br />' : '') . $this->l('Will appear on the main page of your mobile template. If left undefined, the header logo will be used.'), 'type' => 'file', 'name' => 'PS_LOGO_MOBILE', 'thumb' => Configuration::get('PS_LOGO_MOBILE') !== false && file_exists(_PS_IMG_DIR_ . Configuration::get('PS_LOGO_MOBILE')) ? _PS_IMG_ . Configuration::get('PS_LOGO_MOBILE') . '?date=' . time() : _PS_IMG_ . Configuration::get('PS_LOGO') . '?date=' . time()), 'PS_LOGO_MAIL' => array('title' => $this->l('Mail logo'), 'desc' => (Configuration::get('PS_LOGO_MAIL') === false ? '<span class="light-warning">' . $this->l('Warning: No email logo has been indentified. The header logo will be used instead.') . '</span><br />' : '') . $this->l('Will appear on email headers. If undefined, the header logo will be used.'), 'type' => 'file', 'name' => 'PS_LOGO_MAIL', 'thumb' => Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_ . Configuration::get('PS_LOGO_MAIL')) ? _PS_IMG_ . Configuration::get('PS_LOGO_MAIL') . '?date=' . time() : _PS_IMG_ . Configuration::get('PS_LOGO') . '?date=' . time()), 'PS_LOGO_INVOICE' => array('title' => $this->l('Invoice logo'), 'desc' => (Configuration::get('PS_LOGO_INVOICE') === false ? '<span class="light-warning">' . $this->l('Warning: No invoice logo has been defined. The header logo will be used instead.') . '</span><br />' : '') . $this->l('Will appear on invoice headers.') . ' ' . $this->l('Warning: you can use a PNG file for transparency, but it can take up to 1 second per page for processing. Please consider using JPG instead.'), 'type' => 'file', 'name' => 'PS_LOGO_INVOICE', 'thumb' => Configuration::get('PS_LOGO_INVOICE') !== false && file_exists(_PS_IMG_DIR_ . Configuration::get('PS_LOGO_INVOICE')) ? _PS_IMG_ . Configuration::get('PS_LOGO_INVOICE') . '?date=' . time() : _PS_IMG_ . Configuration::get('PS_LOGO') . '?date=' . time()), 'PS_FAVICON' => array('title' => $this->l('Favicon'), 'hint' => $this->l('Only ICO format allowed'), 'hint' => $this->l('Will appear in the address bar of your web browser.'), 'type' => 'file', 'name' => 'PS_FAVICON', 'thumb' => _PS_IMG_ . Configuration::get('PS_FAVICON') . '?date=' . time()), 'PS_STORES_ICON' => array('title' => $this->l('Store icon'), 'hint' => $this->l('Only GIF format allowed.'), 'hint' => $this->l('Will appear on the store locator (inside Google Maps).') . '<br />' . $this->l('Suggested size: 30x30, transparent GIF.'), 'type' => 'file', 'name' => 'PS_STORES_ICON', 'thumb' => _PS_IMG_ . Configuration::get('PS_STORES_ICON') . '?date=' . time()), 'PS_NAVIGATION_PIPE' => array('title' => $this->l('Navigation pipe'), 'hint' => $this->l('Used for the navigation path: Store Name > Category Name > Product Name.'), 'cast' => 'strval', 'type' => 'text', 'size' => 20), 'PS_ALLOW_MOBILE_DEVICE' => array('title' => $this->l('Enable the mobile theme.'), 'hint' => $this->l('Allows visitors browsing on mobile devices to view a lighter version of your website.'), 'type' => 'radio', 'required' => true, 'validation' => 'isGenericName', 'choices' => array(0 => $this->l('I\'d like to disable it, please. '), 1 => $this->l('I\'d like to enable it only on smart phones.'), 2 => $this->l('I\'d like to enable it only on tablets.'), 3 => $this->l('I\'d like to enable it on both smart phones and tablets.'))), 'PS_MAIL_COLOR' => array('title' => $this->l('Mail color'), 'hint' => $this->l('Your mail will be highlighted in this color. HTML colors only, please (e.g. "lightblue", "#CC6600").'), 'type' => 'color', 'name' => 'PS_MAIL_COLOR', 'size' => 30, 'value' => Configuration::get('PS_MAIL_COLOR'))), 'submit' => array('title' => $this->l('Save'))));
$this->fields_list = array('id_theme' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'name' => array('title' => $this->l('Name')), 'directory' => array('title' => $this->l('Directory')), 'responsive' => array('title' => $this->l('Responsive'), 'type' => 'bool', 'active' => 'responsive', 'align' => 'center', 'class' => 'fixed-width-xs'), 'default_left_column' => array('title' => $this->l('Default left column'), 'type' => 'bool', 'active' => 'default_left_column', 'align' => 'center', 'class' => 'fixed-width-xs'), 'default_right_column' => array('title' => $this->l('Default right column'), 'type' => 'bool', 'active' => 'default_right_column', 'align' => 'center', 'class' => 'fixed-width-xs'));
}
示例15: renderView
public function renderView()
{
$this->toolbar_title = $this->l('Payment');
unset($this->toolbar_btn['back']);
$shop_context = !Shop::isFeatureActive() || Shop::getContext() == Shop::CONTEXT_SHOP;
if (!$shop_context) {
$this->tpl_view_vars = array('shop_context' => $shop_context);
return parent::renderView();
}
$this->tpl_view_vars = array('modules_list' => $this->renderModulesList('back-office,AdminPayment,index'), 'ps_base_uri' => __PS_BASE_URI__, 'url_submit' => self::$currentIndex . '&token=' . $this->token, 'shop_context' => $shop_context);
return parent::renderView();
}