当前位置: 首页>>代码示例>>PHP>>正文


PHP CAdminList::addRow方法代码示例

本文整理汇总了PHP中CAdminList::addRow方法的典型用法代码示例。如果您正苦于以下问题:PHP CAdminList::addRow方法的具体用法?PHP CAdminList::addRow怎么用?PHP CAdminList::addRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAdminList的用法示例。


在下文中一共展示了CAdminList::addRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sprintf

$tableId = 'tbl_user_vars_list';
$adminSort = new CAdminSorting($tableId, 'NAME', 'asc');
$adminList = new CAdminList($tableId, $adminSort);
$adminList->addHeaders($headers);
if ($request->getQuery('mode') != 'list') {
    $context = new CAdminContextMenu($contextMenu);
}
$queryBuilder = new Entity\Query(Model\VarsTable::getEntity());
$queryBuilder->setSelect(array('ID', 'NAME', 'CODE', 'DESCRIPTION', 'VALUE'))->setFilter(array('GROUP_ID' => $dataGroup['ID']));
$sortBy = $request->getQuery('by') ? strtoupper($request->getQuery('by')) : 'ID';
$sortOrder = $request->getQuery('order') ?: 'asc';
$queryBuilder->setOrder(array($sortBy => $sortOrder));
$resultData = new CAdminResult($queryBuilder->exec(), $tableId);
$resultData->navStart();
$adminList->navText($resultData->getNavPrint(Loc::getMessage('PAGES')));
while ($item = $resultData->fetch()) {
    $row = $adminList->addRow($item['ID'], $item);
    $actions = array();
    $actions[] = array('ICON' => 'edit', 'TEXT' => Loc::GetMessage('USER_VARS_ACTION_EDIT_VAR'), 'ACTION' => $adminList->actionRedirect('user_vars_edit.php?ID=' . $item['ID'] . '&GROUP_ID=' . $dataGroup['ID']));
    $actions[] = array('ICON' => 'delete', 'TEXT' => Loc::getMessage('USER_VARS_ACTION_DELETE_VAR'), 'ACTION' => "if(confirm('" . Loc::getMessage('USER_VARS_DELETE_VAR_CONFIRM') . "')) " . $adminList->actionRedirect('user_vars_edit.php?action=delete&ID=' . $item['ID'] . '&GROUP_ID=' . $dataGroup['ID'] . '&' . bitrix_sessid_get()));
    $row->addActions($actions);
}
$prologType = $request->getQuery('mode') == 'list' ? 'prolog_js' : 'prolog';
require sprintf('%s%s', getenv('DOCUMENT_ROOT'), $includePath[$prologType]);
if ($prologType != 'prolog_js') {
    $context->show();
}
$adminList->checkListMode();
$adminList->displayList();
$epilogType = $request->getQuery('mode') == 'list' ? 'epilog_js' : 'epilog';
require sprintf('%s%s', getenv('DOCUMENT_ROOT'), $includePath[$epilogType]);
开发者ID:ASDAFF,项目名称:citfact.uservars,代码行数:31,代码来源:user_vars_list.php

示例2: array

$lAdmin->addHeaders($arHeaders);
$result = Bitrix\ABTest\ABTestTable::getList(array('order' => array(strtoupper($by) => $order), 'select' => array('*', 'USER_NAME' => 'USER.NAME', 'USER_LAST_NAME' => 'USER.LAST_NAME', 'USER_SECOND_NAME' => 'USER.SECOND_NAME', 'USER_TITLE' => 'USER.TITLE', 'USER_LOGIN' => 'USER.LOGIN')));
$result = new CAdminResult($result, $sTableID);
$arRows = array();
$arActiveTests = array();
while ($abtest = $result->fetch()) {
    $arRows[] = $abtest;
    if ($abtest['ACTIVE'] == 'Y') {
        if (!isset($arActiveTests[$abtest['SITE_ID']])) {
            $arActiveTests[$abtest['SITE_ID']] = array();
        }
        $arActiveTests[$abtest['SITE_ID']][] = $abtest['ID'];
    }
}
foreach ($arRows as &$abtest) {
    $row =& $lAdmin->addRow($abtest['ID'], $abtest);
    $row->addViewField('TITLE', sprintf('<div%s><b>%s</b><br>%s</div>', in_array($abtest['ENABLED'], array('T', 'Y')) ? '' : ' style="color: #808080; "', htmlspecialcharsbx($abtest['NAME']) ?: str_replace('#ID#', $abtest['ID'], getMessage('ABTEST_TEST_TITLE')), htmlspecialcharsbx($abtest['DESCR'])));
    if (in_array($abtest['ENABLED'], array('T', 'Y'))) {
        if ($abtest['ACTIVE'] == 'Y') {
            $start_date = $abtest['START_DATE']->format(Bitrix\Main\Type\Date::convertFormatToPhp($arLang['FORMAT_DATE']));
            $end_date = null;
            if ($abtest['DURATION'] != 0) {
                if ($abtest['DURATION'] > 0) {
                    $end = clone $abtest['START_DATE'];
                    $end->add(intval($abtest['DURATION']) . ' days');
                    $end_date = $end->format(Bitrix\Main\Type\Date::convertFormatToPhp($arLang['FORMAT_DATE']));
                } else {
                    $siteCapacity = Bitrix\ABTest\AdminHelper::getSiteCapacity($abtest['SITE_ID']);
                    $testCapacity = Bitrix\ABTest\AdminHelper::getTestCapacity($abtest['ID']);
                    if ($abtest['MIN_AMOUNT'] > 0 && $abtest['PORTION'] > 0 && $siteCapacity['daily'] > 0) {
                        $rem = $abtest['MIN_AMOUNT'] - min($testCapacity);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:abtest_admin.php


注:本文中的CAdminList::addRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。