• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP HelperTreeCategories类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中HelperTreeCategories的典型用法代码示例。如果您正苦于以下问题:PHP HelperTreeCategories类的具体用法?PHP HelperTreeCategories怎么用?PHP HelperTreeCategories使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了HelperTreeCategories类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: renderForm

 public function renderForm($args, $data)
 {
     $options = array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')));
     $orderby = array(array('order' => 'date_add', 'name' => $this->l('Date Add')), array('order' => 'date_upd', 'name' => $this->l('Date Update')), array('order' => 'name', 'name' => $this->l('Name')), array('order' => 'id_product', 'name' => $this->l('Product Id')), array('order' => 'price', 'name' => $this->l('Price')));
     $orderway = array(array('orderway' => 'ASC', 'name' => $this->l('Ascending')), array('orderway' => 'DESC', 'name' => $this->l('Descending')));
     $root = Category::getRootCategory();
     $categories = array();
     $helper = $this->getFormHelper();
     $items = '';
     $tab_edit = '';
     if ($data['params'] && isset($data['params']['leotab']) && $data['params']['leotab']) {
         $tabs = $data['params']['leotab'];
         $items = $this->getTabs($tabs);
         if (Tools::getValue('id_tab')) {
             $id_tab = Tools::getValue('id_tab');
             $tab_edit = $items[$id_tab] ? $items[$id_tab] : '';
             $categories = $items[$id_tab]['categories'] ? $items[$id_tab]['categories'] : array();
         }
     }
     $tree = new HelperTreeCategories('categories-tree', 'Categories');
     $tree->setRootCategory($root->id)->setUseCheckBox(true)->setUseSearch(true)->setSelectedCategories($categories);
     $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Carousel Form.')), 'input' => array(array('type' => 'text', 'label' => $this->l('Number of Items In Page'), 'name' => 'itemspage', 'default' => 3, 'desc' => $this->l('The maximum number of products in each page tab (default: 3).')), array('type' => 'text', 'label' => $this->l('Number of Columns In Page'), 'name' => 'columns', 'default' => 3, 'desc' => $this->l('The maximum number of products in each page tab (default: 3).')), array('type' => 'text', 'label' => $this->l('Number of products displayed In Tab'), 'name' => 'itemstab', 'default' => 6, 'desc' => $this->l('The maximum number of products in each tab (default: 6).')), array('type' => 'select', 'label' => $this->l('Order By:'), 'desc' => $this->l('The maximum number of products in each page  (default: 3).'), 'name' => 'orderby', 'default' => 'date_add', 'options' => array('query' => $orderby, 'id' => 'order', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Order Way:'), 'desc' => $this->l('The maximum number of products in each page  (default: 3).'), 'name' => 'orderway', 'default' => 'date_add', 'options' => array('query' => $orderway, 'id' => 'orderway', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Interval'), 'name' => 'interval', 'default' => 8000, 'desc' => $this->l('Enter Time(miniseconds) to play carousel. Value 0 to stop.')), array('type' => 'setting_tab', 'name' => 'setting_tab', 'lang' => true, 'tree' => $tree->render(), 'default' => '')), 'buttons' => array(array('title' => $this->l('Save And Stay'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveandstayleotempcp'), array('title' => $this->l('Save'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveleotempcp')));
     $helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues($data), 'languages' => Context::getContext()->controller->getLanguages(), 'id_lang_default' => (int) Configuration::get('PS_LANG_DEFAULT'), 'iso_code' => Context::getContext()->language->iso_code, 'text_title' => 'title_' . Context::getContext()->language->iso_code, 'path' => __PS_BASE_URI__ . 'themes/' . _THEME_NAME_ . '/img/icontab/', 'images' => LeoWidgetBase::getImageList(_PS_ROOT_DIR_ . '/themes/' . _THEME_NAME_ . '/img/icontab/'), 'url' => AdminController::$currentIndex . '&id_leowidgets=' . Tools::getValue('id_leowidgets') . '&updateleowidgets&token=' . Tools::getValue('token') . '&conf=4', 'items' => $items, 'tab_edit' => $tab_edit);
     return $helper->generateForm($this->fields_form);
 }
开发者ID:ekachandrasetiawan,项目名称:BeltcareCom,代码行数:25,代码来源:advancetab.php


