本文整理汇总了PHP中Supplier::getSuppliers方法的典型用法代码示例。如果您正苦于以下问题:PHP Supplier::getSuppliers方法的具体用法?PHP Supplier::getSuppliers怎么用?PHP Supplier::getSuppliers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Supplier
的用法示例。
在下文中一共展示了Supplier::getSuppliers方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderForm
public function renderForm()
{
if (!$this->object->id) {
$this->object->price = -1;
}
$this->fields_form = array('legend' => array('title' => $this->l('Catalog price rules'), 'icon' => 'icon-dollar'), 'input' => array(array('type' => 'text', 'label' => $this->l('Name'), 'name' => 'name', 'maxlength' => 32, 'required' => true, 'hint' => $this->l('Forbidden characters') . ' <>;=#{}'), array('type' => 'select', 'label' => $this->l('Shop'), 'name' => 'shop_id', 'options' => array('query' => Shop::getShops(), 'id' => 'id_shop', 'name' => 'name'), 'condition' => Shop::isFeatureActive(), 'default_value' => Shop::getContextShopID()), array('type' => 'select', 'label' => $this->l('Currency'), 'name' => 'id_currency', 'options' => array('query' => array_merge(array(0 => array('id_currency' => 0, 'name' => $this->l('All currencies'))), Currency::getCurrencies()), 'id' => 'id_currency', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Country'), 'name' => 'id_country', 'options' => array('query' => array_merge(array(0 => array('id_country' => 0, 'name' => $this->l('All countries'))), Country::getCountries((int) $this->context->language->id)), 'id' => 'id_country', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Group'), 'name' => 'id_group', 'options' => array('query' => array_merge(array(0 => array('id_group' => 0, 'name' => $this->l('All groups'))), Group::getGroups((int) $this->context->language->id)), 'id' => 'id_group', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('From quantity'), 'name' => 'from_quantity', 'maxlength' => 10, 'required' => true), array('type' => 'text', 'label' => $this->l('Price (tax excl.)'), 'name' => 'price', 'disabled' => $this->object->price == -1 ? 1 : 0, 'maxlength' => 10, 'suffix' => $this->context->currency->getSign('right')), array('type' => 'checkbox', 'name' => 'leave_bprice', 'values' => array('query' => array(array('id' => 'on', 'name' => $this->l('Leave base price'), 'val' => '1', 'checked' => '1')), 'id' => 'id', 'name' => 'name')), array('type' => 'datetime', 'label' => $this->l('From'), 'name' => 'from'), array('type' => 'datetime', 'label' => $this->l('To'), 'name' => 'to'), array('type' => 'select', 'label' => $this->l('Reduction type'), 'name' => 'reduction_type', 'options' => array('query' => array(array('reduction_type' => 'amount', 'name' => $this->l('Amount')), array('reduction_type' => 'percentage', 'name' => $this->l('Percentage'))), 'id' => 'reduction_type', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Reduction with or without taxes'), 'name' => 'reduction_tax', 'align' => 'center', 'options' => array('query' => array(array('lab' => $this->l('Tax included'), 'val' => 1), array('lab' => $this->l('Tax excluded'), 'val' => 0)), 'id' => 'val', 'name' => 'lab')), array('type' => 'text', 'label' => $this->l('Reduction'), 'name' => 'reduction', 'required' => true)), 'submit' => array('title' => $this->l('Save')));
if (($value = $this->getFieldValue($this->object, 'price')) != -1) {
$price = number_format($value, 6);
} else {
$price = '';
}
$this->fields_value = array('price' => $price, 'from_quantity' => ($value = $this->getFieldValue($this->object, 'from_quantity')) ? $value : 1, 'reduction' => number_format(($value = $this->getFieldValue($this->object, 'reduction')) ? $value : 0, 6), 'leave_bprice_on' => $price ? 0 : 1);
$attribute_groups = array();
$attributes = Attribute::getAttributes((int) $this->context->language->id);
foreach ($attributes as $attribute) {
if (!isset($attribute_groups[$attribute['id_attribute_group']])) {
$attribute_groups[$attribute['id_attribute_group']] = array('id_attribute_group' => $attribute['id_attribute_group'], 'name' => $attribute['attribute_group']);
}
$attribute_groups[$attribute['id_attribute_group']]['attributes'][] = array('id_attribute' => $attribute['id_attribute'], 'name' => $attribute['name']);
}
$features = Feature::getFeatures((int) $this->context->language->id);
foreach ($features as &$feature) {
$feature['values'] = FeatureValue::getFeatureValuesWithLang((int) $this->context->language->id, $feature['id_feature'], true);
}
$this->tpl_form_vars = array('manufacturers' => Manufacturer::getManufacturers(), 'suppliers' => Supplier::getSuppliers(), 'attributes_group' => $attribute_groups, 'features' => $features, 'categories' => Category::getSimpleCategories((int) $this->context->language->id), 'conditions' => $this->object->getConditions(), 'is_multishop' => Shop::isFeatureActive());
return parent::renderForm();
}
示例2: hookDisplayLeftColumn
function hookDisplayLeftColumn($params)
{
$id_lang = (int) Context::getContext()->language->id;
if (!$this->isCached('blocksupplier.tpl', $this->getCacheId())) {
$this->smarty->assign(array('suppliers' => Supplier::getSuppliers(false, $id_lang), 'link' => $this->context->link, 'text_list' => Configuration::get('SUPPLIER_DISPLAY_TEXT'), 'text_list_nb' => Configuration::get('SUPPLIER_DISPLAY_TEXT_NB'), 'form_list' => Configuration::get('SUPPLIER_DISPLAY_FORM'), 'display_link_supplier' => Configuration::get('PS_DISPLAY_SUPPLIERS')));
}
return $this->display(__FILE__, 'blocksupplier.tpl', $this->getCacheId());
}
示例3: initContent
public function initContent()
{
parent::initContent();
if (isset($this->context->cookie->id_compare)) {
$this->context->smarty->assign('compareProducts', CompareProduct::getCompareProducts((int) $this->context->cookie->id_compare));
}
$this->productSort();
// Product sort must be called before assignProductList()
$this->assignScenes();
$this->assignSubcategories();
if ($this->category->id != 1) {
$this->assignProductList();
}
$this->context->smarty->assign(array('category' => $this->category, 'products' => isset($this->cat_products) && $this->cat_products ? $this->cat_products : null, 'id_category' => (int) $this->category->id, 'id_category_parent' => (int) $this->category->id_parent, 'return_category_name' => Tools::safeOutput($this->category->name), 'path' => Tools::getPath($this->category->id), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize('category'), 'mediumSize' => Image::getSize('medium'), 'thumbSceneSize' => Image::getSize('thumb_scene'), 'homeSize' => Image::getSize('home'), 'allow_oosp' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers()));
$this->setTemplate(_PS_THEME_DIR_ . 'category.tpl');
}
示例4: process
public function process()
{
if (Validate::isLoadedObject($this->supplier) and $this->supplier->active) {
$nbProducts = $this->supplier->getProducts($this->supplier->id, NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
$this->pagination((int) $nbProducts);
self::$smarty->assign(array('nb_products' => $nbProducts, 'products' => $this->supplier->getProducts($this->supplier->id, (int) self::$cookie->id_lang, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay), 'path' => $this->supplier->active ? Tools::safeOutput($this->supplier->name) : '', 'homeSize' => Image::getSize('home'), 'supplier' => $this->supplier));
} elseif (!Tools::getValue('id_supplier')) {
if (Configuration::get('PS_DISPLAY_SUPPLIERS')) {
$result = Supplier::getSuppliers(true, (int) self::$cookie->id_lang, true);
$nbProducts = count($result);
$this->pagination($nbProducts);
$suppliers = Supplier::getSuppliers(true, (int) self::$cookie->id_lang, true, $this->p, $this->n);
foreach ($suppliers as &$row) {
$row['image'] = !file_exists(_PS_SUPP_IMG_DIR_ . '/' . $row['id_supplier'] . '-medium.jpg') ? Language::getIsoById((int) self::$cookie->id_lang) . '-default' : $row['id_supplier'];
}
self::$smarty->assign(array('pages_nb' => ceil($nbProducts / (int) $this->n), 'nbSuppliers' => $nbProducts, 'mediumSize' => Image::getSize('medium'), 'suppliers' => $suppliers, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY')));
} else {
self::$smarty->assign('nbSuppliers', 0);
}
}
}
示例5: renderForm
/**
* AdminController::renderForm() override
* @see AdminController::renderForm()
*/
public function renderForm()
{
if (Tools::isSubmit('addsupply_order') || Tools::isSubmit('updatesupply_order') || Tools::isSubmit('submitAddsupply_order') || Tools::isSubmit('submitUpdatesupply_order')) {
if (Tools::isSubmit('addsupply_order') || Tools::isSubmit('submitAddsupply_order')) {
$this->toolbar_title = $this->l('Stock: Create a new supply order');
}
$update = false;
if (Tools::isSubmit('updatesupply_order') || Tools::isSubmit('submitUpdatesupply_order')) {
$this->toolbar_title = $this->l('Stock: Manage supply orders');
$update = true;
}
if (Tools::isSubmit('mod') && Tools::getValue('mod') === 'template' || $this->object->is_template) {
$this->toolbar_title .= ' (' . $this->l('template') . ')';
}
$this->addJqueryUI('ui.datepicker');
//get warehouses list
$warehouses = Warehouse::getWarehouses(true);
// displays warning if there are no warehouses
if (!$warehouses) {
$this->displayWarning($this->l('You must have at least one warehouse. See Stock/Warehouses'));
}
//get currencies list
$currencies = Currency::getCurrencies(false, true, true);
//get suppliers list
$suppliers = array_unique(Supplier::getSuppliers(), SORT_REGULAR);
//get languages list
$languages = Language::getLanguages(true);
$this->fields_form = array('legend' => array('title' => $this->l('Order information'), 'icon' => 'icon-pencil'), 'input' => array(array('type' => 'text', 'label' => $this->l('Reference'), 'name' => 'reference', 'required' => true, 'hint' => $this->l('The reference number for your order.')), array('type' => 'select', 'label' => $this->l('Supplier'), 'name' => 'id_supplier', 'required' => true, 'options' => array('query' => $suppliers, 'id' => 'id_supplier', 'name' => 'name'), 'hint' => array($this->l('Select the supplier you\'ll be purchasing from.'), $this->l('Warning: All products already added to the order will be removed.'))), array('type' => 'select', 'label' => $this->l('Warehouse'), 'name' => 'id_warehouse', 'required' => true, 'options' => array('query' => $warehouses, 'id' => 'id_warehouse', 'name' => 'name'), 'hint' => $this->l('Which warehouse will the order be sent to?')), array('type' => 'select', 'label' => $this->l('Currency'), 'name' => 'id_currency', 'required' => true, 'options' => array('query' => $currencies, 'id' => 'id_currency', 'name' => 'name'), 'hint' => array($this->l('The currency of the order.'), $this->l('Warning: All products already added to the order will be removed.'))), array('type' => 'select', 'label' => $this->l('Order Language'), 'name' => 'id_lang', 'required' => true, 'options' => array('query' => $languages, 'id' => 'id_lang', 'name' => 'name'), 'hint' => $this->l('The language of the order.')), array('type' => 'text', 'label' => $this->l('Global discount percentage'), 'name' => 'discount_rate', 'required' => false, 'hint' => $this->l('This is the global discount percentage for the order.')), array('type' => 'text', 'label' => $this->l('Automatically load products'), 'name' => 'load_products', 'required' => false, 'hint' => array($this->l('This will reset the order.'), $this->l('If a value specified, each of your current product (from the selected supplier and warehouse) with a quantity lower than or equal to this value will be loaded. This means that PrestaShop will pre-fill this order with the products that are low on quantity.')))), 'submit' => !$update ? array('title' => $this->l('Save order')) : array(), 'buttons' => !$update ? array('save-and-stay' => array('title' => $this->l('Save order and stay'), 'name' => 'submitAddsupply_orderAndStay', 'type' => 'submit', 'class' => 'btn btn-default pull-right', 'icon' => 'process-icon-save')) : array());
if (Tools::isSubmit('mod') && Tools::getValue('mod') === 'template' || $this->object->is_template) {
$this->fields_form['input'][] = array('type' => 'hidden', 'name' => 'is_template');
$this->fields_form['input'][] = array('type' => 'hidden', 'name' => 'date_delivery_expected');
} else {
$this->fields_form['input'][] = array('type' => 'date', 'label' => $this->l('Expected delivery date'), 'name' => 'date_delivery_expected', 'required' => true, 'desc' => $this->l('The expected delivery date for this order is...'));
}
//specific discount display
if (isset($this->object->discount_rate)) {
$this->object->discount_rate = Tools::ps_round($this->object->discount_rate, 4);
}
//specific date display
if (isset($this->object->date_delivery_expected)) {
$date = explode(' ', $this->object->date_delivery_expected);
if ($date) {
$this->object->date_delivery_expected = $date[0];
}
}
$this->displayInformation($this->l('If you wish to order products, they have to be available for the specified supplier/warehouse.') . ' ' . $this->l('See Catalog/Products/[Your Product]/Suppliers & Warehouses.') . '<br />' . $this->l('Changing the currency or the supplier will reset the order.') . '<br />' . '<br />' . $this->l('Please note that you can only order from one supplier at a time.'));
return parent::renderForm();
}
}
示例6: nl2br2
}
$category->name = Category::hideCategoryPosition($category->name);
$category->description = nl2br2($category->description);
$subCategories = $category->getSubCategories(intval($cookie->id_lang));
$smarty->assign('category', $category);
if (Db::getInstance()->numRows()) {
$smarty->assign('subcategories', $subCategories);
}
if ($category->id != 1) {
$nbProducts = $category->getProducts(NULL, NULL, NULL, $orderBy, $orderWay, true);
include dirname(__FILE__) . '/pagination.php';
$smarty->assign('nb_products', $nbProducts);
$cat_products = $category->getProducts(intval($cookie->id_lang), intval($p), intval($n), $orderBy, $orderWay);
}
$smarty->assign(array('products' => (isset($cat_products) and $cat_products) ? $cat_products : NULL, 'id_category' => intval($category->id), 'id_category_parent' => intval($category->id_parent), 'return_category_name' => Tools::safeOutput(Category::hideCategoryPosition($category->name)), 'path' => Tools::getPath(intval($category->id), $category->name)));
}
}
$smarty->assign(array('allow_oosp' => intval(Configuration::get('PS_ORDER_OUT_OF_STOCK')), 'suppliers' => Supplier::getSuppliers(), 'errors' => $errors));
$smarty->assign(array('homeSize' => Image::getSize('home')));
if (isset($subCategories)) {
$smarty->assign(array('subcategories_nb_total' => sizeof($subCategories), 'subcategories_nb_half' => ceil(sizeof($subCategories) / 2)));
}
$smarty->display(_PS_THEME_DIR_ . 'category.tpl');
include dirname(__FILE__) . '/footer.php';
} catch (Exception $e) {
echo $e->getMessage();
echo "<br><bR>";
foreach ($e->getTrace() as $line) {
echo "{$line['class']}.{$line['function']} @ {$line['file']}:{$line['line']}<br>";
}
}
示例7: hookLeftColumn
function hookLeftColumn($params)
{
global $smarty, $link;
$smarty->assign(array('suppliers' => Supplier::getSuppliers(false), 'link' => $link, 'text_list' => Configuration::get('SUPPLIER_DISPLAY_TEXT'), 'text_list_nb' => Configuration::get('SUPPLIER_DISPLAY_TEXT_NB'), 'form_list' => Configuration::get('SUPPLIER_DISPLAY_FORM'), 'display_link_supplier' => Configuration::get('PS_DISPLAY_SUPPLIERS')));
return $this->display(__FILE__, 'blocksupplier.tpl');
}
示例8: initContent
/**
* Initializes page content variables
*/
public function initContent()
{
parent::initContent();
$this->setTemplate(_PS_THEME_DIR_ . 'category.tpl');
if (!$this->customer_access) {
return;
}
if (isset($this->context->cookie->id_compare)) {
$this->context->smarty->assign('compareProducts', CompareProduct::getCompareProducts((int) $this->context->cookie->id_compare));
}
// Product sort must be called before assignProductList()
$this->productSort();
$this->assignScenes();
$this->assignSubcategories();
$this->assignProductList();
$products = $this->category->getProducts($this->context->language->id, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay);
$products_options = ProductOption::getProductOptions($this->context->language->id);
$combinations = $this->getProductAttributeCombinations($products);
// $this->context->smarty->assign('combinations', $combinations);
$this->context->smarty->assign(array('category' => $this->category, 'combinations' => $combinations, 'description_short' => Tools::truncateString($this->category->description, 350), 'products' => isset($this->cat_products) && $this->cat_products ? $this->cat_products : null, 'products_options' => isset($products_options) && $products_options ? $products_options : null, 'id_category' => (int) $this->category->id, 'id_category_parent' => (int) $this->category->id_parent, 'return_category_name' => Tools::safeOutput($this->category->name), 'path' => Tools::getPath($this->category->id), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize(ImageType::getFormatedName('category')), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'thumbSceneSize' => Image::getSize(ImageType::getFormatedName('m_scene')), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'allow_oosp' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers(), 'body_classes' => array($this->php_self . '-' . $this->category->id, $this->php_self . '-' . $this->category->link_rewrite)));
}
示例9: showFormSetting
/**
* show megamenu item configuration.
*/
protected function showFormSetting()
{
$this->context->controller->addJS(__PS_BASE_URI__ . 'modules/leobootstrapmenu/assets/admin/jquery.nestable.js');
$this->context->controller->addJS(__PS_BASE_URI__ . 'modules/leobootstrapmenu/assets/admin/form.js');
$this->context->controller->addJS(__PS_BASE_URI__ . 'js/jquery/plugins/jquery.cookie-plugin.js');
$this->context->controller->addJS(__PS_BASE_URI__ . 'js/jquery/ui/jquery.ui.tabs.min.js');
$this->context->controller->addCss(__PS_BASE_URI__ . 'js/jquery/ui/themes/base/jquery.ui.tabs.css');
$this->context->controller->addCss(__PS_BASE_URI__ . 'modules/leobootstrapmenu/assets/admin/form.css');
// $action_widget = $this->base_config_url.'&widgets=1';
$this->widget->loadEngines();
// $widget = $this->widget;
$id_lang = $this->context->language->id;
$id_btmegamenu = (int) Tools::getValue('id_btmegamenu');
$obj = new Btmegamenu($id_btmegamenu);
$tree = $obj->getTree();
$categories = LeoBtmegamenuHelper::getCategories();
$manufacturers = Manufacturer::getManufacturers(false, $id_lang, true);
$suppliers = Supplier::getSuppliers(false, $id_lang, true);
$cmss = CMS::listCms($this->context->language->id, false, true);
$menus = $obj->getDropdown(null, $obj->id_parent);
$default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
$soption = array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')));
$this->fields_form[0]['form'] = array('legend' => array('title' => $this->l('Create New MegaMenu Item.')), 'input' => array(array('type' => 'hidden', 'label' => $this->l('Megamenu ID'), 'name' => 'id_btmegamenu', 'default' => 0), array('type' => 'text', 'label' => $this->l('Title:'), 'name' => 'title', 'value' => true, 'lang' => true, 'default' => ''), array('type' => 'text', 'label' => $this->l('Sub Title:'), 'lang' => true, 'name' => 'text', 'cols' => 40, 'rows' => 10, 'default' => ''), array('type' => 'select', 'label' => $this->l('Parent ID'), 'name' => 'id_parent', 'options' => array('query' => $menus, 'id' => 'id', 'name' => 'title'), 'default' => 'url'), array('type' => 'switch', 'label' => $this->l('Is Active'), 'name' => 'active', 'values' => $soption, 'default' => '1'), array('type' => 'switch', 'label' => $this->l('Show Title'), 'name' => 'show_title', 'values' => $soption, 'default' => '1'), array('type' => 'select', 'label' => $this->l('Menu Type'), 'name' => 'type', 'id' => 'menu_type', 'desc' => $this->l('Select a menu link type and fill data for following input'), 'options' => array('query' => array(array('id' => 'url', 'name' => $this->l('Url')), array('id' => 'category', 'name' => $this->l('Category')), array('id' => 'product', 'name' => $this->l('Product')), array('id' => 'manufacture', 'name' => $this->l('Manufacture')), array('id' => 'supplier', 'name' => $this->l('Supplier')), array('id' => 'cms', 'name' => $this->l('Cms')), array('id' => 'html', 'name' => $this->l('Html'))), 'id' => 'id', 'name' => 'name'), 'default' => 'url'), array('type' => 'text', 'label' => $this->l('Product ID'), 'name' => 'product_type', 'id' => 'product_type', 'class' => 'menu-type-group', 'default' => ''), array('type' => 'select', 'label' => $this->l('CMS Type'), 'name' => 'cms_type', 'id' => 'cms_type', 'options' => array('query' => $cmss, 'id' => 'id_cms', 'name' => 'meta_title'), 'default' => '', 'class' => 'menu-type-group'), array('type' => 'text', 'label' => $this->l('URL'), 'name' => 'url', 'id' => 'url_type', 'required' => true, 'lang' => true, 'class' => 'url-type-group-lang', 'default' => ''), array('type' => 'select', 'label' => $this->l('Category Type'), 'name' => 'category_type', 'id' => 'category_type', 'options' => array('query' => $categories, 'id' => 'id_category', 'name' => 'name'), 'default' => '', 'class' => 'menu-type-group'), array('type' => 'select', 'label' => $this->l('Manufacture Type'), 'name' => 'manufacture_type', 'id' => 'manufacture_type', 'options' => array('query' => $manufacturers, 'id' => 'id_manufacturer', 'name' => 'name'), 'default' => '', 'class' => 'menu-type-group'), array('type' => 'select', 'label' => $this->l('Supplier Type'), 'name' => 'supplier_type', 'id' => 'supplier_type', 'options' => array('query' => $suppliers, 'id' => 'id_supplier', 'name' => 'name'), 'default' => '', 'class' => 'menu-type-group'), array('type' => 'textarea', 'label' => $this->l('HTML Type'), 'name' => 'content_text', 'desc' => $this->l('This menu is only for display content,PLease do not select it for menu level 1'), 'lang' => true, 'default' => '', 'autoload_rte' => true, 'class' => 'menu-type-group-lang'), array('type' => 'select', 'label' => $this->l('Target Open'), 'name' => 'target', 'options' => array('query' => array(array('id' => '_self', 'name' => $this->l('Self')), array('id' => '_blank', 'name' => $this->l('Blank')), array('id' => '_parent', 'name' => $this->l('Parent')), array('id' => '_top', 'name' => $this->l('Top'))), 'id' => 'id', 'name' => 'name'), 'default' => '_self'), array('type' => 'text', 'label' => $this->l('Menu Class'), 'name' => 'menu_class', 'display_image' => true, 'default' => ''), array('type' => 'text', 'label' => $this->l('Menu Icon Class'), 'name' => 'icon_class', 'display_image' => true, 'default' => '', 'desc' => $this->l('The module integrated with FontAwesome') . '. ' . $this->l('Check list of icons and class name in here') . ' <a href="http://fontawesome.io/" target="_blank">http://fontawesome.io/</a> or your icon class'), array('type' => 'file', 'label' => $this->l('Or Menu Icon Image'), 'name' => 'image', 'display_image' => true, 'default' => '', 'desc' => $this->l('Use image icon if no use con Class'), 'thumb' => '', 'title' => $this->l('Icon Preview')), array('type' => 'switch', 'label' => $this->l('Group Submenu'), 'name' => 'is_group', 'values' => $soption, 'default' => '0', 'desc' => $this->l('Group all sub menu to display in same level')), array('type' => 'text', 'label' => $this->l('Column'), 'name' => 'colums', 'values' => $soption, 'default' => '1', 'desc' => $this->l('Set each sub menu item as column'))), 'submit' => array('title' => $this->l('Save'), 'class' => 'button btn btn-danger'));
$helper = new HelperForm();
$helper->module = $this;
$helper->name_controller = $this->name;
$helper->identifier = $this->identifier;
$helper->token = Tools::getAdminTokenLite('AdminModules');
foreach (Language::getLanguages(false) as $lang) {
$helper->languages[] = array('id_lang' => $lang['id_lang'], 'iso_code' => $lang['iso_code'], 'name' => $lang['name'], 'is_default' => $default_lang == $lang['id_lang'] ? 1 : 0);
}
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
$helper->default_form_language = $default_lang;
$helper->allow_employee_form_lang = $default_lang;
$helper->toolbar_scroll = true;
$helper->title = $this->displayName;
$helper->submit_action = 'save' . $this->name;
$helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues($obj), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id);
$live_editor_url = AdminController::$currentIndex . '&configure=' . $this->name . '&liveeditor=1&token=' . Tools::getAdminTokenLite('AdminModules');
$action = AdminController::$currentIndex . '&configure=' . $this->name . '&save' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules');
$helper->toolbar_btn = array('back' => array('href' => AdminController::$currentIndex . '&configure=' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Back to list')));
$html = $this->_html . '<div class="col-lg-12"> <div class="alert alert-info clearfix"><div class="pull-right">Using <a href="' . $live_editor_url . '" class="btn btn-danger"> ' . $this->l('Live Edit Tools') . '</a> ' . $this->l('To Make Rich Content For Megamenu') . '</div></div></div>';
$output = $html . '
<ul class="nav nav-tabs clearfix">
<li class="active"><a href="#megamenu" data-toggle="tab">' . $this->l('Megamenu') . '</a></li>
</ul>
<div class="tab-content clearfix">
<div class="tab-pane active" id="megamenu">
';
$show_cavas = Configuration::get('LEO_MEGAMENU_CAVAS');
$addnew = AdminController::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminModules') . '&configure=' . $this->name . '&tab_module=front_office_features&module_name=' . $this->name;
$output .= '<div class="col-md-4"><div class="panel panel-default"><h3 class="panel-title">' . $this->l('Tree Megamenu Management') . '</h3>
<div class="panel-content">' . $this->l('To sort orders or update parent-child, you drap and drop expected menu, then click to Update button to Save') . '<hr><p><input type="button" value="' . $this->l('New Menu Item') . '" id="addcategory" data-loading-text="' . $this->l('Processing ...') . '" class="btn btn-danger" name="addcategory">
<a href="' . Context::getContext()->link->getAdminLink('AdminLeotempcpWidgets') . '" class="leo-modal-action btn btn-modeal btn-success btn-info">' . $this->l('List Widget') . '</a></p>
<hr><p><input type="button" value="' . $this->l('Update') . '" id="show_cavas" data-loading-text="' . $this->l('Processing ...') . '" class="btn btn-info" ></p>
<label>' . $this->l('Show Cavas') . '</label>
<select name="show_cavas" class="show_cavas">
<option value="1" ' . (isset($show_cavas) && $show_cavas == 1 ? 'checked' : null) . '>' . $this->l('Yes') . '</option>
<option value="0" ' . (isset($show_cavas) && $show_cavas == 0 ? 'checked' : null) . '>' . $this->l('No') . '</option>
</select>
<hr><p><input type="button" value="' . $this->l('Update Positions') . '" id="serialize" data-loading-text="' . $this->l('Processing ...') . '" class="btn btn-danger" name="serialize"></p><hr>' . $tree . '</div></div></div>
<div class="col-md-8">' . $helper->generateForm($this->fields_form) . '</div>
<script type="text/javascript">var addnew ="' . $addnew . '"; var action="' . $action . '";$("#content").PavMegaMenuList({action:action,addnew:addnew});</script>';
$output .= '</div>';
$output .= '</div><script>$(\'#myTab a[href="#profile"]\').tab(\'show\')</script>';
return $output;
}
示例10: makeMenu
protected function makeMenu()
{
$menu_items = $this->getMenuItems();
$id_lang = (int)$this->context->language->id;
$id_shop = (int)Shop::getContextShopID();
$iteration = 1;
foreach ($menu_items as $item) {
if (!$item) {
continue;
}
preg_match($this->pattern, $item, $value);
$id = (int)substr($item, strlen($value[1]), strlen($item));
switch (substr($item, 0, strlen($value[1]))) {
case 'CAT':
$this->_menu .= $this->generateCategoriesMenu(Category::getNestedCategories($id, $id_lang, false, $this->user_groups), 0, $iteration);
$iteration++;
break;
case 'PRD':
$selected = ($this->page_name == 'product' && (Tools::getValue('id_product') == $id)) ? ' class="sfHover"' : '';
$product = new Product((int)$id, true, (int)$id_lang);
if (!is_null($product->id)) {
$this->_menu .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($product->getLink()).'" title="'.$product->name.'">'.$product->name.'</a></li>'.PHP_EOL;
}
break;
case 'CMS':
$selected = ($this->page_name == 'cms' && (Tools::getValue('id_cms') == $id)) ? ' class="sfHover"' : '';
$cms = CMS::getLinks((int)$id_lang, array($id));
if (count($cms)) {
$this->_menu .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($cms[0]['link']).'" title="'.Tools::safeOutput($cms[0]['meta_title']).'">'.Tools::safeOutput($cms[0]['meta_title']).'</a></li>'.PHP_EOL;
}
break;
case 'CMS_CAT':
$category = new CMSCategory((int)$id, (int)$id_lang);
if (count($category)) {
$this->_menu .= '<li><a href="'.Tools::HtmlEntitiesUTF8($category->getLink()).'" title="'.$category->name.'">'.$category->name.'</a>';
$this->getCMSMenuItems($category->id);
$this->_menu .= '</li>'.PHP_EOL;
}
break;
// Case to handle the option to show all Manufacturers
case 'ALLMAN':
$link = new Link;
$this->_menu .= '<li><a href="'.$link->getPageLink('manufacturer').'" title="'.$this->l('All manufacturers').'">'.$this->l('All manufacturers').'</a><ul>'.PHP_EOL;
$manufacturers = Manufacturer::getManufacturers();
foreach ($manufacturers as $key => $manufacturer) {
$this->_menu .= '<li><a href="'.$link->getManufacturerLink((int)$manufacturer['id_manufacturer'], $manufacturer['link_rewrite']).'" title="'.Tools::safeOutput($manufacturer['name']).'">'.Tools::safeOutput($manufacturer['name']).'</a></li>'.PHP_EOL;
}
$this->_menu .= '</ul>';
break;
case 'MAN':
$selected = ($this->page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : '';
$manufacturer = new Manufacturer((int)$id, (int)$id_lang);
if (!is_null($manufacturer->id)) {
if (intval(Configuration::get('PS_REWRITING_SETTINGS'))) {
$manufacturer->link_rewrite = Tools::link_rewrite($manufacturer->name);
} else {
$manufacturer->link_rewrite = 0;
}
$link = new Link;
$this->_menu .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($link->getManufacturerLink((int)$id, $manufacturer->link_rewrite)).'" title="'.Tools::safeOutput($manufacturer->name).'">'.Tools::safeOutput($manufacturer->name).'</a></li>'.PHP_EOL;
}
break;
// Case to handle the option to show all Suppliers
case 'ALLSUP':
$link = new Link;
$this->_menu .= '<li><a href="'.$link->getPageLink('supplier').'" title="'.$this->l('All suppliers').'">'.$this->l('All suppliers').'</a><ul>'.PHP_EOL;
$suppliers = Supplier::getSuppliers();
foreach ($suppliers as $key => $supplier) {
$this->_menu .= '<li><a href="'.$link->getSupplierLink((int)$supplier['id_supplier'], $supplier['link_rewrite']).'" title="'.Tools::safeOutput($supplier['name']).'">'.Tools::safeOutput($supplier['name']).'</a></li>'.PHP_EOL;
}
$this->_menu .= '</ul>';
break;
case 'SUP':
$selected = ($this->page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : '';
$supplier = new Supplier((int)$id, (int)$id_lang);
if (!is_null($supplier->id)) {
$link = new Link;
$this->_menu .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($link->getSupplierLink((int)$id, $supplier->link_rewrite)).'" title="'.$supplier->name.'">'.$supplier->name.'</a></li>'.PHP_EOL;
}
break;
case 'SHOP':
$selected = ($this->page_name == 'index' && ($this->context->shop->id == $id)) ? ' class="sfHover"' : '';
$shop = new Shop((int)$id);
if (Validate::isLoadedObject($shop)) {
$link = new Link;
$this->_menu .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($shop->getBaseURL()).'" title="'.$shop->name.'">'.$shop->name.'</a></li>'.PHP_EOL;
}
break;
case 'LNK':
$link = MenuTopLinks::get((int)$id, (int)$id_lang, (int)$id_shop);
//.........这里部分代码省略.........
示例11: assignAll
/**
* Assign template vars if displaying the supplier list
*/
protected function assignAll()
{
if (Configuration::get('PS_DISPLAY_SUPPLIERS')) {
$result = Supplier::getSuppliers(true, $this->context->language->id, true);
$nbProducts = count($result);
$this->pagination($nbProducts);
$suppliers = Supplier::getSuppliers(true, $this->context->language->id, true, $this->p, $this->n);
foreach ($suppliers as &$row) {
$row['image'] = !file_exists(_PS_SUPP_IMG_DIR_ . '/' . $row['id_supplier'] . '-' . ImageType::getFormatedName('medium') . '.jpg') ? $this->context->language->iso_code . '-default' : $row['id_supplier'];
}
$this->context->smarty->assign(array('pages_nb' => ceil($nbProducts / (int) $this->n), 'nbSuppliers' => $nbProducts, 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'suppliers_list' => $suppliers, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY')));
} else {
Tools::redirect('index.php?controller=404');
}
}
示例12: array
$currentIndex = 'index.php?tab=AdminCatalog';
$manufacturers = Manufacturer::getManufacturers();
if ($manufacturers) {
$jsonArray = array();
foreach ($manufacturers as $manufacturer) {
$jsonArray[] = '{"optionValue": "' . $manufacturer['id_manufacturer'] . '", "optionDisplay": "' . htmlspecialchars($manufacturer['name']) . '"}';
}
die('[' . implode(',', $jsonArray) . ']');
}
}
if (isset($_GET['ajaxReferrers'])) {
require 'tabs/AdminReferrers.php';
}
if (isset($_GET['ajaxProductSuppliers'])) {
$currentIndex = 'index.php?tab=AdminCatalog';
$suppliers = Supplier::getSuppliers();
if ($suppliers) {
$jsonArray = array();
foreach ($suppliers as $supplier) {
$jsonArray[] = '{"optionValue": "' . $supplier['id_supplier'] . '", "optionDisplay": "' . htmlspecialchars($supplier['name']) . '"}';
}
die('[' . implode(',', $jsonArray) . ']');
}
}
if (isset($_GET['ajaxProductAccessories'])) {
$currentIndex = 'index.php?tab=AdminCatalog';
$jsonArray = array();
$products = Db::getInstance()->ExecuteS('
SELECT p.`id_product`, pl.`name`
FROM `' . _DB_PREFIX_ . 'product` p
NATURAL LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` pl
示例13: _displayForm
private function _displayForm()
{
$params = $this->params;
$id_lang = $this->context->language->id;
$id_btmegamenu = (int) Tools::getValue('id_btmegamenu');
$obj = new Btmegamenu($id_btmegamenu);
$tree = $obj->getTree();
$categories = LeoBtmegamenuHelper::getCategories();
$manufacturers = Manufacturer::getManufacturers(false, $id_lang, true);
$suppliers = Supplier::getSuppliers(false, $id_lang, true);
$cmss = CMS::listCms($this->context->language->id, false, true);
$menus = $obj->getDropdown(null, $obj->id_parent);
require_once dirname(__FILE__) . '/form.php';
}
示例14: initiContentForInformation
private function initiContentForInformation()
{
$vhafmkgxjva = "category_nbr";
$mvcrgvbvcb = "language";
$myqwjjy = "category_nbr";
$dutlbmuk = "categories";
${$mvcrgvbvcb} = new Language($this->id_language);
${${"GLOBALS"}["jhyxxhuo"]} = file_exists(_PS_ROOT_DIR_ . "/js/tiny_mce/langs/" . $language->iso_code . ".js") ? $language->iso_code : "en";
${"GLOBALS"}["gfbjkeb"] = "ad";
${${"GLOBALS"}["kuvwml"]} = str_replace("\\", "\\\\", dirname($_SERVER["PHP_SELF"]));
$crebbb = "categories";
$this->sellerinfo = new SellerInfo(SellerInfo::getIdByCustomerId(self::$cookie->id_customer), self::$cookie->id_lang);
${$dutlbmuk} = array();
${$myqwjjy} = (int) Db::getInstance()->getValue("SELECT COUNT(*) AS cnt FROM " . _DB_PREFIX_ . "category");
if (${$vhafmkgxjva} <= 1000) {
$kmgfuo = "specialcids";
${"GLOBALS"}["uvadbayndxqr"] = "specialcids";
$uxpwiboxxa = "sql";
${${"GLOBALS"}["vvskebgpewm"]} = "SELECT c.id_category, c.id_parent, cl.name \n\t\t\tFROM " . _DB_PREFIX_ . "category c \n\t\t\t\tINNER JOIN " . _DB_PREFIX_ . "category_owner co ON (c.id_category=co.id_category AND (IFNULL(co.id_owner,0)=0 OR IFNULL(co.id_owner,0)=" . intval($this->sellerinfo->id_seller) . "))\n\t\t\t\tLEFT JOIN " . _DB_PREFIX_ . "category_lang cl ON (c.id_category=cl.id_category AND cl.id_lang=" . $this->context->language->id . " AND cl.id_shop=" . $this->context->shop->id . ")\n\t\t\t\tWHERE c.id_category > 1\n\t\t\t\t";
$einijh = "specialcids";
${"GLOBALS"}["wzpgiddtedw"] = "caterows";
${$kmgfuo} = AgileMultipleSeller::getSpecialCatrgoryIds();
if (!empty(${${"GLOBALS"}["uvadbayndxqr"]})) {
${$uxpwiboxxa} .= " AND c.id_category NOT IN (" . ${$einijh} . ")";
}
${${"GLOBALS"}["gmagdrofuuu"]} = Db::getInstance()->ExecuteS(${${"GLOBALS"}["vvskebgpewm"]});
${${"GLOBALS"}["kkajzqyo"]} = AgileHelper::getSortedFullnameCategory(${${"GLOBALS"}["wzpgiddtedw"]});
}
$ohvjrmga = "HOOK_PRODYCT_LIST_OPTIONS";
${$ohvjrmga} = "";
if (Module::isInstalled("agilesellerlistoptions")) {
include_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
${${"GLOBALS"}["nbpjcibnley"]} = new AgileSellerListOptions();
${${"GLOBALS"}["kenogesux"]} = $aslo_module->hookAgileAdminProductsFormTop(array("for_front" => 1, "id_product" => $this->object->id), true);
}
$newCatFormat = $this->getNewCategoryFormat();
self::$smarty->assign(array("ad" => ${${"GLOBALS"}["gfbjkeb"]}, "isoTinyMCE" => ${${"GLOBALS"}["jhyxxhuo"]}, "theme_css_dir" => _THEME_CSS_DIR_, "ajaxurl" => _MODULE_DIR_, "suppliers" => Supplier::getSuppliers(), "manufacturers" => Manufacturer::getManufacturers(), "currency" => new Currency((int) Configuration::get("PS_CURRENCY_DEFAULT")), "ps_ssl_enabled" => Configuration::get("PS_SSL_ENABLED"), "is_pack" => $this->object->id && Pack::isPack($this->object->id) || Tools::getValue("ppack") || Tools::getValue("type_product") == Product::PTYPE_PACK, "categories" => ${$crebbb}, "new_categories" => $newCatFormat, "order_out_of_stock" => Configuration::get("PS_ORDER_OUT_OF_STOCK"), "bullet_common_field" => "", "is_agilesellerlistoptions_installed" => Module::isInstalled("agilesellerlistoptions"), "HOOK_PRODYCT_LIST_OPTIONS" => ${${"GLOBALS"}["kenogesux"]}));
}
示例15: _postProcess
//.........这里部分代码省略.........
$this->clearCache();
} elseif (Tools::getValue('deleteColumnWrap') && Tools::getValue('id_wrap')) {
$ObjAdvancedTopMenuColumnWrapClass = new AdvancedTopMenuColumnWrapClass(Tools::getValue('id_wrap'));
if ($ObjAdvancedTopMenuColumnWrapClass->delete()) {
$this->_html .= $this->displayConfirmation($this->l('Column has been deleted'));
} else {
$this->errors[] = $this->l('Error during delete column');
}
$this->clearCache();
} elseif (Tools::getValue('deleteColumn') && Tools::getValue('id_column')) {
$ObjAdvancedTopMenuColumnClass = new AdvancedTopMenuColumnClass(Tools::getValue('id_column'));
if ($ObjAdvancedTopMenuColumnClass->delete()) {
$this->_html .= $this->displayConfirmation($this->l('Group has been deleted'));
} else {
$this->errors[] = $this->l('Error during delete Group');
}
$this->clearCache();
} elseif (Tools::getValue('deleteElement') && Tools::getValue('id_element')) {
$AdvancedTopMenuElementsClass = new AdvancedTopMenuElementsClass(Tools::getValue('id_element'));
if ($AdvancedTopMenuElementsClass->delete()) {
$this->_html .= $this->displayConfirmation($this->l('Item has been deleted'));
} else {
$this->errors[] = $this->l('Error during delete item');
}
$this->clearCache();
} elseif (Tools::getValue('getMenuForm')) {
$ObjAdvancedTopMenuClass = false;
if (Tools::getValue('editMenu') && Tools::getValue('id_menu')) {
$ObjAdvancedTopMenuClass = new AdvancedTopMenuClass(Tools::getValue('id_menu'));
}
$cms = CMS::listCms(intval($this->_cookie->id_lang));
$categories = Category::getCategories(intval($this->_cookie->id_lang), false);
$manufacturer = Manufacturer::getManufacturers(false, $this->_cookie->id_lang, true);
$supplier = Supplier::getSuppliers(false, $this->_cookie->id_lang, true);
self::_cleanBuffer();
if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
$this->_html = '';
}
$this->displayMenuForm($cms, $categories, $manufacturer, $supplier, $ObjAdvancedTopMenuClass);
$this->initColorPicker();
$this->initTinyMce();
echo $this->_html;
die;
} elseif (Tools::getValue('getColumnWrapForm')) {
$ObjAdvancedTopMenuColumnWrapClass = false;
if (Tools::getValue('editColumnWrap') && Tools::getValue('id_wrap')) {
$ObjAdvancedTopMenuColumnWrapClass = new AdvancedTopMenuColumnWrapClass(Tools::getValue('id_wrap'));
}
$menus = AdvancedTopMenuClass::getMenus($this->_cookie->id_lang, false);
self::_cleanBuffer();
if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
$this->_html = '';
}
$this->displayColumnWrapForm($menus, $ObjAdvancedTopMenuColumnWrapClass);
$this->initColorPicker();
$this->initTinyMce();
echo $this->_html;
die;
} elseif (Tools::getValue('getColumnForm')) {
$ObjAdvancedTopMenuColumnClass = false;
if (Tools::getValue('editColumn') && Tools::getValue('id_column')) {
$ObjAdvancedTopMenuColumnClass = new AdvancedTopMenuColumnClass(Tools::getValue('id_column'));
}
$cms = CMS::listCms(intval($this->_cookie->id_lang));
$categories = Category::getCategories(intval($this->_cookie->id_lang), false);
$manufacturer = Manufacturer::getManufacturers(false, $this->_cookie->id_lang, true);