本文整理汇总了PHP中ilObjMediaObject::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjMediaObject::getTitle方法的具体用法?PHP ilObjMediaObject::getTitle怎么用?PHP ilObjMediaObject::getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjMediaObject
的用法示例。
在下文中一共展示了ilObjMediaObject::getTitle方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: initForm
/**
* init Form
*
* @param string $a_mode values: create | edit
*/
public function initForm()
{
global $lng, $ilCtrl;
//table_id
$hidden_prop = new ilHiddenInputGUI("table_id");
$hidden_prop->setValue($this->table_id);
$this->form->addItem($hidden_prop);
$ilCtrl->setParameter($this, "record_id", $this->record_id);
$this->form->setFormAction($ilCtrl->getFormAction($this));
$allFields = $this->table->getRecordFields();
foreach ($allFields as $field) {
$item = ilDataCollectionDatatype::getInputField($field);
if ($field->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_REFERENCE) {
$fieldref = $field->getFieldRef();
$reffield = ilDataCollectionCache::getFieldCache($fieldref);
$options = array();
if (!$field->isNRef()) {
$options[""] = '--';
}
$reftable = ilDataCollectionCache::getTableCache($reffield->getTableId());
foreach ($reftable->getRecords() as $record) {
// If the referenced field is MOB or FILE, we display the filename in the dropdown
if ($reffield->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_FILE) {
$file_obj = new ilObjFile($record->getRecordFieldValue($fieldref), false);
$options[$record->getId()] = $file_obj->getFileName();
} else {
if ($reffield->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_MOB) {
$media_obj = new ilObjMediaObject($record->getRecordFieldValue($fieldref), false);
$options[$record->getId()] = $media_obj->getTitle();
} else {
$options[$record->getId()] = $record->getRecordFieldValue($fieldref);
}
}
}
$item->setOptions($options);
}
if ($this->record_id) {
$record = ilDataCollectionCache::getRecordCache($this->record_id);
}
$item->setRequired($field->getRequired());
//WORKAROUND. If field is from type file: if it's required but already has a value it is no longer required as the old value is taken as default without the form knowing about it.
if ($field->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_FILE || $field->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_MOB && ($this->record_id && $record->getId() != 0 && ($record->getRecordFieldValue($field->getId()) != "-" || $record->getRecordFieldValue($field->getId()) != ""))) {
$item->setRequired(false);
}
if (!ilObjDataCollection::_hasWriteAccess($this->parent_obj->ref_id) && $field->getLocked()) {
$item->setDisabled(true);
}
$this->form->addItem($item);
}
// Add possibility to change the owner in edit mode
if ($this->record_id) {
$ownerField = $this->table->getField('owner');
$inputfield = ilDataCollectionDatatype::getInputField($ownerField);
$this->form->addItem($inputfield);
}
// save and cancel commands
if (isset($this->record_id)) {
$this->form->setTitle($lng->txt("dcl_update_record"));
$this->form->addCommandButton("save", $lng->txt("dcl_update_record"));
$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
} else {
$this->form->setTitle($lng->txt("dcl_add_new_record"));
$this->form->addCommandButton("save", $lng->txt("save"));
$this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
}
$ilCtrl->setParameter($this, "table_id", $this->table_id);
$ilCtrl->setParameter($this, "record_id", $this->record_id);
}
示例3: initForm
/**
* init Form
*/
public function initForm()
{
$this->form = new ilPropertyFormGUI();
$prefix = $this->ctrl->isAsynch() ? 'dclajax' : 'dcl';
// Used by datacolleciton.js to select input elements
$this->form->setId($prefix . $this->table_id . $this->record_id);
$hidden_prop = new ilHiddenInputGUI("table_id");
$hidden_prop->setValue($this->table_id);
$this->form->addItem($hidden_prop);
if ($this->record_id) {
$hidden_prop = new ilHiddenInputGUI("record_id");
$hidden_prop->setValue($this->record_id);
$this->form->addItem($hidden_prop);
}
$this->ctrl->setParameter($this, "record_id", $this->record_id);
$this->form->setFormAction($this->ctrl->getFormAction($this));
$allFields = $this->table->getRecordFields();
$inline_css = '';
foreach ($allFields as $field) {
$item = ilDataCollectionDatatype::getInputField($field);
if ($item === NULL) {
continue;
// Fields calculating values at runtime, e.g. ilDataCollectionFormulaField do not have input
}
if ($field->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_REFERENCE) {
$fieldref = $field->getFieldRef();
$reffield = ilDataCollectionCache::getFieldCache($fieldref);
$options = array();
if (!$field->isNRef()) {
$options[""] = $this->lng->txt('dcl_please_select');
}
$reftable = ilDataCollectionCache::getTableCache($reffield->getTableId());
foreach ($reftable->getRecords() as $record) {
// If the referenced field is MOB or FILE, we display the filename in the dropdown
switch ($reffield->getDatatypeId()) {
case ilDataCollectionDatatype::INPUTFORMAT_FILE:
$file_obj = new ilObjFile($record->getRecordFieldValue($fieldref), false);
$options[$record->getId()] = $file_obj->getFileName();
break;
case ilDataCollectionDatatype::INPUTFORMAT_MOB:
$media_obj = new ilObjMediaObject($record->getRecordFieldValue($fieldref), false);
$options[$record->getId()] = $media_obj->getTitle();
break;
case ilDataCollectionDatatype::INPUTFORMAT_DATETIME:
$options[$record->getId()] = $record->getRecordFieldSingleHTML($fieldref);
break;
default:
$options[$record->getId()] = $record->getRecordFieldValue($fieldref);
break;
}
}
asort($options);
$item->setOptions($options);
if ($field->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_REFERENCE) {
// FSX use this to apply to MultiSelectInputGUI
// if (!$field->isNRef()) { // addCustomAttribute only defined for single selects
if ($reftable->hasPermissionToAddRecord($_GET['ref_id'])) {
$item->addCustomAttribute('data-ref="1"');
$item->addCustomAttribute('data-ref-table-id="' . $reftable->getId() . '"');
$item->addCustomAttribute('data-ref-field-id="' . $reffield->getId() . '"');
}
// }
}
if ($item instanceof ilMultiSelectInputGUI) {
$item->setWidth(400);
$item->setHeight(100);
$inline_css .= 'div#' . $item->getFieldId() . '{resize:both;} ';
}
}
if ($this->record_id) {
$record = ilDataCollectionCache::getRecordCache($this->record_id);
}
$item->setRequired($field->getRequired());
//WORKAROUND. If field is from type file: if it's required but already has a value it is no longer required as the old value is taken as default without the form knowing about it.
if ($field->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_FILE || $field->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_MOB) {
if ($this->record_id and $record->getId()) {
$field_value = $record->getRecordFieldValue($field->getId());
if ($field_value) {
$item->setRequired(false);
}
}
// If this is an ajax request to return the form, input files are currently not supported
if ($this->ctrl->isAsynch()) {
$item->setDisabled(true);
}
}
if (!ilObjDataCollection::_hasWriteAccess($this->parent_obj->ref_id) && $field->getLocked()) {
$item->setDisabled(true);
}
$this->form->addItem($item);
}
$this->tpl->addInlineCss($inline_css);
// Add possibility to change the owner in edit mode
if ($this->record_id) {
$ownerField = $this->table->getField('owner');
$inputfield = ilDataCollectionDatatype::getInputField($ownerField);
$this->form->addItem($inputfield);
//.........这里部分代码省略.........
示例4: showPrintView
/**
* show print view
*/
function showPrintView()
{
global $ilUser, $lng, $ilCtrl;
include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
if (!$this->lm->isActivePrintView()) {
return;
}
$this->renderPageTitle();
$c_obj_id = $this->getCurrentPageId();
// set values according to selection
if ($_POST["sel_type"] == "page") {
if (!is_array($_POST["obj_id"]) || !in_array($c_obj_id, $_POST["obj_id"])) {
$_POST["obj_id"][] = $c_obj_id;
}
}
if ($_POST["sel_type"] == "chapter" && $c_obj_id > 0) {
$path = $this->lm_tree->getPathFull($c_obj_id);
$chap_id = $path[1]["child"];
if ($chap_id > 0) {
$_POST["obj_id"][] = $chap_id;
}
}
//var_dump($_GET);
//var_dump($_POST);
// set style sheets
if (!$this->offlineMode()) {
$this->tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
} else {
$style_name = $ilUser->getPref("style") . ".css";
$this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
}
// content style
$this->tpl->setCurrentBlock("ContentStyle");
if (!$this->offlineMode()) {
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->lm->getStyleSheetId()));
} else {
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", "content_style/content.css");
}
$this->tpl->parseCurrentBlock();
// syntax style
$this->tpl->setCurrentBlock("SyntaxStyle");
$this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
$this->tpl->parseCurrentBlock();
//$this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$this->tpl->addBlockFile("CONTENT", "content", "tpl.lm_print_view.html", true);
// set title header
$this->tpl->setVariable("HEADER", $this->lm->getTitle());
$nodes = $this->lm_tree->getSubtree($this->lm_tree->getNodeData($this->lm_tree->getRootId()));
include_once "./Modules/LearningModule/classes/class.ilLMPageGUI.php";
include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
include_once "./Modules/LearningModule/classes/class.ilStructureObject.php";
$act_level = 99999;
$activated = false;
$glossary_links = array();
$output_header = false;
$media_links = array();
// get header and footer
if ($this->lm->getFooterPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
if (ilLMObject::_exists($this->lm->getFooterPage())) {
$page_object_gui = $this->getLMPageGUI($this->lm->getFooterPage());
include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
$page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->lm->getStyleSheetId(), "lm"));
// determine target frames for internal links
$page_object_gui->setLinkFrame($_GET["frame"]);
$page_object_gui->setOutputMode("print");
$page_object_gui->setPresentationTitle("");
$page_object_gui->setFileDownloadLink("#");
$page_object_gui->setFullscreenLink("#");
$page_object_gui->setSourceCodeDownloadScript("#");
$footer_page_content = $page_object_gui->showPage();
}
}
if ($this->lm->getHeaderPage() > 0 && !$this->lm->getHideHeaderFooterPrint()) {
if (ilLMObject::_exists($this->lm->getHeaderPage())) {
$page_object_gui = $this->getLMPageGUI($this->lm->getHeaderPage());
include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
$page_object_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->lm->getStyleSheetId(), "lm"));
// determine target frames for internal links
$page_object_gui->setLinkFrame($_GET["frame"]);
$page_object_gui->setOutputMode("print");
$page_object_gui->setPresentationTitle("");
$page_object_gui->setFileDownloadLink("#");
$page_object_gui->setFullscreenLink("#");
$page_object_gui->setSourceCodeDownloadScript("#");
$header_page_content = $page_object_gui->showPage();
}
}
// add free selected pages
if (is_array($_POST["obj_id"])) {
foreach ($_POST["obj_id"] as $k) {
if ($k > 0 && !$this->lm_tree->isInTree($k)) {
if (ilLMObject::_lookupType($k) == "pg") {
$nodes[] = array("obj_id" => $k, "type" => "pg", "free" => true);
}
}
}
} else {
//.........这里部分代码省略.........
示例5: getExportResources
function getExportResources()
{
$export_files = array();
require_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
include_once "./Modules/File/classes/class.ilObjFile.php";
$tree = new ilTree($this->slm_object->getId());
$tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
$tree->setTreeTablePK("slm_id");
foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
$page_obj = new ilSCORM2004Page($page["obj_id"]);
$page_obj->buildDom();
$mob_ids = $page_obj->collectMediaObjects(false);
foreach ($mob_ids as $mob_id) {
if ($mob_id > 0 && ilObject::_exists($mob_id)) {
$path = ilObjMediaObject::_lookupStandardItemPath($mob_id, false, false);
$media_obj = new ilObjMediaObject($mob_id);
$export_files[$i]["date"] = $media_obj->getCreateDate();
$export_files[$i]["size"] = @filesize($path);
// could be remote, e.g. youtube video
$export_files[$i]["file"] = $media_obj->getTitle();
$export_files[$i]["type"] = $media_obj->getDescription();
$export_files[$i]["path"] = $path;
$this->ctrl->setParameter($this, "resource", rawurlencode(ilObjMediaObject::_lookupStandardItemPath($mob_id, false, false)));
$export_files[$i]["link"] = $this->ctrl->getLinkTarget($this, "downloadResource");
$i++;
}
}
include_once "./Services/COPage/classes/class.ilPCFileList.php";
$file_ids = ilPCFileList::collectFileItems($page_obj, $page_obj->getDomDoc());
foreach ($file_ids as $file_id) {
$file_obj = new ilObjFile($file_id, false);
$export_files[$i]["date"] = $file_obj->getCreateDate();
$export_files[$i]["size"] = $file_obj->getFileSize();
$export_files[$i]["file"] = $file_obj->getFileName();
$export_files[$i]["type"] = $file_obj->getFileType();
$export_files[$i]["file_id"] = $file_id;
$this->ctrl->setParameter($this, "file_id", $file_id);
$export_files[$i]["link"] = $this->ctrl->getLinkTarget($this, "downloadFile", "");
$i++;
}
unset($page_obj);
}
return $export_files;
}
示例6: parseExportValue
/**
* Function to parse incoming data from form input value $value. returns the strin/number/etc. to store in the database.
* @param $value
* @return int|string
*/
public function parseExportValue($value)
{
$return = false;
if ($this->id == ilDataCollectionDatatype::INPUTFORMAT_FILE) {
if (!ilObject2::_exists($value) || ilObject2::_lookupType($value, false) != "file") {
return;
}
$file = $value;
if ($file != "-") {
$file_obj = new ilObjFile($file, false);
$file_name = $file_obj->getFileName();
$return = $file_name;
} else {
$return = $file;
}
} elseif ($this->id == ilDataCollectionDatatype::INPUTFORMAT_MOB) {
$file = $value;
if ($file != "-") {
$mob = new ilObjMediaObject($file, false);
$mob_name = $mob->getTitle();
$return = $mob_name;
} else {
$return = $file;
}
} elseif ($this->id == ilDataCollectionDatatype::INPUTFORMAT_DATETIME) {
$return = substr($value, 0, 10);
} elseif ($this->id == ilDataCollectionDatatype::INPUTFORMAT_BOOLEAN) {
$return = $value ? 1 : 0;
} else {
$return = $value;
}
return $return;
}
示例7: createMediaFromUploadDir
/**
* Create media object from upload directory
*/
function createMediaFromUploadDir()
{
$mset = new ilSetting("mobs");
$upload_dir = trim($mset->get("upload_dir"));
include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
if (is_array($_POST["file"]) && ilMainMenuGUI::_checkAdministrationPermission()) {
foreach ($_POST["file"] as $f) {
$f = str_replace("..", "", $f);
$fullpath = $upload_dir . "/" . $f;
$mob = new ilObjMediaObject();
$mob->setTitle(basename($fullpath));
$mob->setDescription("");
$mob->create();
// determine and create mob directory, move uploaded file to directory
//$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
$mob->createDirectory();
$mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
$media_item = new ilMediaItem();
$mob->addMediaItem($media_item);
$media_item->setPurpose("Standard");
$file = $mob_dir . "/" . basename($fullpath);
ilUtil::moveUploadedFile($fullpath, basename($fullpath), $file, false, $_POST["action"]);
// get mime type
$format = ilObjMediaObject::getMimeType($file);
$location = basename($fullpath);
// set real meta and object data
$media_item->setFormat($format);
$media_item->setLocation($location);
$media_item->setLocationType("LocalFile");
$mob->setDescription($format);
// determine width and height of known image types
$wh = ilObjMediaObject::_determineWidthHeight(500, 400, $format, "File", $mob_dir . "/" . $location, $media_item->getLocation(), true, true, "", "");
$media_item->setWidth($wh["width"]);
$media_item->setHeight($wh["height"]);
if ($wh["info"] != "") {
// ilUtil::sendInfo($wh["info"], true);
}
$media_item->setHAlign("Left");
ilUtil::renameExecutables($mob_dir);
$mob->update();
// put it into current folder
$mep_item = new ilMediaPoolItem();
$mep_item->setTitle($mob->getTitle());
$mep_item->setType("mob");
$mep_item->setForeignId($mob->getId());
$mep_item->create();
$tree = $this->object->getTree();
$parent = $_GET["mepitem_id"] == "" ? $tree->getRootId() : $_GET["mepitem_id"];
$tree->insertNode($mep_item->getId(), $parent);
}
}
ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" . $_GET["ref_id"] . "&mepitem_id=" . $_GET["mepitem_id"]);
}
示例8: confirmDeleteObject
/**
* Before deleting a floor plan, the user has to confirm it via a
* confirmation GUI which is created in this function.
*/
public function confirmDeleteObject()
{
if (!$this->permission->checkPrivilege(PRIVC::DELETE_FLOORPLANS)) {
ilUtil::sendFailure($this->lng->txt("rep_robj_xrs_no_permission_for_action"));
$this->ctrl->redirectByClass('ilinfoscreengui', 'showSummary', 'showSummary');
return false;
}
$this->tabs->clearTargets();
$this->tabs->setBackTarget($this->lng->txt('rep_robj_xrs_back_to_floor_plans'), $this->ctrl->getLinkTarget($this, 'render'));
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($this->ctrl->getFormAction($this));
$fplan = $fplan = new ilRoomSharingFloorPlans($this->pool_id, new ilRoomsharingDatabase($this->pool_id));
// check if floorplan is associated to a room
$allRooms = $fplan->getRoomsWithFloorplan((int) $_GET['file_id']);
foreach ($allRooms as $room) {
$rooms[] = $room["name"];
}
if (empty($rooms)) {
$cgui->setHeaderText($this->lng->txt("info_delete_sure"));
} else {
$roomsWithPlan = implode(", ", $rooms);
$cgui->setHeaderText($this->lng->txt("info_delete_sure") . '<br>' . $this->lng->txt("rep_robj_xrs_floor_plans_room_assoc") . ' ' . $roomsWithPlan);
}
// the buttons for confirming and cancelling the deletion
$cgui->setCancel($this->lng->txt("cancel"), "render");
$cgui->setConfirm($this->lng->txt("delete"), "removeFloorplan");
// the table which includes the thumbnail picture and the title
$mobj = new ilObjMediaObject((int) $_GET['file_id']);
$med = $mobj->getMediaItem("Standard");
$target = $med->getThumbnailTarget();
$cgui->addItem('file_id', (int) $_GET['file_id'], $mobj->getTitle(), $target);
$this->tpl->setContent($cgui->getHTML());
}
示例9: start
function start()
{
global $ilDB;
ilUtil::makeDir($this->target_dir_absolute . "/objects");
$query_frm = 'SELECT * FROM frm_settings fs ' . 'JOIN object_data od ON fs.obj_id = od.obj_id ' . 'JOIN frm_data ON top_frm_fk = od.obj_id ' . 'WHERE fs.obj_id = ' . $ilDB->quote($this->forum_id, 'integer');
$res = $ilDB->query($query_frm);
while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
break;
}
$this->xmlStartTag("Forum", null);
$this->xmlElement("Id", null, (int) $row->top_pk);
$this->xmlElement("ObjId", null, (int) $row->obj_id);
$this->xmlElement("Title", null, $row->title);
$this->xmlElement("Description", null, $row->description);
$this->xmlElement("DefaultView", null, (int) $row->default_view);
$this->xmlElement("Pseudonyms", null, (int) $row->anonymized);
$this->xmlElement("Statistics", null, (int) $row->statistics_enabled);
$this->xmlElement("PostingActivation", null, (int) $row->post_activation);
$this->xmlElement("PresetSubject", null, (int) $row->preset_subject);
$this->xmlElement("PresetRe", null, (int) $row->add_re_subject);
$this->xmlElement("NotificationType", null, $row->notification_type);
$this->xmlElement("ForceNotification", null, (int) $row->admin_force_noti);
$this->xmlElement("ToggleNotification", null, (int) $row->user_toggle_noti);
$this->xmlElement("LastPost", null, $row->top_last_post);
$this->xmlElement("Moderator", null, (int) $row->top_mods);
$this->xmlElement("CreateDate", null, $row->top_date);
$this->xmlElement("UpdateDate", null, $row->top_update);
$this->xmlElement("UpdateUserId", null, $row->update_user);
$this->xmlElement("UserId", null, (int) $row->top_usr_id);
$query_thr = "SELECT frm_threads.* " . " FROM frm_threads " . " INNER JOIN frm_data ON top_pk = thr_top_fk " . 'WHERE top_frm_fk = ' . $ilDB->quote($this->forum_id, 'integer');
$res = $ilDB->query($query_thr);
while ($row = $ilDB->fetchObject($res)) {
$this->xmlStartTag("Thread");
$this->xmlElement("Id", null, (int) $row->thr_pk);
$this->xmlElement("Subject", null, $row->thr_subject);
$this->xmlElement("UserId", null, (int) $row->thr_usr_id);
$this->xmlElement("Alias", null, $row->thr_usr_alias);
$this->xmlElement("LastPost", null, $row->thr_last_post);
$this->xmlElement("CreateDate", null, $row->thr_date);
$this->xmlElement("UpdateDate", null, $row->thr_date);
$this->xmlElement("ImportName", null, $row->import_name);
$this->xmlElement("Sticky", null, (int) $row->is_sticky);
$this->xmlElement("Closed", null, (int) $row->is_closed);
$query = 'SELECT frm_posts.*, frm_posts_tree.*
FROM frm_posts
INNER JOIN frm_data
ON top_pk = pos_top_fk
INNER JOIN frm_posts_tree
ON pos_fk = pos_pk
WHERE pos_thr_fk = ' . $ilDB->quote($row->thr_pk, 'integer') . ' ';
$query .= " ORDER BY frm_posts_tree.lft ASC";
$resPosts = $ilDB->query($query);
$lastDepth = null;
while ($rowPost = $ilDB->fetchObject($resPosts)) {
/*
// Used for nested postings
if( $rowPost->depth < $lastDepth )
{
for( $i = $rowPost->depth; $i <= $lastDepth; $i++ )
{
$this->xmlEndTag("Post");
}
}*/
$this->xmlStartTag("Post");
$this->xmlElement("Id", null, (int) $rowPost->pos_pk);
$this->xmlElement("UserId", null, (int) $rowPost->pos_usr_id);
$this->xmlElement("Alias", null, $rowPost->pos_usr_alias);
$this->xmlElement("Subject", null, $rowPost->pos_subject);
$this->xmlElement("CreateDate", null, $rowPost->pos_date);
$this->xmlElement("UpdateDate", null, $rowPost->pos_update);
$this->xmlElement("UpdateUserId", null, (int) $rowPost->update_user);
$this->xmlElement("Censorship", null, (int) $rowPost->pos_cens);
$this->xmlElement("CensorshipMessage", null, $rowPost->pos_cens_com);
$this->xmlElement("Notification", null, $rowPost->notify);
$this->xmlElement("ImportName", null, $rowPost->import_name);
$this->xmlElement("Status", null, (int) $rowPost->pos_status);
$this->xmlElement("Message", null, ilRTE::_replaceMediaObjectImageSrc($rowPost->pos_message, 0));
$media_exists = false;
$mobs = ilObjMediaObject::_getMobsOfObject('frm:html', $rowPost->pos_pk);
foreach ($mobs as $mob) {
$moblabel = "il_" . IL_INST_ID . "_mob_" . $mob;
if (ilObjMediaObject::_exists($mob)) {
if (!$media_exists) {
$this->xmlStartTag("MessageMediaObjects");
$media_exists = true;
}
$mob_obj = new ilObjMediaObject($mob);
$imgattrs = array("label" => $moblabel, "uri" => $this->target_dir_relative . "/objects/" . "il_" . IL_INST_ID . "_mob_" . $mob . "/" . $mob_obj->getTitle());
$this->xmlElement("MediaObject", $imgattrs, NULL);
$mob_obj->exportFiles($this->target_dir_absolute);
}
}
if ($media_exists) {
$this->xmlEndTag("MessageMediaObjects");
}
$this->xmlElement("Lft", null, (int) $rowPost->lft);
$this->xmlElement("Rgt", null, (int) $rowPost->rgt);
$this->xmlElement("Depth", null, (int) $rowPost->depth);
$this->xmlElement("ParentId", null, (int) $rowPost->parent_pos);
$tmp_file_obj = new ilFileDataForum($this->forum_id, $rowPost->pos_pk);
//.........这里部分代码省略.........
示例10: isTitleForUpdateAlreadyTaken
/**
* Checks whether or not the new title of an existing floorplan is not already taken.
* The new title of a floorplan should of course not collide with its current title.
*
* @param string $a_title the new title that is about to be set
* @param string $a_file_id the id of the floorplan whose name is about to be changed
*
* @return boolean true, if the name is taken; false otherwise
*/
private function isTitleForUpdateAlreadyTaken($a_title, $a_file_id)
{
$taken = false;
$media_obj = new ilObjMediaObject($a_file_id);
$old_title = $media_obj->getTitle();
if ($a_title != $old_title) {
$taken = $this->isTitleAlreadyTaken($a_title);
}
return $taken;
}
示例11: parseSortingValue
/**
* @param $value
* @param ilDataCollectionRecordField $record_field
* @param bool|true $link
* @return int|string
*/
public function parseSortingValue($value, ilDataCollectionRecordField $record_field, $link = true)
{
switch ($this->id) {
case self::INPUTFORMAT_DATETIME:
return strtotime($value);
case self::INPUTFORMAT_FILE:
if (!ilObject2::_exists($value) || ilObject2::_lookupType($value, false) != "file") {
return '';
}
$file_obj = new ilObjFile($value, false);
return $file_obj->getTitle();
case self::INPUTFORMAT_MOB:
$mob = new ilObjMediaObject($value, false);
return $mob->getTitle();
case ilDataCollectionDatatype::INPUTFORMAT_TEXT:
$arr_properties = $record_field->getField()->getProperties();
if ($arr_properties[ilDataCollectionField::PROPERTYID_URL]) {
if ($json = json_decode($value)) {
return $json->title ? $json->title : $json->link;
} else {
return $value;
}
} else {
return $value;
}
default:
return $value;
}
}