Cleaning code

skala
Julio Montoya 15 years ago
parent 9fbb87a26d
commit 25aa1aac19
  1. 10
      main/coursecopy/classes/CourseRestorer.class.php

@ -27,7 +27,8 @@ define('FILE_OVERWRITE', 3);
/** /**
* Class to restore items from a course object to a Dokeos-course * Class to restore items from a course object to a Dokeos-course
* @author Bart Mollet <bart.mollet@hogent.be> * @author Bart Mollet <bart.mollet@hogent.be>
* @package dokeos.backup * @author Julio Montoya <gugli100@gmail.com> Several fixes/improvements
* @package chamilo.backup
*/ */
class CourseRestorer class CourseRestorer
{ {
@ -43,8 +44,7 @@ class CourseRestorer
/** /**
* Create a new CourseRestorer * Create a new CourseRestorer
*/ */
function CourseRestorer($course) function CourseRestorer($course) {
{
$this->course = $course; $this->course = $course;
$this->file_option = FILE_RENAME; $this->file_option = FILE_RENAME;
} }
@ -63,8 +63,7 @@ class CourseRestorer
* @param string $destination_course_code The code of the Dokeos-course in * @param string $destination_course_code The code of the Dokeos-course in
* which the resources should be stored. Default: Current Dokeos-course. * which the resources should be stored. Default: Current Dokeos-course.
*/ */
function restore($destination_course_code = '',$session_id = 0) function restore($destination_course_code = '',$session_id = 0) {
{
if ($destination_course_code == '') { if ($destination_course_code == '') {
$course_info = api_get_course_info(); $course_info = api_get_course_info();
$this->course->destination_db = $course_info['dbName']; $this->course->destination_db = $course_info['dbName'];
@ -185,6 +184,7 @@ class CourseRestorer
* Restore documents * Restore documents
*/ */
function restore_documents($session_id = 0, $destination_course_code = '') { function restore_documents($session_id = 0, $destination_course_code = '') {
$perm = api_get_permissions_for_new_directories(); $perm = api_get_permissions_for_new_directories();
if ($this->course->has_resources(RESOURCE_DOCUMENT)) { if ($this->course->has_resources(RESOURCE_DOCUMENT)) {

Loading…
Cancel
Save