本文整理汇总了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]);
示例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>';
}