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


PHP ilObject::cloneObject方法代码示例

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


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

示例1: cloneObject

 /**
  * Clone
  *
  * @access public
  * @param int target id
  * @param int copy id
  * 
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB, $ilLog;
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $fb = $this->getFeedBlock();
     include_once "./Services/Block/classes/class.ilExternalFeedBlock.php";
     $new_feed_block = new ilExternalFeedBlock();
     $new_feed_block->setContextObjId($new_obj->getId());
     $new_feed_block->setContextObjType("feed");
     if (is_object($fb)) {
         $new_feed_block->setFeedUrl($fb->getFeedUrl());
         $new_feed_block->setTitle($fb->getTitle());
     }
     $new_feed_block->create();
     return $new_obj;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:24,代码来源:class.ilObjExternalFeed.php

示例2: cloneObject

 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree = false)
 {
     global $rbacreview;
     require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
     $original_room = ilChatroom::byObjectId($this->getId());
     $newObj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
     $objId = $newObj->getId();
     $original_settings = $original_room->getSettings();
     $room = new ilChatroom();
     $original_settings['object_id'] = $objId;
     $room->saveSettings($original_settings);
     // rbac log
     include_once "Services/AccessControl/classes/class.ilRbacLog.php";
     $rbac_log_roles = $rbacreview->getParentRoleIds($newObj->getRefId(), false);
     $rbac_log = ilRbacLog::gatherFaPa($newObj->getRefId(), array_keys($rbac_log_roles), true);
     ilRbacLog::add(ilRbacLog::CREATE_OBJECT, $newObj->getRefId(), $rbac_log);
     return $newObj;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:18,代码来源:class.ilObjChatroom.php

示例3: cloneObject

 /**
  * Clone object
  *
  * @access public
  * @param int ref_id of target container
  * @param int copy id
  * @return object new svy object
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB;
     $this->loadFromDb();
     // Copy settings
     $newObj = parent::cloneObject($a_target_id, $a_copy_id);
     $this->cloneMetaData($newObj);
     $newObj->updateMetaData();
     $newObj->setAuthor($this->getAuthor());
     $newObj->setIntroduction($this->getIntroduction());
     $newObj->setOutro($this->getOutro());
     $newObj->setEvaluationAccess($this->getEvaluationAccess());
     $newObj->setStartDate($this->getStartDate());
     $newObj->setEndDate($this->getEndDate());
     $newObj->setInvitation($this->getInvitation());
     $newObj->setInvitationMode($this->getInvitationMode());
     $newObj->setAnonymize($this->getAnonymize());
     $newObj->setShowQuestionTitles($this->getShowQuestionTitles());
     $newObj->setTemplate($this->getTemplate());
     $newObj->setPoolUsage($this->getPoolUsage());
     $newObj->setViewOwnResults($this->hasViewOwnResults());
     $newObj->setMailOwnResults($this->hasMailOwnResults());
     // #12661
     if ($this->get360Mode()) {
         $newObj->set360Mode(true);
         $newObj->set360SelfEvaluation($this->get360SelfEvaluation());
         $newObj->set360SelfAppraisee($this->get360SelfAppraisee());
         $newObj->set360SelfRaters($this->get360SelfRaters());
         $newObj->set360Results($this->get360Results());
         $newObj->set360SkillService($this->get360SkillService());
     }
     // reminder/notification
     $newObj->setReminderStatus($this->getReminderStatus());
     $newObj->setReminderStart($this->getReminderStart());
     $newObj->setReminderEnd($this->getReminderEnd());
     $newObj->setReminderFrequency($this->getReminderFrequency());
     $newObj->setReminderTarget($this->getReminderTarget());
     // reminder_last_sent must not be copied!
     $newObj->setTutorNotificationStatus($this->getTutorNotificationStatus());
     $newObj->setTutorNotificationRecipients($this->getTutorNotificationRecipients());
     $newObj->setTutorNotificationTarget($this->getTutorNotificationTarget());
     $question_pointer = array();
     // clone the questions
     $mapping = array();
     include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
     foreach ($this->questions as $key => $question_id) {
         $question = ilObjSurvey::_instanciateQuestion($question_id);
         if ($question) {
             $question->id = -1;
             $original_id = SurveyQuestion::_getOriginalId($question_id, false);
             $question->saveToDb($original_id);
             $newObj->questions[$key] = $question->getId();
             $question_pointer[$question_id] = $question->getId();
             $mapping[$question_id] = $question->getId();
         }
     }
     //copy online status if object is not the root copy object
     $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
     if (!$cp_options->isRootNode($this->getRefId())) {
         $newObj->setStatus($this->isOnline() ? self::STATUS_ONLINE : self::STATUS_OFFLINE);
     }
     $newObj->saveToDb();
     $newObj->cloneTextblocks($mapping);
     // #14929
     if ($this->get360Mode() && $this->get360SkillService()) {
         include_once "./Modules/Survey/classes/class.ilSurveySkill.php";
         $src_skills = new ilSurveySkill($this);
         $tgt_skills = new ilSurveySkill($newObj);
         foreach ($mapping as $src_qst_id => $tgt_qst_id) {
             $qst_skill = $src_skills->getSkillForQuestion($src_qst_id);
             if ($qst_skill) {
                 $tgt_skills->addQuestionSkillAssignment($tgt_qst_id, $qst_skill["base_skill_id"], $qst_skill["tref_id"]);
             }
         }
     }
     // clone the questionblocks
     $questionblocks = array();
     $questionblock_questions = array();
     $result = $ilDB->queryF("SELECT * FROM svy_qblk_qst WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()));
     if ($result->numRows() > 0) {
         while ($row = $ilDB->fetchAssoc($result)) {
             array_push($questionblock_questions, $row);
             $questionblocks[$row["questionblock_fi"]] = $row["questionblock_fi"];
         }
     }
     // create new questionblocks
     foreach ($questionblocks as $key => $value) {
         $questionblock = ilObjSurvey::_getQuestionblock($key);
         $questionblock_id = ilObjSurvey::_addQuestionblock($questionblock["title"], $questionblock["owner_fi"], $questionblock["show_questiontext"], $questionblock["show_blocktitle"]);
         $questionblocks[$key] = $questionblock_id;
     }
     // create new questionblock questions
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilObjSurvey.php

示例4: cloneObject

 /**
 * Creates a 1:1 copy of the object and places the copy in a given repository
 *
 * @access public
 */
 function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilLog;
     $newObj = parent::cloneObject($a_target_id, $a_copy_id);
     $newObj->setOnline($this->getOnline());
     $newObj->saveToDb();
     // clone the questions in the question pool
     $questions =& $this->getQplQuestions();
     foreach ($questions as $question_id) {
         $newObj->copyQuestion($question_id, $newObj->getId());
     }
     // clone meta data
     include_once "./Services/MetaData/classes/class.ilMD.php";
     $md = new ilMD($this->getId(), 0, $this->getType());
     $new_md =& $md->cloneMD($newObj->getId(), 0, $newObj->getType());
     // update the metadata with the new title of the question pool
     $newObj->updateMetaData();
     return $newObj;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:24,代码来源:class.ilObjQuestionPool.php

