本文整理汇总了PHP中CLanguage::Update方法的典型用法代码示例。如果您正苦于以下问题:PHP CLanguage::Update方法的具体用法?PHP CLanguage::Update怎么用?PHP CLanguage::Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLanguage
的用法示例。
在下文中一共展示了CLanguage::Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
$isAdmin = $USER->CanDoOperation('edit_other_settings');
IncludeModuleLangFile(__FILE__);
$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("MAIN_PARAM"), "ICON" => "lang_edit", "TITLE" => GetMessage("MAIN_PARAM_TITLE")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
$message = null;
$bVarsFromForm = false;
$ID = IntVal($ID);
if ($REQUEST_METHOD == "POST" && (strlen($save) > 0 || strlen($apply) > 0) && $isAdmin && check_bitrix_sessid()) {
$arFields = array("ACTIVE" => $_REQUEST['ACTIVE'], "SORT" => $_REQUEST['SORT'], "DEF" => $_REQUEST['DEF'], "NAME" => $_REQUEST['NAME'], "FORMAT_DATE" => $_REQUEST['FORMAT_DATE'], "FORMAT_DATETIME" => $_REQUEST['FORMAT_DATETIME'], "WEEK_START" => intval($_REQUEST["WEEK_START"]), "FORMAT_NAME" => CSite::GetNameFormatByValue($_REQUEST["FORMAT_NAME"]), "CHARSET" => $_REQUEST['CHARSET'], "DIRECTION" => $_REQUEST['DIRECTION']);
if ($ID <= 0) {
$arFields["LID"] = $LID;
}
$langs = new CLanguage();
if ($ID > 0) {
$res = $langs->Update($LID, $arFields);
} else {
$res = strlen($langs->Add($arFields)) > 0;
$new = "Y";
}
if (!$res) {
$bVarsFromForm = true;
} else {
if (strlen($save) > 0) {
LocalRedirect(BX_ROOT . "/admin/lang_admin.php?lang=" . LANGUAGE_ID);
} elseif ($new == "Y") {
LocalRedirect(BX_ROOT . "/admin/lang_edit.php?lang=" . LANGUAGE_ID . "&LID=" . $LID . "&" . $tabControl->ActiveTabParam());
} else {
LocalRedirect(BX_ROOT . "/admin/lang_edit.php?lang=" . LANGUAGE_ID . "&LID=" . $LID . "&" . $tabControl->ActiveTabParam());
}
}
示例2: switch
}
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
$DB->StartTransaction();
if (!CLanguage::Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
}
$DB->Commit();
break;
case "activate":
case "deactivate":
$ob = new CLanguage();
$arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
if (!$ob->Update($ID, $arFields)) {
$lAdmin->AddGroupError(GetMessage("EDIT_ERROR") . $ob->LAST_ERROR, $ID);
}
break;
}
}
}
$APPLICATION->SetTitle(GetMessage("TITLE"));
$langs = CLanguage::GetList($by, $order, array());
$rsData = new CAdminResult($langs, $sTableID);
$rsData->NavStart();
// установка строки навигации
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PAGES"), false));
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "lid", "default" => true), array("id" => "ACTIVE", "content" => GetMessage('ACTIVE'), "sort" => "active", "default" => true), array("id" => "SORT", "content" => GetMessage('SORT'), "sort" => "sort", "default" => true), array("id" => "NAME", "content" => GetMessage("NAME"), "sort" => "name", "default" => true), array("id" => "DEF", "content" => GetMessage("DEF"), "sort" => "def", "default" => true)));
while ($arRes = $rsData->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arRes, "lang_edit.php?LID=" . $f_ID . "&lang=" . LANGUAGE_ID, GetMessage("LANG_EDIT_TITLE"));
示例3: array
{
$arFields = array(
"ACTIVE" => $_POST['ACTIVE'],
"SORT" => $_POST['SORT'],
"DEF" => $_POST['DEF'],
"NAME" => $_POST['NAME'],
"CULTURE_ID" => $_POST['CULTURE_ID'],
);
if($ID <= 0)
$arFields["LID"] = $_POST["LID"];
$langs = new CLanguage;
if($ID > 0)
{
$res = $langs->Update($_POST["LID"], $arFields);
}
else
{
$res = (strlen($langs->Add($arFields))>0);
}
if(!$res)
{
$bVarsFromForm = true;
}
else
{
if ($_POST["save"] <> '')
LocalRedirect(FX_ROOT."/admin/lang_admin.php?lang=".LANGUAGE_ID);
else