本文整理汇总了PHP中HelperList类的典型用法代码示例。如果您正苦于以下问题:PHP HelperList类的具体用法?PHP HelperList怎么用?PHP HelperList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HelperList类的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: 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);
}
示例4: 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;
}
示例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: ajaxProcessDetails
/**
* method call when ajax request is made with the details row action
* @see AdminController::postProcess()
*/
public function ajaxProcessDetails()
{
if ($id = Tools::getValue('id')) {
$this->table = 'attribute';
$this->className = 'Attribute';
$this->identifier = 'id_attribute';
$this->lang = true;
if (!Validate::isLoadedObject($obj = new AttributeGroup((int) $id))) {
$this->errors[] = Tools::displayError('An error occurred while updating the status for an object.') . ' <b>' . $this->table . '</b> ' . Tools::displayError('(cannot load object)');
}
$this->fields_list = array('id_attribute' => array('title' => $this->l('ID'), 'width' => 40, 'align' => 'center'), 'name' => array('title' => $this->l('Value'), 'width' => 'auto', 'filter_key' => 'b!name'));
if ($obj->group_type == 'color') {
$this->fields_list['color'] = array('title' => $this->l('Color'), 'width' => 40, 'filter_key' => 'b!color');
}
$this->fields_list['position'] = array('title' => $this->l('Position'), 'width' => 40, 'filter_key' => 'a!position', 'position' => 'position');
$this->addRowAction('edit');
$this->addRowAction('delete');
// override attributes
$this->display = 'list';
$this->tpl_folder = 'attributes/';
$this->_where = 'AND a.`id_attribute_group` = ' . (int) $id;
$this->_orderBy = 'position';
// get list and force no limit clause in the request
$this->getList($this->context->language->id, null, null, 0, false);
// Render list
$helper = new HelperList();
$helper->actions = $this->actions;
$helper->override_folder = $this->tpl_folder;
$helper->no_link = true;
$helper->shopLinkType = '';
$helper->identifier = $this->identifier;
$helper->toolbar_scroll = false;
$helper->orderBy = 'position';
$helper->orderWay = 'ASC';
$helper->currentIndex = self::$currentIndex;
$helper->token = $this->token;
$helper->table = $this->table;
$helper->simple_header = true;
$helper->show_toolbar = false;
$helper->bulk_actions = $this->bulk_actions;
$helper->position_identifier = 'id_attribute';
$content = $helper->generateList($this->_list, $this->fields_list);
die(Tools::jsonEncode(array('use_parent_structure' => false, 'data' => $content)));
}
}
示例8: renderListModel
public function renderListModel()
{
$content = array();
$fields_list = array();
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->actions = null;
$helper->show_toolbar = false;
$helper->module = $this;
$helper->listTotal = count($content);
$helper->identifier = 'id_product_comment';
$helper->title = 'Moderate Comments';
$helper->table = $this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
return $helper->generateList($content, $fields_list);
}
示例9: renderRestricList
public function renderRestricList()
{
$default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
$this->bulk_actions = array('add' => array('text' => $this->l('Add Selected Countries'), 'icon' => 'icon-plus'), 'remove' => array('text' => $this->l('Remove Selected Countries'), 'icon' => 'icon-minus'));
if (Module::isInstalled("eko_ctt")) {
$this->bulk_actions['divid1'] = array('text' => 'divider');
$this->bulk_actions['addo'] = array('text' => $this->l('Add Selected Countries to Order Status'), 'icon' => 'icon-plus');
$this->bulk_actions['removeo'] = array('text' => $this->l('Remove Selected Countries from Order Status'), 'icon' => 'icon-minus');
$this->bulk_actions['divid2'] = array('text' => 'divider');
$this->bulk_actions['addc'] = array('text' => $this->l('Add Selected Countries to CTT Status'), 'icon' => 'icon-plus');
$this->bulk_actions['removec'] = array('text' => $this->l('Remove Selected Countries from CTT Status'), 'icon' => 'icon-minus');
}
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = false;
$helper->identifier = 'id_country';
$helper->show_toolbar = false;
$helper->no_link = true;
$helper->bulk_actions = $this->bulk_actions;
$helper->title = '<i class="icon icon-globe"></i> ' . $this->l('Country Restrict');
$helper->table = '_' . $this->name . "restrict";
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name;
return $helper->generateList($this->getRestricFieldsData(), $this->getRestricFields());
}
示例10: 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);
}
示例11: 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);
}
示例12: renderList
public function renderList()
{
// Campagne en cours de création (off-line)
// ----------------------------------------
if (!count($this->getLocalCampaigns())) {
$this->_list = array();
} else {
$this->_list = $this->getLocalCampaigns(self::NEW_CMP);
}
$helper = new HelperList();
$helper->no_link = true;
$helper->shopLinkType = '';
$helper->simple_header = false;
$helper->table = $this->table;
$helper->identifier = 'campaign_id';
$helper->show_toolbar = true;
$helper->toolbar_scroll = false;
$helper->token = $this->token;
$helper->currentIndex = AdminController::$currentIndex;
$helper->allow_export = false;
$helper->title = '<i class="icon-edit"></i> ' . $this->module->l('Drafted messages (off-line)', 'adminmarketingslist');
$helper->actions = array('edit', 'delete');
$helper->listTotal = count($this->_list);
$helper->toolbar_btn['new'] = array('href' => 'index.php?controller=AdminMarketingS&token=' . Tools::getAdminTokenLite('AdminMarketingS'), 'desc' => $this->module->l('New sms campaign', 'adminmarketingslist'));
$this->fields_list = array('campaign_id' => array('title' => $this->module->l('ID', 'adminmarketingslist'), 'width' => 140, 'type' => 'text', 'search' => false, 'ajax' => true), 'campaign_date_update' => array('title' => $this->module->l('Last Update', 'adminmarketingslist'), 'width' => 'auto', 'type' => 'text', 'search' => false, 'ajax' => true), 'campaign_name' => array('title' => $this->module->l('Campaign name', 'adminmarketingslist'), 'width' => 'auto', 'type' => 'text', 'search' => false, 'callback' => 'callbackTitle', 'ajax' => true));
$output = $helper->generateList($this->_list, $this->fields_list);
// Campagnes on-line
// -----------------
if ($this->session_api->connectFromCredentials('sms')) {
$response_array = array();
$parameters = array('account_ids' => array($this->session_api->account_id), 'campaign_states' => array(self::SCHEDULED, self::WAITING_NEXT_SLOT, self::SLEEPING, self::SENDING, self::RETRYING, self::FINISHED, self::UNAVAILABLE_CREDIT, self::FINISHING));
if ($this->session_api->call('sms', 'campaign', 'enum_by_states', $parameters, $response_array)) {
// Campagnes en cours d'envoi, programmées ou en pause
// ---------------------------------------------------
$data = array_filter($response_array, function ($k) {
$states = array('scheduled', 'waiting_next_slot', 'sleeping', 'sending', 'retrying', 'unavailable_credit');
return in_array($k['state'], $states);
});
if (count($data) > 0) {
$helper = new HelperList();
$helper->no_link = true;
$helper->shopLinkType = '';
$helper->simple_header = false;
$helper->table = $this->table;
$helper->identifier = 'campaign_id';
$helper->show_toolbar = true;
$helper->toolbar_scroll = false;
$helper->token = Tools::getAdminTokenLite('AdminMarketingSStats');
$helper->currentIndex = $this->context->link->getAdminLink('AdminMarketingSStats', false);
$helper->allow_export = false;
$helper->title = '<i class="icon-share"></i> ' . $this->module->l('Messages in the outbox (on-line)', 'adminmarketingslist') . ' <span class="badge">' . count($data) . '</span>';
$helper->actions = array('details');
$helper->listTotal = count($data);
$this->fields_list = array('campaign_id' => array('title' => $this->module->l('ID', 'adminmarketingslist'), 'width' => 140, 'type' => 'text', 'search' => false), 'start_date' => array('title' => $this->module->l('Date send', 'adminmarketingslist'), 'width' => 'auto', 'type' => 'text', 'callback' => 'callbackTime', 'search' => false), 'name' => array('title' => $this->module->l('Campaign name', 'adminmarketingslist'), 'width' => 'auto', 'type' => 'text', 'callback' => 'callbackTitle', 'search' => false));
$output .= $helper->generateList($data, $this->fields_list);
}
$data = array_filter($response_array, function ($k) {
return $k['state'] == 'finished';
});
if (count($data) > 0) {
// Campagne archivées
// ------------------
$helper = new HelperList();
$helper->no_link = true;
$helper->shopLinkType = '';
$helper->simple_header = false;
$helper->table = $this->table;
$helper->identifier = 'campaign_id';
$helper->show_toolbar = false;
$helper->toolbar_scroll = false;
$helper->token = Tools::getAdminTokenLite('AdminMarketingSStats');
$helper->currentIndex = $this->context->link->getAdminLink('AdminMarketingSStats', false);
$helper->allow_export = false;
$helper->title = '<i class="icon-folder-open"></i> ' . $this->module->l('Sent & archived messages (on-line)', 'adminmarketingslist') . ' <span class="badge">' . count($data) . '</span>';
$helper->actions = array('details');
$helper->listTotal = count($response_array);
$this->fields_list = array('campaign_id' => array('title' => $this->module->l('ID', 'adminmarketingslist'), 'width' => 140, 'type' => 'text', 'search' => false), 'start_date' => array('title' => $this->module->l('Sent date', 'adminmarketingslist'), 'width' => 'auto', 'type' => 'text', 'callback' => 'callbackDate', 'search' => false), 'name' => array('title' => $this->module->l('Campaign name', 'adminmarketingslist'), 'width' => 'auto', 'type' => 'text', 'callback' => 'callbackTitle', 'search' => false));
$output .= $helper->generateList($data, $this->fields_list);
}
}
}
$footer = $this->getTemplatePath() . 'footer.tpl';
$output .= $this->context->smarty->fetch($footer);
return $output;
}
示例13: 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;
}
}
示例14: 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);
}
示例15: 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();
}
}