示例5: cloneObject

 /**
  * Clone HTML learning module
  *
  * @param int target ref_id
  * @param int copy id
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB, $ilUser, $ilias;
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $this->cloneMetaData($new_obj);
     $new_obj->setTitle($this->getTitle());
     $new_obj->setDescription($this->getDescription());
     $new_obj->setShowLicense($this->getShowLicense());
     $new_obj->setShowBibliographicalData($this->getShowBibliographicalData());
     // copy content
     $new_obj->populateByDirectoy($this->getDataDirectory());
     $new_obj->setStartFile($this->getStartFile());
     $new_obj->update();
     return $new_obj;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:21,代码来源:class.ilObjFileBasedLM.php

示例6: cloneObject

 /**
  * Clone scorm object
  *
  * @param int target ref_id
  * @param int copy id
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB, $ilUser, $ilias;
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $this->cloneMetaData($new_obj);
     // copy properties
     $new_obj->setTitle($this->getTitle());
     $new_obj->setDescription($this->getDescription());
     $new_obj->setSubType($this->getSubType());
     $new_obj->setAPIAdapterName($this->getAPIAdapterName());
     $new_obj->setAPIFunctionsPrefix($this->getAPIFunctionsPrefix());
     $new_obj->setAutoReviewChar($this->getAutoReviewChar());
     $new_obj->setDefaultLessonMode($this->getDefaultLessonMode());
     $new_obj->setEditable($this->getEditable());
     $new_obj->setMaxAttempt($this->getMaxAttempt());
     //		$new_obj->getModuleVersion($this->getModuleVersion());	??
     $new_obj->setModuleVersion(1);
     $new_obj->setCreditMode($this->getCreditMode());
     $new_obj->setAssignedGlossary($this->getAssignedGlossary());
     $new_obj->setTries($this->getTries());
     $new_obj->setSession($this->getSession());
     $new_obj->setNoMenu($this->getNoMenu());
     $new_obj->setHideNavig($this->getHideNavig());
     $new_obj->setSequencing($this->getSequencing());
     $new_obj->setInteractions($this->getInteractions());
     $new_obj->setObjectives($this->getObjectives());
     $new_obj->setComments($this->getComments());
     $new_obj->setTime_from_lms($this->getTime_from_lms());
     $new_obj->setDebug($this->getDebug());
     $new_obj->setLocalization($this->getLocalization());
     $new_obj->setSequencingExpertMode($this->getSequencingExpertMode());
     $new_obj->setDebugPw($this->getDebugPw());
     $new_obj->setOpenMode($this->getOpenMode());
     $new_obj->setWidth($this->getWidth());
     $new_obj->setHeight($this->getHeight());
     $new_obj->setAutoContinue($this->getAutoContinue());
     $new_obj->setAuto_last_visited($this->getAuto_last_visited());
     $new_obj->setCheck_values($this->getCheck_values());
     $new_obj->setOfflineMode($this->getOfflineMode());
     $new_obj->setAutoSuspend($this->getAutoSuspend());
     $new_obj->update();
     // set/copy stylesheet
     /*		include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
     		$style_id = $this->getStyleSheetId();
     		if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
     		{
     			$style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
     			$new_id = $style_obj->ilClone();
     			$new_obj->setStyleSheetId($new_id);
     			$new_obj->update();
     		}*/
     // up to this point $new_obj is of type ilobjsahslearning module
     // create instance of correct subtype and call forward it to
     // cloneIntoNewObject method
     switch ($this->getSubType()) {
         case "scorm":
             include_once "./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php";
             $source_obj = new ilObjSCORMLearningModule($this->getRefId());
             $new_obj = new ilObjSCORMLearningModule($new_obj->getRefId());
             break;
         case "scorm2004":
             include_once "./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php";
             $source_obj = new ilObjSCORM2004LearningModule($this->getRefId());
             $new_obj = new ilObjSCORM2004LearningModule($new_obj->getRefId());
             break;
         case "aicc":
             include_once "./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php";
             $source_obj = new ilObjAICCLearningModule($this->getRefId());
             $new_obj = new ilObjAICCLearningModule($new_obj->getRefId());
             break;
         case "hacp":
             include_once "./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php";
             $source_obj = new ilObjHACPLearningModule($this->getRefId());
             $new_obj = new ilObjHACPLearningModule($new_obj->getRefId());
             break;
     }
     // copy data directory
     $new_obj->populateByDirectoy($source_obj->getDataDirectory());
     // copy authored content ...
     if ($new_obj->getEditable()) {
         $source_obj->copyAuthoredContent($new_obj);
     } else {
         // ... or read manifest file
         $new_obj->readObject();
     }
     return $new_obj;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:93,代码来源:class.ilObjSAHSLearningModule.php

