public function renderForm($args, $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')); $source = array(array('value' => 'pcategories', 'name' => $this->l('Category')), array('value' => 'ptype', 'name' => $this->l('Product')), array('value' => 'pmanufacturers', 'name' => $this->l('Manufacturers')), array('value' => 'pproductids', 'name' => $this->l('Product Ids'))); $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'))); $pmanufacturers = $this->getManufacturers(Context::getContext()->shop->id); $selected_cat = array(); if ($data) { if ($data['params'] && isset($data['params']['categories']) && $data['params']['categories']) { $selected_cat = $data['params']['categories']; } if ($data['params'] && isset($data['params']['pmanufacturer']) && $data['params']['pmanufacturer']) { $data['params']['pmanufacturer[]'] = $data['params']['pmanufacturer']; } } $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Carousel Form.')), 'input' => array(array('type' => 'select', 'label' => $this->l('Source'), 'name' => 'source', 'class' => 'group', 'default' => 'date_add', 'options' => array('query' => $source, 'id' => 'value', 'name' => 'name')), array('type' => 'categories', 'label' => $this->l('Categories'), 'name' => 'categories', 'default' => '', 'tree' => array('id' => 'pcategories', 'title' => 'Categories', 'selected_categories' => $selected_cat, 'use_search' => true, 'use_checkbox' => true)), array('type' => 'select', 'label' => $this->l('Products List Type'), 'name' => 'ptype', 'options' => array('query' => $types, 'id' => 'value', 'name' => 'text'), 'default' => "newest", 'desc' => $this->l('Select a Product List Type')), array('type' => 'text', 'label' => $this->l('Product Ids'), 'name' => 'pproductids', 'default' => ''), array('type' => 'select', 'label' => $this->l('Manufacturer'), 'name' => 'pmanufacturer[]', 'id' => 'pmanufacturers', 'default' => '', 'multiple' => true, 'options' => array('query' => $pmanufacturers, 'id' => 'id_manufacturer', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Order By'), 'desc' => $this->l('The maximum number of products in each page Carousel (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 Carousel (default: 3).'), 'name' => 'orderway', 'default' => 'date_add', 'options' => array('query' => $orderway, 'id' => 'orderway', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Limit'), 'name' => 'itemstab', 'default' => 6, 'desc' => $this->l('The maximum number of products in each Carousel (default: 6).')), array('type' => 'select', 'label' => $this->l('Carousel type'), 'name' => 'carousel_type', 'default' => LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'class' => 'form-action', 'options' => array('query' => LeomanagewidgetsOwlCarousel::getCaroulseOptions(), 'id' => 'value', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Items Per Page'), 'name' => 'itemspage', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('The maximum number of products in each page Carousel (default: 3).')), array('type' => 'text', 'label' => $this->l('Colums In Tab'), 'name' => 'columns', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => 'The maximum column products in each page Carousel (default: 3).'), array('type' => 'text', 'label' => $this->l('Interval'), 'name' => 'interval', 'default' => 8000, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('Enter Time(miniseconds) to play carousel. Value 0 to stop.'))), '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'))); // Add library owl carousel $owl_carousel = new LeomanagewidgetsOwlCarousel(); $arrays = $owl_carousel->getOwlCarouselAdminFormOptions(); foreach ($arrays as $key => $array) { $this->fields_form[1]['form']['input'][] = $array; } $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); }
public function renderForm($args, $data) { # validate module unset($args); $helper = $this->getFormHelper(); $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', 'type' => 'submit', 'name' => 'saveandstayleotempcp'), array('title' => $this->l('Save'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveleotempcp'))); // Add library owl carousel $owl_carousel = new LeomanagewidgetsOwlCarousel(); $arrays = $owl_carousel->getOwlCarouselAdminFormOptions(); foreach ($arrays as $key => $array) { # validate module unset($key); $this->fields_form[1]['form']['input'][] = $array; } if (!isset($data['params']['nbcusthtml']) || !$data['params']['nbcusthtml']) { $nbcusthtml = 5; } else { $nbcusthtml = $data['params']['nbcusthtml']; } for ($i = 1; $i <= $nbcusthtml; $i++) { $tmpArray = array('type' => 'text', 'label' => $this->l('Title ' . $i), 'name' => 'title_' . $i, 'default' => 'Title Sample ' . $i, 'lang' => true); $this->fields_form[1]['form']['input'][] = $tmpArray; $tmpArray = array('type' => 'text', 'label' => $this->l('Header ' . $i), 'name' => 'header_' . $i, 'default' => 'Header Sample ' . $i, 'lang' => true); $this->fields_form[1]['form']['input'][] = $tmpArray; $tmpArray = array('type' => 'textarea', 'label' => $this->l('Content ' . $i), 'name' => 'content_' . $i, 'default' => 'Content Sample ' . $i, 'cols' => 40, 'rows' => 10, 'value' => true, 'lang' => true, 'autoload_rte' => true, 'desc' => $this->l('Enter Content ' . $i)); $this->fields_form[1]['form']['input'][] = $tmpArray; } $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); // echo "<pre>";print_r($nbcusthtml);die; return $helper->generateForm($this->fields_form); }
public function renderForm($args, $data) { # validate module unset($args); $helper = $this->getFormHelper(); $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form')), 'input' => array(array('type' => 'radio', 'label' => $this->l('Show Button Controls'), 'name' => 'show_controls', 'default' => '', 'values' => array(array('id' => 'no', 'value' => false, 'label' => $this->l('No')), array('id' => 'yes', 'value' => true, 'label' => $this->l('Yes')))), array('type' => 'text', 'label' => $this->l('Start Slide'), 'name' => 'startSlide', 'default' => 0), array('type' => 'text', 'label' => $this->l('Number of Customer HTML'), 'name' => 'nbcusthtml', 'default' => 5, 'desc' => 'Enter a number greater 0'), array('type' => 'select', 'label' => $this->l('Carousel type'), 'name' => 'carousel_type', 'default' => LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'class' => 'form-action', 'options' => array('query' => LeomanagewidgetsOwlCarousel::getCaroulseOptions(), 'id' => 'value', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Interval'), 'name' => 'interval', 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'default' => 4000), array('type' => 'select', 'label' => $this->l('Auto Play'), 'name' => 'auto_play', 'default' => '', 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'options' => array('query' => array(array('id' => false, 'name' => $this->l('No')), array('id' => true, 'name' => $this->l('Yes'))), 'id' => 'id', 'name' => 'name'))), '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'))); // Add library owl carousel $owl_carousel = new LeomanagewidgetsOwlCarousel(); $arrays = $owl_carousel->getOwlCarouselAdminFormOptions(); foreach ($arrays as $key => $array) { # validate module unset($key); $this->fields_form[1]['form']['input'][] = $array; } if (!isset($data['params']['nbcusthtml']) || !$data['params']['nbcusthtml']) { $nbcusthtml = 5; } else { $nbcusthtml = $data['params']['nbcusthtml']; } for ($i = 1; $i <= $nbcusthtml; $i++) { $tmpArray = array('type' => 'text', 'label' => $this->l('Title ' . $i), 'name' => 'title_' . $i, 'default' => 'Title Sample ' . $i, 'lang' => true); $this->fields_form[1]['form']['input'][] = $tmpArray; $tmpArray = array('type' => 'text', 'label' => $this->l('Header ' . $i), 'name' => 'header_' . $i, 'default' => 'Header Sample ' . $i, 'lang' => true); $this->fields_form[1]['form']['input'][] = $tmpArray; $tmpArray = array('type' => 'textarea', 'label' => $this->l('Content ' . $i), 'name' => 'content_' . $i, 'default' => 'Content Sample ' . $i, 'cols' => 40, 'rows' => 10, 'value' => true, 'lang' => true, 'autoload_rte' => true, 'desc' => $this->l('Enter Content ' . $i)); $this->fields_form[1]['form']['input'][] = $tmpArray; } $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); // echo "<pre>";print_r($nbcusthtml);die; return $helper->generateForm($this->fields_form); }
public function renderForm($args, $data) { # validate module unset($args); $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'))); $selected_cat = array(); if ($data) { if ($data['params'] && $data['params']['categories']) { $selected_cat = $data['params']['categories']; } } $helper = $this->getFormHelper(); $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Carousel Form.')), 'input' => array(array('type' => 'categories', 'label' => $this->l('Categories'), 'name' => 'categories', 'default' => '', 'tree' => array('id' => 'categories-tree', 'title' => 'Categories', 'selected_categories' => $selected_cat, 'use_search' => true, 'use_checkbox' => true)), 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('Limit'), 'name' => 'itemstab', 'default' => 6, 'desc' => $this->l('The maximum number of products in each (default: 6).')), array('type' => 'select', 'label' => $this->l('Carousel type'), 'name' => 'carousel_type', 'default' => LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'class' => 'form-action', 'options' => array('query' => LeomanagewidgetsOwlCarousel::getCaroulseOptions(), 'id' => 'value', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Items Per Page'), 'name' => 'itemspage', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('The maximum number of products in each page (default: 3).')), array('type' => 'text', 'label' => $this->l('Colums In Tab'), 'name' => 'columns', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('The maximum column products in each page (default: 3).'))), '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'))); // Add library owl carousel $owl_carousel = new LeomanagewidgetsOwlCarousel(); $arrays = $owl_carousel->getOwlCarouselAdminFormOptions(); foreach ($arrays as $key => $array) { # validate module unset($key); $this->fields_form[1]['form']['input'][] = $array; } $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); }
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' => '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('Limit'), 'name' => 'itemstab', 'default' => 6, 'desc' => $this->l('The maximum number of products in each tab (default: 6).')), array('type' => 'select', 'label' => $this->l('Carousel type'), 'name' => 'carousel_type', 'default' => LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'class' => 'form-action', 'options' => array('query' => LeomanagewidgetsOwlCarousel::getCaroulseOptions(), 'id' => 'value', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Number of Items In Page'), 'name' => 'itemspage', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, '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, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('The maximum number of products in each page tab (default: 3).')), array('type' => 'text', 'label' => $this->l('Interval'), 'name' => 'interval', 'default' => 8000, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('Enter Time(miniseconds) to play carousel. Value 0 to stop.'))), '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'))); // Add library owl carousel $owl_carousel = new LeomanagewidgetsOwlCarousel(); $arrays = $owl_carousel->getOwlCarouselAdminFormOptions(); foreach ($arrays as $key => $array) { # validate module $this->fields_form[1]['form']['input'][] = $array; } $this->fields_form[1]['form']['input'][] = array('type' => 'setting_tab', 'name' => 'setting_tab', 'lang' => true, 'tree' => $tree->render(), 'default' => ''); $theme_dir = Context::getContext()->shop->theme_directory; $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_dir . '/img/icontab/', 'images' => LeoWidgetBase::getImageList(_PS_ROOT_DIR_ . '/themes/' . $theme_dir . '/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); }
public function renderForm($args, $data) { # validate module unset($args); $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'))); $selected_cat = array(); if ($data) { if ($data['params'] && $data['params']['categories']) { $selected_cat = $data['params']['categories']; } } $helper = $this->getFormHelper(); $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'))); // Add library owl carousel $owl_carousel = new LeomanagewidgetsOwlCarousel(); $arrays = $owl_carousel->getOwlCarouselAdminFormOptions(); foreach ($arrays as $key => $array) { # validate module unset($key); $this->fields_form[1]['form']['input'][] = $array; } $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); }
public function renderForm($args, $data) { # validate module unset($args); // $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'))); // Add library owl carousel $owl_carousel = new LeomanagewidgetsOwlCarousel(); $arrays = $owl_carousel->getOwlCarouselAdminFormOptions(); foreach ($arrays as $key => $array) { # validate module unset($key); $this->fields_form[1]['form']['input'][] = $array; } $this->fields_form[1]['form']['input'][] = array('type' => 'setting_tab', 'name' => 'setting_tab', 'lang' => true, 'tree' => $tree->render(), 'default' => ''); $theme_dir = Context::getContext()->shop->theme_directory; $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_dir . '/img/icontab/', 'images' => LeoWidgetBase::getImageList(_PS_ROOT_DIR_ . '/themes/' . $theme_dir . '/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); }
public function renderForm($args, $data) { $helper = $this->getFormHelper(); $imagesTypes = ImageType::getImagesTypes('manufacturers'); $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.')), 'input' => array(array('type' => 'select', 'label' => $this->l('Image'), 'desc' => $this->l('Select type image for manufacture.'), 'name' => 'image', 'default' => 'small' . '_default', 'options' => array('query' => $imagesTypes, 'id' => 'name', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Limit'), 'name' => 'itemstab', 'default' => 6, 'desc' => $this->l('The maximum number of products in each Carousel (default: 6).')), array('type' => 'select', 'label' => $this->l('Carousel type'), 'name' => 'carousel_type', 'default' => LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'class' => 'form-action', 'options' => array('query' => LeomanagewidgetsOwlCarousel::getCaroulseOptions(), 'id' => 'value', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Items Per Page'), 'name' => 'itemspage', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('The maximum number of products in each page Carousel (default: 3).')), array('type' => 'text', 'label' => $this->l('Colums In Tab'), 'name' => 'columns', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => 'The maximum column products in each page Carousel (default: 3).'), array('type' => 'text', 'label' => $this->l('Interval'), 'name' => 'interval', 'default' => 8000, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('Enter Time(miniseconds) to play carousel. Value 0 to stop.'))), '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'))); // Add library owl carousel $owl_carousel = new LeomanagewidgetsOwlCarousel(); $arrays = $owl_carousel->getOwlCarouselAdminFormOptions(); foreach ($arrays as $array) { # validate module $this->fields_form[1]['form']['input'][] = $array; } $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); unset($args); return $helper->generateForm($this->fields_form); }
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'))); $helper = $this->getFormHelper(); $this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Carousel Form.')), 'input' => array(array('type' => 'switch', 'label' => $this->l('Special Tab'), 'name' => 'special_display', 'desc' => $this->l('Show Special Tab.'), 'default' => 1, 'values' => $options), array('type' => 'switch', 'label' => $this->l('BestSeller Tab'), 'name' => 'bestseller_display', 'desc' => $this->l('Show BestSeller Tab.'), 'default' => 1, 'values' => $options), array('type' => 'switch', 'label' => $this->l('Featured Tab'), 'name' => 'featured_display', 'desc' => $this->l('Show Featured Tab.'), 'default' => 1, 'values' => $options), array('type' => 'switch', 'label' => $this->l('New Arrials Tab'), 'name' => 'newarrivals_display', 'desc' => $this->l('Show New Arrials Tab.'), 'default' => 0, 'values' => $options), 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('Limit'), 'name' => 'itemstab', 'default' => 6, 'desc' => $this->l('The maximum number of products in each tab (default: 6).')), array('type' => 'select', 'label' => $this->l('Carousel type'), 'name' => 'carousel_type', 'default' => LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'class' => 'form-action', 'options' => array('query' => LeomanagewidgetsOwlCarousel::getCaroulseOptions(), 'id' => 'value', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Items Per Page'), 'name' => 'itemspage', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('The maximum number of products in each page tab (default: 3).')), array('type' => 'text', 'label' => $this->l('Colums In Tab'), 'name' => 'columns', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('The maximum number of products in each page tab (default: 3).')), array('type' => 'text', 'label' => $this->l('Interval'), 'name' => 'interval', 'default' => 8000, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('Enter Time(miniseconds) to play carousel. Value 0 to stop.'))), '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'))); // Add library owl carousel $owl_carousel = new LeomanagewidgetsOwlCarousel(); $arrays = $owl_carousel->getOwlCarouselAdminFormOptions(); foreach ($arrays as $key => $array) { $this->fields_form[1]['form']['input'][] = $array; } $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); }
public function renderForm($args, $data) { $helper = $this->getFormHelper(); $imagesTypes = ImageType::getImagesTypes('manufacturers'); $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', 'type' => 'submit', 'name' => 'saveandstayleotempcp'), array('title' => $this->l('Save'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveleotempcp'))); // Add library owl carousel $owl_carousel = new LeomanagewidgetsOwlCarousel(); $arrays = $owl_carousel->getOwlCarouselAdminFormOptions(); foreach ($arrays as $array) { # validate module $this->fields_form[1]['form']['input'][] = $array; } $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); unset($args); return $helper->generateForm($this->fields_form); }