本文整理汇总了PHP中ilObject::_writeTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::_writeTitle方法的具体用法?PHP ilObject::_writeTitle怎么用?PHP ilObject::_writeTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObject
的用法示例。
在下文中一共展示了ilObject::_writeTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MDUpdateListener
/**
* Meta data update listener
*
* Important note: Do never call create() or update()
* method of ilObject here. It would result in an
* endless loop: update object -> update meta -> update
* object -> ...
* Use static _writeTitle() ... methods instead.
*
* @param string $a_element
*/
function MDUpdateListener($a_element)
{
include_once 'Services/MetaData/classes/class.ilMD.php';
switch ($a_element) {
case 'General':
// Update Title and description
$md = new ilMD(0, $this->getId(), $this->getType());
$md_gen = $md->getGeneral();
if (is_object($md_gen)) {
ilObject::_writeTitle($this->getId(), $md_gen->getTitle());
$this->setTitle($md_gen->getTitle());
foreach ($md_gen->getDescriptionIds() as $id) {
$md_des = $md_gen->getDescription($id);
ilObject::_writeDescription($this->getId(), $md_des->getDescription());
$this->setDescription($md_des->getDescription());
break;
}
}
break;
default:
}
return true;
}
示例2: uploadObject
/**
* display status information or report errors messages
* in case of error
*
* @access public
*/
function uploadObject()
{
global $_FILES, $rbacsystem;
include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
// check create permission
if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], "sahs")) {
$this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
} elseif ($_FILES["scormfile"]["name"]) {
// check if file was uploaded
$source = $_FILES["scormfile"]["tmp_name"];
if ($source == 'none' || !$source) {
$this->ilias->raiseError($this->lng->txt("msg_no_file"), $this->ilias->error_obj->MESSAGE);
}
// get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
switch ($__FILES["scormfile"]["error"]) {
case UPLOAD_ERR_INI_SIZE:
$this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"), $this->ilias->error_obj->MESSAGE);
break;
case UPLOAD_ERR_FORM_SIZE:
$this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"), $this->ilias->error_obj->MESSAGE);
break;
case UPLOAD_ERR_PARTIAL:
$this->ilias->raiseError($this->lng->txt("err_partial_file_upload"), $this->ilias->error_obj->MESSAGE);
break;
case UPLOAD_ERR_NO_FILE:
$this->ilias->raiseError($this->lng->txt("err_no_file_uploaded"), $this->ilias->error_obj->MESSAGE);
break;
}
$file = pathinfo($_FILES["scormfile"]["name"]);
} elseif ($_POST["uploaded_file"]) {
// check if the file is in the upload directory and readable
if (!ilUploadFiles::_checkUploadFile($_POST["uploaded_file"])) {
$this->ilias->raiseError($this->lng->txt("upload_error_file_not_found"), $this->ilias->error_obj->MESSAGE);
}
$file = pathinfo($_POST["uploaded_file"]);
} else {
$this->ilias->raiseError($this->lng->txt("msg_no_file"), $this->ilias->error_obj->MESSAGE);
}
$name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
if ($name == "") {
$name = $this->lng->txt("no_title");
}
// create and insert object in objecttree
switch ($_POST["sub_type"]) {
case "scorm2004":
include_once "./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php";
$newObj = new ilObjSCORM2004LearningModule();
$newObj->setEditable($_POST["editable"] == 'y');
$newObj->setImportSequencing($_POST["import_sequencing"]);
$newObj->setSequencingExpertMode($_POST["import_sequencing"]);
break;
case "scorm":
include_once "./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php";
$newObj = new ilObjSCORMLearningModule();
break;
case "aicc":
include_once "./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php";
$newObj = new ilObjAICCLearningModule();
break;
case "hacp":
include_once "./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php";
$newObj = new ilObjHACPLearningModule();
break;
}
$newObj->setTitle($name);
$newObj->setSubType($_POST["sub_type"]);
$newObj->setDescription("");
$newObj->create(true);
$newObj->createReference();
$newObj->putInTree($_GET["ref_id"]);
$newObj->setPermissions($_GET["ref_id"]);
$newObj->notify("new", $_GET["ref_id"], $_GET["parent_non_rbac_id"], $_GET["ref_id"], $newObj->getRefId());
// create data directory, copy file to directory
$newObj->createDataDirectory();
if ($_FILES["scormfile"]["name"]) {
// copy uploaded file to data directory
$file_path = $newObj->getDataDirectory() . "/" . $_FILES["scormfile"]["name"];
ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"], $_FILES["scormfile"]["name"], $file_path);
} else {
// copy uploaded file to data directory
$file_path = $newObj->getDataDirectory() . "/" . $_POST["uploaded_file"];
ilUploadFiles::_copyUploadFile($_POST["uploaded_file"], $file_path);
}
ilUtil::unzip($file_path);
ilUtil::renameExecutables($newObj->getDataDirectory());
$title = $newObj->readObject();
if ($title != "") {
ilObject::_writeTitle($newObj->getId(), $title);
/*$md = new ilMD($newObj->getId(),0, $newObj->getType());
if(is_object($md_gen = $md->getGeneral()))
{
$md_gen->setTitle($title);
$md_gen->update();
}*/
//.........这里部分代码省略.........
示例3:
final function _writeTitle($a_obj_id, $a_title)
{
return parent::_writeTitle($a_obj_id, $a_title);
}