当前位置: 首页>>代码示例>>PHP>>正文


PHP CLanguage::Update方法代码示例

本文整理汇总了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());
        }
    }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:lang_edit.php

示例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"));
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:lang_admin.php

示例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
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:lang_edit.php


注:本文中的CLanguage::Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。