示例2: renderForm

 public function renderForm($args, $data)
 {
     global $currentIndex;
     $options = array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')));
     $orderby = array(array('order' => 'date_add', 'name' => $this->l('Date Add')), array('order' => 'date_upd', 'name' => $this->l('Date Update')), array('order' => 'name', 'name' => $this->l('Name')), array('order' => 'id_product', 'name' => $this->l('Product Id')), array('order' => 'price', 'name' => $this->l('Price')));
     $orderway = array(array('orderway' => 'ASC', 'name' => $this->l('Ascending')), array('orderway' => 'DESC', 'name' => $this->l('Descending')));
     $root = Category::getRootCategory();
     $categories = array();
     $helper = $this->getFormHelper();
     $items = '';
     $tab_edit = '';
     if ($data['params'] && isset($data['params']['leotab']) && $data['params']['leotab']) {
         $tabs = $data['params']['leotab'];
         $items = $this->getTabs($tabs);
         if (Tools::getValue('id_tab')) {
             $id_tab = Tools::getValue('id_tab');
             $tab_edit = $items[$id_tab] ? $items[$id_tab] : '';
             $categories = $items[$id_tab]['categories'] ? $items[$id_tab]['categories'] : array();
         }
     }
     $tree = new HelperTreeCategories('categories-tree', 'Categories');
     $tree->setRootCategory($root->id)->setUseCheckBox(true)->setUseSearch(true)->setSelectedCategories($categories);
     $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Carousel Form.')), 'input' => array(array('type' => 'html', 'html_content' => 'Please access <a href="http://apollotheme.com/" target="_blank" title="apollo site">Apollotheme.com</a> to buy professional version to use this '), array('type' => 'html', 'html_content' => '<a target="_blank" href="http://apollotheme.com/how-to-buy-pro-version/" target="_blank" title="How to buy">How to buy Professional Version</a>'), array('type' => 'html', 'html_content' => '<a target="_blank" href="http://apollotheme.com/different-between-free-pro-version/" target="_blank" title="Why should use">Why should use Professional Version</a>')), 'buttons' => array(array('title' => $this->l('Save And Stay'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveandstayleotempcp'), array('title' => $this->l('Save'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveleotempcp')));
     $helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues($data), 'languages' => Context::getContext()->controller->getLanguages(), 'id_lang_default' => (int) Configuration::get('PS_LANG_DEFAULT'), 'iso_code' => Context::getContext()->language->iso_code, 'text_title' => 'title_' . Context::getContext()->language->iso_code, 'path' => __PS_BASE_URI__ . 'themes/' . _THEME_NAME_ . '/img/icontab/', 'images' => LeoWidgetBase::getImageList(_PS_ROOT_DIR_ . '/themes/' . _THEME_NAME_ . '/img/icontab/'), 'url' => AdminController::$currentIndex . '&id_leowidgets=' . Tools::getValue('id_leowidgets') . '&updateleowidgets&token=' . Tools::getValue('token') . '&conf=4', 'items' => $items, 'tab_edit' => $tab_edit);
     return $helper->generateForm($this->fields_form);
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:26,代码来源:advancetab.php


示例3: renderForm

    public function renderForm($data)
    {
        $helper = $this->getFormHelper();
        $types = array();
        $types[] = array('value' => 'newest', 'text' => $this->l('Products Newest'));
        $types[] = array('value' => 'bestseller', 'text' => $this->l('Products Bestseller'));
        $types[] = array('value' => 'special', 'text' => $this->l('Products Special'));
        $types[] = array('value' => 'featured', 'text' => $this->l('Products Featured'));
        $types[] = array('value' => 'toprating', 'text' => $this->l('Products Top Rating'));
        $lists = array(array('value' => 'grid', 'text' => $this->l('Grid')), array('value' => 'list1', 'text' => $this->l('List 1')), array('value' => 'list2', 'text' => $this->l('List 2')));
        $modes = array(array('value' => 'normal', 'text' => $this->l('Normal')), array('value' => 'carousel', 'text' => $this->l('Carousel')));
        $this->fields_form[1]['form'] = array('input' => array(array('type' => 'categories_select', 'label' => $this->l('Categories:'), 'name' => 'categoryBox', 'default' => '')));
        $values = $this->getConfigFieldsValues($data);
        $selected_cat = $values['categoryBox'];
        $categories = explode(',', $selected_cat);
        $root = Category::getRootCategory();
        $tree = new HelperTreeCategories('associated-categories-tree', 'Associated categories');
        $tree->setRootCategory($root->id)->setUseCheckBox(true)->setUseSearch(true)->setSelectedCategories($categories);
        $category_tpl = $tree->render();
        $key = time();
        $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.')), 'input' => array(array('type' => 'text', 'label' => $this->l('Banner'), 'name' => 'banner_imagefile', 'class' => 'imageupload', 'default' => '', 'id' => 'banner_imagefile' . $key, 'desc' => 'Put image folder in the image folder ROOT_SHOP_DIR/img/'), array('type' => 'textarea', 'label' => $this->l('Description'), 'name' => 'description', 'cols' => 40, 'rows' => 20, 'value' => true, 'lang' => true, 'default' => '', 'autoload_rte' => false, 'desc' => 'Enter HTML CODE in here'), array('type' => 'categories_select', 'label' => $this->l('Categories:'), 'name' => 'categoryBox', 'category_tree' => $category_tpl, 'default' => '1,2,3', 'desc' => $this->l('Categories only apply for Products List Type: Products Newest, Products Bestseller,
								 Products Special, Products Top Rating, Products Most View')), array('type' => 'text', 'label' => $this->l('Limit'), 'name' => 'limit', 'default' => 6), array('type' => 'select', 'label' => $this->l('Products List Type'), 'name' => 'list_type', 'options' => array('query' => $types, 'id' => 'value', 'name' => 'text'), 'default' => 'newest', 'desc' => $this->l('Select a Product List Type')), array('type' => 'select', 'label' => $this->l('Display Mode'), 'name' => 'display_mode', 'options' => array('query' => $modes, 'id' => 'value', 'name' => 'text'), 'default' => 'carousel'), array('type' => 'text', 'label' => $this->l('Number Columns On Large Desktops.'), 'name' => 'columns', 'desc' => $this->l('The maximum column items  in tab.'), 'default' => '4'), array('type' => 'text', 'label' => $this->l('Number Columns On Small Desktops'), 'name' => 'nbr_desktops', 'default' => '4'), array('type' => 'text', 'label' => $this->l('Number Columns On Tablets'), 'name' => 'nbr_tablets', 'default' => '2'), array('type' => 'text', 'label' => $this->l('Number Columns On Mobile'), 'name' => 'nbr_mobile', 'default' => '1'), array('type' => 'select', 'label' => $this->l('List Mode'), 'name' => 'list_mode', 'options' => array('query' => $lists, 'id' => 'value', 'name' => 'text'), 'default' => 'grid')), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'));
        $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
        $helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues($data), 'languages' => Context::getContext()->controller->getLanguages(), 'id_language' => $default_lang);
        $string = '
					 <script type="text/javascript">
						$(".imageupload").WPO_Gallery({gallery:false});
					</script>
		 
			';
        return '<div id="imageslist' . $key . '">' . $helper->generateForm($this->fields_form) . $string . '</div>';
    }
