本文整理汇总了PHP中CAdminList::BeginEpilogContent方法的典型用法代码示例。如果您正苦于以下问题:PHP CAdminList::BeginEpilogContent方法的具体用法?PHP CAdminList::BeginEpilogContent怎么用?PHP CAdminList::BeginEpilogContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAdminList
的用法示例。
在下文中一共展示了CAdminList::BeginEpilogContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildList
//.........这里部分代码省略.........
$visibleColumns = array_values($visibleColumns);
$visibleColumns = array_merge($visibleColumns, array_keys($this->tableColumnsMap));
}
$className = static::getModel();
$visibleColumns[] = static::pk();
$sectionsVisibleColumns[] = static::sectionPk();
$raw = array('SELECT' => $visibleColumns, 'FILTER' => $this->arFilter, 'SORT' => $sort);
foreach ($this->fields as $name => $settings) {
if (isset($settings['VIRTUAL']) and $settings['VIRTUAL'] == true) {
$key = array_search($name, $visibleColumns);
unset($visibleColumns[$key]);
unset($this->arFilter[$name]);
unset($sort[$name]);
}
if (isset($settings['FORCE_SELECT']) and $settings['FORCE_SELECT'] == true) {
$visibleColumns[] = $name;
}
}
$visibleColumns = array_unique($visibleColumns);
$sectionsVisibleColumns = array_unique($sectionsVisibleColumns);
// Поля для селекта (перевернутый массив)
$listSelect = array_flip($visibleColumns);
foreach ($this->fields as $code => $settings) {
$widget = $this->createWidgetForField($code);
$widget->changeGetListOptions($this->arFilter, $visibleColumns, $sort, $raw);
// Множественные поля не должны быть в селекте
if (!empty($settings['MULTIPLE'])) {
unset($listSelect[$code]);
}
}
// Поля для селекта (множественные поля отфильтрованы)
$listSelect = array_flip($listSelect);
if ($sectionEditHelper) {
$mixedData = $this->getMixedData($sectionsVisibleColumns, $visibleColumns, $sort, $raw);
$res = new \CDbResult();
$res->InitFromArray($mixedData);
$res = new \CAdminResult($res, $this->getListTableID());
$res->nSelectedCount = $this->totalRowsCount;
// используем кастомный NavStart что бы определить правильное количество страниц и элементов в списке
$this->customNavStart($res);
$this->list->NavText($res->GetNavPrint(Loc::getMessage("PAGES")));
while ($data = $res->NavNext(false)) {
$this->modifyRowData($data);
if ($data['IS_SECTION']) {
list($link, $name) = $this->getRow($data, $this->getHelperClass(AdminSectionEditHelper::className()));
$row = $this->list->AddRow('s' . $data[$this->pk()], $data, $link, $name);
foreach ($this->sectionFields as $code => $settings) {
if (in_array($code, $sectionsVisibleColumns)) {
$this->addRowSectionCell($row, $code, $data);
}
}
$row->AddActions($this->getRowActions($data, true));
} else {
$this->modifyRowData($data);
list($link, $name) = $this->getRow($data);
// объединение полей элемента с полями раздела
foreach ($this->tableColumnsMap as $elementCode => $sectionCode) {
if (isset($data[$elementCode])) {
$data[$sectionCode] = $data[$elementCode];
}
}
$row = $this->list->AddRow($data[$this->pk()], $data, $link, $name);
foreach ($this->fields as $code => $settings) {
$this->addRowCell($row, $code, $data, isset($this->tableColumnsMap[$code]) ? $this->tableColumnsMap[$code] : false);
}
$row->AddActions($this->getRowActions($data));
}
}
} else {
$res = $this->getData($className, $this->arFilter, $listSelect, $sort, $raw);
$res = new \CAdminResult($res, $this->getListTableID());
$res->NavStart();
$this->list->NavText($res->GetNavPrint(Loc::getMessage("PAGES")));
while ($data = $res->NavNext(false)) {
$this->modifyRowData($data);
list($link, $name) = $this->getRow($data);
$row = $this->list->AddRow($data[$this->pk()], $data, $link, $name);
foreach ($this->fields as $code => $settings) {
$this->addRowCell($row, $code, $data);
}
$row->AddActions($this->getRowActions($data));
}
}
$this->list->AddFooter($this->getFooter($res));
$this->list->AddGroupActionTable($this->getGroupActions(), $this->groupActionsParams);
$this->list->AddAdminContextMenu($this->getContextMenu());
$this->list->BeginPrologContent();
echo $this->prologHtml;
$this->list->EndPrologContent();
$this->list->BeginEpilogContent();
echo $this->epilogHtml;
$this->list->EndEpilogContent();
// добавляем ошибки в CAdminList для режимов list и frame
if (in_array($_GET['mode'], array('list', 'frame')) && is_array($this->getErrors())) {
foreach ($this->getErrors() as $error) {
$this->list->addGroupError($error);
}
}
$this->list->CheckListMode();
}
示例2: unset
$row->AddField("QUANTITY", '<input type="text" id="' . $tableId . '_qty_' . $arItems["ID"] . '" value="' . $ratio . '" size="5" />' . $measure);
unset($measure, $ratio);
$arActions[] = array("TEXT" => GetMessage("SPS_SELECT"), "DEFAULT" => "Y", "ACTION" => $tableId . '_helper.SelEl(' . CUtil::PhpToJSObject($arParams) . ', this);');
$row->AddField("ACTION", '<a class="select-sku">' . GetMessage('SPS_SELECT') . '</a>');
} else {
$arActions[] = array("TEXT" => GetMessage("SPS_SELECT"), "DEFAULT" => "Y", "ACTION" => $tableId . '_helper.onSectionClick(' . $arItems["ID"] . ',\'' . CUtil::JSEscape($arItems['NAME']) . '\');');
}
foreach ($arPrices as $price) {
$row->AddViewField("PRICE" . $price['ID'], CCurrencyLang::CurrencyFormat($arItems['PRICES'][$price['ID']]['PRICE'], $arItems['PRICES'][$price['ID']]['CURRENCY'], true));
}
}
addPropsCell($row, $arSelectedProps, $arItems);
$row->AddViewField('NAME', '<a class="adm-list-table-link"><span class="bx-s-iconset ' . $icon . '"></span>' . htmlspecialcharsex($arItems['NAME']) . '</a>');
$row->AddActions($arActions);
}
$lAdmin->BeginEpilogContent();
?>
<script type="text/javascript">
<?php
foreach ($arSku as $k => $v) {
?>
if (BX('<?php
echo $tableId;
?>
_sku-<?php
echo $v;
?>
'))
{
var skuRow = BX('<?php
echo $tableId;
示例3: getData
/**
* Основной цикл отображения списка. Этапы:
* <ul>
* <li> Вывод заголовков страницы </li>
* <li> Определение списка видимых колонок и колонок, участвующих в выборке. </li>
* <li> Создание виджета для каждого поля выборки </li>
* <li> Модификация параметров запроса каждым из виджетов </li>
* <li> Выборка данных </li>
* <li> Вывод строк таблицы. Во время итерации по строкам возможна модификация данных строки. </li>
* <li> Отрисовка футера таблиы, добавление контекстного меню </li>
* </ul>
*
* @param array $sort Настройки сортировки.
*
* @see AdminListHelper::getList();
* @see AdminListHelper::modifyRowData();
* @see AdminListHelper::addRowCell();
* @see AdminListHelper::addRow();
* @see HelperWidget::changeGetListOptions();
*/
public function getData($sort)
{
$this->setContext(AdminListHelper::OP_GET_DATA_BEFORE);
$this->list->AddHeaders($this->arHeader);
$visibleColumns = $this->list->GetVisibleHeaderColumns();
$className = static::getModel();
$visibleColumns[] = static::pk();
$raw = array('SELECT' => $visibleColumns, 'FILTER' => $this->arFilter, 'SORT' => $sort);
foreach ($this->fields as $name => $settings) {
if (isset($settings['VIRTUAL']) and $settings['VIRTUAL'] == true) {
$key = array_search($name, $visibleColumns);
unset($visibleColumns[$key]);
unset($this->arFilter[$name]);
unset($sort[$name]);
}
if (isset($settings['FORCE_SELECT']) and $settings['FORCE_SELECT'] == true) {
$visibleColumns[] = $name;
}
}
$visibleColumns = array_unique($visibleColumns);
// Поля для селекта (перевернутый массив)
$listSelect = array_flip($visibleColumns);
foreach ($this->fields as $code => $settings) {
$widget = $this->createWidgetForField($code);
$widget->changeGetListOptions($this->arFilter, $visibleColumns, $sort, $raw);
// Множественные поля не должны быть в селекте
if (!empty($settings['MULTIPLE'])) {
unset($listSelect[$code]);
}
}
// Поля для селекта (множественные поля отфильтрованы)
$listSelect = array_flip($listSelect);
$res = $this->getList($className, $this->arFilter, $listSelect, $sort, $raw);
$res = new \CAdminResult($res, $this->getListTableID());
$res->NavStart();
$this->list->NavText($res->GetNavPrint(Loc::getMessage("PAGES")));
while ($data = $res->NavNext(false)) {
$this->modifyRowData($data);
list($link, $name) = $this->addRow($data);
$row = $this->list->AddRow($data[$this->pk()], $data, $link, $name);
foreach ($this->fields as $code => $settings) {
$this->addRowCell($row, $code, $data);
}
$actions = $this->addRowActions($data);
$row->AddActions($actions);
}
$this->addFooter($res);
$this->list->AddFooter($this->footer);
$this->list->AddGroupActionTable($this->groupActionsList, $this->groupActionsParams);
$this->list->AddAdminContextMenu($this->contextMenu);
$this->list->BeginPrologContent();
echo $this->prologHtml;
$this->list->EndPrologContent();
$this->list->BeginEpilogContent();
echo $this->epilogHtml;
$this->list->EndEpilogContent();
$this->list->CheckListMode();
}