本文整理汇总了PHP中HelperList::generateList方法的典型用法代码示例。如果您正苦于以下问题:PHP HelperList::generateList方法的具体用法?PHP HelperList::generateList怎么用?PHP HelperList::generateList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HelperList
的用法示例。
在下文中一共展示了HelperList::generateList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderList
public function renderList()
{
$fields = array('city' => array('title' => $this->l('Город'), 'orderby' => false), 'mobile' => array('title' => $this->l('Мобильный'), 'orderby' => false, 'search' => false), 'phone' => array('title' => $this->l('Стационарный'), 'orderby' => false, 'search' => false));
if (Tools::isSubmit('submitFilter')) {
$filterCity = Tools::getValue('Filter_city');
$list = DB::getInstance()->executeS("\n select `c`.`id_city`, `cl`.`name` as `city`, `pc`.`mobile`, `pc`.`phone`\n from `" . _DB_PREFIX_ . "city` as `c`\n left join `" . _DB_PREFIX_ . "city_lang` as `cl` ON `cl`.`id_city` = `c`.`id_city`\n left join `" . _DB_PREFIX_ . "phone_city` as `pc` ON `pc`.`id_city` = `c`.`id_city`\n where `c`.`is_root` = 1 and `cl`.`id_lang` = {$this->context->language->id} AND `cl`.`name` LIKE '%{$filterCity}%'\n ");
} else {
$list = DB::getInstance()->executeS("\n select `c`.`id_city`, `cl`.`name` as `city`, `pc`.`mobile`, `pc`.`phone`\n from `" . _DB_PREFIX_ . "city` as `c`\n left join `" . _DB_PREFIX_ . "city_lang` as `cl` ON `cl`.`id_city` = `c`.`id_city`\n left join `" . _DB_PREFIX_ . "phone_city` as `pc` ON `pc`.`id_city` = `c`.`id_city`\n where `c`.`is_root` = 1 and `cl`.`id_lang` = {$this->context->language->id}\n ");
}
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = false;
$helper->actions = array('edit');
$helper->identifier = 'id_city';
$helper->show_toolbar = false;
$helper->title = $this->l('Телефоны по городам');
$helper->table = '';
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
return $helper->generateList($list, $fields);
}
示例2: getContent
public function getContent()
{
if (Tools::isSubmit('updatePositions')) {
$this->updatePositionsDnd();
}
$helper = new HelperList();
// Obligatoire
$helper->shopLinkType = '';
// Obligatoire. Correspondant souvent à id_*
$helper->identifier = 'id_example_data';
// Permet de ne pas afficher le header complet.
$helper->simple_header = true;
//
$helper->module = $this;
// Important.
$helper->token = Tools::getAdminTokenLite('AdminModules');
// Permet de définir le champ sur lequel est associé les positions.
$helper->position_identifier = 'position';
// Si utilisation des positions, obligatoire.
$helper->orderBy = 'position';
$helper->orderWay = 'ASC';
// Permet de définir l'ID de la table. Le terme "module-" en préfixe est TRES important.
$helper->table_id = 'module-helperlist_positions';
// Ou encore
$helper->table_id = 'module-' . $this->name;
// Permet de récupérer les champs/headers de la liste. On passe par une méthode, par lisitibilité du code.
$fields_list = $this->getListHeader();
// Permet de récupérer les enregistrements/lignes de la liste. On passe par une méthode, par lisibilité du code.
$values = $this->getListValues();
return $helper->generateList($values, $fields_list);
}
示例3: renderList
public function renderList()
{
// Total recipients will be stored in $this->list_total
// ----------------------------------------------------
$recipients = $this->getRecipientsDB();
// Count the duplicates
// --------------------
$request = 'SELECT SUM(duplic - 1)
FROM
(
SELECT COUNT(target) as duplic
FROM ' . _DB_PREFIX_ . 'expressmailing_fax_recipients
WHERE campaign_id= ' . $this->campaign_id . '
GROUP BY target
HAVING COUNT(target) > 1
) as dd';
$this->duplicate_count = Db::getInstance()->getValue($request, false);
// Panel 1 : CSV import
// --------------------
$this->fields_form = array('legend' => array('title' => $this->module->l('Contacts importation (step 3)', 'adminmarketingfstep3'), 'icon' => 'icon-beaker'), 'input' => array(array('type' => _PS_MODE_DEV_ ? 'text' : 'hidden', 'lang' => false, 'label' => 'Ref :', 'name' => 'campaign_id', 'col' => 1, 'readonly' => 'readonly'), array('type' => 'file', 'label' => $this->module->l('Import a csv file :', 'adminmarketingfstep3'), 'name' => 'csv_file', 'required' => true)), 'submit' => array('title' => $this->module->l('Start analysis ...', 'adminmarketingfstep3'), 'name' => 'importCsvStep3', 'icon' => 'process-icon-cogs'), 'buttons' => array(array('type' => 'submit', 'title' => $this->module->l('Clear selection', 'adminmarketingfstep3'), 'icon' => 'process-icon-delete', 'name' => 'clearRecipients', 'class' => 'pull-left'), array('type' => 'submit', 'title' => sprintf($this->module->l('Clear duplicates (%d)', 'adminmarketingfstep3'), $this->duplicate_count), 'icon' => 'process-icon-eraser', 'name' => 'clearDuplicate', 'class' => 'pull-left button-clear-duplicate')));
$output = parent::renderForm();
// Panel 2 : Recipients preview
// ----------------------------
$helper_list = new HelperList();
$helper_list->no_link = true;
$helper_list->shopLinkType = '';
$helper_list->simple_header = true;
$helper_list->identifier = 'ID';
$helper_list->show_toolbar = false;
$helper_list->table = 'expressmailing_fax_recipients';
$helper_list->imageType = 'jpg';
$fields_list = array('target' => array('title' => $this->module->l('Phone', 'adminmarketingfstep3'), 'width' => 140, 'search' => false, 'type' => 'text'), 'col_1' => array('title' => $this->module->l('Col_1', 'adminmarketingfstep3'), 'width' => 140, 'search' => false, 'type' => 'text'), 'col_2' => array('title' => $this->module->l('Col_2', 'adminmarketingfstep3'), 'width' => 140, 'search' => false, 'type' => 'text'), 'col_3' => array('title' => $this->module->l('Col_3', 'adminmarketingfstep3'), 'width' => 140, 'search' => false, 'type' => 'text'), 'col_4' => array('title' => $this->module->l('Col_4', 'adminmarketingfstep3'), 'width' => 140, 'search' => false, 'type' => 'text'), 'col_5' => array('title' => $this->module->l('Col_5', 'adminmarketingfstep3'), 'width' => 140, 'search' => false, 'type' => 'text'));
$html_list = $helper_list->generateList($recipients, $fields_list);
if (!preg_match('/<table.*<\\/table>/iUs', $html_list, $array_table)) {
$output .= $html_list;
}
$this->fields_form = array('legend' => array('title' => $this->module->l('Recipients preview', 'adminmarketingfstep3') . '<span class="badge">' . $this->list_total . '</span>', 'icon' => 'icon-phone'), 'input' => array(array('type' => 'hidden', 'lang' => false, 'label' => 'Ref :', 'name' => 'campaign_id', 'col' => 1, 'readonly' => 'readonly'), array('type' => 'free', 'name' => 'html_list')), 'submit' => array('title' => $this->module->l('Validate this selection', 'adminmarketingfstep3'), 'name' => 'submitFaxStep3', 'icon' => 'process-icon-next'), 'buttons' => array(array('href' => 'index.php?controller=AdminMarketingFStep2&campaign_id=' . $this->campaign_id . '&token=' . Tools::getAdminTokenLite('AdminMarketingFStep2'), 'title' => $this->module->l('Back', 'adminmarketingfstep3'), 'icon' => 'process-icon-back')));
$this->getFieldsValues();
// Concatenate list and buttons
// ----------------------------
$html_boutons = parent::renderForm();
$output .= preg_replace('/<div class="form-group">/', $array_table[0] . '<div class="form-group">', $html_boutons, 1);
$footer = $this->getTemplatePath() . 'footer.tpl';
$output .= $this->context->smarty->fetch($footer);
return $output;
}
示例4: displayAjaxProductsList
/**
* Listing ajax des produits
*/
public function displayAjaxProductsList()
{
$filterCond = $this->_getProductFilterConditions();
//Récupération des produits
$products = Db::getInstance()->ExecuteS("SELECT p.id_product,p.reference, pl.name \n\t\t\t\t\t\t\tFROM ps_product p\n\t\t\t\t\t\t\tLEFT JOIN ps_product_lang pl ON ( p.id_product = pl.id_product AND pl.id_lang = " . $this->context->language->id . ")\n\t\t\t\t\t\t\t" . $filterCond);
$fields_list = array('id_product' => array('title' => $this->l('id'), 'type' => 'text', 'width' => 50, 'class' => 'product_id product-link'), 'reference' => array('title' => $this->l('ref'), 'type' => 'text', 'width' => 100, 'class' => 'product-link'), 'name' => array('title' => $this->l('name'), 'type' => 'text', 'width' => 150, 'class' => 'product_name product-link'), 'add_link' => array('title' => $this->l('Add to cart link'), 'type' => 'text', 'width' => 150, 'class' => 'product-add-cart-link', 'search' => false));
$productList = new HelperList();
$productList->simple_header = false;
$productList->identifier = 'id_product';
$productList->title = 'Product List';
$productList->table = $this->helper_list_name;
$productList->shopLinkType = '';
$productList->currentIndex = str_replace('index.php', '', $_SERVER['PHP_SELF']) . $this->context->link->getAdminLink('Wysiwyg&module=eicmslinks&action=ProductsList&ajax=1');
$productList->token = $this->token;
$productList->no_link = true;
echo $productList->generateList($products, $fields_list);
}
示例5: renderList
public function renderList()
{
$fields_list = array('id' => array('title' => $this->l('Link ID'), 'type' => 'text'), 'shop_name' => array('title' => $this->l('Shop'), 'type' => 'text'), 'city_name' => array('title' => $this->l('City'), 'type' => 'text'), 'domain' => array('title' => $this->l('URL'), 'type' => 'text'), 'yandex' => array('title' => $this->l('Yandex'), 'type' => 'bool'), 'google' => array('title' => $this->l('Google'), 'type' => 'bool'));
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = false;
$helper->identifier = 'id';
$helper->actions = array('edit', 'delete');
$helper->show_toolbar = false;
$helper->title = $this->l('Link list');
$helper->table = $this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
$links = $this->getLinks();
if (is_array($links) && count($links)) {
return $helper->generateList($links, $fields_list);
} else {
return false;
}
}
示例6: renderList
public function renderList()
{
$this->fields_list = array();
$this->fields_list['nama_bank'] = array('title' => $this->l('Nama Bank'), 'type' => 'text', 'search' => true, 'orderby' => true);
$this->fields_list['no_rek'] = array('title' => $this->l('No Rekening'), 'type' => 'text', 'search' => true, 'orderby' => true);
$this->fields_list['reg_account_name'] = array('title' => $this->l('Account Name'), 'type' => 'text', 'search' => true, 'orderby' => true);
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = false;
$helper->identifier = 'id_accountbank';
$helper->actions = array('edit', 'delete');
$helper->show_toolbar = true;
$helper->imageType = 'jpg';
$helper->toolbar_btn['new'] = array('href' => AdminController::$currentIndex . '&configure=' . $this->name . '&add' . $this->name . '&token=' . $this->token, 'desc' => $this->l('Add new'));
$helper->title = 'DATA ACCOUNT BANK';
$helper->table = $this->name;
$helper->token = $this->token;
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
$content = $this->getListContent();
return $helper->generateList($content, $this->fields_list);
}
示例7: renderList
public function renderList()
{
$fields_list = array('id' => array('title' => $this->l('Id'), 'type' => 'text'), 'text_' . $this->context->language->id => array('title' => $this->l('Text'), 'type' => 'text'), 'url' => array('title' => $this->l('Url'), 'type' => 'text'));
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->identifier = 'id';
$helper->actions = array('edit', 'delete');
$helper->show_toolbar = false;
$helper->title = $this->l('Link list');
$helper->table = $this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
$links = $this->getLinks();
if (is_array($links) && count($links)) {
return $helper->generateList($this->getLinks(), $fields_list);
} else {
return false;
}
}
示例8: ajaxProcess
public function ajaxProcess()
{
// get product list of order
if (Tools::isSubmit('action') && Tools::isSubmit('id') && (Tools::getValue('action') == 'detailsAjax' || Tools::getValue('action') == 'details')) {
// override attributes
$this->identifier = 'id_order_detail';
$this->display = 'list';
$this->lang = false;
$this->explicitSelect = false;
$this->actions = array();
// get current lang id
$lang_id = (int) $this->context->language->id;
// Get order id
$order_id = (int) Tools::getValue('id');
$this->fields_list = array('product_name' => array('title' => $this->l('Product name'), 'callback' => 'getProductLinkTag'), 'product_quantity' => array('title' => $this->l('Quantity'), 'align' => 'center'), 'product_reference' => array('title' => $this->l('Product Reference')), 'unit_price_tax_incl' => array('title' => $this->l('Unit price ti'), 'type' => 'price'), 'total_price_tax_incl' => array('title' => $this->l('Total price ti'), 'type' => 'price'), 'stock_level_color' => array('title' => $this->l('Stock level'), 'align' => 'center', 'callback' => 'gestockLevelColor'));
// Load product attributes with sql override
$this->table = 'order_detail';
unset($this->_join);
$this->_select = null;
$this->_select = 'i.id_image, a.product_name, a.product_quantity, a.product_reference,a.unit_price_tax_incl, a.total_price_tax_incl';
$this->_join = ' LEFT JOIN ' . _DB_PREFIX_ . 'image i ON a.product_id = i.id_product
INNER JOIN ' . _DB_PREFIX_ . 'product_lang pl ON (a.product_id = pl.id_product AND pl.id_lang = ' . (int) $this->context->language->id . ') ';
$this->_where = ' AND a.id_order = ' . $order_id;
$this->_group = ' GROUP BY a.id_order_detail ';
// get list and force no limit clause in the request
$this->getList($lang_id, 'a.product_name', 'ASC', 0, false);
// Render list
$helper = new HelperList();
$helper->bulk_actions = array();
$helper->toolbar_scroll = $this->toolbar_scroll;
$helper->show_toolbar = false;
$helper->actions = $this->actions;
$helper->list_skip_actions = $this->list_skip_actions;
$helper->no_link = true;
$helper->shopLinkType = '';
$helper->identifier = $this->identifier;
// Force render - no filter, form, js, sorting ...
$helper->simple_header = true;
$helper->override_folder = 'advanced_order_ajax/';
$content = $helper->generateList($this->_list, $this->fields_list);
echo Tools::jsonEncode(array('use_parent_structure' => false, 'data' => $content));
} elseif (Tools::isSubmit('task') && Tools::getValue('task') == 'getOrdersWithSameProduct') {
$this->ajaxGetOrdersWithSameProduct();
} elseif (Tools::isSubmit('task') && Tools::getValue('task') == 'getProducts') {
$this->ajaxGetProducts();
} elseif (Tools::isSubmit('task') && Tools::getValue('task') == 'updateOrderStatus') {
include_once _PS_MODULE_DIR_ . 'erpillicopresta/ajax/ajax.php';
} else {
echo 'error';
}
die;
}
示例9: renderView
public function renderView()
{
$this->tpl_view_vars['query'] = Tools::safeOutput($this->query);
$this->tpl_view_vars['show_toolbar'] = true;
if (count($this->errors)) {
return parent::renderView();
} else {
$nb_results = 0;
foreach ($this->_list as $list) {
if ($list != false) {
$nb_results += count($list);
}
}
$this->tpl_view_vars['nb_results'] = $nb_results;
if (isset($this->_list['features']) && count($this->_list['features'])) {
$this->tpl_view_vars['features'] = $this->_list['features'];
}
if (isset($this->_list['categories']) && count($this->_list['categories'])) {
$categories = array();
foreach ($this->_list['categories'] as $category) {
$categories[] = getPath($this->context->link->getAdminLink('AdminCategories', false), $category['id_category']);
}
$this->tpl_view_vars['categories'] = $categories;
}
if (isset($this->_list['products']) && count($this->_list['products'])) {
$view = '';
$this->initProductList();
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->identifier = 'id_product';
$helper->actions = array('edit');
$helper->show_toolbar = false;
$helper->table = 'product';
$helper->currentIndex = $this->context->link->getAdminLink('AdminProducts', false);
$helper->token = Tools::getAdminTokenLite('AdminProducts');
if ($this->_list['products']) {
$view = $helper->generateList($this->_list['products'], $this->fields_list['products']);
}
$this->tpl_view_vars['products'] = $view;
}
if (isset($this->_list['customers']) && count($this->_list['customers'])) {
$view = '';
$this->initCustomerList();
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->identifier = 'id_customer';
$helper->actions = array('edit', 'view');
$helper->show_toolbar = false;
$helper->table = 'customer';
$helper->currentIndex = $this->context->link->getAdminLink('AdminCustomers', false);
$helper->token = Tools::getAdminTokenLite('AdminCustomers');
if ($this->_list['customers']) {
foreach ($this->_list['customers'] as $key => $val) {
$this->_list['customers'][$key]['orders'] = Order::getCustomerNbOrders((int) $val['id_customer']);
}
$view = $helper->generateList($this->_list['customers'], $this->fields_list['customers']);
}
$this->tpl_view_vars['customers'] = $view;
}
if (isset($this->_list['orders']) && count($this->_list['orders'])) {
$view = '';
$this->initOrderList();
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->identifier = 'id_order';
$helper->actions = array('view');
$helper->show_toolbar = false;
$helper->table = 'order';
$helper->currentIndex = $this->context->link->getAdminLink('AdminOrders', false);
$helper->token = Tools::getAdminTokenLite('AdminOrders');
if ($this->_list['orders']) {
$view = $helper->generateList($this->_list['orders'], $this->fields_list['orders']);
}
$this->tpl_view_vars['orders'] = $view;
}
if (isset($this->_list['modules']) && count($this->_list['modules'])) {
$this->tpl_view_vars['modules'] = $this->_list['modules'];
}
if (isset($this->_list['addons']) && count($this->_list['addons'])) {
$this->tpl_view_vars['addons'] = $this->_list['addons'];
}
return parent::renderView();
}
}
示例10: renderForm
public function renderForm()
{
$get_available_themes = Theme::getAvailable(false);
$available_theme_dir = array();
$selected_theme_dir = null;
$metas = Meta::getMetas();
$formated_metas = array();
foreach ($metas as $meta) {
$meta_object = new Meta($meta['id_meta']);
$title = $meta['page'];
if (isset($meta_object->title[(int) $this->context->language->id]) && $meta_object->title[(int) $this->context->language->id] != '') {
$title = $meta_object->title[(int) $this->context->language->id];
}
$formated_metas[$meta['id_meta']] = array('title' => $title, 'left' => 0, 'right' => 0);
}
$image_url = false;
if ($this->object) {
if ((int) $this->object->id > 0) {
$theme = new Theme((int) $this->object->id);
$theme_metas = $theme->getMetas();
// if no theme_meta are found, we must create them
if (empty($theme_metas)) {
$metas = Db::getInstance()->executeS('SELECT id_meta FROM ' . _DB_PREFIX_ . 'meta');
$metas_default = array();
foreach ($metas as $meta) {
$tmp_meta['id_meta'] = (int) $meta['id_meta'];
$tmp_meta['left'] = 1;
$tmp_meta['right'] = 1;
$metas_default[] = $tmp_meta;
}
$theme->updateMetas($metas_default);
$theme_metas = $theme->getMetas();
}
$image_url = '<img alt="preview" src="' . __PS_BASE_URI__ . 'themes/' . $theme->directory . '/preview.jpg">';
foreach ($theme_metas as $theme_meta) {
$formated_metas[$theme_meta['id_meta']]['id_theme_meta'] = (int) $theme_meta['id_theme_meta'];
$formated_metas[$theme_meta['id_meta']]['id_meta'] = (int) $theme_meta['id_meta'];
$formated_metas[$theme_meta['id_meta']]['left'] = (int) $theme_meta['left_column'];
$formated_metas[$theme_meta['id_meta']]['right'] = (int) $theme_meta['right_column'];
}
}
$selected_theme_dir = $this->object->directory;
}
foreach ($get_available_themes as $k => $dirname) {
$available_theme_dir[$k]['value'] = $dirname;
$available_theme_dir[$k]['label'] = $dirname;
$available_theme_dir[$k]['id'] = $dirname;
}
$this->fields_form = array('tinymce' => false, 'legend' => array('title' => $this->l('Theme'), 'icon' => 'icon-picture'), 'input' => array(array('type' => 'text', 'label' => $this->l('Name of the theme'), 'name' => 'name', 'required' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'file', 'label' => $this->l('Preview image for the theme'), 'name' => 'image_preview', 'display_image' => true, 'hint' => sprintf($this->l('Max image size: %1s'), Tools::formatBytes(Tools::getMaxUploadSize())), 'image' => $image_url), array('type' => 'switch', 'label' => $this->l('Default left column'), 'name' => 'default_left_column', 'hint' => $this->l('Choose a default behavior when displaying the column in a new page added by you or by a module.'), 'values' => array(array('id' => 'default_left_column_on', 'value' => 1, 'label' => $this->l('Yes')), array('id' => 'default_left_column_off', 'value' => 0, 'label' => $this->l('No')))), array('type' => 'switch', 'label' => $this->l('Default right column'), 'name' => 'default_right_column', 'hint' => $this->l('Choose a default behavior when displaying the column in a new page added by you or by a module.'), 'values' => array(array('id' => 'default_right_column_on', 'value' => 1, 'label' => $this->l('Yes')), array('id' => 'default_right_column_off', 'value' => 0, 'label' => $this->l('No')))), array('type' => 'text', 'label' => $this->l('Number of products per page'), 'name' => 'product_per_page', 'hint' => $this->l('This value will be used when activating the theme.'))), 'submit' => array('title' => $this->l('Save')));
// adding a new theme, you can create a directory, and copy from an existing theme
if ($this->display == 'add' || !$this->object->id) {
$this->fields_form['input'][] = array('type' => 'text', 'label' => $this->l('Name of the theme\'s directory'), 'name' => 'directory', 'required' => true, 'hint' => $this->l('If the directory does not exists, it will be created.'));
$theme_query = Theme::getThemes();
$this->fields_form['input'][] = array('type' => 'select', 'name' => 'based_on', 'label' => $this->l('Copy missing files from existing theme'), 'hint' => $this->l('If you create a new theme, it\'s recommended that you use the default theme files.'), 'options' => array('id' => 'id', 'name' => 'name', 'default' => array('value' => 0, 'label' => '-'), 'query' => $theme_query));
$this->fields_form['input'][] = array('type' => 'switch', 'label' => $this->l('Responsive'), 'name' => 'responsive', 'hint' => $this->l('Please indicate if the theme is adapted to all screen sizes (mobile, tablet, desktop).'), 'values' => array(array('id' => 'responsive_on', 'value' => 1, 'label' => $this->l('Yes')), array('id' => 'responsive_off', 'value' => 0, 'label' => $this->l('No'))));
} else {
$this->fields_form['input'][] = array('type' => 'radio', 'label' => $this->l('Directory'), 'name' => 'directory', 'required' => true, 'br' => true, 'values' => $available_theme_dir, 'selected' => $selected_theme_dir, 'hint' => $this->l('Please select a valid theme directory.'));
}
$list = '';
if (Tools::getIsset('update' . $this->table)) {
$fields_list = array('title' => array('title' => $this->l('Meta'), 'align' => 'center', 'width' => 'auto'), 'left' => array('title' => $this->l('Left column'), 'active' => 'left', 'type' => 'bool', 'ajax' => true), 'right' => array('title' => $this->l('Right column'), 'active' => 'right', 'type' => 'bool', 'ajax' => true));
$helper_list = new HelperList();
$helper_list->tpl_vars = array('icon' => 'icon-columns');
$helper_list->title = $this->l('Appearance of columns');
$helper_list->no_link = true;
$helper_list->shopLinkType = '';
$helper_list->identifier = 'id_theme_meta';
$helper_list->table = 'meta';
$helper_list->currentIndex = $this->context->link->getAdminLink('AdminThemes', false);
$helper_list->token = Tools::getAdminTokenLite('AdminThemes');
$list = $helper_list->generateList($formated_metas, $fields_list);
}
return parent::renderForm() . $list;
}
示例11: renderList
public function renderList()
{
$fields_list = array('id' => array('title' => $this->l('ID'), 'search' => false), 'shop_name' => array('title' => $this->l('Shop'), 'search' => false), 'gender' => array('title' => $this->l('Gender'), 'search' => false), 'lastname' => array('title' => $this->l('Lastname'), 'search' => false), 'firstname' => array('title' => $this->l('Firstname'), 'search' => false), 'email' => array('title' => $this->l('Email'), 'search' => false), 'subscribed' => array('title' => $this->l('Subscribed'), 'type' => 'bool', 'active' => 'subscribed', 'search' => false), 'newsletter_date_add' => array('title' => $this->l('Subscribed on'), 'type' => 'date', 'search' => false));
if (!Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE')) {
unset($fields_list['shop_name']);
}
$helper_list = new HelperList();
$helper_list->module = $this;
$helper_list->title = $this->l('Newsletter registrations');
$helper_list->shopLinkType = '';
$helper_list->no_link = true;
$helper_list->show_toolbar = true;
$helper_list->simple_header = false;
$helper_list->identifier = 'id';
$helper_list->table = 'merged';
$helper_list->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name;
$helper_list->token = Tools::getAdminTokenLite('AdminModules');
$helper_list->actions = array('viewCustomer');
$helper_list->toolbar_btn['export'] = array('href' => $helper_list->currentIndex . '&exportSubscribers&token=' . $helper_list->token, 'desc' => $this->l('Export'));
/* Before 1.6.0.7 displayEnableLink() could not be overridden in Module class
we declare another row action instead */
if (version_compare(_PS_VERSION_, '1.6.0.7', '<')) {
unset($fields_list['subscribed']);
$helper_list->actions = array_merge($helper_list->actions, array('unsubscribe'));
}
// This is needed for displayEnableLink to avoid code duplication
$this->_helperlist = $helper_list;
/* Retrieve list data */
$subscribers = $this->getSubscribers();
$helper_list->listTotal = count($subscribers);
/* Paginate the result */
$page = ($page = Tools::getValue('submitFilter' . $helper_list->table)) ? $page : 1;
$pagination = ($pagination = Tools::getValue($helper_list->table . '_pagination')) ? $pagination : 50;
$subscribers = $this->paginateSubscribers($subscribers, $page, $pagination);
return $helper_list->generateList($subscribers, $fields_list);
}
示例12: renderList
public function renderList($id_wishlist)
{
$wishlist = new WishList($id_wishlist);
$products = WishList::getProductByIdCustomer($id_wishlist, $wishlist->id_customer, $this->context->language->id);
foreach ($products as $key => $val) {
$image = Image::getCover($val['id_product']);
$products[$key]['image'] = $this->context->link->getImageLink($val['link_rewrite'], $image['id_image'], ImageType::getFormatedName('small'));
}
$fields_list = array('image' => array('title' => $this->l('Image'), 'type' => 'image'), 'name' => array('title' => $this->l('Product'), 'type' => 'text'), 'attributes_small' => array('title' => $this->l('Combination'), 'type' => 'text'), 'quantity' => array('title' => $this->l('Quantity'), 'type' => 'text'), 'priority' => array('title' => $this->l('Priority'), 'type' => 'priority', 'values' => array($this->l('High'), $this->l('Medium'), $this->l('Low'))));
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->no_link = true;
$helper->actions = array('view');
$helper->show_toolbar = false;
$helper->module = $this;
$helper->identifier = 'id_product';
$helper->title = $this->l('Product list');
$helper->table = $this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
$helper->tpl_vars = array('priority' => array($this->l('High'), $this->l('Medium'), $this->l('Low')));
return $helper->generateList($products, $fields_list);
}
示例13: renderList
public function renderList()
{
$output = '';
if ($this->session_api->connectFromCredentials('email')) {
Tools::clearCache($this->context->smarty);
$response_array = array();
$parameters = array('account_id' => $this->session_api->account_id, 'max_lines' => 20, 'campaign_id' => (int) Tools::getValue('campaign_id'));
if ($this->session_api->call('email', 'campaign', 'enum_last_sent', $parameters, $response_array)) {
if (is_array($response_array) && count($response_array)) {
// On retrouve tous les jours d'envoi (envois fractionnés sur plusieurs jours)
// ---------------------------------------------------------------------------
$tools = new EMTools();
$days = array();
foreach ($response_array as $day) {
$days[] = array('day_api' => $day['stat_date'], 'day_lang' => $tools->getLocalizableDate($day['stat_date']));
}
$this->context->smarty->assign(array('days' => $days, 'current_index' => AdminController::$currentIndex . '&campaign_id=' . $response_array[0]['campaign_id'], 'campaign_id' => $response_array[0]['campaign_id'], 'campaign_name' => Tools::htmlentitiesDecodeUTF8($response_array[0]['name'])));
// S'il y a un stat_date, il faut ré-intéroger l'API pour obtenir les stats du jour sélectionné
// --------------------------------------------------------------------------------------------
if (Tools::getValue('stat_date')) {
$stat_array = array();
$parameters = array('account_id' => $this->session_api->account_id, 'campaign_id' => (int) Tools::getValue('campaign_id'), 'stat_date' => (int) Tools::getValue('stat_date'));
if ($this->session_api->call('email', 'campaign', 'get_statistics', $parameters, $stat_array)) {
$response_array = array($stat_array);
}
// Pour rester compatible avec le code ci-dessous
}
// S'il n'y a pas de stat_date, l'API nous retourne directement les stats du dernier envoi
// ---------------------------------------------------------------------------------------
$this->context->smarty->assign(array('select_day' => $response_array[0]['stat_date'], 'sent' => $response_array[0]['sent'], 'not_sent' => $response_array[0]['not_sent'], 'delivered' => $response_array[0]['delivered'], 'not_delivered' => $response_array[0]['not_delivered'], 'opened' => $response_array[0]['opened'], 'not_opened' => $response_array[0]['not_opened'], 'unique_clickers' => $response_array[0]['unique_clickers'], 'all_clicks' => $response_array[0]['all_clicks'], 'unsubscribes' => $response_array[0]['unsubscribes'], 'abuses' => $response_array[0]['abuses'], 'ratio_sent' => $response_array[0]['ratio_sent'], 'ratio_not_sent' => $response_array[0]['ratio_not_sent'], 'ratio_delivered' => $response_array[0]['ratio_delivered'], 'ratio_not_delivered' => $response_array[0]['ratio_not_delivered'], 'ratio_opened' => $response_array[0]['ratio_opened'], 'ratio_not_opened' => $response_array[0]['ratio_not_opened'], 'ratio_unique_clickers' => $response_array[0]['ratio_unique_clickers'], 'ratio_unsubscribes' => $response_array[0]['ratio_unsubscribes'], 'ratio_abuses' => $response_array[0]['ratio_abuses']));
// On affiche le tableau des stats
// -------------------------------
$diplay = $this->getTemplatePath() . 'marketinge_stats/marketinge_stats.tpl';
$output = $this->context->smarty->fetch($diplay);
// On charge les données du graphique des "opened"
// -----------------------------------------------
$delivered = array();
/* ne pas utiliser le nom response_array SVP */
$parameters = array('account_id' => $this->session_api->account_id, 'campaign_id' => $response_array[0]['campaign_id'], 'stat_date' => $response_array[0]['stat_date']);
$this->session_api->call('email', 'campaign', 'get_graph_delivered_per_hour', $parameters, $delivered);
$this->context->smarty->assign('delivered', $delivered);
$graph = $this->getTemplatePath() . 'marketinge_stats/marketinge_graph.tpl';
$output .= $this->context->smarty->fetch($graph);
} else {
// On affiche une liste vide
// -------------------------
$helper = new HelperList();
$helper->no_link = true;
$helper->shopLinkType = '';
$helper->simple_header = false;
// Mettre 'search' => false dans chaque fields_list
$helper->table = $this->table;
$helper->identifier = 'campaign_id';
$helper->show_toolbar = true;
$helper->toolbar_scroll = false;
$helper->token = Tools::getAdminTokenLite('AdminMarketingEStats');
$helper->currentIndex = $this->context->link->getAdminLink('AdminMarketingEStats', false);
$helper->allow_export = false;
$helper->title = '<i class="icon-bar-chart"></i> ' . $this->module->l('Broadcast evolution during last 24/48 hours', 'adminmarketingestats');
$helper->toolbar_btn = array('back' => array('href' => 'index.php?controller=AdminMarketingEList&token=' . Tools::getAdminTokenLite('AdminMarketingEList'), 'desc' => $this->module->l('Back to list', 'adminmarketingestats')));
$helper->actions = array('details');
$this->fields_list = array();
$output .= $helper->generateList($this->fields_list, $this->fields_list);
}
}
}
$footer = $this->getTemplatePath() . 'footer.tpl';
$output .= $this->context->smarty->fetch($footer);
return $output;
}
示例14: renderCommentsList
public function renderCommentsList()
{
require_once dirname(__FILE__) . '/ProductComment.php';
$comments = ProductComment::getByValidate(1, false);
$fields_list = $this->getStandardFieldList();
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->actions = array('delete');
$helper->show_toolbar = false;
$helper->module = $this;
$helper->listTotal = count($comments);
$helper->identifier = 'id_product_comment';
$helper->title = $this->l('Approved Reviews');
$helper->table = $this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
//$helper->tpl_vars = array('priority' => array($this->l('High'), $this->l('Medium'), $this->l('Low')));
return $helper->generateList($comments, $fields_list);
}
示例15: renderList
public function renderList()
{
$current_index = AdminController::$currentIndex;
$token = Tools::getAdminTokenLite('AdminModules');
$list = DB::getInstance()->executeS("\n SELECT * FROM `" . _DB_PREFIX_ . "mycarrier_rule`\n ");
$fields_list = array('id_rule' => array('title' => $this->l('Id'), 'width' => 20, 'type' => 'text'), 'name' => array('title' => $this->l('Name'), 'width' => 'auto', 'type' => 'text'), 'is_msk' => array('title' => $this->l('Moskow region'), 'width' => 80, 'type' => 'bool', 'active' => 'status'), 'price' => array('title' => $this->l('Price'), 'width' => 80, 'type' => 'price'));
$helper = new HelperList();
$helper->module = $this;
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->actions = array('edit', 'delete');
$helper->identifier = 'id_rule';
$helper->show_toolbar = true;
$helper->title = 'helper list';
$helper->table = '_rule';
$helper->token = $token;
$helper->currentIndex = $current_index . '&configure=' . $this->name;
$helper->toolbar_btn = array('new' => array('href' => $current_index . '&configure=' . $this->name . '&token=' . $token . '&addBlockCMS', 'desc' => $this->l('Add new')));
$this->_html .= $helper->generateList($list, $fields_list);
}