本文整理汇总了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 {