Ejemplo n.º 1
0
 /**
  * Clone course data directory
  *
  * @access public
  * @static
  *
  * @param string obj_id source
  * @param string obj_id target
  */
 public static function _clone($a_source_id, $a_target_id)
 {
     $source = new ilFSStorageCourse($a_source_id);
     $target = new ilFSStorageCourse($a_target_id);
     $target->create();
     ilFileSystemStorage::_copyDirectory($source->getAbsolutePath(), $target->getAbsolutePath());
     // Delete member export files
     $target->deleteDirectory($target->getMemberExportDirectory());
     unset($source);
     unset($target);
     return true;
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @access public
  * @param int storage type
  * @param bool En/Disable automatic path conversion. If enabled files with id 123 will be stored in directory files/1/file_123
  * @param int object id of container (e.g file_id or mob_id)
  * 
  */
 public function __construct($a_container_id = 0)
 {
     parent::__construct(self::STORAGE_WEB, true, $a_container_id);
 }
Ejemplo n.º 3
0
 /**
  * init and create directory
  */
 protected function init()
 {
     parent::init();
     $this->create();
 }
 /**
  * Create directory
  *
  * @access public
  * 
  */
 public function create()
 {
     parent::create();
     if (!file_exists($this->submission_path)) {
         ilUtil::makeDirParents($this->submission_path);
     }
     if (!file_exists($this->tmp_path)) {
         ilUtil::makeDirParents($this->tmp_path);
     }
     if (!file_exists($this->feedb_path)) {
         ilUtil::makeDirParents($this->feedb_path);
     }
     return true;
 }
Ejemplo n.º 5
0
 /**
  * Constructor
  *
  * @access public
  * 
  */
 public function __construct($a_container_id = 0)
 {
     global $log;
     $this->log = $log;
     parent::__construct(ilFileSystemStorage::STORAGE_DATA, true, $a_container_id);
 }
Ejemplo n.º 6
0
 /**
  * Constructor
  *
  * @access public
  * @param int object id of container (e.g file_id or mob_id)
  * 
  */
 public function __construct($a_container_id, $a_usr_id)
 {
     $this->usr_id = $a_usr_id;
     parent::__construct(self::STORAGE_DATA, true, $a_container_id);
     $this->appendToPath('_' . $this->usr_id);
 }
Ejemplo n.º 7
0
 /**
  * Get export directory for an repository object
  *
  * @param int $a_obj_id object id
  * @param string $a_type export type ("xml", "html", ...), default "xml"
  * @param string $a_obj_type object type (optional, if not given, type is looked up)
  *
  * @return string export directory
  */
 public static function _getExportDirectory($a_obj_id, $a_type = "xml", $a_obj_type = "", $a_entity = "")
 {
     global $objDefinition;
     $ent = $a_entity == "" ? "" : "_" . $a_entity;
     if ($a_obj_type == "") {
         $a_obj_type = ilObject::_lookupType($a_obj_id);
     }
     if (in_array($a_obj_type, self::$new_file_structure)) {
         include_once './Services/FileSystem/classes/class.ilFileSystemStorage.php';
         $dir = ilUtil::getDataDir() . DIRECTORY_SEPARATOR;
         $dir .= 'il' . $objDefinition->getClassName($a_obj_type) . $ent . DIRECTORY_SEPARATOR;
         $dir .= ilFileSystemStorage::_createPathFromId($a_obj_id, $a_obj_type) . DIRECTORY_SEPARATOR;
         $dir .= $a_type == 'xml' ? 'export' : 'export_' . $a_type;
         return $dir;
     }
     include_once './Services/Export/classes/class.ilImportExportFactory.php';
     $exporter_class = ilImportExportFactory::getExporterClass($a_obj_type);
     $export_dir = call_user_func(array($exporter_class, 'lookupExportDirectory'), $a_obj_type, $a_obj_id, $a_type, $a_entity);
     $GLOBALS['ilLog']->write(__METHOD__ . ': Export dir is ' . $export_dir);
     return $export_dir;
 }
 public function getPath()
 {
     return parent::getPath() . '/' . $this->subPath;
 }
 /**
  * @param integer $activeId
  */
 public function __construct($activeId)
 {
     parent::__construct(ilFileSystemStorage::STORAGE_DATA, true, $activeId);
 }