开发者ID:vuduykhuong1412,项目名称:GitHub,代码行数:32,代码来源:productlist.php


示例4: displayAjaxCategoriesList

 /**
  * Listing ajax des catégories
  */
 public function displayAjaxCategoriesList()
 {
     //Insertion des styles admin nécessaire à l'affichage des actions ajax
     foreach ($this->css_files as $css_key => $css_type) {
         echo '<link rel="stylesheet" type="text/css" href="' . $css_key . '" type="' . $css_type . '"/>';
     }
     //Géneration du tree des catégories
     if (_PS_VERSION_ < '1.6') {
         $categoryTree = new Helper();
         echo $categoryTree->renderCategoryTree(2, array(), 'id-category-for-insert');
     } else {
         $categoryTree = new HelperTreeCategories('categories-tree', $this->l('Check the category to display the link'));
         echo $categoryTree->setAttribute()->setInputName('id-category-for-insert')->render();
     }
 }
开发者ID:nenes25,项目名称:prestashop_eicmslinks,代码行数:18,代码来源:wysiwyg.php


示例5: renderForm

    public function renderForm($data)
    {
        $helper = $this->getFormHelper();
        $soption = array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled', 'producttabs')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled', 'producttabs')));
        $lists = array(array('value' => 'grid', 'text' => $this->l('Grid')), array('value' => 'list1', 'text' => $this->l('List 1')), array('value' => 'list2', 'text' => $this->l('List 2')));
        $modes = array(array('value' => 'normal', 'text' => $this->l('Normal')), array('value' => 'carousel', 'text' => $this->l('Carousel')));
        $this->fields_form[1]['form'] = array('input' => array(array('type' => 'categories_select', 'label' => $this->l('Categories:'), 'name' => 'categoryBox', 'default' => '')));
        $values = $this->getConfigFieldsValues($data);
        $selected_cat = $values['categoryBox'];
        $categories = explode(',', $selected_cat);
        $root = Category::getRootCategory();
        $tree = new HelperTreeCategories('associated-categories-tree', 'Associated categories');
        $tree->setRootCategory($root->id)->setUseCheckBox(true)->setUseSearch(true)->setSelectedCategories($categories);
        $category_tpl = $tree->render();
        $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.', 'producttabs')), 'input' => array(array('type' => 'text', 'label' => $this->l('Sub Title.'), 'name' => 'sub_title', 'desc' => $this->l('Display Sub Title.'), 'default' => '', 'lang' => true), array('type' => 'categories_select', 'label' => $this->l('Categories:', 'producttabs'), 'name' => 'categoryBox', 'category_tree' => $category_tpl, 'default' => '1,2,3', 'desc' => $this->l('Categories only apply for Products List Type: Products Newest, Products Bestseller, Products Special, 
						Products Top Rating, Products Most View', 'producttabs')), array('type' => 'text', 'label' => $this->l('Limit', 'producttabs'), 'name' => 'limit', 'default' => 6), array('type' => 'select', 'label' => $this->l('Display Mode'), 'name' => 'display_mode', 'options' => array('query' => $modes, 'id' => 'value', 'name' => 'text'), 'default' => 'carousel'), array('type' => 'text', 'label' => $this->l('Number Columns On Large Desktops.'), 'name' => 'columns', 'desc' => $this->l('The maximum column items  in tab.'), 'default' => '4'), array('type' => 'text', 'label' => $this->l('Number Columns On Small Desktops'), 'name' => 'nbr_desktops', 'default' => '4'), array('type' => 'text', 'label' => $this->l('Number Columns On Tablets'), 'name' => 'nbr_tablets', 'default' => '2'), array('type' => 'text', 'label' => $this->l('Number Columns On Mobile'), 'name' => 'nbr_mobile', 'default' => '1'), array('type' => 'select', 'label' => $this->l('List Mode'), 'name' => 'list_mode', 'options' => array('query' => $lists, 'id' => 'value', 'name' => 'text'), 'default' => 'grid'), array('type' => 'switch', 'label' => $this->l('Enable Newest', 'producttabs'), 'name' => 'enable_newest', 'values' => $soption, 'default' => '1', 'desc' => $this->l('Whethere to display Newest Products', 'producttabs')), array('type' => 'switch', 'label' => $this->l('Enable Featured', 'producttabs'), 'name' => 'enable_featured', 'values' => $soption, 'default' => '0', 'desc' => $this->l('Whethere to display featured Products', 'producttabs')), array('type' => 'switch', 'label' => $this->l('Enable Bestseller', 'producttabs'), 'name' => 'enable_bestseller', 'values' => $soption, 'default' => '1', 'desc' => $this->l('Whethere to display Bestseller Products', 'producttabs')), array('type' => 'switch', 'label' => $this->l('Enable Special', 'producttabs'), 'name' => 'enable_special', 'values' => $soption, 'default' => '1', 'desc' => $this->l('Whethere to display Special Products', 'producttabs')), array('type' => 'switch', 'label' => $this->l('Enable Top Rating', 'producttabs'), 'name' => 'enable_toprating', 'values' => $soption, 'default' => '1', 'desc' => $this->l('Whethere to display Top Rating Products', 'producttabs'))), 'submit' => array('title' => $this->l('Save', 'producttabs'), 'class' => 'button'));
        $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
        $helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues($data), 'languages' => Context::getContext()->controller->getLanguages(), 'id_language' => $default_lang);
        return $helper->generateForm($this->fields_form);
    }
开发者ID:vuduykhuong1412,项目名称:GitHub,代码行数:20,代码来源:producttabs.php


示例6: renderForm

 public function renderForm($args, $data)
 {
     # validate module
     unset($args);
     $helper = $this->getFormHelper();
     $root = Category::getRootCategory();
     $selected_cat = array();
     $selected_cates = '';
     $selected_images = '';
     $themeName = Context::getContext()->shop->getTheme();
     $image_path = 'themes/' . $themeName . '/img/icontab/';
     $imageList = $this->getImages($image_path);
     if ($data) {
         if ($data['params'] && isset($data['params']['categoryBox']) && $data['params']['categoryBox']) {
             $selected_cat = $data['params']['categoryBox'];
         }
         if ($data['params'] && isset($data['params']['category_img']) && $data['params']['category_img']) {
             //$selected_images = Tools::jsonDecode($data['params']['category_val'],true);
             $selected_images = $data['params']['category_img'];
         }
         if ($data['params'] && isset($data['params']['selected_cates']) && $data['params']['selected_cates']) {
             $selected_cates = $data['params']['selected_cates'];
         }
     }
     // $cate = new Category(13);
     // $result = $cate-> getParentsCategories();
     // echo "<pre>";print_r($result);die;
     $tree = new HelperTreeCategories('image_cate_tree', 'All Categories');
     $tree->setRootCategory($root->id)->setUseCheckBox(true)->setUseSearch(true)->setSelectedCategories($selected_cat);
     //		$list_image = array('default.gif', 'leo.gif');
     $orderby = array(array('order' => 'position', 'name' => $this->l('Position')), array('order' => 'depth', 'name' => $this->l('Depth')), array('order' => 'name', 'name' => $this->l('Name')));
     $showicons = array(array('show' => '1', 'name' => $this->l('Yes')), array('show' => '2', 'name' => $this->l('Level 1 categories')), array('show' => '0', 'name' => $this->l('No')));
     $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.')), 'input' => array(array('type' => 'html', 'html_content' => 'Please access <a href="http://apollotheme.com/" target="_blank" title="apollo site">Apollotheme.com</a> to buy professional version to use this '), array('type' => 'html', 'html_content' => '<a target="_blank" href="http://apollotheme.com/how-to-buy-pro-version/" target="_blank" title="How to buy">How to buy Professional Version</a>'), array('type' => 'html', 'html_content' => '<a target="_blank" href="http://apollotheme.com/different-between-free-pro-version/" target="_blank" title="Why should use">Why should use Professional Version</a>')), 'buttons' => array(array('title' => $this->l('Save And Stay'), 'icon' => 'process-icon-save', 'class' => 'pull-right sub_categories', 'type' => 'submit', 'name' => 'saveandstayleotempcp'), array('title' => $this->l('Save'), 'icon' => 'process-icon-save', 'class' => 'pull-right sub_categories', 'type' => 'submit', 'name' => 'saveleotempcp')));
     $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
     $data_form = $this->getConfigFieldsValues($data);
     $data_form['id_root'] = $root->id;
     $data_form['id_lang'] = Context::getContext()->employee->id_lang;
     //echo "<pre>";print_r($data);die;
     $helper->tpl_vars = array('fields_value' => $data_form, 'languages' => Context::getContext()->controller->getLanguages(), 'id_language' => $default_lang);
     return $helper->generateForm($this->fields_form);
 }
开发者ID:pacxs,项目名称:pacxscom,代码行数:41,代码来源:category_image.php


