当前位置: 首页>>代码示例>>PHP>>正文


PHP ilObjMediaObject类代码示例

本文整理汇总了PHP中ilObjMediaObject的典型用法代码示例。如果您正苦于以下问题:PHP ilObjMediaObject类的具体用法?PHP ilObjMediaObject怎么用?PHP ilObjMediaObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ilObjMediaObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAllFloorplans

 /**
  * Gets all floorplans.
  *
  * @return type return of $this->ilDB->query
  */
 public function getAllFloorplans()
 {
     $set = $this->ilDB->query('SELECT * FROM ' . dbc::FLOORPLANS_TABLE . ' WHERE pool_id = ' . $this->ilDB->quote($this->pool_id, 'integer') . ' order by file_id DESC');
     $floorplans = array();
     $row = $this->ilDB->fetchAssoc($set);
     while ($row) {
         $mobj = new ilObjMediaObject($row['file_id']);
         $row["title"] = $mobj->getTitle();
         $floorplans[] = $row;
         $row = $this->ilDB->fetchAssoc($set);
     }
     return $floorplans;
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:18,代码来源:class.ilRoomSharingDatabaseFloorplan.php

示例2: fromXML

 /**
  * Creates a question from a QTI file
  *
  * Receives parameters from a QTI parser and creates a valid ILIAS question object
  *
  * @param object $item The QTI item object
  * @param integer $questionpool_id The id of the parent questionpool
  * @param integer $tst_id The id of the parent test if the question is part of a test
  * @param object $tst_object A reference to the parent test object
  * @param integer $question_counter A reference to a question counter to count the questions of an imported question pool
  * @param array $import_mapping An array containing references to included ILIAS objects
  * @access public
  */
 function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
 {
     global $ilUser;
     // empty session variable for imported xhtml mobs
     unset($_SESSION["import_mob_xhtml"]);
     $presentation = $item->getPresentation();
     $duration = $item->getDuration();
     $now = getdate();
     $created = sprintf("%04d%02d%02d%02d%02d%02d", $now['year'], $now['mon'], $now['mday'], $now['hours'], $now['minutes'], $now['seconds']);
     $feedbacksgeneric = array();
     $this->addGeneralMetadata($item);
     $this->object->setTitle($item->getTitle());
     $this->object->setNrOfTries($item->getMaxattempts());
     $this->object->setComment($item->getComment());
     $this->object->setAuthor($item->getAuthor());
     $this->object->setOwner($ilUser->getId());
     $this->object->setQuestion($this->object->QTIMaterialToString($item->getQuestiontext()));
     $this->object->setObjId($questionpool_id);
     $this->object->setEstimatedWorkingTime($duration["h"], $duration["m"], $duration["s"]);
     $this->object->setPoints($item->getMetadataEntry("points"));
     $this->object->setOrderText($item->getMetadataEntry("ordertext"));
     $this->object->setTextSize($item->getMetadataEntry("textsize"));
     $this->object->setSeparator($item->getMetadataEntry("separator"));
     // additional content editing mode information
     $this->object->setAdditionalContentEditingMode($this->fetchAdditionalContentEditingModeInformation($item));
     $this->object->saveToDb();
     // handle the import of media objects in XHTML code
     $questiontext = $this->object->getQuestion();
     if (is_array($_SESSION["import_mob_xhtml"])) {
         include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
         include_once "./Services/RTE/classes/class.ilRTE.php";
         foreach ($_SESSION["import_mob_xhtml"] as $mob) {
             if ($tst_id > 0) {
                 $importfile = $this->getTstImportArchivDirectory() . '/' . $mob["uri"];
             } else {
                 $importfile = $this->getQplImportArchivDirectory() . '/' . $mob["uri"];
             }
             $GLOBALS['ilLog']->write(__METHOD__ . ': import mob from dir: ' . $importfile);
             $media_object =& ilObjMediaObject::_saveTempFileAsMediaObject(basename($importfile), $importfile, FALSE);
             ilObjMediaObject::_saveUsage($media_object->getId(), "qpl:html", $this->object->getId());
             $questiontext = str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $questiontext);
         }
     }
     $this->object->setQuestion(ilRTE::_replaceMediaObjectImageSrc($questiontext, 1));
     $this->object->saveToDb();
     if (count($item->suggested_solutions)) {
         foreach ($item->suggested_solutions as $suggested_solution) {
             $this->object->setSuggestedSolution($suggested_solution["solution"]->getContent(), $suggested_solution["gap_index"], true);
         }
         $this->object->saveToDb();
     }
     if ($tst_id > 0) {
         $q_1_id = $this->object->getId();
         $question_id = $this->object->duplicate(true, null, null, null, $tst_id);
         $tst_object->questions[$question_counter++] = $question_id;
         $import_mapping[$item->getIdent()] = array("pool" => $q_1_id, "test" => $question_id);
     } else {
         $import_mapping[$item->getIdent()] = array("pool" => $this->object->getId(), "test" => 0);
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:73,代码来源:class.assOrderingHorizontalImport.php

示例3: getXmlExportHeadDependencies

 /**
  * Get head dependencies
  *
  * @param		string		entity
  * @param		string		target release
  * @param		array		ids
  * @return		array		array of array with keys "component", entity", "ids"
  */
 function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
 {
     if ($a_entity == "pg") {
         // get all media objects and files of the page
         include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
         include_once "./Modules/File/classes/class.ilObjFile.php";
         $mob_ids = array();
         $file_ids = array();
         foreach ($a_ids as $pg_id) {
             $pg_id = explode(":", $pg_id);
             // get media objects
             $mids = ilObjMediaObject::_getMobsOfObject($pg_id[0] . ":pg", $pg_id[1]);
             foreach ($mids as $mid) {
                 if (ilObject::_lookupType($mid) == "mob") {
                     $mob_ids[] = $mid;
                 }
             }
             // get files
             $files = ilObjFile::_getFilesOfObject($pg_id[0] . ":pg", $pg_id[1]);
             foreach ($files as $file) {
                 if (ilObject::_lookupType($file) == "file") {
                     $file_ids[] = $file;
                 }
             }
         }
         return array(array("component" => "Services/MediaObjects", "entity" => "mob", "ids" => $mob_ids), array("component" => "Modules/File", "entity" => "file", "ids" => $file_ids));
     }
     return array();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:37,代码来源:class.ilCOPageExporter.php

示例4: fillRow

 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilAccess;
     if ($a_set["type"] == "mob") {
         // output thumbnail
         $mob = new ilObjMediaObject($a_set["id"]);
         $med = $mob->getMediaItem("Standard");
         $target = $med->getThumbnailTarget();
         if ($target != "") {
             $this->tpl->setCurrentBlock("thumbnail");
             $this->tpl->setVariable("IMG_THUMB", $target);
             $this->tpl->parseCurrentBlock();
         }
     } else {
         if ($a_set["type"] == "incl") {
             $this->tpl->setCurrentBlock("thumbnail");
             $this->tpl->setVariable("IMG_THUMB", ilUtil::getImagePath("icon_pg.svg"));
             $this->tpl->parseCurrentBlock();
         }
     }
     // allow editing of media objects
     if ($this->parent_obj->mode != "getObject" && $a_set["type"] == "mob") {
         // output edit link
         $this->tpl->setCurrentBlock("edit");
         $ilCtrl->setParameter($this->parent_obj, "clip_item_id", $a_set["id"]);
         $ilCtrl->setParameterByClass("ilObjMediaObjectGUI", "clip_item_id", $a_set["id"]);
         $this->tpl->setVariable("EDIT_LINK", $ilCtrl->getLinkTargetByClass("ilObjMediaObjectGUI", "edit", array("ilEditClipboardGUI")));
         $this->tpl->setVariable("TEXT_OBJECT", $a_set["title"] . " [" . $a_set["id"] . "]");
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setCurrentBlock("show");
         $this->tpl->setVariable("TEXT_OBJECT2", $a_set["title"] . " [" . $a_set["id"] . "]");
         $this->tpl->parseCurrentBlock();
     }
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
     if ($a_set["type"] == "mob") {
         $this->tpl->setVariable("MEDIA_INFO", ilObjMediaObjectGUI::_getMediaInfoHTML($mob));
     }
     $this->tpl->setVariable("CHECKBOX_ID", $a_set["type"] . ":" . $a_set["id"]);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:44,代码来源:class.ilClipboardTableGUI.php

示例5: fillRow

 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng;
     $this->tpl->setVariable("FILENAME", $a_set["filename"]);
     $piname = pathinfo($a_set["filename"]);
     $th_path = ilObjMediaObject::getThumbnailPath($this->mob->getId(), basename($a_set["filename"], "." . $piname['extension']) . ".png");
     if (!is_file($th_path)) {
         $this->mob->makeThumbnail("overlays/" . $a_set["filename"], basename($a_set["filename"], "." . $piname['extension']) . ".png");
     }
     if (is_file($th_path)) {
         $this->tpl->setVariable("THUMB", ilUtil::img($th_path));
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:16,代码来源:class.ilPCIIMOverlaysTableGUI.php

示例6: getPageDiskSize

 public function getPageDiskSize()
 {
     $quota_sum = 0;
     $this->buildDom();
     $dom = $this->getDom();
     if ($dom instanceof php4DOMDocument) {
         $dom = $dom->myDOMDocument;
     }
     $xpath_temp = new DOMXPath($dom);
     // mobs
     include_once "Services/MediaObjects/classes/class.ilObjMediaObject.php";
     $nodes = $xpath_temp->query("//PageContent/MediaObject/MediaAlias");
     foreach ($nodes as $node) {
         $mob_id = array_pop(explode("_", $node->getAttribute("OriginId")));
         $mob_dir = ilObjMediaObject::_getDirectory($mob_id);
         $quota_sum += ilUtil::dirSize($mob_dir);
     }
     return $quota_sum;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:19,代码来源:class.ilPortfolioTemplatePage.php

示例7: importXmlRepresentation

 /**
  * Import XML
  *
  * @param
  * @return
  */
 function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
 {
     // Container import => test object already created
     if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
         $newObj = ilObjectFactory::getInstanceByObjId($new_id, false);
         #$newObj->setImportDirectory(dirname(rtrim($this->getImportDirectory(),'/')));
     } else {
         // Shouldn't happen
         $GLOBALS['ilLog']->write(__METHOD__ . ': Called in non container mode');
         return false;
     }
     include_once "./Services/Survey/classes/class.SurveyImportParser.php";
     list($xml_file) = $this->parseXmlFileNames();
     if (!@file_exists($xml_file)) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': Cannot find xml definition: ' . $xml_file);
         return false;
     }
     $import = new SurveyImportParser(-1, $xml_file, TRUE);
     $import->setSurveyObject($newObj);
     $import->startParsing();
     if (is_array($_SESSION["import_mob_xhtml"])) {
         include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
         include_once "./Services/RTE/classes/class.ilRTE.php";
         include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
         foreach ($_SESSION["import_mob_xhtml"] as $mob) {
             $importfile = dirname($xml_file) . "/" . $mob["uri"];
             if (file_exists($importfile)) {
                 $media_object =& ilObjMediaObject::_saveTempFileAsMediaObject(basename($importfile), $importfile, FALSE);
                 ilObjMediaObject::_saveUsage($media_object->getId(), "svy:html", $newObj->getId());
                 $newObj->setIntroduction(str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $newObj->getIntroduction()));
                 $newObj->setOutro(str_replace("src=\"" . $mob["mob"] . "\"", "src=\"" . "il_" . IL_INST_ID . "_mob_" . $media_object->getId() . "\"", $newObj->getOutro()));
             } else {
                 global $ilLog;
                 $ilLog->write("Error: Could not open XHTML mob file for test introduction during test import. File {$importfile} does not exist!");
             }
         }
         $newObj->setIntroduction(ilRTE::_replaceMediaObjectImageSrc($newObj->getIntroduction(), 1));
         $newObj->setOutro(ilRTE::_replaceMediaObjectImageSrc($newObj->getOutro(), 1));
         $newObj->saveToDb();
     }
     $a_mapping->addMapping("Modules/Survey", "svy", $a_id, $newObj->getId());
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:49,代码来源:class.ilSurveyImporter.php

示例8: getRoomAgreementLink

 /**
  * Creates link for an room agreement file if such exists.
  *
  * @return string link
  */
 private function getRoomAgreementLink()
 {
     $linkPresentation = "";
     $fileId = $this->object->getRoomsAgreementFileId();
     if (!empty($fileId) && $fileId != "0") {
         $agreementFile = new ilObjMediaObject($fileId);
         $media = $agreementFile->getMediaItem("Standard");
         $source = $agreementFile->getDataDirectory() . "/" . $media->getLocation();
         $linkPresentation = "<p> <a target=\"_blank\" href=\"" . $source . "\">" . $this->lng->txt('rep_robj_xrs_current_rooms_user_agreement') . "</a></p>";
     }
     return $linkPresentation;
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:17,代码来源:class.ilObjRoomSharingGUI.php

示例9: toJSON

 /**
  * Returns a JSON representation of the question
  */
 public function toJSON()
 {
     include_once "./Services/RTE/classes/class.ilRTE.php";
     $result = array();
     $result['id'] = (int) $this->getId();
     $result['type'] = (string) $this->getQuestionType();
     $result['title'] = (string) $this->getTitle();
     $result['question'] = $this->formatSAQuestion($this->getQuestion());
     $result['text'] = (string) ilRTE::_replaceMediaObjectImageSrc($this->getErrorText(), 0);
     $result['nr_of_tries'] = (int) $this->getNrOfTries();
     $result['shuffle'] = (bool) $this->getShuffle();
     $result['feedback'] = array('onenotcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false)), 'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true)));
     $answers = array();
     foreach ($this->getErrorData() as $idx => $answer_obj) {
         array_push($answers, array("answertext_wrong" => (string) $answer_obj->text_wrong, "answertext_correct" => (string) $answer_obj->text_correct, "points" => (double) $answer_obj->points, "order" => (int) $idx + 1));
     }
     $result['correct_answers'] = $answers;
     $answers = array();
     $textarray = preg_split("/[\n\r]+/", $this->getErrorText());
     foreach ($textarray as $textidx => $text) {
         $items = preg_split("/\\s+/", trim($text));
         foreach ($items as $idx => $item) {
             if (substr($item, 0, 1) == "#") {
                 $item = substr($item, 1);
                 // #14115 - add position to correct answer
                 foreach ($result["correct_answers"] as $aidx => $answer) {
                     if ($answer["answertext_wrong"] == $item && !$answer["pos"]) {
                         $result["correct_answers"][$aidx]["pos"] = $this->getId() . "_" . $textidx . "_" . ($idx + 1);
                         break;
                     }
                 }
             }
             array_push($answers, array("answertext" => (string) ilUtil::prepareFormOutput($item), "order" => $this->getId() . "_" . $textidx . "_" . ($idx + 1)));
         }
         if ($textidx != sizeof($textarray) - 1) {
             array_push($answers, array("answertext" => "###", "order" => $this->getId() . "_" . $textidx . "_" . ($idx + 2)));
         }
     }
     $result['answers'] = $answers;
     $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
     $result['mobs'] = $mobs;
     return json_encode($result);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:46,代码来源:class.assErrorText.php

示例10: toJSON

 /**
  * Returns a JSON representation of the question
  */
 public function toJSON()
 {
     include_once "./Services/RTE/classes/class.ilRTE.php";
     $result = array();
     $result['id'] = (int) $this->getId();
     $result['type'] = (string) $this->getQuestionType();
     $result['title'] = (string) $this->getTitle();
     $result['question'] = $this->formatSAQuestion($this->getQuestion());
     $result['nr_of_tries'] = (int) $this->getNrOfTries();
     $result['shuffle'] = (bool) $this->getShuffle();
     $result['feedback'] = array("onenotcorrect" => $this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), false), "allcorrect" => $this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), true));
     $answers = array();
     $has_image = false;
     foreach ($this->getAnswers() as $key => $answer_obj) {
         if ((string) $answer_obj->getImage()) {
             $has_image = true;
         }
         array_push($answers, array("answertext" => (string) $answer_obj->getAnswertext(), "points" => (double) $answer_obj->getPoints(), "order" => (int) $answer_obj->getOrder(), "image" => (string) $answer_obj->getImage(), "feedback" => ilRTE::_replaceMediaObjectImageSrc($this->feedbackOBJ->getSpecificAnswerFeedbackExportPresentation($this->getId(), $key), 0)));
     }
     $result['answers'] = $answers;
     if ($has_image) {
         $result['path'] = $this->getImagePathWeb();
         $result['thumb'] = $this->getThumbSize();
     }
     $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $this->getId());
     $result['mobs'] = $mobs;
     return json_encode($result);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:31,代码来源:class.assSingleChoice.php

