本文整理汇总了PHP中CLang::Update方法的典型用法代码示例。如果您正苦于以下问题:PHP CLang::Update方法的具体用法?PHP CLang::Update怎么用?PHP CLang::Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLang
的用法示例。
在下文中一共展示了CLang::Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
if (!$ob->Delete($ID)) {
$DB->Rollback();
if ($ex = $APPLICATION->GetException()) {
$er = $ex->GetString();
} else {
$er = GetMessage("DELETE_ERROR");
}
$lAdmin->AddGroupError($er, $ID);
}
$DB->Commit();
break;
case "activate":
case "deactivate":
$ob = new CLang();
$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 = CLang::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" => "id", "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" => "DIR", "content" => GetMessage("DIR"), "sort" => "dir", "default" => true), array("id" => "DEF", "content" => GetMessage("DEF"), "sort" => "def", "default" => true)));
while ($arRes = $rsData->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arRes, "site_edit.php?LID=" . urlencode($arRes['ID']) . "&lang=" . LANGUAGE_ID, GetMessage("SITE_EDIT"));
$row->AddViewField("ID", '<a href="site_edit.php?lang=' . LANGUAGE_ID . '&LID=' . urlencode($arRes['ID']) . '" title="' . GetMessage("SITE_EDIT_TITLE") . '">' . $f_ID . '</a>');
示例2: rtrim
if (!array_key_exists("START_SITE_WIZARD_REWRITE", $_POST) || $_POST["START_SITE_WIZARD_REWRITE"] != "Y") {
if (strlen($arFields["DOC_ROOT"]) > 0) {
$sr = Rel2Abs($_SERVER["DOCUMENT_ROOT"], $arFields["DOC_ROOT"]);
} else {
$sr = rtrim($_SERVER["DOCUMENT_ROOT"], "/\\");
}
$ber = !file_exists($sr . $_POST["DIR"] . "/index.php");
if (!$ber) {
$APPLICATION->ThrowException(GetMessage("START_SITE_WIZARD_REWRITE_ERROR"));
}
}
}
if ($ber) {
$langs = new CLang();
if (!$bNew) {
$res = $langs->Update($LID, $arFields);
} else {
$res = strlen($langs->Add($arFields)) > 0;
}
}
if (!$res) {
$bVarsFromForm = true;
} else {
$em = new CEventMessage();
if ($_POST["SITE_MESSAGE_LINK"] == "C" && $_POST["SITE_MESSAGE_LINK_C_SITE"] != '') {
$db_msg = CEventMessage::GetList($o = "", $b = "", array("SITE_ID" => $_POST["SITE_MESSAGE_LINK_C_SITE"]));
while ($ar_msg = $db_msg->Fetch()) {
unset($ar_msg["TIMESTAMP_X"]);
$ar_msg["LID"] = $LID;
$em->Add($ar_msg);
}
示例3: OnPostForm
function OnPostForm()
{
$wizard = &$this->GetWizard();
if ($wizard->IsNextButtonClick())
{
$SITES = $wizard->GetVar('sites');
$arSitesPassed = array();
$pub_files = $wizard->GetVar('public_files_installed');
$pub_data = $wizard->GetVar('public_data_installed');
$pub_updater = $wizard->GetVar('public_data_updater');
$arErrors=array();
if (is_array($SITES) && count($SITES)) {
$rS = CSite::GetList($ord='id', $dir='asc', array('ACTIVE'=>'Y'));
$arSites = array();
while($arr = $rS->Fetch()) {
$arSites[$arr['LID']] = $arr;
}
foreach($SITES as $ST) {
if (! in_array($ST, array_keys($arSites)) || !($arSites[$ST]['DIR'] || $arSites[$ST]['DOC_ROOT'])) {
$arErrors[] = array('LID'=>$ST, 'MSG'=>GetMessage('WD_SITE_NOT_FOUND'));
continue;
}
if (! empty($arSites[$ST]['DOC_ROOT'])) {
if (! is_writable($arSites[$ST]['DOC_ROOT']) ) {
$arErrors[] = array('LID'=>$ST, 'NAME'=>$arSites[$ST]['NAME'], 'PATH'=>$arSites[$ST]['DOC_ROOT'], 'MSG'=>GetMessage('WD_SITE_NOT_WRITABLE'));
continue;
}
else {
$doc_root = preg_replace('#\/$#', '', $arSites[$ST]['DOC_ROOT']);
}
}
else {
if (! is_writable($_SERVER['DOCUMENT_ROOT'] . $arSites[$ST]['DIR']) ) {
$arErrors[] = array('LID'=>$ST, 'NAME'=>$arSites[$ST]['NAME'], 'PATH'=>$_SERVER['DOCUMENT_ROOT'] . $arSites[$ST]['DIR'], 'MSG'=>GetMessage('WD_SITE_NOT_WRITABLE'));
continue;
}
else {
$doc_root = preg_replace('#\/$#', '', $_SERVER['DOCUMENT_ROOT'] . $arSites[$ST]['DIR']);
}
}
$tmpls = $wizard->GetVar('template_installed');
$arFields=array();
$arFields['NAME'] = $arSites[$ST]['NAME'];
$index=1;
foreach($tmpls as $tp) {
$arFields["TEMPLATE"][] = array(
"TEMPLATE" => $tp,
"SORT" => $index++,
"CONDITION" => ''
);
}
$bIsUTF = (defined('BX_UTF') && BX_UTF == true);
if (!$bIsUTF) {
if (CopyDirFiles(str_replace('\\', '/', dirname(__FILE__)) . '/public_files', $doc_root, true, true) !== false) {
$pub_files[] = '[' . $arSites[$ST]['LID'] . '] ' . $arSites[$ST]['NAME'];
$langs = new CLang;
if ($langs->Update($ST, $arFields) === false) {
$arErrors[] = array('LID'=>$ST, 'NAME'=>$arSites[$ST]['NAME'], 'MSG'=>GetMessage('WD_TPL_NOT_ASSIGN'));
}
$arSitesPassed[] = $ST;
}
else {
$this->SetError( GetMessage('WD_STEP_2_NOT_INSTALLED') );
}
}
else {
if (WizardServices::CopyDirFilesEx(str_replace('\\', '/', dirname(__FILE__)) . '/public_files', $doc_root) !== false) {
$pub_files[] = '[' . $arSites[$ST]['LID'] . '] ' . $arSites[$ST]['NAME'];
$langs = new CLang;
if ($langs->Update($ST, $arFields) === false) {
$arErrors[] = array('LID'=>$ST, 'NAME'=>$arSites[$ST]['NAME'], 'MSG'=>GetMessage('WD_TPL_NOT_ASSIGN'));
}
$arSitesPassed[] = $ST;
}
else {
$this->SetError( GetMessage('WD_STEP_2_NOT_INSTALLED') );
}
}
}
}
$wizard->SetVar('errors', $arErrors);
$wizard->SetVar('public_files_installed', $pub_files);
//$install_data = $wizard->GetVar('install_data');
if (count($arSitesPassed) && count($pub_data)) {
CModule::IncludeModule('iblock');
// create iblock type
$arType = array(
'ID'=>'BT',
"SECTIONS" => "Y",
"IN_RSS" => "N",
"SORT" => 100,
//.........这里部分代码省略.........