示例7: renderForm

 public function renderForm($args, $data)
 {
     # validate module
     unset($args);
     $helper = $this->getFormHelper();
     $root = Category::getRootCategory();
     $selected_cat = array();
     $selected_cates = '';
     $selected_images = '';
     $themeName = Context::getContext()->shop->getTheme();
     $image_path = 'themes/' . $themeName . '/img/icontab/';
     $imageList = $this->getImages($image_path);
     if ($data) {
         if ($data['params'] && isset($data['params']['categoryBox']) && $data['params']['categoryBox']) {
             $selected_cat = $data['params']['categoryBox'];
         }
         if ($data['params'] && isset($data['params']['category_img']) && $data['params']['category_img']) {
             //$selected_images = Tools::jsonDecode($data['params']['category_val'],true);
             $selected_images = $data['params']['category_img'];
         }
         if ($data['params'] && isset($data['params']['selected_cates']) && $data['params']['selected_cates']) {
             $selected_cates = $data['params']['selected_cates'];
         }
     }
     // $cate = new Category(13);
     // $result = $cate-> getParentsCategories();
     // echo "<pre>";print_r($result);die;
     $tree = new HelperTreeCategories('image_cate_tree', 'All Categories');
     $tree->setRootCategory($root->id)->setUseCheckBox(true)->setUseSearch(true)->setSelectedCategories($selected_cat);
     //		$list_image = array('default.gif', 'leo.gif');
     $orderby = array(array('order' => 'position', 'name' => $this->l('Position')), array('order' => 'depth', 'name' => $this->l('Depth')), array('order' => 'name', 'name' => $this->l('Name')));
     $showicons = array(array('show' => '1', 'name' => $this->l('Yes')), array('show' => '2', 'name' => $this->l('Level 1 categories')), array('show' => '0', 'name' => $this->l('No')));
     $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.')), 'input' => array(array('type' => 'img_cat', 'name' => 'img_cat', 'imageList' => $imageList, 'selected_images' => $selected_images, 'selected_cates' => $selected_cates, 'lang' => true, 'tree' => $tree->render(), 'default' => ''), array('type' => 'text', 'label' => $this->l('Depth'), 'name' => 'cate_depth', 'default' => '1'), array('type' => 'select', 'label' => $this->l('Order By:'), 'name' => 'orderby', 'default' => 'position', 'options' => array('query' => $orderby, 'id' => 'order', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Show icons:'), 'name' => 'showicons', 'default' => '1', 'options' => array('query' => $showicons, 'id' => 'show', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Limit'), 'name' => 'limit', 'default' => '5'), array('type' => 'hidden', 'name' => 'id_root', 'default' => '2'), array('type' => 'hidden', 'name' => 'id_lang', 'default' => '1')), 'buttons' => array(array('title' => $this->l('Save And Stay'), 'icon' => 'process-icon-save', 'class' => 'pull-right sub_categories', 'type' => 'submit', 'name' => 'saveandstayleotempcp'), array('title' => $this->l('Save'), 'icon' => 'process-icon-save', 'class' => 'pull-right sub_categories', 'type' => 'submit', 'name' => 'saveleotempcp')));
     $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
     $data_form = $this->getConfigFieldsValues($data);
     $data_form['id_root'] = $root->id;
     $data_form['id_lang'] = Context::getContext()->employee->id_lang;
     //echo "<pre>";print_r($data);die;
     $helper->tpl_vars = array('fields_value' => $data_form, 'languages' => Context::getContext()->controller->getLanguages(), 'id_language' => $default_lang);
     return $helper->generateForm($this->fields_form);
 }
开发者ID:ahmedonee,项目名称:morinella,代码行数:41,代码来源:category_image.php


示例8: renderForm

 public function renderForm($data)
 {
     $helper = $this->getFormHelper();
     $lists = array(array('value' => 'grid', 'text' => $this->l('Grid')), array('value' => 'list1', 'text' => $this->l('List 1')), array('value' => 'list2', 'text' => $this->l('List 2')));
     $modes = array(array('value' => 'normal', 'text' => $this->l('Normal')), array('value' => 'carousel', 'text' => $this->l('Carousel')));
     $this->fields_form[1]['form'] = array('input' => array(array('type' => 'category_tab', 'label' => 'Categories', 'name' => 'categorytab', 'default' => ''), array('type' => 'categoryBox', 'label' => 'Categories', 'name' => 'categoryBox', 'default' => '')));
     $values = $this->getConfigFieldsValues($data);
     $selected_cat = $values['categoryBox'];
     $categories = explode(',', $selected_cat);
     $root = Category::getRootCategory();
     $tree = new HelperTreeCategories('associated-categories-tree', 'Associated categories');
     $tree->setRootCategory($root->id)->setUseCheckBox(true)->setUseSearch(true)->setSelectedCategories($categories);
     $category_tpl = $tree->render();
     $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[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.')), 'input' => array(array('type' => 'category_tab', 'label' => $this->l('Categories'), 'name' => 'categorytab', 'category_tpl' => $category_tpl, 'default' => ''), array('type' => 'categoryBox', 'label' => '', 'name' => 'categoryBox', 'default' => ''), array('type' => 'switch', 'label' => $this->l('Show Image'), 'name' => 'show_image', 'values' => $soption, 'default' => '1'), array('type' => 'switch', 'label' => $this->l('Show Category Title'), 'name' => 'show_cat_title', 'values' => $soption, 'default' => '1'), array('type' => 'switch', 'label' => $this->l('Show Category Description'), 'name' => 'show_description', 'values' => $soption, 'default' => '0'), array('type' => 'text', 'label' => $this->l('Category Description Limit'), 'name' => 'limit_description', 'default' => 25), array('type' => 'switch', 'label' => $this->l('Show Sub Categories'), 'name' => 'show_sub_category', 'values' => $soption, 'default' => '0'), array('type' => 'text', 'label' => $this->l('Sub Category Limit'), 'name' => 'limit_subcategory', 'default' => 5), array('type' => 'switch', 'label' => $this->l('Show Product Number'), 'name' => 'show_nb_product', 'values' => $soption, 'default' => '0'), array('type' => 'switch', 'label' => $this->l('Show Products List'), 'name' => 'show_products', 'values' => $soption, 'default' => '0'), array('type' => 'text', 'label' => $this->l('Limit'), 'name' => 'limit', 'default' => 6), array('type' => 'text', 'label' => $this->l('Number Columns On Large Desktops.'), 'name' => 'columns', 'desc' => $this->l('The maximum column items  in tab.'), 'default' => '4'), array('type' => 'text', 'label' => $this->l('Number Columns On Small Desktops'), 'name' => 'nbr_desktops', 'default' => '4'), array('type' => 'text', 'label' => $this->l('Number Columns On Tablets'), 'name' => 'nbr_tablets', 'default' => '2'), array('type' => 'text', 'label' => $this->l('Number Columns On Mobile'), 'name' => 'nbr_mobile', 'default' => '1'), array('type' => 'select', 'label' => $this->l('List Mode'), 'name' => 'list_mode', 'options' => array('query' => $lists, 'id' => 'value', 'name' => 'text'), 'default' => 'grid')), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'));
     $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
     $fields_value = $this->getConfigFieldsValues($data);
     $selected_cat = $values['categoryBox'];
     $fields_value['categoryBox'] = $values['categoryBox'] ? explode(',', $values['categoryBox']) : array();
     $fields_value['categorytab'] = $values['categorytab'] ? Tools::jsonDecode($values['categorytab'], true) : '';
     $helper->tpl_vars = array('fields_value' => $fields_value, 'languages' => Context::getContext()->controller->getLanguages(), 'id_language' => $default_lang);
     return $helper->generateForm($this->fields_form);
 }
开发者ID:vuduykhuong1412,项目名称:GitHub,代码行数:23,代码来源:categoriesinfo.php


示例9: renderForm

 public function renderForm($data)
 {
     $helper = $this->getFormHelper();
     $this->fields_form[1]['form'] = array('input' => array(array('type' => 'category_tab', 'label' => 'Categories', 'name' => 'categorytab', 'default' => ''), array('type' => 'categoryBox', 'label' => 'Categories', 'name' => 'categoryBox', 'default' => '')));
     $values = $this->getConfigFieldsValues($data);
     $selected_cat = $values['categoryBox'];
     $categories = explode(',', $selected_cat);
     $root = Category::getRootCategory();
     $tree = new HelperTreeCategories('associated-categories-tree', 'Associated categories');
     $tree->setRootCategory($root->id)->setUseCheckBox(true)->setUseSearch(true)->setSelectedCategories($categories);
     $category_tpl = $tree->render();
     $orders = array(array('value' => 'date_add', 'name' => $this->l('Date Add')), array('value' => 'date_add DESC', 'name' => $this->l('Date Add DESC')), array('value' => 'name', 'name' => $this->l('Name')), array('value' => 'name DESC', 'name' => $this->l('Name DESC')), array('value' => 'quantity', 'name' => $this->l('Quantity')), array('value' => 'quantity DESC', 'name' => $this->l('Quantity DESC')), array('value' => 'price', 'name' => $this->l('Price')), array('value' => 'price DESC', 'name' => $this->l('Price DESC')));
     $lists = array(array('value' => 'grid', 'text' => $this->l('Grid')), array('value' => 'list1', 'text' => $this->l('List 1')), array('value' => 'list2', 'text' => $this->l('List 2')));
     $modes = array(array('value' => 'normal', 'text' => $this->l('Normal')), array('value' => 'carousel', 'text' => $this->l('Carousel')));
     $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.')), 'input' => array(array('type' => 'category_tab', 'label' => $this->l('Categories'), 'name' => 'categorytab', 'category_tpl' => $category_tpl, 'default' => ''), array('type' => 'categoryBox', 'label' => '', 'name' => 'categoryBox', 'default' => ''), array('type' => 'text', 'label' => $this->l('Limit'), 'name' => 'limit', 'default' => 6), array('type' => 'select', 'label' => $this->l('Order By'), 'name' => 'order_by', 'options' => array('query' => $orders, 'id' => 'value', 'name' => 'name'), 'default' => 'date_add DESC'), array('type' => 'select', 'label' => $this->l('Display Mode'), 'name' => 'display_mode', 'options' => array('query' => $modes, 'id' => 'value', 'name' => 'text'), 'default' => 'carousel'), array('type' => 'text', 'label' => $this->l('Number Columns On Large Desktops.'), 'name' => 'columns', 'desc' => $this->l('The maximum column items  in tab.'), 'default' => '4'), array('type' => 'text', 'label' => $this->l('Number Columns On Small Desktops'), 'name' => 'nbr_desktops', 'default' => '4'), array('type' => 'text', 'label' => $this->l('Number Columns On Tablets'), 'name' => 'nbr_tablets', 'default' => '2'), array('type' => 'text', 'label' => $this->l('Number Columns On Mobile'), 'name' => 'nbr_mobile', 'default' => '1'), array('type' => 'select', 'label' => $this->l('List Mode'), 'name' => 'list_mode', 'options' => array('query' => $lists, 'id' => 'value', 'name' => 'text'), 'default' => 'grid')), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'));
     $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
     $fields_value = $this->getConfigFieldsValues($data);
     $selected_cat = $values['categoryBox'];
     $fields_value['categoryBox'] = $values['categoryBox'] ? explode(',', $values['categoryBox']) : array();
     $fields_value['categorytab'] = $values['categorytab'] ? Tools::jsonDecode($values['categorytab'], true) : '';
     $helper->tpl_vars = array('fields_value' => $fields_value, 'languages' => Context::getContext()->controller->getLanguages(), 'id_language' => $default_lang);
     return $helper->generateForm($this->fields_form);
 }