示例7: cloneObject

 /**
  * Clone exercise (no member data)
  *
  * @access public
  * @param int target ref_id
  * @param int copy id
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB;
     // Copy settings
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $new_obj->setInstruction($this->getInstruction());
     $new_obj->setTimestamp($this->getTimestamp());
     $new_obj->setPassMode($this->getPassMode());
     $new_obj->saveData();
     $new_obj->setPassNr($this->getPassNr());
     $new_obj->setShowSubmissions($this->getShowSubmissions());
     $new_obj->setCompletionBySubmission($this->isCompletionBySubmissionEnabled());
     $new_obj->update();
     // Copy assignments
     include_once "./Modules/Exercise/classes/class.ilExAssignment.php";
     ilExAssignment::cloneAssignmentsOfExercise($this->getId(), $new_obj->getId());
     //$tmp_file_obj =& new ilFileDataExercise($this->getId());
     //$tmp_file_obj->ilClone($new_obj->getId());
     //unset($tmp_file_obj);
     // Copy learning progress settings
     include_once 'Services/Tracking/classes/class.ilLPObjSettings.php';
     $obj_settings = new ilLPObjSettings($this->getId());
     $obj_settings->cloneSettings($new_obj->getId());
     unset($obj_settings);
     return $new_obj;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:33,代码来源:class.ilObjExercise.php

示例8: cloneObject

 /**
 * Creates a 1:1 copy of the object and places the copy in a given repository
 *
 * @access public
 */
 function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilLog;
     $newObj = parent::cloneObject($a_target_id, $a_copy_id);
     //copy online status if object is not the root copy object
     $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
     if (!$cp_options->isRootNode($this->getRefId())) {
         $newObj->setOnline($this->getOnline());
     }
     $newObj->setShowTaxonomies($this->getShowTaxonomies());
     $newObj->saveToDb();
     // clone the questions in the question pool
     $questions =& $this->getQplQuestions();
     $questionIdsMap = array();
     foreach ($questions as $question_id) {
         $newQuestionId = $newObj->copyQuestion($question_id, $newObj->getId());
         $questionIdsMap[$question_id] = $newQuestionId;
     }
     // clone meta data
     include_once "./Services/MetaData/classes/class.ilMD.php";
     $md = new ilMD($this->getId(), 0, $this->getType());
     $new_md =& $md->cloneMD($newObj->getId(), 0, $newObj->getType());
     // update the metadata with the new title of the question pool
     $newObj->updateMetaData();
     require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolTaxonomiesDuplicator.php';
     $duplicator = new ilQuestionPoolTaxonomiesDuplicator();
     $duplicator->setSourceObjId($this->getId());
     $duplicator->setSourceObjType($this->getType());
     $duplicator->setTargetObjId($newObj->getId());
     $duplicator->setTargetObjType($newObj->getType());
     $duplicator->setQuestionIdMapping($questionIdsMap);
     $duplicator->duplicate();
     $duplicatedTaxKeyMap = $duplicator->getDuplicatedTaxonomiesKeysMap();
     $newObj->setNavTaxonomyId($duplicatedTaxKeyMap->getMappedTaxonomyId($this->getNavTaxonomyId()));
     $newObj->saveToDb();
     return $newObj;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:42,代码来源:class.ilObjQuestionPool.php

