bool CCourseImport::CCourseImport( string PACKAGE_DIR, array arSITE_ID );
The CCourseImport constructor of the CCourseImport class is used to initialize the course to be imported.
Parameter | Description |
---|---|
PACKAGE_DIR | Path to the directory (relative to the site root) where the course archive is located. |
arSITE_ID | An array of the site identifiers describing sites to which the imported course will be bound. |
If an error occurs, the LAST_ERROR object 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 |