当前位置: 首页>>代码示例>>PHP>>正文


PHP HelperTreeCategories::setRootCategory方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例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' => '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

示例7: 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

示例8: 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

示例9: 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

示例10: getContent


//.........这里部分代码省略.........
					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 = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT ag.id_attribute_group, ag.is_color_group, agl.name, COUNT(DISTINCT(a.id_attribute)) n
			FROM ' . _DB_PREFIX_ . 'attribute_group ag
			LEFT JOIN ' . _DB_PREFIX_ . 'attribute_group_lang agl ON (agl.id_attribute_group = ag.id_attribute_group)
			LEFT JOIN ' . _DB_PREFIX_ . 'attribute a ON (a.id_attribute_group = ag.id_attribute_group)
			WHERE agl.id_lang = ' . (int) $cookie->id_lang . '
			GROUP BY ag.id_attribute_group');
        $features = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT fl.id_feature, fl.name, COUNT(DISTINCT(fv.id_feature_value)) n
			FROM ' . _DB_PREFIX_ . 'feature_lang fl
			LEFT JOIN ' . _DB_PREFIX_ . 'feature_value fv ON (fv.id_feature = fl.id_feature)
			WHERE (fv.custom IS NULL OR fv.custom = 0) AND fl.id_lang = ' . (int) $cookie->id_lang . '
			GROUP BY fl.id_feature');
        if (Shop::isFeatureActive() && count(Shop::getShops(true, null, true)) > 1) {
            $helper = new HelperForm();
            $helper->id = Tools::getValue('id_layered_filter', null);
            $helper->table = 'layered_filter';
            $helper->identifier = 'id_layered_filter';
            $this->context->smarty->assign('asso_shops', $helper->renderAssoShop());
        }
        if (version_compare(_PS_VERSION_, '1.6.0', '>=') === true) {
            $tree_categories_helper = new HelperTreeCategories('categories-treeview');
            $tree_categories_helper->setRootCategory(Shop::getContext() == Shop::CONTEXT_SHOP ? Category::getRootCategory()->id_category : 0)->setUseCheckBox(true);
        } else {
            if (Shop::getContext() == Shop::CONTEXT_SHOP) {
                $root_category = Category::getRootCategory();
                $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name);
            } else {
                $root_category = array('id_category' => '0', 'name' => $this->l('Root'));
            }
            $tree_categories_helper = new Helper();
        }
        $module_url = Tools::getProtocol(Tools::usingSecureMode()) . $_SERVER['HTTP_HOST'] . $this->getPathUri();
        if (method_exists($this->context->controller, 'addJquery')) {
            $this->context->controller->addJS($this->_path . 'js/blocklayered_admin.js');
            if (version_compare(_PS_VERSION_, '1.6.0.3', '>=') === true) {
                $this->context->controller->addjqueryPlugin('sortable');
            } elseif (version_compare(_PS_VERSION_, '1.6.0', '>=') === true) {
                $this->context->controller->addJS(_PS_JS_DIR_ . 'jquery/plugins/jquery.sortable.js');
            } else {
                $this->context->controller->addJS($this->_path . 'js/jquery.sortable.js');
            }
        }
        if (version_compare(_PS_VERSION_, '1.6.0', '>=') === true) {
            $this->context->controller->addCSS($this->_path . 'css/blocklayered_admin_1.6.css');
        } else {
            $this->context->controller->addCSS($this->_path . 'css/blocklayered_admin.css');
        }
        if (Tools::getValue('add_new_filters_template')) {
            $this->context->smarty->assign(array('current_url' => $this->context->link->getAdminLink('AdminModules') . '&configure=blocklayered&tab_module=front_office_features&module_name=blocklayered', 'uri' => $this->getPathUri(), 'id_layered_filter' => 0, 'template_name' => sprintf($this->l('My template - %s'), date('Y-m-d')), 'attribute_groups' => $attribute_groups, 'features' => $features, 'total_filters' => 6 + count($attribute_groups) + count($features)));
            if (version_compare(_PS_VERSION_, '1.6.0', '>=') === true) {
                $this->context->smarty->assign('categories_tree', $tree_categories_helper->render());
            } else {
                $this->context->smarty->assign('categories_tree', $tree_categories_helper->renderCategoryTree($root_category, array(), 'categoryBox'));
            }
开发者ID:Beattle,项目名称:perrino-shop,代码行数:67,代码来源:blocklayered.php

示例11: generate

 public function generate()
 {
     $this->tpl = $this->createTemplate($this->base_tpl);
     if (is_null($this->submit_action)) {
         $this->submit_action = 'submitAdd' . $this->table;
     }
     $categories = true;
     $color = true;
     $date = true;
     $tinymce = true;
     $textarea_autosize = true;
     $file = true;
     foreach ($this->fields_form as $fieldset_key => &$fieldset) {
         if (isset($fieldset['form']['tabs'])) {
             $tabs[] = $fieldset['form']['tabs'];
         }
         if (isset($fieldset['form']['input'])) {
             foreach ($fieldset['form']['input'] as $key => &$params) {
                 // If the condition is not met, the field will not be displayed
                 if (isset($params['condition']) && !$params['condition']) {
                     unset($this->fields_form[$fieldset_key]['form']['input'][$key]);
                 }
                 switch ($params['type']) {
                     case 'select':
                         $field_name = (string) $params['name'];
                         // If multiple select check that 'name' field is suffixed with '[]'
                         if (isset($params['multiple']) && $params['multiple'] && stripos($field_name, '[]') === false) {
                             $params['name'] .= '[]';
                         }
                         break;
                     case 'categories':
                         if ($categories) {
                             if (!isset($params['tree']['id'])) {
                                 throw new PrestaShopException('Id must be filled for categories tree');
                             }
                             $tree = new HelperTreeCategories($params['tree']['id'], isset($params['tree']['title']) ? $params['tree']['title'] : null);
                             if (isset($params['name'])) {
                                 $tree->setInputName($params['name']);
                             }
                             if (isset($params['tree']['selected_categories'])) {
                                 $tree->setSelectedCategories($params['tree']['selected_categories']);
                             }
                             if (isset($params['tree']['disabled_categories'])) {
                                 $tree->setDisabledCategories($params['tree']['disabled_categories']);
                             }
                             if (isset($params['tree']['root_category'])) {
                                 $tree->setRootCategory($params['tree']['root_category']);
                             }
                             if (isset($params['tree']['use_search'])) {
                                 $tree->setUseSearch($params['tree']['use_search']);
                             }
                             if (isset($params['tree']['use_checkbox'])) {
                                 $tree->setUseCheckBox($params['tree']['use_checkbox']);
                             }
                             if (isset($params['tree']['set_data'])) {
                                 $tree->setData($params['tree']['set_data']);
                             }
                             $this->context->smarty->assign('categories_tree', $tree->render());
                             $categories = false;
                         }
                         break;
                     case 'file':
                         $uploader = new HelperUploader();
                         $uploader->setId(isset($params['id']) ? $params['id'] : null);
                         $uploader->setName($params['name']);
                         $uploader->setUrl(isset($params['url']) ? $params['url'] : null);
                         $uploader->setMultiple(isset($params['multiple']) ? $params['multiple'] : false);
                         $uploader->setUseAjax(isset($params['ajax']) ? $params['ajax'] : false);
                         $uploader->setMaxFiles(isset($params['max_files']) ? $params['max_files'] : null);
                         if (isset($params['files']) && $params['files']) {
                             $uploader->setFiles($params['files']);
                         } elseif (isset($params['image']) && $params['image']) {
                             // Use for retrocompatibility
                             $uploader->setFiles(array(0 => array('type' => HelperUploader::TYPE_IMAGE, 'image' => isset($params['image']) ? $params['image'] : null, 'size' => isset($params['size']) ? $params['size'] : null, 'delete_url' => isset($params['delete_url']) ? $params['delete_url'] : null)));
                         }
                         if (isset($params['file']) && $params['file']) {
                             // Use for retrocompatibility
                             $uploader->setFiles(array(0 => array('type' => HelperUploader::TYPE_FILE, 'size' => isset($params['size']) ? $params['size'] : null, 'delete_url' => isset($params['delete_url']) ? $params['delete_url'] : null, 'download_url' => isset($params['file']) ? $params['file'] : null)));
                         }
                         if (isset($params['thumb']) && $params['thumb']) {
                             // Use for retrocompatibility
                             $uploader->setFiles(array(0 => array('type' => HelperUploader::TYPE_IMAGE, 'image' => isset($params['thumb']) ? '<img src="' . $params['thumb'] . '" alt="' . (isset($params['title']) ? $params['title'] : '') . '" title="' . (isset($params['title']) ? $params['title'] : '') . '" />' : null)));
                         }
                         $uploader->setTitle(isset($params['title']) ? $params['title'] : null);
                         $params['file'] = $uploader->render();
                         break;
                     case 'color':
                         if ($color) {
                             // Added JS file
                             $this->context->controller->addJqueryPlugin('colorpicker');
                             $color = false;
                         }
                         break;
                     case 'date':
                         if ($date) {
                             $this->context->controller->addJqueryUI('ui.datepicker');
                             $date = false;
                         }
                         break;
                     case 'textarea':
//.........这里部分代码省略.........
开发者ID:prestanesia,项目名称:PrestaShop,代码行数:101,代码来源:HelperForm.php


注:本文中的HelperTreeCategories::setRootCategory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。