/** * Overwritten for qpl * @param string $a_obj_type * @param int $a_obj_id * @param string $a_export_type */ public static function lookupExportDirectory($a_obj_type, $a_obj_id, $a_export_type = 'xml', $a_entity = "") { if ($a_export_type == 'xml') { return ilUtil::getDataDir() . "/qpl_data" . "/qpl_" . $a_obj_id . "/export_zip"; } return ilUtil::getDataDir() . "/qpl_data" . "/qpl_" . $a_obj_id . "/export_" . $a_export_type; }
/** * export directory lookup * @return string export directory */ public static function lookupExportDirectory($a_obj_type, $a_obj_id, $a_export_type = 'xml', $a_entity = "") { $ent = $a_entity == "" ? "" : "_" . $a_entity; if ($a_export_type == 'xml') { return ilUtil::getDataDir() . "/" . $a_obj_type . $ent . "_data" . "/" . $a_obj_type . "_" . $a_obj_id . "/export"; } return ilUtil::getDataDir() . "/" . $a_obj_type . $ent . "_data" . "/" . $a_obj_type . "_" . $a_obj_id . "/export_" . $a_export_type; }
public function getRelativePathExMailDirectory() { switch ($this->getStorageType()) { case self::STORAGE_DATA: $path = ilUtil::getDataDir(); break; case self::STORAGE_WEB: $path = ilUtil::getWebspaceDir(); break; } $path = ilUtil::removeTrailingPathSeparators($path); $path .= '/'; // Append path prefix $path .= $this->getPathPrefix() . '/'; return str_replace($path, '', $this->getAbsolutePath()); }
$lng->loadLanguageModule("sop"); $this->lng =& $lng; $this->ctrl =& $ilCtrl; $this->ctrl->saveParameter($this, "ref_id"); $this->offlineMode = new ilSCORMOfflineMode(); $this->online_icon = 'icon_slm_b.png'; $this->offline_icon = 'icon_slm_b_offline.png'; $this->icon = $this->online_icon; } function executeCommand() { global $tpl, $ilCtrl; $this->lmId = ilObject::_lookupObjectId($_GET["ref_id"]); $this->clientIdSop = $this->offlineMode->getClientIdSop(); $cmd = $ilCtrl->getCmd(); $this->setOfflineModeTabs($cmd); switch ($cmd) { case 'offlineMode_il2sopContent': ilUtil::deliverFile(ilUtil::getDataDir() . "/lm_data/lm_" . $this->lmId . ".zip", "lm_" . $this->lmId . ".zip"); break; case 'offlineMode_il2sop': $this->offlineMode->il2sop(); break; case 'offlineMode_il2sopStop': $this->offlineMode->setOfflineMode("online"); $this->view($this->offlineMode->getOfflineMode(), "msg_export_failure"); break; case 'offlineMode_il2sopOk': $this->offlineMode->setOfflineMode("offline"); $this->view($this->offlineMode->getOfflineMode(), "msg_export_ok"); break; case 'offlineMode_sop2il': $this->offlineMode->sop2il(); break; case 'offlineMode_sop2ilStop': $this->offlineMode->setOfflineMode("offline"); $this->view($this->offlineMode->getOfflineMode(), "msg_push_tracking_failure"); break; case 'offlineMode_sop2ilOk': $this->offlineMode->setOfflineMode("online"); $this->view($this->offlineMode->getOfflineMode(), "msg_push_tracking_ok");
function createExportDirectory() { $lm_data_dir = ilUtil::getDataDir() . "/lm_data"; if (!is_writable($lm_data_dir)) { $this->ilias->raiseError("Content object Data Directory (" . $lm_data_dir . ") not writeable.", $this->ilias->error_obj->FATAL); } // create learning module directory (data_dir/lm_data/lm_<id>) $lm_dir = $lm_data_dir . "/lm_" . $this->module_id; ilUtil::makeDir($lm_dir); if (!@is_dir($lm_dir)) { $this->ilias->raiseError("Creation of Learning Module Directory failed.", $this->ilias->error_obj->FATAL); } //$export_dir = $lm_dir."/export_".$this->mode; ilUtil::makeDir($this->export_dir); if (!@is_dir($this->export_dir)) { $this->ilias->raiseError("Creation of Export Directory failed.", $this->ilias->error_obj->FATAL); } }
/** * get export directory of lm */ function getExportDirectory($a_type = "xml") { switch ($a_type) { case "html": $export_dir = ilUtil::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export_html"; break; case "scorm": $export_dir = ilUtil::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export_scorm"; break; default: // = xml $export_dir = ilUtil::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export"; break; } return $export_dir; }
public function zipLmForOfflineMode() { $lmDir = ilUtil::getWebspaceDir("filesystem") . "/lm_data/lm_" . $this->getId(); $zipFile = ilUtil::getDataDir() . "/lm_data/lm_" . $this->getId(); return ilUtil::zip($lmDir, $zipFile, true); }
/** * Checks if external chatroom directory exists or can be created. * @return string * @throws Exception */ protected function checkDirectory() { $srv_prp_path = ilUtil::getDataDir() . '/chatroom/'; if (!file_exists($srv_prp_path)) { if (!ilUtil::makeDir($srv_prp_path)) { throw new Exception('Directory cannot be created'); } } return $srv_prp_path; }
public function initConsumer() { include_once "Auth/OpenID/Consumer.php"; include_once "Auth/OpenID/FileStore.php"; include_once 'Auth/OpenID/DumbStore.php'; if (is_object($this->consumer)) { return true; } $this->initTempDir(); $store = new Auth_OpenID_FileStore(ilUtil::getDataDir() . DIRECTORY_SEPARATOR . 'tmp'); return $this->consumer = new Auth_OpenID_Consumer($store); }
/** * try to rebuild files */ protected function rebuildUploadedFiles() { global $ilUser; if ($_POST["ilfilehash"]) { $user_id = $ilUser->getId(); $temp_path = ilUtil::getDataDir() . "/temp"; if (is_dir($temp_path) && $user_id && $user_id != ANONYMOUS_USER_ID) { $reload = array(); $temp_files = glob($temp_path . "/" . $ilUser->getId() . "~~" . $_POST["ilfilehash"] . "~~*"); if (is_array($temp_files)) { foreach ($temp_files as $full_file) { $file = explode("~~", basename($full_file)); $field = $file[2]; $idx = $file[3]; $idx2 = $file[4]; $type = $file[5] . "/" . $file[6]; $name = $file[7]; if ($idx2 != "") { if (!$_FILES[$field]["tmp_name"][$idx][$idx2]) { $reload[$field]["tmp_name"][$idx][$idx2] = $full_file; $reload[$field]["name"][$idx][$idx2] = $name; $reload[$field]["type"][$idx][$idx2] = $type; $reload[$field]["error"][$idx][$idx2] = 0; $reload[$field]["size"][$idx][$idx2] = filesize($full_file); } } else { if ($idx != "") { if (!$_FILES[$field]["tmp_name"][$idx]) { $reload[$field]["tmp_name"][$idx] = $full_file; $reload[$field]["name"][$idx] = $name; $reload[$field]["type"][$idx] = $type; $reload[$field]["error"][$idx] = 0; $reload[$field]["size"][$idx] = filesize($full_file); } } else { if (!$_FILES[$field]["tmp_name"]) { $reload[$field]["tmp_name"] = $full_file; $reload[$field]["name"] = $name; $reload[$field]["type"] = $type; $reload[$field]["error"] = 0; $reload[$field]["size"] = filesize($full_file); } } } } } $this->reloaded_files = $reload; } } }
/** * creates data directory for import files * (data_dir/qpl_data/qpl_<id>/import, depending on data * directory that is set in ILIAS setup/ini) */ static function _createImportDirectory() { global $ilias; include_once "./Services/Utilities/classes/class.ilUtil.php"; $qpl_data_dir = ilUtil::getDataDir() . "/qpl_data"; ilUtil::makeDir($qpl_data_dir); if (!is_writable($qpl_data_dir)) { $ilias->raiseError("Questionpool Data Directory (" . $qpl_data_dir . ") not writeable.", $ilias->error_obj->FATAL); } // create questionpool directory (data_dir/qpl_data/qpl_import) $qpl_dir = $qpl_data_dir . "/qpl_import"; ilUtil::makeDir($qpl_dir); if (!@is_dir($qpl_dir)) { $ilias->raiseError("Creation of Questionpool Directory failed.", $ilias->error_obj->FATAL); } return $qpl_dir; }
/** * creates data directory for export files * (data_dir/usrf_data/export, depending on data * directory that is set in ILIAS setup/ini) */ function createExportDirectory() { if (!@is_dir($this->getExportDirectory())) { $usrf_data_dir = ilUtil::getDataDir() . "/usrf_data"; ilUtil::makeDir($usrf_data_dir); if (!is_writable($usrf_data_dir)) { $this->ilias->raiseError("Userfolder data directory (" . $usrf_data_dir . ") not writeable.", $this->ilias->error_obj->MESSAGE); } // create Export subdirectory (data_dir/lm_data/lm_<id>/Export) $export_dir = $usrf_data_dir . "/export"; ilUtil::makeDir($export_dir); if (!@is_dir($export_dir)) { $this->ilias->raiseError("Creation of Userfolder Export Directory failed.", $this->ilias->error_obj->MESSAGE); } } }
/** * get user import directory name */ function getImportDir() { // For each user session a different directory must be used to prevent // that one user session overwrites the import data that another session // is currently importing. global $ilUser; $importDir = ilUtil::getDataDir() . '/user_import/usr_' . $ilUser->getId() . '_' . session_id(); ilUtil::makeDirParents($importDir); return $importDir; }
/** * get import directory of glossary */ function getImportDirectory() { $export_dir = ilUtil::getDataDir() . "/glo_data" . "/glo_" . $this->getId() . "/import"; return $export_dir; }
/** * get user import directory name */ function _getImportDir() { return ilUtil::getDataDir() . "/cat_import"; }
function quotaHandleVerification($a_type, $a_obj_id, $a_owner_id) { global $ilDB; // see ilFileSystemStorage::_createPathFromId() $tpath = array(); $tfound = false; $tnum = $a_obj_id; for ($i = 3; $i > 0; $i--) { $factor = pow(100, $i); if ($tmp = (int) ($tnum / $factor) or $tfound) { $tpath[] = $tmp; $tnum = $tnum % $factor; $tfound = true; } } $file_path = ilUtil::getDataDir() . "/ilVerification/"; if (count($tpath)) { $file_path .= implode('/', $tpath) . '/'; } $file_path .= "vrfc_" . $a_obj_id; if (file_exists($file_path)) { $file_size = (int) ilUtil::dirsize($file_path); if ($file_size > 0) { $ilDB->manipulate("INSERT INTO il_disk_quota" . " (owner_id, src_type, src_obj_id, src_size)" . " VALUES (" . $ilDB->quote($a_owner_id, "integer") . ", " . $ilDB->quote($a_type, "text") . ", " . $ilDB->quote($a_obj_id, "integer") . ", " . $ilDB->quote($file_size, "integer") . ")"); } } }
<#3210> <?php $ilDB->addTableColumn("sahs_lm", "entry_page", array("type" => "integer", "notnull" => true, "default" => 0, "length" => 4)); ?> <#3211> <?php $ilCtrlStructureReader->getStructure(); ?> <#3212> <?php $ilCtrlStructureReader->getStructure(); ?> <#3213> <?php // convert old qpl export files $qpl_export_base = ilUtil::getDataDir() . "/qpl_data/"; // quit if import dir not available if (@is_dir($qpl_export_base) && is_writeable($qpl_export_base)) { // open directory $h_dir = dir($qpl_export_base); // get files and save the in the array while ($entry = $h_dir->read()) { if ($entry != "." && $entry != "..") { if (@is_dir($qpl_export_base . $entry)) { $q_dir = dir($qpl_export_base . $entry); while ($q_entry = $q_dir->read()) { if ($q_entry != "." and $q_entry != "..") { if (@is_dir($qpl_export_base . $entry . '/' . $q_entry) && strcmp($q_entry, 'export') == 0) { $exp_dir = dir($qpl_export_base . $entry . '/' . $q_entry); while ($exp_entry = $exp_dir->read()) { if (@is_file($qpl_export_base . $entry . '/' . $q_entry . '/' . $exp_entry)) {
/** * get export directory of lm */ function getExportDirectory($a_type = "xml") { switch ($a_type) { case "scorm": $export_dir = ilUtil::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export_scorm"; break; default: // = xml if (substr($a_type, 0, 4) == "html") { $export_dir = ilUtil::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export_" . $a_type; } else { $export_dir = ilUtil::getDataDir() . "/lm_data" . "/lm_" . $this->getId() . "/export"; } break; } return $export_dir; }
foreach ($questionPoints as $questionId => $points) { $ilDB->execute($updateQuestionPoints, array($points, $questionId)); } ?> <#9> <?php $ilCtrlStructureReader->getStructure(); ?> <#10> <?php // ensure that ID 1 is not used $ilDB->nextId("tax_node"); ?> <#11> <?php $base_path = ilUtil::getDataDir(); $set = $ilDB->query("SELECT at.*,ea.exc_id" . " FROM exc_assignment ea" . " JOIN il_exc_team at ON (at.ass_id = ea.id)" . " WHERE ea.type = " . $ilDB->quote(4, "integer")); while ($row = $ilDB->fetchAssoc($set)) { // see ilFileSystemStorage::_createPathFromId() $tpath = array(); $tfound = false; $tnum = $row["exc_id"]; for ($i = 3; $i > 0; $i--) { $factor = pow(100, $i); if ($tmp = (int) ($tnum / $factor) or $tfound) { $tpath[] = $tmp; $tnum = $tnum % $factor; $tfound = true; } } $ass_path = $base_path . "/ilExercise/";
/** * creates data directory for import files * (data_dir/tst_data/tst_<id>/import, depending on data * directory that is set in ILIAS setup/ini) */ function _createImportDirectory() { global $ilias; include_once "./Services/Utilities/classes/class.ilUtil.php"; $tst_data_dir = ilUtil::getDataDir() . "/tst_data"; ilUtil::makeDir($tst_data_dir); if (!is_writable($tst_data_dir)) { $this->ilias->raiseError("Test Data Directory (" . $tst_data_dir . ") not writeable.", $this->ilias->error_obj->FATAL); } // create test directory (data_dir/tst_data/tst_import) $tst_dir = $tst_data_dir . "/tst_import"; ilUtil::makeDir($tst_dir); if (!@is_dir($tst_dir)) { $ilias->raiseError("Creation of test import directory failed.", $ilias->error_obj->FATAL); } return $tst_dir; }
/** * @return string */ public function getClientSaltLocation() { return ilUtil::getDataDir() . '/' . self::SALT_STORAGE_FILENAME; }
/** * @param ilImportMapping $a_mapping */ public function importLibraryFile($a_mapping) { $import_path = $this->getImportDirectory() . "/Modules/Bibliographic/set_1/expDir_1/" . $this->import_bib_object->getFilename(); $new_id = $this->import_bib_object->getId(); $new_path = ilUtil::getDataDir() . "/bibl/" . $new_id; mkdir($new_path); copy($import_path, $new_path . "/" . $this->import_bib_object->getFilename()); $this->import_bib_object->writeSourcefileEntriesToDb(); }
/** * Create import directory */ function createImportDirectory() { $sty_data_dir = ilUtil::getDataDir() . "/sty"; ilUtil::makeDir($sty_data_dir); if (!is_writable($sty_data_dir)) { $this->ilias->raiseError("Style data directory (" . $sty_data_dir . ") not writeable.", $this->ilias->error_obj->FATAL); } $style_dir = $sty_data_dir . "/sty_" . $this->getId(); ilUtil::makeDir($style_dir); if (!@is_dir($style_dir)) { $this->ilias->raiseError("Creation of style directory failed (" . $style_dir . ").", $this->ilias->error_obj->FATAL); } // create import subdirectory $im_dir = $style_dir . "/import"; ilUtil::makeDir($im_dir); if (!@is_dir($im_dir)) { $this->ilias->raiseError("Creation of Import Directory failed (" . $im_dir . ").", $this->ilias->error_obj->FATAL); } return $im_dir; }
/** * Returns the number of bytes used on the harddisk for mail attachments, * by the user with the specified user id. * @param int user id. * @return array{'count'=>integer,'size'=>integer} * // an associative array with the disk * // usage in bytes and the count of attachments. */ function _lookupDiskUsageOfUser($user_id) { // XXX - This method is extremely slow. We should // use a cache to speed it up, for example, we should // store the disk space used in table mail_attachment. global $ilDB, $lng; $mail_data_dir = ilUtil::getDataDir('filesystem') . DIRECTORY_SEPARATOR . "mail"; $q = "SELECT path " . "FROM mail_attachment ma " . "JOIN mail m ON ma.mail_id=m.mail_id " . "WHERE m.user_id = " . $ilDB->quote($user_id); $result_set = $ilDB->query($q); $size = 0; $count = 0; while ($row = $result_set->fetchRow(DB_FETCHMODE_ASSOC)) { $attachment_path = $mail_data_dir . DIRECTORY_SEPARATOR . $row['path']; $attachment_size = ilUtil::dirsize($attachment_path); if ($attachment_size != -1) { $size += $attachment_size; } $count++; } return array('count' => $count, 'size' => $size); }
/** * Constructor * * @access public * */ public function __construct() { $this->import_dir = ilUtil::getDataDir() . '/ilAdvancedMetaData/import'; $this->init(); }
/** * Create a temporary file in an ILIAS writable directory * * @return string File name of the temporary file * @static * */ public static function ilTempnam() { $temp_path = ilUtil::getDataDir() . "/temp"; if (!is_dir($temp_path)) { ilUtil::createDirectory($temp_path); } $temp_name = tempnam($temp_path, "tmp"); // ---> // added the following line because tempnam creates a backslash on some // Windows systems which leads to problems, because the "...\tmp..." can be // interpreted as "...{TAB-CHARACTER}...". The normal slash works fine // even under windows (Helmut Schottmüller, 2005-08-31) $temp_name = str_replace("\\", "/", $temp_name); // ---> unlink($temp_name); return $temp_name; }
/** * Returns upload path * * @return string */ public function getUploadPath() { $path = ilUtil::getDataDir() . "/chatroom/" . $this->gui->object->getId() . "/uploads/"; return $path; }
/** * @return string the folder is: $ILIAS-data-folder/bibl/$id */ public function getFileDirectory() { return ilUtil::getDataDir() . DIRECTORY_SEPARATOR . $this->getType() . DIRECTORY_SEPARATOR . $this->getId(); }
/** * get import directory of survey */ function getImportDirectory() { include_once "./Services/Utilities/classes/class.ilUtil.php"; $import_dir = ilUtil::getDataDir() . "/spl_data" . "/spl_" . $this->getId() . "/import"; if (@is_dir($import_dir)) { return $import_dir; } else { return false; } }
/** * create work directory for image map editing */ function createWorkDirectory() { if (!@is_dir(ilUtil::getDataDir() . "/map_workfiles")) { ilUtil::createDirectory(ilUtil::getDataDir() . "/map_workfiles"); } $work_dir = $this->getWorkDirectory(); if (!@is_dir($work_dir)) { ilUtil::createDirectory($work_dir); } }