示例9: cloneObject

 final function cloneObject($a_target_id, $a_copy_id = null, $a_omit_tree = false)
 {
     if ($this->beforeCloneObject()) {
         $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
         if ($new_obj) {
             $this->doCloneObject($new_obj, $a_target_id, $a_copy_id);
             return $new_obj;
         }
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:10,代码来源:class.ilObject2.php

示例10: cloneObject

 /**
  * Clone container settings
  *
  * @access public
  * @param int target ref_id
  * @param int copy id
  * @return object new object 
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
     $sorting = new ilContainerSortingSettings($new_obj->getId());
     $sorting->setSortMode($this->getOrderType());
     $sorting->update();
     // copy content page
     include_once "./Services/COPage/classes/class.ilPageObject.php";
     if (ilPageObject::_exists($this->getType(), $this->getId())) {
         $orig_page = new ilPageObject($this->getType(), $this->getId());
         $new_page_object = new ilPageObject($this->getType());
         $new_page_object->setParentId($new_obj->getId());
         $new_page_object->setId($new_obj->getId());
         $new_page_object->createFromXML();
         $new_page_object->setXMLContent($orig_page->getXMLContent());
         $new_page_object->buildDom();
         $new_page_object->update();
     }
     return $new_obj;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:29,代码来源:class.ilContainer.php

示例11: cloneObject

 /**
  * Clone container settings
  *
  * @access public
  * @param int target ref_id
  * @param int copy id
  * @return object new object 
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilLog;
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
     $sorting = new ilContainerSortingSettings($new_obj->getId());
     $sorting->setSortMode($this->getOrderType());
     $sorting->update();
     // copy content page
     include_once "./Services/Container/classes/class.ilContainerPage.php";
     if (ilContainerPage::_exists("cont", $this->getId())) {
         $orig_page = new ilContainerPage($this->getId());
         $orig_page->copy($new_obj->getId(), "cont", $new_obj->getId());
     }
     // #10271 - copy start objects page
     include_once "./Services/Container/classes/class.ilContainerStartObjectsPage.php";
     if (ilContainerStartObjectsPage::_exists("cstr", $this->getId())) {
         $orig_page = new ilContainerStartObjectsPage($this->getId());
         $orig_page->copy($new_obj->getId(), "cstr", $new_obj->getId());
     }
     // #10271
     foreach (self::_getContainerSettings($this->getId()) as $keyword => $value) {
         self::_writeContainerSetting($new_obj->getId(), $keyword, $value);
         // copy custom icons
         if ($keyword == "icon_custom" && $value) {
             // see saveIcons()
             $new_obj->createContainerDirectory();
             $tgt_dir = $new_obj->getContainerDirectory();
             $src_dir = $this->getContainerDirectory();
             $file = "icon_custom.svg";
             $src_file = $src_dir . "/" . $file;
             if (file_exists($src_file)) {
                 copy($src_file, $tgt_dir . "/" . $file);
             }
         }
     }
     return $new_obj;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:46,代码来源:class.ilContainer.php

示例12: cloneObject

 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree = false)
 {
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
     $new_obj->setOffline($this->isOffline());
     $new_obj->setScheduleType($this->getScheduleType());
     $new_obj->setPublicLog($this->hasPublicLog());
     $smap = null;
     if ($this->getScheduleType() == self::TYPE_FIX_SCHEDULE) {
         $new_obj->setNumberOfSlots($this->getNumberOfSlots());
         // schedules
         include_once "Modules/BookingManager/classes/class.ilBookingSchedule.php";
         foreach (ilBookingSchedule::getList($this->getId()) as $item) {
             $schedule = new ilBookingSchedule($item["booking_schedule_id"]);
             $smap[$item["booking_schedule_id"]] = $schedule->doClone($new_obj->getId());
         }
     }
     // objects
     include_once "Modules/BookingManager/classes/class.ilBookingObject.php";
     foreach (ilBookingObject::getList($this->getId()) as $item) {
         $bobj = new ilBookingObject($item["booking_object_id"]);
         $bobj->doClone($new_obj->getId(), $smap);
     }
     $new_obj->update();
     return $new_obj;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:25,代码来源:class.ilObjBookingPool.php

示例13: cloneObject

 /**
  * Clone wiki
  *
  * @param int target ref_id
  * @param int copy id
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB, $ilUser, $ilias;
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $new_obj->setTitle($this->getTitle());
     $new_obj->setStartPage($this->getStartPage());
     $new_obj->setShortTitle($this->getShortTitle());
     $new_obj->setRatingOverall($this->getRatingOverall());
     $new_obj->setRating($this->getRating());
     $new_obj->setRatingAsBlock($this->getRatingAsBlock());
     $new_obj->setRatingForNewPages($this->getRatingForNewPages());
     $new_obj->setRatingCategories($this->getRatingCategories());
     $new_obj->setPublicNotes($this->getPublicNotes());
     $new_obj->setIntroduction($this->getIntroduction());
     $new_obj->setImportantPages($this->getImportantPages());
     $new_obj->setPageToc($this->getPageToc());
     $new_obj->update();
     // set/copy stylesheet
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $style_id = $this->getStyleSheetId();
     if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id)) {
         $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
         $new_id = $style_obj->ilClone();
         $new_obj->setStyleSheetId($new_id);
         $new_obj->update();
     }
     // copy content
     include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
     $pages = ilWikiPage::getAllPages($this->getId());
     if (count($pages) > 0) {
         // if we have any pages, delete the start page first
         $pg_id = ilWikiPage::getPageIdForTitle($new_obj->getId(), $new_obj->getStartPage());
         $start_page = new ilWikiPage($pg_id);
         $start_page->delete();
     }
     $map = array();
     foreach ($pages as $p) {
         $page = new ilWikiPage($p["id"]);
         $new_page = new ilWikiPage();
         $new_page->setTitle($page->getTitle());
         $new_page->setWikiId($new_obj->getId());
         $new_page->setTitle($page->getTitle());
         $new_page->setBlocked($page->getBlocked());
         $new_page->setRating($page->getRating());
         $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
         $new_page->create();
         $page->copy($new_page->getId(), "", 0, true);
         //$new_page->setXMLContent($page->copyXMLContent(true));
         //$new_page->buildDom(true);
         //$new_page->update();
         $map[$p["id"]] = $new_page->getId();
     }
     // copy important pages
     foreach (ilObjWiki::_lookupImportantPagesList($this->getId()) as $ip) {
         $new_obj->addImportantPage($map[$ip["page_id"]], $ip["ord"], $ip["indent"]);
     }
     // copy rating categories
     include_once "./Services/Rating/classes/class.ilRatingCategory.php";
     foreach (ilRatingCategory::getAllForObject($this->getId()) as $rc) {
         $new_rc = new ilRatingCategory();
         $new_rc->setParentId($new_obj->getId());
         $new_rc->setTitle($rc["title"]);
         $new_rc->setDescription($rc["description"]);
         $new_rc->save();
     }
     return $new_obj;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:73,代码来源:class.ilObjWiki.php

示例14: cloneObject

 /**
  * Clone media cast
  *
  * @param int target ref_id
  * @param int copy id
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB, $ilUser, $ilias;
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $new_obj->setTitle($this->getTitle());
     $new_obj->setPublicFiles($this->getPublicFiles());
     $new_obj->setDownloadable($this->getDownloadable());
     $new_obj->setDefaultAccess($this->getDefaultAccess());
     $new_obj->setOrder($this->getOrder());
     $new_obj->update();
     // copy items
     $this->copyItems($new_obj);
     // copy order!?
     return $new_obj;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:21,代码来源:class.ilObjMediaCast.php

示例15: cloneObject

 /**
  * Clone
  *
  * @access public
  * @param int target id
  * @param int copy id
  * 
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $this->cloneMetaData($new_obj);
     // object created now copy other settings
     include_once 'Modules/WebResource/classes/class.ilLinkResourceItems.php';
     $links = new ilLinkResourceItems($this->getId());
     $links->cloneItems($new_obj->getId());
     // append copy info weblink title
     if (ilLinkResourceItems::_isSingular($new_obj->getId())) {
         $first = ilLinkResourceItems::_getFirstLink($new_obj->getId());
         ilLinkResourceItems::updateTitle($first['link_id'], $new_obj->getTitle());
     }
     return $new_obj;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:23,代码来源:class.ilObjLinkResource.php


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