示例11: exportXHTMLMediaObjects

 function exportXHTMLMediaObjects($a_export_dir)
 {
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
     $mobs = ilObjMediaObject::_getMobsOfObject("tst:html", $this->test_obj->getId());
     foreach ($mobs as $mob) {
         if (ilObjMediaObject::_exists($mob)) {
             $mob_obj =& new ilObjMediaObject($mob);
             $mob_obj->exportFiles($a_export_dir);
             unset($mob_obj);
         }
     }
     foreach ($this->test_obj->questions as $question_id) {
         $mobs = ilObjMediaObject::_getMobsOfObject("qpl:html", $question_id);
         foreach ($mobs as $mob) {
             if (ilObjMediaObject::_exists($mob)) {
                 $mob_obj =& new ilObjMediaObject($mob);
                 $mob_obj->exportFiles($a_export_dir);
                 unset($mob_obj);
             }
         }
     }
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:22,代码来源:class.ilTestExport.php

示例12: saveStatutoryRegulationsObject

 public function saveStatutoryRegulationsObject()
 {
     require_once 'Services/RTE/classes/class.ilRTE.php';
     if (isset($_POST['statutory_regulations']) && $_POST['statutory_regulations'] != NULL) {
         $this->genSetData->set('statutory_regulations', ilRTE::_replaceMediaObjectImageSrc($_POST['statutory_regulations'], 0), 'regulations');
         // copy temporary media objects (frm~)
         include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
         $mediaObjects = ilRTE::_getMediaObjects($_POST['statutory_regulations'], 0);
         $myMediaObjects = ilObjMediaObject::_getMobsOfObject('pays~:html', ilObject::_lookupObjId($this->ref_id));
         foreach ($mediaObjects as $mob) {
             foreach ($myMediaObjects as $myMob) {
                 if ($mob == $myMob) {
                     // change usage
                     ilObjMediaObject::_removeUsage($mob, 'pays~:html', ilObject::_lookupObjId($this->ref_id));
                     break;
                 }
             }
             ilObjMediaObject::_saveUsage($mob, 'pays~:html', ilObject::_lookupObjId($this->ref_id));
         }
     } else {
         $this->genSetData->set('statutory_regulations', NULL, 'regulations');
     }
     // remove usage of deleted media objects
     include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
     $oldMediaObjects = ilObjMediaObject::_getMobsOfObject('pays~:html', ilObject::_lookupObjId($this->ref_id));
     $curMediaObjects = ilRTE::_getMediaObjects($_POST['statutory_regulations'], 0);
     foreach ($oldMediaObjects as $oldMob) {
         $found = false;
         foreach ($curMediaObjects as $curMob) {
             if ($oldMob == $curMob) {
                 $found = true;
                 break;
             }
         }
         if (!$found) {
             if (ilObjMediaObject::_exists($oldMob)) {
                 ilObjMediaObject::_removeUsage($oldMob, 'pays~:html', ilObject::_lookupObjId($this->ref_id));
                 $mob_obj = new ilObjMediaObject($oldMob);
                 $mob_obj->delete();
             }
         }
     }
     $this->genSetData->set('show_sr_shoppingcart', isset($_POST['show_sr_shoppingcart']) ? 1 : 0, 'regulations');
     $this->genSetData->set('attach_sr_invoice', isset($_POST['attach_sr_invoice']) ? 1 : 0, 'regulations');
     $this->StatutoryRegulationsObject();
     ilUtil::sendSuccess($this->lng->txt('pays_updated_general_settings'));
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:48,代码来源:class.ilObjPaymentSettingsGUI.php

示例13: exportXMLMediaObjects

 /**
  * export media objects to xml (see ilias_co.dtd)
  *
  * @param	object		$a_xml_writer	ilXmlWriter object that receives the
  *										xml data
  */
 function exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 {
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
     foreach ($this->mob_ids as $mob_id) {
         $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
         if (ilObjMediaObject::_exists($mob_id)) {
             $media_obj = new ilObjMediaObject($mob_id);
             $media_obj->exportXML($a_xml_writer, $a_inst);
             $media_obj->exportFiles($a_target_dir);
             unset($media_obj);
         }
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:19,代码来源:class.ilObjQuestionPool.php

示例14: getFileLinkForUserAgreementId

 /**
  * Generate the link to the room agreement.
  *
  * @param integer $a_file_id
  *
  * @return string
  */
 private function getFileLinkForUserAgreementId($a_file_id)
 {
     $agreement_file = new ilObjMediaObject($a_file_id);
     $media = $agreement_file->getMediaItem("Standard");
     $source = $agreement_file->getDataDirectory() . "/" . $media->getLocation();
     $link = "<p> <a target=\"_blank\" href=\"" . $source . "\">" . $this->lng->txt('rep_robj_xrs_current_rooms_user_agreement') . "</a></p>";
     return $link;
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:15,代码来源:class.ilRoomSharingShowAndEditBookGUI.php

示例15: showNews

 /**
  * show news
  */
 function showNews()
 {
     global $lng, $ilCtrl, $ilUser;
     // workaround for dynamic mode (if cache is disabled, showNews has no data)
     if (empty(self::$st_data)) {
         $this->setData($this->getNewsData());
     }
     $news_set = new ilSetting("news");
     $enable_internal_rss = $news_set->get("enable_rss_for_internal");
     include_once "./Services/News/classes/class.ilNewsItem.php";
     $news = new ilNewsItem($_GET["news_id"]);
     $tpl = new ilTemplate("tpl.show_news.html", true, true, "Services/News");
     // get current item in data set
     $previous = $next = "";
     reset($this->data);
     $c = current($this->data);
     $curr_cnt = 1;
     while ($c["id"] > 0 && $c["id"] != $_GET["news_id"]) {
         $previous = $c;
         $c = next($this->data);
         $curr_cnt++;
     }
     // collect news items to show
     $news_list = array();
     if (is_array($c["aggregation"])) {
         //$agg_obj_id = ilObject::_lookupObjId($c["agg_ref_id"]);
         //$agg_obj_type = ilObject::_lookupType($agg_obj_id);
         //$agg_obj_title = ilObject::_lookupObjId($agg_obj_id);
         $news_list[] = array("ref_id" => $c["agg_ref_id"], "agg_ref_id" => $c["agg_ref_id"], "aggregation" => $c["aggregation"], "user_id" => "", "content_type" => "text", "mob_id" => 0, "visibility" => "", "content" => "", "content_long" => "", "update_date" => $news->getUpdateDate(), "creation_date" => "", "content_is_lang_var" => false, "loc_context" => $_GET["news_context"], "context_obj_type" => $news->getContextObjType(), "title" => "");
         foreach ($c["aggregation"] as $c_item) {
             ilNewsItem::_setRead($ilUser->getId(), $c_item["id"]);
             $c_item["loc_context"] = $c_item["ref_id"];
             $c_item["loc_stop"] = $_GET["news_context"];
             $news_list[] = $c_item;
         }
     } else {
         $news_list[] = array("ref_id" => $_GET["news_context"], "user_id" => $news->getUserId(), "content_type" => $news->getContentType(), "mob_id" => $news->getMobId(), "visibility" => $news->getVisibility(), "priority" => $news->getPriority(), "content" => $news->getContent(), "content_long" => $news->getContentLong(), "update_date" => $news->getUpdateDate(), "creation_date" => $news->getCreationDate(), "context_sub_obj_type" => $news->getContextSubObjType(), "context_obj_type" => $news->getContextObjType(), "context_sub_obj_id" => $news->getContextSubObjId(), "content_is_lang_var" => $news->getContentIsLangVar(), "content_text_is_lang_var" => $news->getContentTextIsLangVar(), "loc_context" => $_GET["news_context"], "title" => $news->getTitle());
         ilNewsItem::_setRead($ilUser->getId(), $_GET["news_id"]);
     }
     foreach ($news_list as $item) {
         // user
         if ($item["user_id"] > 0 && ilObject::_exists($item["user_id"])) {
             // get login
             if (ilObjUser::_exists($item["user_id"])) {
                 $user = new ilObjUser($item["user_id"]);
                 $displayname = $user->getLogin();
             } else {
                 // this should actually not happen, since news entries
                 // should be deleted when the user is going to be removed
                 $displayname = "&lt;" . strtolower($lng->txt("deleted")) . "&gt;";
             }
             $tpl->setCurrentBlock("user_info");
             $tpl->setVariable("VAL_AUTHOR", $displayname);
             $tpl->setVariable("TXT_AUTHOR", $lng->txt("author"));
             $tpl->parseCurrentBlock();
         }
         // media player
         if ($item["content_type"] == NEWS_AUDIO && $item["mob_id"] > 0 && ilObject::_exists($item["mob_id"])) {
             include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
             include_once "./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php";
             $mob = new ilObjMediaObject($item["mob_id"]);
             $med = $mob->getMediaItem("Standard");
             $mpl = new ilMediaPlayerGUI();
             if (strcasecmp("Reference", $med->getLocationType()) == 0) {
                 $mpl->setFile($med->getLocation());
             } else {
                 $mpl->setFile(ilObjMediaObject::_getURL($mob->getId()) . "/" . $med->getLocation());
             }
             $mpl->setDisplayHeight($med->getHeight());
             $tpl->setCurrentBlock("player");
             $tpl->setVariable("PLAYER", $mpl->getMp3PlayerHtml());
             $tpl->parseCurrentBlock();
         }
         // access
         if ($enable_internal_rss && $item["visibility"] != "") {
             $obj_id = ilObject::_lookupObjId($item["ref_id"]);
             $tpl->setCurrentBlock("access");
             $tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility"));
             if ($item["visibility"] == NEWS_PUBLIC || $item["priority"] == 0 && ilBlockSetting::_lookup("news", "public_notifications", 0, $obj_id)) {
                 $tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public"));
             } else {
                 $tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users"));
             }
             $tpl->parseCurrentBlock();
         }
         // content
         if (trim($item["content"]) != "") {
             $tpl->setCurrentBlock("content");
             $tpl->setVariable("VAL_CONTENT", nl2br($this->makeClickable(ilNewsItem::determineNewsContent($item["context_obj_type"], $item["content"], $item["content_text_is_lang_var"]))));
             //$tpl->setVariable("VAL_CONTENT", nl2br($item["content"]));
             $tpl->parseCurrentBlock();
         }
         if (trim($item["content_long"]) != "") {
             $tpl->setCurrentBlock("long");
             $tpl->setVariable("VAL_LONG_CONTENT", $this->makeClickable($item["content_long"]));
             $tpl->parseCurrentBlock();
         }
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilNewsForContextBlockGUI.php


注:本文中的ilObjMediaObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。