За комментируйте пожалуйста работу метода InstallDB:
function InstallDB($arParams = array())
{
global $DB, $DBType, $APPLICATION;
$this->errors = false;
if(!$DB->Query("SELECT 'x' FROM b_learn_course WHERE 1=0", true))
{
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/learning/install/db/".strtolower($DB->type)."/install.sql" ;
}
if($this->errors !== false)
{
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
}
else
{
RegisterModule("learning" ;
RegisterModuleDependences("main", "OnGroupDelete", "learning", "CCourse", "OnGroupDelete" ;
RegisterModuleDependences("main", "OnBeforeLangDelete", "learning", "CCourse", "OnBeforeLangDelete" ;
RegisterModuleDependences("main", "OnUserDelete", "learning", "CCourse", "OnUserDelete" ;
RegisterModuleDependences("main", "OnSiteDelete", "learning", "CSitePath", "DeleteBySiteID" ;
RegisterModuleDependences("search", "OnReindex", "learning", "CCourse", "OnSearchReindex" ;
RegisterModuleDependences("main", "OnGetRatingContentOwner", "learning", "CRatingsComponentsLearning", "OnGetRatingContentOwner", 200);
RegisterModuleDependences("main", "OnAddRatingVote", "learning", "CRatingsComponentsLearning", "OnAddRatingVote", 200);
RegisterModuleDependences("main", "OnCancelRatingVote", "learning", "CRatingsComponentsLearning", "OnCancelRatingVote", 200);
if ($DB->Query("SELECT 'x' FROM b_learn_site_path WHERE 1=0", true))
{
$sites = CLang::GetList($by, $order, Array("ACTIVE"=>"Y" );
while($site = $sites->Fetch())
{
$path = "/learning/";
if($_REQUEST["copy_".$site["LID"]] == "Y" && !empty($_REQUEST["path_".$site["LID"]] )
{
$path = $_REQUEST["path_".$site["LID"]];
}
$DB->Query(
"INSERT INTO b_learn_site_path(ID, SITE_ID, PATH,TYPE) ".
"VALUES".
"(NULL , '".$site["LID"]."', '".$path."course/index.php?COURSE_ID=#COURSE_ID#&INDEX=Y', 'C'),".
"(NULL , '".$site["LID"]."', '".$path."course/index.php?COURSE_ID=#COURSE_ID#&CHAPTER_ID=#CHAPTER_ID#', 'H'),".
"(NULL , '".$site["LID"]."', '".$path."course/index.php?COURSE_ID=#COURSE_ID#&LESSON_ID=#LESSON_ID#', 'L')"
, true);
}
}
return true;
}
}
function InstallDB($arParams = array())
{
global $DB, $DBType, $APPLICATION;
$this->errors = false;
if(!$DB->Query("SELECT 'x' FROM b_learn_course WHERE 1=0", true))
{
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/learning/install/db/".strtolower($DB->type)."/install.sql" ;
}
if($this->errors !== false)
{
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
}
else
{
RegisterModule("learning" ;
RegisterModuleDependences("main", "OnGroupDelete", "learning", "CCourse", "OnGroupDelete" ;
RegisterModuleDependences("main", "OnBeforeLangDelete", "learning", "CCourse", "OnBeforeLangDelete" ;
RegisterModuleDependences("main", "OnUserDelete", "learning", "CCourse", "OnUserDelete" ;
RegisterModuleDependences("main", "OnSiteDelete", "learning", "CSitePath", "DeleteBySiteID" ;
RegisterModuleDependences("search", "OnReindex", "learning", "CCourse", "OnSearchReindex" ;
RegisterModuleDependences("main", "OnGetRatingContentOwner", "learning", "CRatingsComponentsLearning", "OnGetRatingContentOwner", 200);
RegisterModuleDependences("main", "OnAddRatingVote", "learning", "CRatingsComponentsLearning", "OnAddRatingVote", 200);
RegisterModuleDependences("main", "OnCancelRatingVote", "learning", "CRatingsComponentsLearning", "OnCancelRatingVote", 200);
if ($DB->Query("SELECT 'x' FROM b_learn_site_path WHERE 1=0", true))
{
$sites = CLang::GetList($by, $order, Array("ACTIVE"=>"Y" );
while($site = $sites->Fetch())
{
$path = "/learning/";
if($_REQUEST["copy_".$site["LID"]] == "Y" && !empty($_REQUEST["path_".$site["LID"]] )
{
$path = $_REQUEST["path_".$site["LID"]];
}
$DB->Query(
"INSERT INTO b_learn_site_path(ID, SITE_ID, PATH,TYPE) ".
"VALUES".
"(NULL , '".$site["LID"]."', '".$path."course/index.php?COURSE_ID=#COURSE_ID#&INDEX=Y', 'C'),".
"(NULL , '".$site["LID"]."', '".$path."course/index.php?COURSE_ID=#COURSE_ID#&CHAPTER_ID=#CHAPTER_ID#', 'H'),".
"(NULL , '".$site["LID"]."', '".$path."course/index.php?COURSE_ID=#COURSE_ID#&LESSON_ID=#LESSON_ID#', 'L')"
, true);
}
}
return true;
}
}