コード例 #1
0
 /**
  * @see	\wcf\system\importer\IImporter::import()
  */
 public function import($oldID, array $data, array $additionalData = array())
 {
     $data['objectID'] = ImportHandler::getInstance()->getNewID('de.codequake.cms.news', $data['objectID']);
     if (!$data['objectID']) {
         return 0;
     }
     $attachmentID = parent::import($oldID, $data, $additionalData);
     if ($attachmentID && $attachmentID != $oldID) {
         // fix embedded attachments
         $news = new News($data['objectID']);
         if (($newMessage = $this->fixEmbeddedAttachments($news->message, $oldID, $attachmentID)) !== false) {
             $editor = new NewsEditor($news);
             $editor->update(array('message' => $newMessage));
         }
     }
     return $attachmentID;
 }
 /**
  * @see	\wcf\system\importer\IImporter::import()
  */
 public function import($oldID, array $data, array $additionalData = array())
 {
     $data['objectID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.conversation.message', $data['objectID']);
     if (!$data['objectID']) {
         return 0;
     }
     $attachmentID = parent::import($oldID, $data, $additionalData);
     if ($attachmentID && $attachmentID != $oldID) {
         // fix embedded attachments
         $messageObj = new ConversationMessage($data['objectID']);
         if (($newMessage = $this->fixEmbeddedAttachments($messageObj->message, $oldID, $attachmentID)) !== false) {
             $editor = new ConversationMessageEditor($messageObj);
             $editor->update(array('message' => $newMessage));
         }
     }
     return $attachmentID;
 }
コード例 #3
0
 /**
  * @see	\wcf\system\importer\IImporter::import()
  */
 public function import($oldID, array $data, array $additionalData = array())
 {
     // get news id
     $data['objectID'] = ImportHandler::getInstance()->getNewID('de.voolia.news.entry', $data['objectID']);
     if (!$data['objectID']) {
         return 0;
     }
     $attachmentID = parent::import($oldID, $data, $additionalData);
     if ($attachmentID && $attachmentID != $oldID) {
         // get the news
         $news = new News($data['objectID']);
         // update news text with the new attachment id
         if (($newText = $this->fixEmbeddedAttachments($news->text, $oldID, $attachmentID)) !== false) {
             $newsEditor = new NewsEditor($news);
             $newsEditor->update(array('text' => $newText));
         }
     }
     return $attachmentID;
 }