bool CCourseImport::ImportPackage();
The ImportPackage method imports a course.
The method returns true on success, or false otherwise. If an error occurs, the LAST_ERROR property will contain the error description.
<?
if (CModule::IncludeModule("learning"))
{
if ($USER->IsAdmin())
{
@set_time_limit(0);
$package = new CCourseImport($PACKAGE_DIR = "/upload/mypackage/",
Array("ru", "en"));
if (strlen($package->LAST_ERROR) > 0)
{
echo "Error: ".$package->LAST_ERROR;
}
else
{
$success = $package->ImportPackage();
if (!$success)
echo "Error: ".$package->LAST_ERROR;
else
echo "Ok!";
}
}
}
?>| © 2001-2007 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |