133 $res = $ilDB->queryF(
'SELECT * FROM frm_drafts_history WHERE history_id = %s',
136 while(
$row = $ilDB->fetchAssoc(
$res))
150 $res = $ilDB->queryF(
'SELECT * FROM frm_drafts_history WHERE draft_id = %s ORDER BY draft_date DESC',
152 $instances =
array();
153 while(
$row = $ilDB->fetchAssoc(
$res))
156 $tmp_obj = self::populateWithDatabaseRecord($tmp_obj,
$row);
158 $instances[] = $tmp_obj;
176 return $history_draft;
179 public function delete()
183 $ilDB->manipulatef(
'DELETE FROM frm_drafts_history WHERE history_id = %s',
194 $res = $ilDB->queryF(
'SELECT * FROM frm_drafts_history WHERE draft_id = %s 195 ORDER BY history_id ASC',
213 $res = $ilDB->queryF(
'SELECT * FROM frm_drafts_history WHERE draft_id = %s 214 ORDER BY history_id DESC',
217 while(
$row = $ilDB->fetchAssoc(
$res))
230 $next_id = $ilDB->nextId(
'frm_drafts_history');
231 $ilDB->insert(
'frm_drafts_history',
232 array(
'history_id' =>
array(
'integer', $next_id),
236 'draft_date' =>
array(
'timestamp',
date(
"Y-m-d H:i:s"))
244 include_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
248 foreach($mediaObjects as $mob)
250 foreach($myMediaObjects as $myMob)
265 require_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
268 foreach($oldMediaObjects as $oldMob)
281 $draft = ilForumPostDraft::newInstanceByDraftId($this->
getDraftId());
289 $draft->updateDraft();
300 $draft_ids =
array();
301 if(count($post_ids) > 0)
305 $res = $ilDB->query(
' 306 SELECT frm_drafts_history.history_id, frm_drafts_history.draft_id 307 FROM frm_posts_drafts 308 INNER JOIN frm_drafts_history ON frm_posts_drafts.draft_id 309 WHERE ' . $ilDB->in(
'post_id', $post_ids,
false,
'integer'));
311 while(
$row = $ilDB->fetchAssoc(
$res))
313 $draft_ids[] =
$row[
'draft_id'];
325 if(count($draft_ids) > 0)
327 $res = $ilDB->query(
'SELECT history_id FROM frm_drafts_history 328 WHERE ' . $ilDB->in(
'draft_id', $draft_ids,
false,
'integer'));
330 while(
$row = $ilDB->fetchAssoc(
$res))
336 $ilDB->manipulate(
'DELETE FROM frm_drafts_history WHERE ' 337 . $ilDB->in(
'draft_id', $draft_ids,
false,
'integer'));
static _getMediaObjects($a_text, $a_direction=0)
Returns all media objects found in the passed string.
readByHistoryId($history_id)
setHistoryId($history_id)
addMobsToDraftsHistory($message)
static moveMediaObjects($post_message, $source_type, $source_id, $target_type, $target_id, $direction=0)
setPostSubject($post_subject)
deleteHistoryByPostIds($post_ids=array())
__construct($history_id=0)
ilForumDraftsHistory constructor.
Class ilForumDraftHistory.
setDraftDate($draft_date)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static getInstancesByDraftId($draft_id)
Create styles array
The data for the language used.
getFirstAutosaveByDraftId($draft_id)
deleteHistoryByDraftIds($draft_ids=array())
setPostMessage($post_message)
static populateWithDatabaseRecord(ilForumDraftsHistory $history_draft, array $row)
getLastAutosaveByDraftId($draft_id)