本文整理匯總了PHP中CAgent::GetById方法的典型用法代碼示例。如果您正苦於以下問題:PHP CAgent::GetById方法的具體用法?PHP CAgent::GetById怎麽用?PHP CAgent::GetById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CAgent
的用法示例。
在下文中一共展示了CAgent::GetById方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Copyright
# Copyright (c) 2002-2007 Bitrix #
# http://www.bitrixsoft.com #
# mailto:admin@bitrixsoft.com #
##############################################
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/prolog.php";
define("HELP_FILE", "utilities/agent_edit.php");
ClearVars("a_");
if (!$USER->CanDoOperation('view_other_settings')) {
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$isAdmin = $USER->CanDoOperation('edit_php');
IncludeModuleLangFile(__FILE__);
$ID = intval($ID);
if ($ID > 0) {
$res = CAgent::GetById($ID);
$arr = $res->ExtractFields("a_");
}
$APPLICATION->SetTitle($ID <= 0 ? GetMessage("MAIN_AGENT_NEW_PAGE_TITLE") : str_replace("#ID#", " {$ID}", GetMessage("MAIN_AGENT_EDIT_PAGE_TITLE")));
$sTableID = "tbl_agent_edit";
$aTabs = array(array("DIV" => "tab1", "TAB" => GetMessage("MAIN_AGENT_TAB"), "ICON" => "main_user_edit", "TITLE" => GetMessage("MAIN_AGENT_TAB_TITLE")));
$editTab = new CAdminTabControl("editTab", $aTabs);
$APPLICATION->ResetException();
if ($REQUEST_METHOD == "POST" && (strlen($save) > 0 || strlen($apply) > 0) && $isAdmin && check_bitrix_sessid()) {
$arFields = array("NAME" => $NAME, "MODULE_ID" => $MODULE_ID, "ACTIVE" => $ACTIVE, "SORT" => $SORT, "IS_PERIOD" => $IS_PERIOD, "AGENT_INTERVAL" => $AGENT_INTERVAL, "NEXT_EXEC" => $NEXT_EXEC, "USER_ID" => false);
if (intval($USER_ID) > 0) {
$arFields["USER_ID"] = $USER_ID;
}
if ($ID > 0) {
$res = CAgent::Update($ID, $arFields);
} else {