public function __construct($course_id, $section_i)
 {
     parent::__construct($course_id, $section_i);
     // 初期値設定
     // true|false ではなく 1|0 で指定
     // マジックナンバーはコメント参照 (無いものは未調査)
     $this->prefs->course_id = $this->course->id;
     $this->prefs->section = $this->section->id;
     $this->prefs->restoreto = 1;
     //既存コース (2: コースを新規作成)
     $this->prefs->metacourse = 0;
     $this->prefs->users = 2;
     $this->prefs->logs = 0;
     $this->prefs->user_files = 0;
     $this->prefs->course_files = 1;
     $this->prefs->site_files = 1;
     $this->prefs->gradebook_history = 0;
     $this->prefs->messages = 0;
     $this->prefs->newdirectoryname = NULL;
     if ($this->course->format == 'project') {
         // project フォーマットの場合はリストア先のセクションディレクトリ名を取得
         require_once $GLOBALS['CFG']->dirroot . '/course/format/project/lib.php';
         $project_title = project_format_get_title($this->course, $this->section->id, $this->section->section);
         if (!$project_title) {
             throw new SharingCart_SectionException('Project format section title not found');
         }
         $this->prefs->newdirectoryname = $project_title->directoryname;
     }
     $this->prefs->course_startdateoffset = 0;
     $this->prefs->course_shortname = NULL;
 }
 public function __construct($course_id, $section_i)
 {
     parent::__construct($course_id, $section_i);
     // 初期値設定
     // true|false ではなく 1|0 で指定
     // 2 以上のマジックナンバーはコメント参照 (無いものは未調査)
     $this->prefs->backup_course = $this->course->id;
     $this->prefs->backup_section = $this->section->id;
     $this->prefs->backup_metacourse = 1;
     $this->prefs->backup_users = 2;
     $this->prefs->backup_logs = 0;
     $this->prefs->backup_user_files = 0;
     $this->prefs->backup_course_files = 1;
     $this->prefs->backup_site_files = 0;
     $this->prefs->backup_gradebook_history = 0;
     $this->prefs->backup_messages = 0;
     $this->prefs->backup_blogs = 0;
     $this->prefs->newdirectoryname = NULL;
     $this->zip_userdata = array();
     $this->zip_userfile = array();
 }