本文整理汇总了PHP中ilObject::_writeDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::_writeDescription方法的具体用法?PHP ilObject::_writeDescription怎么用?PHP ilObject::_writeDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObject
的用法示例。
在下文中一共展示了ilObject::_writeDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
final function _writeDescription($a_obj_id, $a_desc)
{
return parent::_writeDescription($a_obj_id, $a_desc);
}
示例2: 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;
}
示例3: il_import
/**
* Imports an extracted SCORM 2004 module from ilias-data dir into database
*
* @access public
* @return string title of package
*/
public function il_import($packageFolder, $packageId, $ilias, $validate, $reimport = false)
{
global $ilDB, $ilLog, $ilErr;
$title = "";
if ($reimport === true) {
$this->packageId = $packageId;
$this->dbRemoveAll();
}
$this->packageFolder = $packageFolder;
$this->packageId = $packageId;
$this->imsmanifestFile = $this->packageFolder . '/' . 'imsmanifest.xml';
//step 1 - parse Manifest-File and validate
$this->imsmanifest = new DOMDocument();
$this->imsmanifest->async = false;
if (!@$this->imsmanifest->load($this->imsmanifestFile)) {
$this->diagnostic[] = 'XML not wellformed';
return false;
}
//step 2 tranform
$this->manifest = $this->transform($this->imsmanifest, self::DB_ENCODE_XSL);
if (!$this->manifest) {
$this->diagnostic[] = 'Cannot transform into normalized manifest';
return false;
}
//setp 2.5 if only a single item, make sure the scormType of it's linked resource is SCO
$path = new DOMXpath($this->manifest);
$path->registerNamespace("scorm", "http://www.openpalms.net/scorm/scorm13");
$items = $path->query("//scorm:item");
if ($items->length == 1) {
$n = $items->item(0);
$resource = $path->query("//scorm:resource");
//[&id='"+$n->getAttribute("resourceId")+"']");
foreach ($resource as $res) {
if ($res->getAttribute('id') == $n->getAttribute("resourceId")) {
$res->setAttribute('scormType', 'sco');
}
}
}
//$this->manifest->save("C:\Users\gratat\after.xml");
//step 3 validation -just for normalized XML
if ($validate == "y") {
if (!$this->validate($this->manifest, self::VALIDATE_XSD)) {
$ilErr->raiseError("<b>The uploaded SCORM 1.2 / SCORM 2004 is not valid. You can try to import the package without the validation option checked on your own risk. </b><br><br>Validation Error(s):</b><br> Normalized XML is not conform to " . self::VALIDATE_XSD, $ilErr->MESSAGE);
}
}
$this->dbImport($this->manifest);
if (file_exists($this->packageFolder . '/' . 'index.xml')) {
$doc = simplexml_load_file($this->packageFolder . '/' . 'index.xml');
$l = $doc->xpath("/ContentObject/MetaData");
if ($l[0]) {
include_once 'Services/MetaData/classes/class.ilMDXMLCopier.php';
$mdxml =& new ilMDXMLCopier($l[0]->asXML(), $packageId, $packageId, ilObject::_lookupType($packageId));
$mdxml->startParsing();
$mdxml->getMDObject()->update();
}
} else {
include_once "./Modules/Scorm2004/classes/class.ilSCORM13MDImporter.php";
$importer = new ilSCORM13MDImporter($this->imsmanifest, $packageId);
$importer->import();
$title = $importer->getTitle();
$description = $importer->getDescription();
if ($description != "") {
ilObject::_writeDescription($packageId, $description);
}
}
//step 5
$x = simplexml_load_string($this->manifest->saveXML());
$x['persistPreviousAttempts'] = $this->packageData['persistprevattempts'];
$x['online'] = $this->packageData['c_online'];
$x['defaultLessonMode'] = $this->packageData['default_lesson_mode'];
$x['credit'] = $this->packageData['credit'];
$x['autoReview'] = $this->packageData['auto_review'];
$j = array();
// first read resources into flat array to resolve item/identifierref later
$r = array();
foreach ($x->resource as $xe) {
$r[strval($xe['id'])] = $xe;
unset($xe);
}
// iterate through items and set href and scoType as activity attributes
foreach ($x->xpath('//*[local-name()="item"]') as $xe) {
// get reference to resource and set href accordingly
if ($b = $r[strval($xe['resourceId'])]) {
$xe['href'] = strval($b['base']) . strval($b['href']);
unset($xe['resourceId']);
if (strval($b['scormType']) == 'sco') {
$xe['sco'] = true;
}
}
}
// iterate recursivly through activities and build up simple php object
// with items and associated sequencings
// top node is the default organization which is handled as an item
self::jsonNode($x->organization, $j['item']);
//.........这里部分代码省略.........