當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CAdminList::actionRedirect方法代碼示例

本文整理匯總了PHP中CAdminList::actionRedirect方法的典型用法代碼示例。如果您正苦於以下問題:PHP CAdminList::actionRedirect方法的具體用法?PHP CAdminList::actionRedirect怎麽用?PHP CAdminList::actionRedirect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CAdminList的用法示例。


在下文中一共展示了CAdminList::actionRedirect方法的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

     $stop_date = $abtest['STOP_DATE'] ? $abtest['STOP_DATE']->format(Bitrix\Main\Type\Date::convertFormatToPhp($arLang['FORMAT_DATE'])) : false;
     $user_name = $abtest['USER_ID'] ? CUser::formatName(CSite::getNameFormat(), array('TITLE' => $abtest['USER_TITLE'], 'NAME' => $abtest['USER_NAME'], 'SECOND_NAME' => $abtest['USER_SECOND_NAME'], 'LAST_NAME' => $abtest['USER_LAST_NAME'], 'LOGIN' => $abtest['USER_LOGIN']), true, true) : false;
     $status = '<table style="width: 100%; border-spacing: 0px; "><tr>';
     $status .= '<td style="width: 1px; padding: 0px; vertical-align: top; "><img src="/bitrix/images/abtest/ab-test-off.gif"></td>';
     $status .= '<td style="padding: 0px 10px; vertical-align: top; ">';
     $status .= '<span style="white-space: nowrap; font-weight: bold; ">' . getMessage('ABTEST_STATE_STOPPED') . '</span><br>';
     if ($stop_date) {
         $status .= '<span style="white-space: nowrap; ">' . getMessage('ABTEST_STOP_DATE') . ': ' . $stop_date . '</span><br>';
     }
     if ($user_name) {
         $status .= '<span style="white-space: nowrap; ">' . getMessage('ABTEST_STOPPED_BY') . ': <a href="/bitrix/admin/user_edit.php?ID=' . $abtest['USER_ID'] . '&lang=' . LANG . '">' . $user_name . '</a></span>';
     }
     $status .= '</td>';
     if ($isAdmin) {
         if ($abtest['ENABLED'] == 'T') {
             $action = $lAdmin->actionRedirect('abtest_edit.php?ID=' . $abtest['ID'] . '&lang=' . LANG);
         } else {
             if (empty($arActiveTests[$abtest['SITE_ID']])) {
                 $action = 'if (confirm(\'' . CUtil::JSEscape(getMessage('ABTEST_START_CONFIRM')) . '\')) ' . $lAdmin->actionDoGroup($abtest['ID'], 'start');
             } else {
                 $action = 'alert(\'' . CUtil::JSEscape(getMessage('ABTEST_ONLYONE_WARNING')) . '\')';
             }
         }
         if (empty($arActiveTests[$abtest['SITE_ID']])) {
             $status .= '<td style="width: 1px; padding: 0px; vertical-align: top; "><span class="adm-btn adm-btn-green" onclick="' . $action . '">' . getMessage('ABTEST_BTN_START') . '</span></td>';
         } else {
             $status .= '<td style="width: 1px; padding: 0px; vertical-align: top; "><span class="adm-btn adm-btn-disabled" style="margin-right: 0px; " onclick="' . $action . '">' . getMessage('ABTEST_BTN_START') . '</span></td>';
         }
     }
     $status .= '</tr></table>';
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:abtest_admin.php


注:本文中的CAdminList::actionRedirect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。