- Модуль: learning
- Путь к файлу: ~/bitrix/modules/learning/classes/mysql/sitepath.php
- Класс: CSitePath
- Вызов: CSitePath::Add
static function Add($arFields)
{
global $DB;
$arFields1 = array();
foreach ($arFields as $key => $value)
{
if (mb_substr($key, 0, 1) == "=")
{
$arFields1[mb_substr($key, 1)] = $value;
unset($arFields[$key]);
}
}
if (!CSitePath::CheckFields("ADD", $arFields))
return false;
$arInsert = $DB->PrepareInsert("b_learn_site_path", $arFields);
foreach ($arFields1 as $key => $value)
{
if ($arInsert[0] <> '')
$arInsert[0] .= ", ";
$arInsert[0] .= $key;
if ($arInsert[1] <> '')
$arInsert[1] .= ", ";
$arInsert[1] .= $value;
}
if ($arInsert[0] <> '')
{
$strSql =
"INSERT INTO b_learn_site_path(".$arInsert[0].") ".
"VALUES(".$arInsert[1].")";
$DB->Query($strSql, False, "File: ".__FILE__."
Line: ".__LINE__);
$ID = intval($DB->LastID());
return $ID;
}
return False;
}