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


PHP ilObjMediaObject::exportFiles方法代码示例

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


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

示例1: 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

示例2: 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";
     $linked_mobs = array();
     // mobs directly embedded into pages
     foreach ($this->mob_ids as $mob_id) {
         if ($mob_id > 0 && ilObject::_lookupType($mob_id) == "mob") {
             $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
             $media_obj = new ilObjMediaObject($mob_id);
             $media_obj->exportXML($a_xml_writer, $a_inst);
             $media_obj->exportFiles($a_target_dir);
             $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
             $linked_mobs = array_merge($linked_mobs, $lmobs);
             unset($media_obj);
         }
     }
     // linked mobs (in map areas)
     foreach ($linked_mobs as $mob_id) {
         if ($mob_id > 0) {
             $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $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,代码行数:33,代码来源:class.ilObjContentObject.php

示例3: exportFileItems

 /**
  * export files of file itmes
  *
  */
 function exportFileItems($a_target_dir, &$expLog)
 {
     include_once "./Modules/File/classes/class.ilObjFile.php";
     if (is_array($this->file_ids)) {
         foreach ($this->file_ids as $file_id) {
             $expLog->write(date("[y-m-d H:i:s] ") . "File Item " . $file_id);
             if (ilObject::_lookupType($file_id) == "file") {
                 $file_obj = new ilObjFile($file_id, false);
                 $file_obj->export($a_target_dir);
                 unset($file_obj);
             } else {
                 $expLog->write(date("[y-m-d H:i:s] ") . "File Item not found, ID: " . $file_id);
             }
         }
     }
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
     $linked_mobs = array();
     if (is_array($this->mob_ids)) {
         // mobs directly embedded into pages
         foreach ($this->mob_ids as $mob_id) {
             if ($mob_id > 0 && ilObject::_exists($mob_id)) {
                 $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
                 $media_obj = new ilObjMediaObject($mob_id);
                 $media_obj->exportFiles($a_target_dir, $expLog);
                 $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
                 $linked_mobs = array_merge($linked_mobs, $lmobs);
                 unset($media_obj);
             }
         }
         // linked mobs (in map areas)
         foreach ($linked_mobs as $mob_id) {
             if ($mob_id > 0 && ilObject::_exists($mob_id)) {
                 $expLog->write(date("[y-m-d H:i:s] ") . "Media Object " . $mob_id);
                 $media_obj = new ilObjMediaObject($mob_id);
                 $media_obj->exportFiles($a_target_dir);
                 unset($media_obj);
             }
         }
     }
     //media files in questions
     foreach ($this->q_media as $media) {
         if ($media != "") {
             error_log($media);
             copy($media, $a_target_dir . "/objects/" . basename($media));
         }
     }
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:51,代码来源:class.ilSCORM2004Asset.php

示例4: 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);
//.........这里部分代码省略.........
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilForumXMLWriter.php


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