예제 #1
0
     }
     if (in_array($copy_id, $operations)) {
         $new_ops[] = $copy_id;
     }
     if (in_array(6, $operations)) {
         $new_ops[] = 6;
     }
     $query = "INSERT INTO rbac_pa SET " . "rol_id = " . $ilDB->quote($pa_row->rol_id) . ", " . "ops_id = " . $ilDB->quote(serialize($new_ops)) . ", " . "ref_id = " . $ilDB->quote($file_ref_id) . " ";
     $ilDB->query($query);
 }
 // INSERT file_data
 $query = "INSERT INTO file_data (file_id,file_name,file_type,file_size,version,f_mode) " . "VALUES (" . $ilDB->quote($file_obj_id) . ", " . $ilDB->quote($row->file_name) . ", " . $ilDB->quote($row->file_type) . ", " . $ilDB->quote($row->file_size) . ", " . $ilDB->quote(1) . ", " . $ilDB->quote('object') . ")";
 $ilDB->query($query);
 // Move File
 $fss = new ilFSStorageFile($file_obj_id);
 ilUpdateUtils::makeDirParents($fss->getAbsolutePath() . '/001');
 $ess = new ilFSStorageEvent($row->event_id);
 if ($fss->rename($ess->getAbsolutePath() . '/' . $row->file_id, $fss->getAbsolutePath() . '/001/' . $row->file_name)) {
     $ilLog->write('Success renaming file: ' . $ess->getAbsolutePath() . '/' . $row->file_id . " to " . $fss->getAbsolutePath() . '/001/' . $row->file_name);
 } else {
     $ilLog->write('Error renaming file: ' . $ess->getAbsolutePath() . '/' . $row->file_id . " to " . $fss->getAbsolutePath() . '/001/' . $row->file_name);
 }
 // Meta data
 $next_id = $ilDB->nextId("il_meta_general");
 $query = "INSERT INTO il_meta_general (meta_general_id,rbac_id,obj_id,obj_type, " . "general_structure,title,title_language,coverage,coverage_language) " . "VALUES( " . $ilDB->quote($next_id, 'integer') . ", " . $ilDB->quote($file_obj_id, 'integer') . ", " . $ilDB->quote($file_obj_id, 'integer') . ", " . $ilDB->quote('file', 'text') . ", " . $ilDB->quote('Hierarchical', 'text') . ", " . $ilDB->quote($row->file_name, 'text') . ", " . $ilDB->quote('en', 'text') . ", " . $ilDB->quote('', 'text') . ", " . $ilDB->quote('en', 'text') . " " . ")";
 $ilDB->query($query);
 // MD technical
 $next_id = $ilDB->nextId('il_meta_technical');
 $query = "INSERT INTO il_meta_technical (meta_technical_id,rbac_id,obj_id,obj_type, " . "t_size,ir,ir_language,opr,opr_language,duration) " . "VALUES( " . $ilDB->quote($next_id, 'integer') . ", " . $ilDB->quote($file_obj_id, 'integer') . ", " . $ilDB->quote($file_obj_id, 'integer') . ", " . $ilDB->quote('file', 'text') . ", " . $ilDB->quote($row->file_size, 'text') . ", " . $ilDB->quote('', 'text') . ", " . $ilDB->quote('en', 'text') . ", " . $ilDB->quote('', 'text') . ", " . $ilDB->quote('en', 'text') . ", " . $ilDB->quote('', 'text') . " " . ")";
 $ilDB->query($query);
 // MD Format
 /**
  * Create directory
  *
  * @access public
  * 
  */
 public function create()
 {
     if (!file_exists($this->short_path)) {
         ilUpdateUtils::makeDirParents(ilUpdateUtils::removeTrailingPathSeparators($this->short_path));
     }
     return true;
 }