本文整理汇总了PHP中ilObjFile::getFilename方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjFile::getFilename方法的具体用法?PHP ilObjFile::getFilename怎么用?PHP ilObjFile::getFilename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjFile
的用法示例。
在下文中一共展示了ilObjFile::getFilename方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateFileContents
/**
* update file according to filename and version and create history entry
* has to be called after (!) file save for new objects, since file storage will be initialised with obj id.
*
*/
public function updateFileContents()
{
if ($this->setFileContents()) {
require_once "./Services/History/classes/class.ilHistory.php";
ilHistory::_createEntry($this->file->getId(), "replace", $this->file->getFilename() . "," . $this->file->getVersion());
$this->file->addNewsNotification("file_updated");
}
}
示例2: getMaterialInfo
/**
* Get material file name and goto url
*
* @param int $a_wsp_id
* @return array caption, url
*/
function getMaterialInfo($a_wsp_id)
{
global $ilUser;
if (!$this->ws_tree) {
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
$this->ws_tree = new ilWorkspaceTree($ilUser->getId());
$this->ws_access = new ilWorkspaceAccessHandler($caption);
}
$obj_id = $this->ws_tree->lookupObjectId($a_wsp_id);
$caption = ilObject::_lookupTitle($obj_id);
if (!$this->offline_mode) {
$url = $this->ws_access->getGotoLink($a_wsp_id, $obj_id);
} else {
$url = $this->offline_mode . "file_" . $obj_id . "/";
// all possible material types for now
switch (ilObject::_lookupType($obj_id)) {
case "tstv":
include_once "Modules/Test/classes/class.ilObjTestVerification.php";
$obj = new ilObjTestVerification($obj_id, false);
$url .= $obj->getOfflineFilename();
break;
case "excv":
include_once "Modules/Exercise/classes/class.ilObjExerciseVerification.php";
$obj = new ilObjExerciseVerification($obj_id, false);
$url .= $obj->getOfflineFilename();
break;
case "file":
$file = new ilObjFile($obj_id, false);
$url .= $file->getFilename();
break;
}
}
return array($caption, $url);
}