本文整理汇总了PHP中ilUtil::getWebspaceDir方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::getWebspaceDir方法的具体用法?PHP ilUtil::getWebspaceDir怎么用?PHP ilUtil::getWebspaceDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUtil
的用法示例。
在下文中一共展示了ilUtil::getWebspaceDir方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCurrentImageWebPath
public function getCurrentImageWebPath()
{
if ($this->image_current != '' && $this->checkFilesExist(array($this->image_current))) {
return ilUtil::getWebspaceDir('output') . '/' . self::SHOPPATH . '/' . $this->pobject_id . '/' . $this->image_current;
}
return false;
}
示例2: getRelativePathExMailDirectory
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());
}
示例3: recalculatePasses
/**
* @param $userdata
* @param $active_id
*/
public function recalculatePasses($userdata, $active_id)
{
require_once './Modules/Test/classes/class.ilTestEvaluationGUI.php';
// Below!
require_once './Modules/Test/classes/class.ilTestPDFGenerator.php';
require_once './Modules/Test/classes/class.ilTestArchiver.php';
$passes = $userdata->getPasses();
foreach ($passes as $pass => $passdata) {
if (is_object($passdata)) {
$this->recalculatePass($passdata, $active_id, $pass);
if ($this->test->getEnableArchiving()) {
// requires out of the loop!
$test_evaluation_gui = new ilTestEvaluationGUI($this->test);
$overview = $test_evaluation_gui->getPassListOfAnswers($passdata, $active_id, $pass, true, false, false, true);
$filename = ilUtil::getWebspaceDir() . '/assessment/scores-' . $this->test->getId() . '-' . $active_id . '-' . $pass . '.pdf';
ilTestPDFGenerator::generatePDF($overview, ilTestPDFGenerator::PDF_OUTPUT_FILE, $filename);
$archiver = new ilTestArchiver($this->test->getId());
$archiver->handInTestResult($active_id, $pass, $filename);
unlink($filename);
}
}
}
}
示例4: _lookupDiskUsage
/**
* Returns the number of bytes used on the harddisk by the learning module
* with the specified object id.
* @param int object id of a file object.
*/
function _lookupDiskUsage($a_id)
{
$lm_data_dir = ilUtil::getWebspaceDir('filesystem') . "/lm_data";
$lm_dir = $lm_data_dir . DIRECTORY_SEPARATOR . "lm_" . $a_id;
return file_exists($lm_dir) ? ilUtil::dirsize($lm_dir) : 0;
}
示例5: zipLmForOfflineMode
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);
}
示例6: _deleteSmiley
/**
* Deletes smiliey by given id from database.
*
* @global ilDBMySQL $ilDB
* @param integer $a_id
*/
public static function _deleteSmiley($a_id)
{
global $ilDB;
try {
$smiley = self::_getSmiley($a_id);
$path = ilUtil::getWebspaceDir() . '/chatroom/smilies/' . $smiley["smiley_path"];
if (is_file($path)) {
unlink($path);
}
$ilDB->manipulateF("DELETE FROM chatroom_smilies\n\t\t\t\tWHERE\n\t\t\t\t\tsmiley_id = %s", array('integer'), array($a_id));
} catch (Exception $e) {
}
}
示例7: exportHTMLMOB
/**
* export media object to html
*/
function exportHTMLMOB($a_target_dir, &$a_glo_gui, $a_mob_id)
{
global $tpl;
$mob_dir = $a_target_dir . "/mobs";
$source_dir = ilUtil::getWebspaceDir() . "/mobs/mm_" . $a_mob_id;
if (@is_dir($source_dir)) {
ilUtil::makeDir($mob_dir . "/mm_" . $a_mob_id);
ilUtil::rCopy($source_dir, $mob_dir . "/mm_" . $a_mob_id);
}
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$_GET["obj_type"] = "MediaObject";
$_GET["mob_id"] = $a_mob_id;
$_GET["cmd"] = "";
$content =& $a_glo_gui->media();
$file = $a_target_dir . "/media_" . $a_mob_id . ".html";
// open file
if (!($fp = @fopen($file, "w+"))) {
die("<b>Error</b>: Could not open \"" . $file . "\" for writing" . " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
}
chmod($file, 0770);
fwrite($fp, $content);
fclose($fp);
// fullscreen
include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
$mob_obj = new ilObjMediaObject($a_mob_id);
if ($mob_obj->hasFullscreenItem()) {
$tpl = new ilTemplate("tpl.main.html", true, true);
$tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$_GET["mob_id"] = $a_mob_id;
$_GET["cmd"] = "fullscreen";
$content = $a_glo_gui->fullscreen();
$file = $a_target_dir . "/fullscreen_" . $a_mob_id . ".html";
// open file
if (!($fp = @fopen($file, "w+"))) {
die("<b>Error</b>: Could not open \"" . $file . "\" for writing" . " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
}
chmod($file, 0770);
fwrite($fp, $content);
fclose($fp);
}
}
示例8: getDataDirectory
function getDataDirectory()
{
return ilUtil::getWebspaceDir() . "/mobs/mm_" . $this->getId();
}
示例9: getContentStylePath
/**
* get content style path
*
* static (to avoid full reading)
*/
function getContentStylePath($a_style_id)
{
global $ilias;
$rand = rand(1, 999999);
// check global fixed content style
$fixed_style = $ilias->getSetting("fixed_content_style_id");
if ($fixed_style > 0) {
$a_style_id = $fixed_style;
}
// check global default style
if ($a_style_id <= 0) {
$a_style_id = $ilias->getSetting("default_content_style_id");
}
if ($a_style_id > 0 && ilObject::_exists($a_style_id)) {
// check whether file is up to date
if (!ilObjStyleSheet::_lookupUpToDate($a_style_id)) {
$style = new ilObjStyleSheet($a_style_id);
$style->writeCSSFile();
}
return ilUtil::getWebspaceDir("output") . "/css/style_" . $a_style_id . ".css?dummy={$rand}";
} else {
return "./Services/COPage/css/content.css";
}
}
示例10: archiveParticipantSubmission
/**
* @param $active
*
* @return void
*/
protected function archiveParticipantSubmission($active, $pass)
{
global $ilObjDataCache;
require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
$testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
$objectivesList = null;
if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
$testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($this->testSession->getActiveId(), $this->testSession->getPass());
$testSequence->loadFromDb();
$testSequence->loadQuestions();
require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
$objectivesAdapter = ilLOTestQuestionAdapter::getInstance($this->testSession);
$objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
$objectivesList->loadObjectivesTitles();
$testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($this->testSession->getObjectiveOrientedContainerId());
$testResultHeaderLabelBuilder->setUserId($this->testSession->getUserId());
$testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
$testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
$testResultHeaderLabelBuilder->initObjectiveOrientedMode();
}
$results = $this->object->getTestResult($active, $pass, false, !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired());
require_once 'class.ilTestEvaluationGUI.php';
$testevaluationgui = new ilTestEvaluationGUI($this->object);
$results_output = $testevaluationgui->getPassListOfAnswers($results, $active, $pass, false, false, false, false, false, $objectivesList, $testResultHeaderLabelBuilder);
require_once './Modules/Test/classes/class.ilTestArchiver.php';
global $ilSetting;
$inst_id = $ilSetting->get('inst_id', null);
$archiver = new ilTestArchiver($this->object->getId());
$path = ilUtil::getWebspaceDir() . '/assessment/' . $this->object->getId() . '/exam_pdf';
if (!is_dir($path)) {
ilUtil::makeDirParents($path);
}
$filename = $path . '/exam_N' . $inst_id . '-' . $this->object->getId() . '-' . $active . '-' . $pass . '.pdf';
require_once 'class.ilTestPDFGenerator.php';
ilTestPDFGenerator::generatePDF($results_output, ilTestPDFGenerator::PDF_OUTPUT_FILE, $filename);
//$template->setVariable("PDF_FILE_LOCATION", $filename);
// Participant submission
$archiver->handInParticipantSubmission($active, $pass, $filename, $results_output);
//$archiver->handInParticipantMisc( $active, $pass, 'signature_gedoens.sig', $filename );
//$archiver->handInParticipantQuestionMaterial( $active, $pass, 123, 'file_upload.pdf', $filename );
global $ilias;
$questions = $this->object->getQuestions();
foreach ($questions as $question_id) {
$question_object = $this->object->getQuestionDataset($question_id);
if ($question_object->type_tag == 'assFileUpload') {
// Pfad: /data/default/assessment/tst_2/14/21/files/file_14_4_1370417414.png
// /data/ - klar
// /assessment/ - Konvention
// /tst_2/ = /tst_<test_id> (ilObjTest)
// /14/ = /<active_fi>/
// /21/ = /<question_id>/ (question_object)
// /files/ - Konvention
// file_14_4_1370417414.png = file_<active_fi>_<pass>_<some timestamp>.<ext>
$candidate_path = $ilias->ini_ilias->readVariable('server', 'absolute_path') . ilTestArchiver::DIR_SEP . $ilias->ini_ilias->readVariable('clients', 'path') . ilTestArchiver::DIR_SEP . $ilias->client_id . ilTestArchiver::DIR_SEP . 'assessment' . ilTestArchiver::DIR_SEP . 'tst_' . $this->object->test_id . ilTestArchiver::DIR_SEP . $active . ilTestArchiver::DIR_SEP . $question_id . ilTestArchiver::DIR_SEP . 'files' . ilTestArchiver::DIR_SEP;
$handle = opendir($candidate_path);
while ($handle !== false && ($file = readdir($handle)) !== false) {
if ($file != null) {
$filename_start = 'file_' . $active . '_' . $pass . '_';
if (strpos($file, $filename_start) === 0) {
$archiver->handInParticipantQuestionMaterial($active, $pass, $question_id, $file, $file);
}
}
}
}
}
$passdata = $this->object->getTestResult($active, $pass, false, !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired());
$overview = $testevaluationgui->getPassListOfAnswers($passdata, $active, $pass, true, false, false, true, false, $objectivesList, $testResultHeaderLabelBuilder);
$filename = ilUtil::getWebspaceDir() . '/assessment/scores-' . $this->object->getId() . '-' . $active . '-' . $pass . '.pdf';
ilTestPDFGenerator::generatePDF($overview, ilTestPDFGenerator::PDF_OUTPUT_FILE, $filename);
$archiver->handInTestResult($active, $pass, $filename);
unlink($filename);
return;
}
示例11: array
<#4268>
<?php
$ilDB->insert('il_dcl_datatype_prop', array('id' => array('integer', 13), 'datatype_id' => array('integer', 8), 'title' => array('text', 'display_action_menu'), 'inputformat' => array('integer', 4)));
?>
<#4269>
<?php
$ilDB->modifyTableColumn('help_map', 'screen_id', array("type" => "text", "length" => 100, "notnull" => false, 'fixed' => false));
?>
<#4270>
<?php
$ilDB->modifyTableColumn('help_map', 'screen_sub_id', array("type" => "text", "length" => 100, "notnull" => false, 'fixed' => false));
?>
<#4271>
<?php
$client_id = basename(CLIENT_DATA_DIR);
$web_path = ilUtil::getWebspaceDir() . $client_id;
$sec_path = $web_path . "/sec";
if (!file_exists($sec_path)) {
ilUtil::makeDir($sec_path);
}
$mods = array("ilBlog", "ilPoll", "ilPortfolio");
foreach ($mods as $mod) {
$mod_path = $web_path . "/" . $mod;
if (file_exists($mod_path)) {
$mod_sec_path = $sec_path . "/" . $mod;
rename($mod_path, $mod_sec_path);
}
}
?>
<#4272>
<?php
示例12: _renderTable
/**
* Static render table function
*/
static function _renderTable($content, $a_mode = "table_edit", $a_submode = "", $a_table_obj = null)
{
global $ilUser;
$content = "<dummy>" . $content . "</dummy>";
$xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
$args = array('/_xml' => $content, '/_xsl' => $xsl);
$xh = xslt_create();
//echo "<b>XML</b>:".htmlentities($content).":<br>";
//echo "<b>XSLT</b>:".htmlentities($xsl).":<br>";
$med_disabled_path = ilUtil::getImagePath("media_disabled.png");
$wb_path = ilUtil::getWebspaceDir("output");
$enlarge_path = ilUtil::getImagePath("enlarge.png");
$params = array('mode' => $a_mode, 'med_disabled_path' => $med_disabled_path, 'media_mode' => $ilUser->getPref("ilPageEditor_MediaMode"), 'media_mode' => 'disable', 'webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path);
$output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
echo xslt_error($xh);
xslt_free($xh);
// unmask user html
$output = str_replace("<", "<", $output);
$output = str_replace(">", ">", $output);
$output = str_replace("&", "&", $output);
if ($a_mode == "table_edit" && !is_null($a_table_obj)) {
switch ($a_submode) {
case "style":
$output = ilPCTableGUI::_addStyleCheckboxes($output, $a_table_obj);
break;
case "alignment":
$output = ilPCTableGUI::_addAlignmentCheckboxes($output, $a_table_obj);
break;
case "width":
$output = ilPCTableGUI::_addWidthInputs($output, $a_table_obj);
break;
case "span":
$output = ilPCTableGUI::_addSpanInputs($output, $a_table_obj);
break;
}
}
return '<div style="float:left;">' . $output . '</div>';
}
示例13: startSession
/**
* start session
* @global <type> $ilDB
*/
public function startSession()
{
global $ilDB, $ilUser, $ilCtrl, $ilAccess;
// Handle deleted accounts
ilObjVitero::handleDeletedUsers();
try {
// Create update user
$map = new ilViteroUserMapping();
$vuid = $map->getVUserId($ilUser->getId());
$ucon = new ilViteroUserSoapConnector();
if (!$vuid) {
$vuid = $ucon->createUser($ilUser);
$map->map($ilUser->getId(), $vuid);
} else {
try {
$ucon->updateUser($vuid, $ilUser);
} catch (ilViteroConnectorException $e) {
if ($e->getCode() == 53) {
$map->unmap($ilUser->getId());
$vuid = $ucon->createUser($ilUser);
$map->map($ilUser->getId(), $vuid);
}
}
}
// Store update image
if (ilViteroSettings::getInstance()->isAvatarEnabled()) {
$usr_image_path = ilUtil::getWebspaceDir() . '/usr_images/usr_' . $ilUser->getId() . '.jpg';
if (@file_exists($usr_image_path)) {
$ucon->storeAvatarUsingBase64($vuid, array('name' => 'usr_image.jpg', 'type' => ilViteroAvatarSoapConnector::FILE_TYPE_NORMAL, 'file' => $usr_image_path));
}
}
/*
if(ilViteroSettings::getInstance()->isAvatarEnabled() and 0)
{
try {
$avatar_service = new ilViteroAvatarSoapConnector();
$usr_image_path = ilUtil::getWebspaceDir().'/usr_images/usr_'.$ilUser->getId().'.jpg';
if(@file_exists($usr_image_path))
{
$avatar_service->storeAvatar(
$vuid,
array(
'name' => 'usr_image.jpg',
'type' => ilViteroAvatarSoapConnector::FILE_TYPE_NORMAL,
'file' => $usr_image_path
)
);
}
}
catch(ilViteroConnectorException $e)
{
// continue
}
}
*/
// Assign user to vitero group
$grp = new ilViteroGroupSoapConnector();
$grp->addUserToGroup($this->object->getVGroupId(), $vuid);
$grp->changeGroupRole($this->object->getVGroupId(), $vuid, $ilAccess->checkAccess('write', '', $this->object->getRefId()) ? ilViteroGroupSoapConnector::ADMIN_ROLE : ilViteroGroupSoapConnector::MEMBER_ROLE);
$sc = new ilViteroSessionCodeSoapConnector();
$dur = new ilDateTime(time(), IL_CAL_UNIX);
$dur->increment(IL_CAL_HOUR, 2);
$code = $sc->createPersonalBookingSessionCode($vuid, (int) $_GET['bid'], $dur);
$GLOBALS['ilLog']->write(__METHOD__ . ': ' . ilViteroSettings::getInstance()->getWebstartUrl() . '?code=' . $code);
ilUtil::redirect(ilViteroSettings::getInstance()->getWebstartUrl() . '?sessionCode=' . $code);
} catch (ilViteroConnectorException $e) {
ilUtil::sendFailure($e->getViteroMessage(), true);
$ilCtrl->redirect($this, 'infoScreen');
}
}
示例14: removeUserPicture
/**
* Remove user picture.
*/
function removeUserPicture()
{
$webspace_dir = ilUtil::getWebspaceDir();
$image_dir = $webspace_dir . "/usr_images";
$file = $image_dir . "/usr_" . $this->getID() . "." . "jpg";
$thumb_file = $image_dir . "/usr_" . $this->getID() . "_small.jpg";
$xthumb_file = $image_dir . "/usr_" . $this->getID() . "_xsmall.jpg";
$xxthumb_file = $image_dir . "/usr_" . $this->getID() . "_xxsmall.jpg";
$upload_file = $image_dir . "/upload_" . $this->getID();
// remove user pref file name
$this->setPref("profile_image", "");
$this->update();
if (@is_file($file)) {
unlink($file);
}
if (@is_file($thumb_file)) {
unlink($thumb_file);
}
if (@is_file($xthumb_file)) {
unlink($xthumb_file);
}
if (@is_file($xxthumb_file)) {
unlink($xxthumb_file);
}
if (@is_file($upload_file)) {
unlink($upload_file);
}
}
示例15: getOnlineLink
public function getOnlineLink($a_rel_name)
{
return ilUtil::getWebspaceDir('filesystem') . '/courses/' . $a_rel_name . '/index.html';
}