开发者ID:vuduykhuong1412,项目名称:GitHub,代码行数:23,代码来源:categoriestabs.php


示例10: _displayForm

 private function _displayForm()
 {
     /* Gets Slides */
     $id_lang = $this->context->cookie->id_lang;
     $root_cate_id = Configuration::get('ROOT_CATEGORY');
     $id_category = Tools::getValue('id_category', $root_cate_id);
     $current_cate = new Category($id_category, $id_lang);
     $parent_cate = new Category($current_cate->id_parent, $id_lang);
     $categories = Category::getChildren($id_category, $id_lang);
     $displayList = false;
     $slides = array();
     if (Tools::getValue('id_category') && $id_category > $root_cate_id) {
         $displayList = true;
         $slides = $this->getSlides(null, $id_category);
     }
     //category tree
     // Generate category selection tree
     $tree = new HelperTreeCategories('categories-tree', $this->l('Filter by category'));
     $tree->setAttribute('is_category_filter', (bool) $id_category)->setAttribute('base_url', preg_replace('#&id_category=[0-9]*#', '', AdminController::$currentIndex) . '&token=' . Tools::getAdminTokenLite('AdminModules'))->setInputName('id-category')->setSelectedCategories(array((int) $id_category));
     $categoryTree = $tree->render();
     $this->context->smarty->assign(array('slide_width' => Configuration::get('CATESLIDER_WIDTH'), 'slide_height' => Configuration::get('CATESLIDER_HEIGHT'), 'slide_speed' => Configuration::get('CATESLIDER_SPEED'), 'slide_pause' => Configuration::get('CATESLIDER_PAUSE'), 'slide_loop' => Configuration::get('CATESLIDER_LOOP'), 'categoryTree' => $categoryTree, 'displayList' => $displayList, 'current_cate' => $current_cate, 'slides' => $slides));
     return $this->display(__FILE__, 'views/templates/admin/main.tpl');
 }
开发者ID:zangles,项目名称:lennyba,代码行数:23,代码来源:categoryslider.php


