bool CCoursePackage::CreatePackage( int PACKAGE_DIR );
The CreatePackage method creates an archive with the training course.
| Parameter | Description |
|---|---|
| PACKAGE_DIR | Path to the directory (relative to the site root) where the course archive will be created. |
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"))
{
$COURSE_ID = 97;
if (CCourse::GetPermission($COURSE_ID) >= 'W')
{
@set_time_limit(0);
$package = new CCoursePackage($COURSE_ID);
if (strlen($package->LAST_ERROR) > 0)
{
echo "Error: ".$package->LAST_ERROR;
}
else
{
$success = $package->CreatePackage($PACKAGE_DIR = "/upload/mypackage/");
if (!$success)
echo "Error: ".$package->LAST_ERROR;
else
echo "Ok!";
}
}
}
?>| © 2001-2007 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |