本文整理汇总了PHP中CAdminList::GetVisibleHeaderColumns方法的典型用法代码示例。如果您正苦于以下问题:PHP CAdminList::GetVisibleHeaderColumns方法的具体用法?PHP CAdminList::GetVisibleHeaderColumns怎么用?PHP CAdminList::GetVisibleHeaderColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAdminList
的用法示例。
在下文中一共展示了CAdminList::GetVisibleHeaderColumns方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CAdminSorting
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$APPLICATION->SetTitle(GetMessage('HLBLOCK_ADMIN_MENU_TITLE'));
$sTableID = "tbl_hlblock_entity";
$oSort = new CAdminSorting($sTableID, "NAME", "asc");
$lAdmin = new CAdminList($sTableID, $oSort);
$arHeaders = array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "NAME", "content" => GetMessage('HLBLOCK_ADMIN_ENTITY_TITLE'), "sort" => "NAME", "default" => true));
$lAdmin->AddHeaders($arHeaders);
// menu
if ($_REQUEST["mode"] !== "list") {
$aMenu = array(array("TEXT" => GetMessage('HLBLOCK_ADMIN_ADD_ENTITY_BUTTON'), "TITLE" => GetMessage('HLBLOCK_ADMIN_ADD_ENTITY_BUTTON'), "LINK" => "highloadblock_entity_edit.php?lang=" . LANGUAGE_ID, "ICON" => "btn_new"));
$context = new CAdminContextMenu($aMenu);
}
use Bitrix\Highloadblock as HL;
// select data
$rsData = HL\HighloadBlockTable::getList(array("select" => $lAdmin->GetVisibleHeaderColumns(), "order" => array($by => strtoupper($order))));
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
// build list
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PAGES")));
while ($arRes = $rsData->NavNext(true, "f_")) {
$row = $lAdmin->AddRow($f_ID, $arRes);
$can_edit = true;
$arActions = array();
$arActions[] = array("ICON" => "list", "TEXT" => GetMessage('HLBLOCK_ADMIN_ROWS_LIST'), "ACTION" => $lAdmin->ActionRedirect("highloadblock_rows_list.php?ENTITY_ID=" . $f_ID), "DEFAULT" => true);
$arActions[] = array("ICON" => "list", "TEXT" => GetMessage('HLBLOCK_ADMIN_FIELDS_LIST'), "ACTION" => $lAdmin->ActionRedirect("userfield_admin.php?lang=" . LANGUAGE_ID . "&set_filter=Y&find=HLBLOCK_" . intval($f_ID) . "&find_type=ENTITY_ID&back_url=" . urlencode($APPLICATION->GetCurPageParam())));
$arActions[] = array("ICON" => "edit", "TEXT" => GetMessage($can_edit ? "MAIN_ADMIN_MENU_EDIT" : "MAIN_ADMIN_MENU_VIEW"), "ACTION" => $lAdmin->ActionRedirect("highloadblock_entity_edit.php?ID=" . $f_ID));
$arActions[] = array("ICON" => "delete", "TEXT" => GetMessage("MAIN_ADMIN_MENU_DELETE"), "ACTION" => "if(confirm('" . GetMessageJS('HLBLOCK_ADMIN_DELETE_ENTITY_CONFIRM') . "')) " . $lAdmin->ActionRedirect("highloadblock_entity_edit.php?action=delete&ID=" . $f_ID . '&' . bitrix_sessid_get()));
$row->AddActions($arActions);
}
// view
示例2: CAdminResult
$params['limit'] = $navyParams['SIZEN'];
$params['offset'] = 0;
}
}
$dbResultList = new CAdminResult(PaymentTable::getList($params), $tableId);
if ($usePageNavigation) {
$dbResultList->NavStart($params['limit'], $navyParams['SHOW_ALL'], $navyParams['PAGEN']);
$dbResultList->NavRecordCount = $totalCount;
$dbResultList->NavPageCount = $totalPages;
$dbResultList->NavPageNomer = $navyParams['PAGEN'];
} else {
$dbResultList->NavStart();
}
$lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("group_admin_nav")));
$lAdmin->AddHeaders($headers);
$visibleHeaders = $lAdmin->GetVisibleHeaderColumns();
while ($payment = $dbResultList->Fetch()) {
$row =& $lAdmin->AddRow($payment['ID'], $payment);
$row->AddField("ID", "<a href=\"sale_order_payment_edit.php?order_id=" . $payment['ORDER_ID'] . "&payment_id=" . $payment['ID'] . "&lang=" . $lang . GetFilterParams("filter_") . "\">" . $payment['ID'] . "</a>");
$row->AddField("ORDER_ID", "<a href=\"sale_order_edit.php?ID=" . $payment['ORDER_ID'] . "&lang=" . $lang . GetFilterParams("filter_") . "\">" . $payment['ORDER_ID'] . "</a>");
$row->AddField("ACCOUNT_NUMBER", "<a href=\"sale_order_edit.php?ID=" . $payment['ORDER_ID'] . "&lang=" . $lang . GetFilterParams("filter_") . "\">" . htmlspecialcharsbx($payment['ORDER_ACCOUNT_NUMBER']) . "</a>");
$row->AddField("SUM", \CCurrencyLang::CurrencyFormat($payment['SUM'], $payment['CURRENCY']));
$row->AddField("PAID", $payment['PAID'] == 'Y' ? GetMessage("PAYMENT_ORDER_PAID_YES") : GetMessage("PAYMENT_ORDER_PAID_NO"));
$row->AddField("PAY_SYSTEM_NAME", "<a href='sale_pay_system_edit.php?ID=" . $payment['PAY_SYSTEM_ID'] . "&lang=" . $lang . "'>" . htmlspecialcharsbx($payment['PAY_SYSTEM_NAME']) . "</a>");
$row->AddField("COMPANY_BY", "<a href='sale_pay_system_edit.php?ID=" . $payment['COMPANY_ID'] . "&lang=" . $lang . "'>" . htmlspecialcharsbx($payment['COMPANY_BY_NAME']) . "</a>");
$row->AddField("ORDER_USER_NAME", "<a href='/bitrix/admin/user_edit.php?ID=" . $payment['ORDER_USER_ID'] . "&lang=" . $lang . "'>" . htmlspecialcharsbx($payment['ORDER_USER_NAME']) . " " . htmlspecialcharsbx($payment['ORDER_USER_LAST_NAME']) . "</a>");
$row->AddField("RESPONSIBLE_BY", "<a href=\"user_edit.php?ID=" . $payment['RESPONSIBLE_ID'] . "\">" . htmlspecialcharsbx($payment['RESPONSIBLE_BY_NAME']) . " " . htmlspecialcharsbx($payment['RESPONSIBLE_BY_LAST_NAME']) . "</a>");
$arActions = array();
$arActions[] = array("ICON" => "edit", "TEXT" => GetMessage("EDIT_PAYMENT_ALT"), "ACTION" => $lAdmin->ActionRedirect("sale_order_payment_edit.php?order_id=" . $payment['ORDER_ID'] . "&payment_id=" . $payment['ID'] . "&lang=" . $lang . GetFilterParams("filter_") . ""), "DEFAULT" => true);
if (!$bReadOnly) {
$arActions[] = array("SEPARATOR" => true);
示例3: array
$arHeader[] = array("id" => "EXTERNAL_ID", "content" => GetMessage("IBLOCK_FIELD_XML_ID"), "sort" => "external_id");
if (CModule::IncludeModule("workflow")) {
$arHeader[] = array("id" => "WF_STATUS_ID", "content" => GetMessage("IBLOCK_FIELD_STATUS"), "sort" => "status", "default" => true);
$arHeader[] = array("id" => "LOCKED_USER_NAME", "content" => GetMessage("IBLOCK_ELSEARCH_LOCK_BY"));
}
$arHeader[] = array("id" => "SHOW_COUNTER", "content" => GetMessage("IBLOCK_FIELD_SHOW_COUNTER"), "sort" => "show_counter", "align" => "right");
$arHeader[] = array("id" => "SHOW_COUNTER_START", "content" => GetMessage("IBLOCK_FIELD_SHOW_COUNTER_START"), "sort" => "show_counter_start", "align" => "right");
$arHeader[] = array("id" => "PREVIEW_PICTURE", "content" => GetMessage("IBLOCK_FIELD_PREVIEW_PICTURE"), "align" => "right");
$arHeader[] = array("id" => "PREVIEW_TEXT", "content" => GetMessage("IBLOCK_FIELD_PREVIEW_TEXT"));
$arHeader[] = array("id" => "DETAIL_PICTURE", "content" => GetMessage("IBLOCK_FIELD_DETAIL_PICTURE"), "align" => "center");
$arHeader[] = array("id" => "DETAIL_TEXT", "content" => GetMessage("IBLOCK_FIELD_DETAIL_TEXT"));
foreach ($arProps as $prop) {
$arHeader[] = array("id" => "PROPERTY_" . $prop['ID'], "content" => $prop['NAME'], "align" => $prop["PROPERTY_TYPE"] == 'N' ? "right" : "left", "sort" => $prop["MULTIPLE"] != 'Y' ? "PROPERTY_" . $prop['ID'] : "");
}
$lAdmin->AddHeaders($arHeader);
$arSelectedFields = $lAdmin->GetVisibleHeaderColumns();
$arSelectedProps = array();
foreach ($arProps as $prop) {
if (in_array("PROPERTY_" . $prop['ID'], $arSelectedFields)) {
$arSelectedProps[] = $prop;
$arSelect[$prop['ID']] = array();
$props = CIBlockProperty::GetPropertyEnum($prop['ID']);
while ($res = $props->Fetch()) {
$arSelect[$prop['ID']][$res["ID"]] = $res["VALUE"];
}
}
if ($prop["MULTIPLE"] == 'Y') {
if ($key = array_search("PROPERTY_" . $prop['ID'], $arSelectedFields)) {
unset($arSelectedFields[$key]);
}
}
示例4: CAdminList
} else {
$arProps = $arResult['PROPS'];
$arSKUProps = $arResult['SKU_PROPS'];
$arFilter = $arResult['FILTER'];
$arHeaders = $arResult['HEADERS'];
$arPrices = $arResult['PRICES'];
$tableId = CUtil::JSEscape($arResult['TABLE_ID']);
// START TEMPLATE
$APPLICATION->SetAdditionalCSS('/bitrix/panel/main/admin.css');
$lAdmin = new CAdminList($arResult['TABLE_ID'], new CAdminSorting($arResult['TABLE_ID'], "ID", "ASC"));
$lAdmin->InitFilter($arResult['FILTER_FIELDS']);
// fix
$_REQUEST['admin_history'] = 1;
$lAdmin->NavText($arResult['DB_RESULT_LIST']->GetNavPrint(GetMessage("SPS_NAV_LABEL")));
$lAdmin->AddHeaders($arHeaders);
$arSelectedFields = $lAdmin->GetVisibleHeaderColumns();
$arSelectedProps = array();
$allProps = array_merge($arProps, $arSKUProps);
foreach ($allProps as $prop) {
if ($key = array_search("PROPERTY_" . $prop['ID'], $arSelectedFields)) {
$arSelectedProps[] = $prop;
unset($arSelectedFields[$key]);
}
}
$allProps = null;
$arSelectedFields = null;
$arSku = array();
//Add 'Level Up' row to grid
if ($arResult['PARENT_SECTION_ID'] >= 0) {
$row =& $lAdmin->AddRow(0, array());
$row->AddViewField('NAME', '<a class="adm-list-table-link"><span class="bx-s-iconset folder"></span>..</a>');
示例5: array
{
$arErrors = array();
foreach($result->getErrors() as $error)
$arErrors[] = $error->getMessage();
$lAdmin->AddGroupError(join("<br>", $arErrors), $ID);
}
}
}
$lAdmin->AddHeaders($arHeaders);
$arSelect = array();
foreach($arHeaders as $val)
{
if(in_array($val["id"], $lAdmin->GetVisibleHeaderColumns()))
$arSelect[$val["id"]] = (is_set($val, "sort") ? $val["sort"] : $val["id"]);
}
if(!in_array($sPrimaryKey, $arSelect))
$arSelect[$sPrimaryKey] = $sPrimaryKey;
$rsData = $sDataClassName::getList(array(
"select" => $arSelect,
"filter" => $arFilter,
"order" => array(
$by => strtoupper($order)
),
));
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
示例6: unset
$arFilter["=URL_TO"] = $find_url_to;
} else {
$arFilter["URL_TO"] = $find_url_to;
}
$arFilter["=URL_TO_404"] = $find_url_to_404;
foreach ($arFilter as $key => $value) {
if (!strlen($value)) {
unset($arFilter[$key]);
}
}
$arFilter["!PHRASE"] = false;
$aContext = array();
$lAdmin->AddAdminContextMenu($aContext);
$arHeaders = array(array("id" => "PHRASE", "content" => GetMessage("SEARCH_PHS_PHRASE"), "sort" => "PHRASE", "default" => true), array("id" => "COUNT", "content" => GetMessage("SEARCH_PHS_COUNT"), "sort" => "COUNT", "default" => true, "align" => "right"));
$lAdmin->AddHeaders($arHeaders);
$arFields = $lAdmin->GetVisibleHeaderColumns();
$arFields[] = "COUNT";
$rsData = CSearchStatistic::GetList(array($by => $order), $arFilter, $arFields, true);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
// navigation setup
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("SEARCH_PHS_PHRASES")));
while ($arRes = $rsData->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arRes);
}
$lAdmin->AddFooter(array(array("title" => GetMessage("MAIN_ADMIN_LIST_SELECTED"), "value" => $rsData->SelectedRowsCount())));
$lAdmin->CheckListMode();
/***************************************************************************
HTML form
****************************************************************************/
$APPLICATION->SetTitle(GetMessage("SEARCH_PHS_TITLE"));
示例7: intval
if($arID = $lAdmin->GroupAction())
{
if($_REQUEST['action_target']=='selected')
{
$is_filteredTT = null;
//$rsData = CTicket::GetList($by, $order, $arFilter);
$rsData = CTicket::GetList(
$by,
$order,
$arFilter,
$is_filteredTT,
"Y",
"Y",
"Y",
false,
array( "SELECT" => $lAdmin->GetVisibleHeaderColumns() )
);
while($arRes = $rsData->Fetch())
$arID[] = $arRes['ID'];
}
foreach($arID as $ID)
{
if(strlen($ID)<=0)
continue;
$ID = intval($ID);
switch($_REQUEST['action'])
{
示例8: array
array("id"=>"WORK_WWW", "content"=>GetMessage("WORK_WWW"), "sort"=>"work_www"),
array("id"=>"WORK_PHONE", "content"=>GetMessage("WORK_PHONE"), "sort"=>"work_phone"),
array("id"=>"WORK_CITY", "content"=>GetMessage("WORK_CITY"), "sort"=>"work_city"),
array("id"=>"XML_ID", "content"=>GetMessage("XML_ID"), "sort"=>"xml_id"),
array("id"=>"EXTERNAL_AUTH_ID", "content"=>GetMessage("EXTERNAL_AUTH_ID")),
);
$rsRatings = CRatings::GetList(array('ID' => 'ASC'), array('ACTIVE' => 'Y', 'ENTITY_ID' => 'USER'));
while ($arRatingsTmp = $rsRatings->GetNext())
$arHeaders[] = array("id"=>"RATING_".$arRatingsTmp['ID'], "content"=>htmlspecialcharsbx($arRatingsTmp['NAME']), "sort"=>"RATING_".$arRatingsTmp['ID']);
$USER_FIELD_MANAGER->AdminListAddHeaders($entity_id, $arHeaders);
$lAdmin->AddHeaders($arHeaders);
$rsData = CUser::GetList($by, $order, $arFilter, array(
"SELECT" => $lAdmin->GetVisibleHeaderColumns(),
"NAV_PARAMS"=> array("nPageSize"=>CAdminResult::GetNavSize($sTableID)),
));
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PAGES")));
while($arRes = $rsData->NavNext(true, "f_"))
{
$row =& $lAdmin->AddRow($f_ID, $arRes);
$USER_FIELD_MANAGER->AddUserFields($entity_id, $arRes, $row);
$row->AddViewField("ID", "<a href='user_edit.php?lang=".LANGUAGE_ID."&ID=".$f_ID."' title='".GetMessage("MAIN_EDIT_TITLE")."'>".$f_ID."</a>");
$own_edit = ($USER->CanDoOperation('edit_own_profile') && ($USER->GetParam("USER_ID") == $f_ID));
$edit = ($USER->CanDoOperation('edit_subordinate_users') || $USER->CanDoOperation('edit_all_users'));
$can_edit = (IntVal($f_ID)>1 && ($own_edit || $edit));
示例9: array
if($bWorkflow)
$row->AddCheckField("WORKFLOW");
}
else
{
if($arIBTYPE["SECTIONS"]=="Y")
$row->AddViewField("NAME", '<a href="'.htmlspecialcharsbx(CIBlock::GetAdminSectionListLink($f_ID , array('find_section_section'=>0))).'" title="'.GetMessage("IBLOCK_ADM_TO_SECTLIST").'">'.$f_NAME.'</a>');
else
$row->AddViewField("NAME", '<a href="'.htmlspecialcharsbx(CIBlock::GetAdminElementListLink($f_ID , array('find_section_section'=>-1))).'" title="'.GetMessage("IBLOCK_ADM_TO_EL_LIST").'">'.$f_NAME.'</a>');
$row->AddCheckField("ACTIVE", false);
$row->AddCheckField("INDEX_ELEMENT", false);
if($bWorkflow)
$row->AddCheckField("WORKFLOW", false);
}
if(in_array("ELEMENT_CNT", $lAdmin->GetVisibleHeaderColumns()))
{
$f_ELEMENT_CNT = CIBlock::GetElementCount($f_ID);
$row->AddViewField("ELEMENT_CNT", '<a href="'.htmlspecialcharsbx(CIBlock::GetAdminElementListLink($f_ID, array('find_section_section'=>-1))).'" title="'.GetMessage("IBLOCK_ADM_TO_ELLIST").'">'.$f_ELEMENT_CNT.'</a>');
}
if($arIBTYPE["SECTIONS"]=="Y" && in_array("SECTION_CNT", $lAdmin->GetVisibleHeaderColumns()))
$row->AddViewField("SECTION_CNT", '<a href="'.htmlspecialcharsbx(CIBlock::GetAdminSectionListLink($f_ID, array())).'" title="'.GetMessage("IBLOCK_ADM_TO_SECTLIST").'">'.IntVal(CIBlockSection::GetCount(array("IBLOCK_ID"=>$f_ID))).'</a>');
if(
$bBizproc
&& $dbrs["BIZPROC"] == "Y"
&& in_array("WORKFLOW_TEMPLATES", $lAdmin->GetVisibleHeaderColumns())
&& IsModuleInstalled("bizprocdesigner")
)
{
示例10: array
$arHeaders = array();
$arHeaders[] = array("id" => "NAME", "content" => GetMessage("CTRLR_GR_AD_COL_NAME"), "default" => true, "sort" => "name");
$arHeaders[] = array("id" => "TIMESTAMP_X", "content" => GetMessage("CTRLR_GR_AD_COL_MOD"), "default" => true, "sort" => "timestamp_x");
$arHeaders[] = array("id" => "MODIFIED_BY", "content" => GetMessage("CTRLR_GR_AD_COL_MODBY"), "default" => true, "sort" => "modified_by");
$arHeaders[] = array("id" => "DATE_CREATE", "content" => GetMessage("CTRLR_GR_AD_COL_CRE"), "sort" => "DATE_CREATE");
$arHeaders[] = array("id" => "CREATED_BY", "content" => GetMessage("CTRLR_GR_AD_COL_CREBY"), "sort" => "CREATED_BY");
$arHeaders[] = array("id" => "DESCRIPTION", "content" => GetMessage("CTRLR_GR_AD_COL_DESC"));
$arHeaders[] = array("id" => "COUNTER_UPDATE_PERIOD", "content" => GetMessage("CTRLE_GR_AD_COUNTER_UPD_PER"), "sort" => "COUNTER_UPDATE_PERIOD");
$arHeaders[] = array("id" => "CHECK_COUNTER_FREE_SPACE", "content" => GetMessage("CTRLE_GR_AD_COUNTER_FREE"), "sort" => "CHECK_COUNTER_FREE_SPACE");
$arHeaders[] = array("id" => "CHECK_COUNTER_SITES", "content" => GetMessage("CTRLE_GR_AD_COUNTER_SITES"), "sort" => "CHECK_COUNTER_SITES");
$arHeaders[] = array("id" => "CHECK_COUNTER_USERS", "content" => GetMessage("CTRLE_GR_AD_COUNTER_USERS"), "sort" => "CHECK_COUNTER_USERS");
$arHeaders[] = array("id" => "CHECK_COUNTER_LAST_AUTH", "content" => GetMessage("CTRLE_GR_AD_COUNTER_LAST_AU"), "sort" => "CHECK_COUNTER_LAST_AUTH");
$arHeaders[] = array("id" => "ID", "content" => "ID", "default" => true, "sort" => "id");
$USER_FIELD_MANAGER->AdminListAddHeaders($entity_id, $arHeaders);
$lAdmin->AddHeaders($arHeaders);
$rsData = CControllerGroup::GetList(array($by => $order), $arFilter, $lAdmin->GetVisibleHeaderColumns());
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("CTRLR_GR_AD_NAV")));
while ($arRes = $rsData->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arRes);
$USER_FIELD_MANAGER->AddUserFields($entity_id, $arRes, $row);
$row->AddViewField("MODIFIED_BY", '<a href="user_edit.php?ID=' . $f_MODIFIED_BY . '">(' . $f_MODIFIED_BY_LOGIN . ') ' . $f_MODIFIED_BY_NAME . ' ' . $f_MODIFIED_BY_LAST_NAME) . '</a>';
$row->AddViewField("CREATED_BY", '<a href="user_edit.php?ID=' . $f_CREATED_BY . '">(' . $f_CREATED_BY_LOGIN . ') ' . $f_CREATED_BY_NAME . ' ' . $f_CREATED_BY_LAST_NAME) . '</a>';
$row->AddInputField("NAME", array("size" => "35"));
$row->AddViewField("NAME", '<a href="controller_group_edit.php?ID=' . $f_ID . '&lang=' . LANG . '">' . $f_NAME . '</a>');
$row->AddInputField("COUNTER_UPDATE_PERIOD", array("size" => "5"));
$row->AddCheckField("CHECK_COUNTER_FREE_SPACE");
$row->AddCheckField("CHECK_COUNTER_SITES");
$row->AddCheckField("CHECK_COUNTER_USERS");
$row->AddCheckField("CHECK_COUNTER_LAST_AUTH");
示例11: CGroup
if ($ID > 2) {
$ob = new CGroup();
$arFields["ACTIVE"] = $_REQUEST['action'] == "activate" ? "Y" : "N";
if (!$ob->Update($ID, $arFields)) {
$lAdmin->AddGroupError(GetMessage("MAIN_EDIT_ERROR") . ":" . $ob->LAST_ERROR, $ID);
}
} else {
$lAdmin->AddGroupError(GetMessage("MAIN_ERROR_GROUP") . $ID . GetMessage("MAIN_ERROR_GROUP_EDIT"));
}
break;
}
}
}
// заголовок списка
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "id", "default" => true, "align" => "right"), array("id" => "TIMESTAMP_X", "content" => GetMessage('TIMESTAMP'), "sort" => "timestamp_x", "default" => true), array("id" => "ACTIVE", "content" => GetMessage('ACTIVE'), "sort" => "active", "default" => true), array("id" => "C_SORT", "content" => GetMessage("MAIN_C_SORT"), "sort" => "c_sort", "default" => true, "align" => "right"), array("id" => "NAME", "content" => GetMessage("NAME"), "sort" => "name", "default" => true), array("id" => "DESCRIPTION", "content" => GetMessage("MAIN_DESCRIPTION"), "sort" => "description", "default" => false), array("id" => "USERS", "content" => GetMessage('MAIN_USERS'), "sort" => "users", "align" => "right")));
$showUserCount = in_array("USERS", $lAdmin->GetVisibleHeaderColumns());
// инициализация списка - выборка данных
$rsData = CGroup::GetList($by, $order, $arFilter, $showUserCount ? "Y" : "N");
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
// установке параметров списка
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PAGES")));
// построение списка
while ($arRes = $rsData->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arRes, "group_edit.php?lang=" . LANGUAGE_ID . "&ID=" . $f_ID, GetMessage("MAIN_EDIT_TITLE"));
$row->AddViewField("ID", "<a href='group_edit.php?lang=" . LANGUAGE_ID . "&ID=" . $f_ID . "' title='" . GetMessage("MAIN_EDIT_TITLE") . "'>" . $f_ID . "</a>");
if ($USER->CanDoOperation('edit_groups')) {
if ($f_ID <= 2) {
$row->AddCheckField("ACTIVE", false);
} else {
$row->AddCheckField("ACTIVE");
示例12: buildList
/**
* Основной цикл отображения списка. Этапы:
* <ul>
* <li> Вывод заголовков страницы </li>
* <li> Определение списка видимых колонок и колонок, участвующих в выборке. </li>
* <li> Создание виджета для каждого поля выборки </li>
* <li> Модификация параметров запроса каждым из виджетов </li>
* <li> Выборка данных </li>
* <li> Вывод строк таблицы. Во время итерации по строкам возможна модификация данных строки. </li>
* <li> Отрисовка футера таблицы, добавление контекстного меню </li>
* </ul>
*
* @param array $sort Настройки сортировки.
*
* @see AdminListHelper::getList();
* @see AdminListHelper::getMixedData();
* @see AdminListHelper::modifyRowData();
* @see AdminListHelper::addRowCell();
* @see AdminListHelper::addRow();
* @see HelperWidget::changeGetListOptions();
*/
public function buildList($sort)
{
$this->setContext(AdminListHelper::OP_GET_DATA_BEFORE);
$headers = $this->arHeader;
$sectionEditHelper = static::getHelperClass(AdminSectionEditHelper::className());
if ($sectionEditHelper) {
// если есть реализация класса AdminSectionEditHelper, значит используются разделы
$sectionHeaders = $this->getSectionsHeader();
foreach ($sectionHeaders as $sectionHeader) {
foreach ($headers as $i => $elementHeader) {
if ($sectionHeader['id'] == $elementHeader['id']) {
unset($headers[$i]);
}
}
}
$headers = array_merge($headers, $sectionHeaders);
}
// сортировка столбцов с сохранением исходной позиции в
// массиве для развнозначных элементов
// массив $headers модифицируется
$this->mergeSortHeader($headers);
$this->list->AddHeaders($headers);
$visibleColumns = $this->list->GetVisibleHeaderColumns();
if ($sectionEditHelper) {
$modelClass = $this->getModel();
$elementFields = array_keys($modelClass::getEntity()->getFields());
$sectionsVisibleColumns = array();
foreach ($visibleColumns as $k => $v) {
if (isset($this->sectionFields[$v])) {
if (!in_array($k, $elementFields)) {
unset($visibleColumns[$k]);
}
$sectionsVisibleColumns[] = $v;
}
}
$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']) {
//.........这里部分代码省略.........
示例13: array
$APPLICATION->SetTitle(GetMessage('HLBLOCK_ADMIN_ROWS_LIST_PAGE_TITLE', array('#NAME#' => $hlblock['NAME'])));
$entity = HL\HighloadBlockTable::compileEntity($hlblock);
$entity_data_class = $entity->getDataClass();
$entity_table_name = $hlblock['TABLE_NAME'];
$sTableID = 'tbl_' . $entity_table_name;
$oSort = new CAdminSorting($sTableID, "ID", "asc");
$lAdmin = new CAdminList($sTableID, $oSort);
$arHeaders = array(array('id' => 'ID', 'content' => 'ID', 'sort' => 'ID', 'default' => true));
$USER_FIELD_MANAGER->AdminListAddHeaders('HLBLOCK_' . $hlblock['ID'], $arHeaders);
// show all by default
foreach ($arHeaders as &$arHeader) {
$arHeader['default'] = true;
}
unset($arHeader);
$lAdmin->AddHeaders($arHeaders);
if (!in_array($by, $lAdmin->GetVisibleHeaderColumns(), true)) {
$by = 'ID';
}
// select data
$rsData = $entity_data_class::getList(array("select" => $lAdmin->GetVisibleHeaderColumns(), "order" => array($by => strtoupper($order))));
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
if ($_REQUEST["mode"] !== "list") {
// menu
$aMenu = array(array("TEXT" => GetMessage('HLBLOCK_ADMIN_ROWS_ADD_NEW_BUTTON'), "TITLE" => GetMessage('HLBLOCK_ADMIN_ROWS_ADD_NEW_BUTTON'), "LINK" => "highloadblock_row_edit.php?ENTITY_ID=" . intval($_REQUEST['ENTITY_ID']) . "&lang=" . LANGUAGE_ID, "ICON" => "btn_new"), array("TEXT" => GetMessage('HLBLOCK_ADMIN_ROWS_EDIT_ENTITY'), "TITLE" => GetMessage('HLBLOCK_ADMIN_ROWS_EDIT_ENTITY'), "LINK" => "highloadblock_entity_edit.php?ID=" . $hlblock['ID'] . "&lang=" . LANGUAGE_ID, "ICON" => "btn_edit"));
$context = new CAdminContextMenu($aMenu);
}
// build list
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PAGES")));
while ($arRes = $rsData->NavNext(true, "f_")) {
$row = $lAdmin->AddRow($f_ID, $arRes);
示例14: array
if (ControllerIsSharedMode()) {
$arHeaders[] = array("id" => "SHARED_KERNEL", "content" => GetMessage("CTRL_MEMB_ADMIN_COLUMN_SHARED_KERN"), "sort" => "SHARED_KERNEL", "align" => "center");
}
if (COption::GetOptionString("controller", "show_hostname") == "Y") {
$arHeaders[] = array("id" => "HOSTNAME", "content" => GetMessage("CTRL_MEMB_ADMIN_COLUMN_HOSTNAME"), "sort" => "HOSTNAME");
}
$arCounters = array();
$rsCounters = CControllerCounter::GetList();
while ($arCounter = $rsCounters->Fetch()) {
$key = "COUNTER_" . $arCounter["ID"];
$arCounters[$key] = $arCounter;
$arHeaders[] = array("id" => $key, "content" => htmlspecialcharsex($arCounter["NAME"]), "sort" => $key, "align" => $arCounter["COUNTER_FORMAT"] == "F" ? "right" : "left");
}
$USER_FIELD_MANAGER->AdminListAddHeaders($entity_id, $arHeaders);
$lAdmin->AddHeaders($arHeaders);
$arSelect = $lAdmin->GetVisibleHeaderColumns();
$arSelect[] = "ID";
$arSelect[] = "DISCONNECTED";
$arSelect[] = "SHARED_KERNEL";
if (in_array("MODIFIED_BY", $arSelect)) {
$arSelect[] = "MODIFIED_BY_USER";
}
if (in_array("CREATED_BY", $arSelect)) {
$arSelect[] = "CREATED_BY_USER";
}
$rsData = CControllerMember::GetList(array($by => $order), $arFilter, $arSelect, array(), array("nPageSize" => CAdminResult::GetNavSize($sTableID)));
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("CTRL_MEMB_ADMIN_NAVSTRING")));
while ($arRes = $rsData->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arRes);
示例15: htmlspecialcharsbx
if ($bWorkflow) {
$row->AddCheckField("WORKFLOW");
}
} else {
if ($arIBTYPE["SECTIONS"] == "Y") {
$row->AddViewField("NAME", '<a href="' . htmlspecialcharsbx(CIBlock::GetAdminSectionListLink($f_ID, array('find_section_section' => 0))) . '" title="' . GetMessage("IBLOCK_ADM_TO_SECTLIST") . '">' . $f_NAME . '</a>');
} else {
$row->AddViewField("NAME", '<a href="' . htmlspecialcharsbx(CIBlock::GetAdminElementListLink($f_ID, array('find_section_section' => -1))) . '" title="' . GetMessage("IBLOCK_ADM_TO_EL_LIST") . '">' . $f_NAME . '</a>');
}
$row->AddCheckField("ACTIVE", false);
$row->AddCheckField("INDEX_ELEMENT", false);
if ($bWorkflow) {
$row->AddCheckField("WORKFLOW", false);
}
}
if (in_array("ELEMENT_CNT", $lAdmin->GetVisibleHeaderColumns())) {
$f_ELEMENT_CNT = CIBlock::GetElementCount($f_ID);
$row->AddViewField("ELEMENT_CNT", '<a href="' . htmlspecialcharsbx(CIBlock::GetAdminElementListLink($f_ID, array('find_section_section' => -1))) . '" title="' . GetMessage("IBLOCK_ADM_TO_ELLIST") . '">' . $f_ELEMENT_CNT . '</a>');
}
if ($arIBTYPE["SECTIONS"] == "Y" && in_array("SECTION_CNT", $lAdmin->GetVisibleHeaderColumns())) {
$row->AddViewField("SECTION_CNT", '<a href="' . htmlspecialcharsbx(CIBlock::GetAdminSectionListLink($f_ID, array())) . '" title="' . GetMessage("IBLOCK_ADM_TO_SECTLIST") . '">' . IntVal(CIBlockSection::GetCount(array("IBLOCK_ID" => $f_ID))) . '</a>');
}
if ($bBizproc && $dbrs["BIZPROC"] == "Y" && in_array("WORKFLOW_TEMPLATES", $lAdmin->GetVisibleHeaderColumns()) && IsModuleInstalled("bizprocdesigner")) {
$cnt = CBPDocument::GetNumberOfWorkflowTemplatesForDocumentType(array("iblock", "CIBlockDocument", "iblock_" . $f_ID));
$row->AddViewField("WORKFLOW_TEMPLATES", '<a href="/bitrix/admin/iblock_bizproc_workflow_admin.php?document_type=iblock_' . $f_ID . '&lang=' . LANGUAGE_ID . '&back_url_list=' . urlencode($APPLICATION->GetCurPageParam("", array())) . '">' . $cnt . '</a>');
}
$arActions = array();
if ($_REQUEST["admin"] == "Y" && CIBlockRights::UserHasRightTo($f_ID, $f_ID, "iblock_edit")) {
$arActions[] = array("ICON" => "edit", "TEXT" => GetMessage("MAIN_ADMIN_MENU_EDIT"), "DEFAULT" => $_REQUEST["admin"] == "Y", "ACTION" => $lAdmin->ActionRedirect("iblock_edit.php?ID=" . $f_ID . "&type=" . urlencode($type) . "&lang=" . LANGUAGE_ID . "&admin=" . ($_REQUEST["admin"] == "Y" ? "Y" : "N")));
$arActions[] = array("ICON" => "list", "TEXT" => GetMessage("IBLOCK_ADM_MENU_PROPERTIES"), "ACTION" => $lAdmin->ActionRedirect("iblock_property_admin.php?IBLOCK_ID=" . $f_ID . "&lang=" . LANGUAGE_ID . ($_REQUEST["admin"] == "Y" ? "&admin=Y" : "&admin=N")));
}