示例11: renderForm

 public function renderForm()
 {
     if (!($group = $this->loadObject(true))) {
         return;
     }
     $this->fields_form = array('legend' => array('title' => $this->l('Customer group'), 'icon' => 'icon-group'), 'submit' => array('title' => $this->l('Save')), 'input' => array(array('type' => 'text', 'label' => $this->l('Name'), 'name' => 'name', 'required' => true, 'lang' => true, 'col' => 4, 'hint' => $this->l('Forbidden characters:') . ' 0-9!&amp;lt;&amp;gt;,;?=+()@#"�{}_$%:'), array('type' => 'text', 'label' => $this->l('Discount'), 'name' => 'reduction', 'suffix' => '%', 'col' => 1, 'hint' => $this->l('Automatically apply this value as a discount on all products for members of this customer group.')), array('type' => 'select', 'label' => $this->l('Price display method'), 'name' => 'price_display_method', 'col' => 2, 'hint' => $this->l('How prices are displayed in the order summary for this customer group.'), 'options' => array('query' => array(array('id_method' => PS_TAX_EXC, 'name' => $this->l('Tax excluded')), array('id_method' => PS_TAX_INC, 'name' => $this->l('Tax included'))), 'id' => 'id_method', 'name' => 'name')), array('type' => 'switch', 'label' => $this->l('Show prices'), 'name' => 'show_prices', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'show_prices_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'show_prices_off', 'value' => 0, 'label' => $this->l('Disabled'))), 'hint' => $this->l('Customers in this group can view prices.')), array('type' => 'group_discount_category', 'label' => $this->l('Category discount'), 'name' => 'reduction', 'values' => $group->id ? $this->formatCategoryDiscountList((int) $group->id) : array()), array('type' => 'modules', 'label' => $this->l('Modules Authorization'), 'name' => 'auth_modules', 'values' => $this->formatModuleListAuth($group->id))));
     if (Shop::isFeatureActive()) {
         $this->fields_form['input'][] = array('type' => 'shop', 'label' => $this->l('Shop association'), 'name' => 'checkBoxShopAsso');
     }
     if (Tools::getIsset('addgroup')) {
         $this->fields_value['price_display_method'] = Configuration::get('PRICE_DISPLAY_METHOD');
     }
     $this->fields_value['reduction'] = isset($group->reduction) ? $group->reduction : 0;
     $tree = new HelperTreeCategories('categories-tree');
     $this->tpl_form_vars['categoryTreeView'] = $tree->setRootCategory((int) Category::getRootCategory()->id)->render();
     return parent::renderForm();
 }
开发者ID:IngenioContenidoDigital,项目名称:americana,代码行数:17,代码来源:AdminGroupsController.php


示例12: displayAjaxGetCategoriesFromRootCategory

 public function displayAjaxGetCategoriesFromRootCategory()
 {
     if (Tools::isSubmit('id_category')) {
         $selected_cat = array((int) Tools::getValue('id_category'));
         $children = Category::getChildren((int) Tools::getValue('id_category'), $this->context->language->id);
         foreach ($children as $child) {
             $selected_cat[] = $child['id_category'];
         }
         $helper = new HelperTreeCategories('categories-tree', null, (int) Tools::getValue('id_category'), null, false);
         $this->content = $helper->setSelectedCategories($selected_cat)->setUseSearch(true)->setUseCheckBox(true)->render();
     }
     parent::displayAjax();
 }
开发者ID:gks-stage,项目名称:prestashop,代码行数:13,代码来源:AdminShopController.php


示例13: initFormAssociations

 public function initFormAssociations($obj)
 {
     $product = $obj;
     $data = $this->createTemplate($this->tpl_form);
     // Prepare Categories tree for display in Associations tab
     $root = Category::getRootCategory();
     $default_category = $this->context->cookie->id_category_products_filter ? $this->context->cookie->id_category_products_filter : Context::getContext()->shop->id_category;
     if (!$product->id || !$product->isAssociatedToShop()) {
         $selected_cat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->default_form_language);
     } else {
         if (Tools::isSubmit('categoryBox')) {
             $selected_cat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->default_form_language);
         } else {
             $selected_cat = Product::getProductCategoriesFull($product->id, $this->default_form_language);
         }
     }
     // Multishop block
     $data->assign('feature_shop_active', Shop::isFeatureActive());
     $helper = new HelperForm();
     if ($this->object && $this->object->id) {
         $helper->id = $this->object->id;
     } else {
         $helper->id = null;
     }
     $helper->table = $this->table;
     $helper->identifier = $this->identifier;
     // Accessories block
     $accessories = Product::getAccessoriesLight($this->context->language->id, $product->id);
     if ($post_accessories = Tools::getValue('inputAccessories')) {
         $post_accessories_tab = explode('-', Tools::getValue('inputAccessories'));
         foreach ($post_accessories_tab as $accessory_id) {
             if (!$this->haveThisAccessory($accessory_id, $accessories) && ($accessory = Product::getAccessoryById($accessory_id))) {
                 $accessories[] = $accessory;
             }
         }
     }
     $data->assign('accessories', $accessories);
     $product->manufacturer_name = Manufacturer::getNameById($product->id_manufacturer);
     $categories = array();
     foreach ($selected_cat as $key => $category) {
         $categories[] = $key;
     }
     $tree = new HelperTreeCategories('associated-categories-tree', 'Associated categories');
     $tree->setTemplate('tree_associated_categories.tpl')->setHeaderTemplate('tree_associated_header.tpl')->setRootCategory($root->id)->setUseCheckBox(true)->setUseSearch(true)->setSelectedCategories($categories);
     $data->assign(array('default_category' => $default_category, 'selected_cat_ids' => implode(',', array_keys($selected_cat)), 'selected_cat' => $selected_cat, 'id_category_default' => $product->getDefaultCategory(), 'category_tree' => $tree->render(), 'product' => $product, 'link' => $this->context->link, 'is_shop_context' => Shop::getContext() == Shop::CONTEXT_SHOP));
     $this->tpl_form_vars['custom_form'] = $data->fetch();
 }
开发者ID:,项目名称:,代码行数:47,代码来源:


示例14: getContent


//.........这里部分代码省略.........
                        Db::getInstance()->execute('
					DELETE FROM ' . _DB_PREFIX_ . 'layered_filter
					WHERE id_layered_filter = ' . (int) Tools::getValue('id_layered_filter') . ' LIMIT 1');
                        $this->buildLayeredCategories();
                        $message = $this->displayConfirmation($this->l('Filter template deleted, categories updated (reverted to default Filter template).'));
                    } else {
                        $message = $this->displayError($this->l('Filter template not found'));
                    }
                }
            }
        }
        $category_box = array();
        $attribute_groups 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Helper_Admin类代码示例发布时间:2022-05-23
下一篇:
PHP HelperList类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap