4 require_once
'Services/Block/classes/class.ilBlockGUI.php';
5 require_once
'./Modules/Forum/classes/class.ilForum.php';
30 parent::__construct();
32 $lng->loadLanguageModule(
'forum');
36 $this->
setTitle($lng->txt(
'frm_my_posting_drafts'));
38 $this->allow_moving =
true;
44 public function executeCommand()
51 $cmd = $ilCtrl->getCmd(
'getHTML');
61 return self::$block_type;
82 if($this->
getCurrentDetailLevel() == 0 || !$ilSetting->get(
'save_post_drafts', 0) || !$ilSetting->get(
'block_activated_pdfrmpostdraft', 0))
88 return parent::getHTML();
97 $this->tpl->setVariable(
'SUBJECT', $draft[
'subject']);
98 $this->tpl->setVariable(
'SOURCE', $draft[
'source']);
99 $this->tpl->setVariable(
"HREF", $draft[
'href']);
113 require_once
'./Modules/Forum/classes/class.ilForumPostDraft.php';
114 require_once
'./Modules/Forum/classes/class.ilForumUtil.php';
115 require_once
'./Services/Link/classes/class.ilLink.php';
119 $draft_as_array =
array();
121 if(is_array($drafts_instances) || count($drafts_instances) > 0 )
123 foreach($drafts_instances as $draft)
126 if((
int)$draft->getThreadId() == 0)
131 $draft_as_array[
'subject'] = $draft->getPostSubject();
132 $draft_as_array[
'draft_id'] = $draft->getDraftId();
135 $draft_as_array[
'source'] = implode(
'/', $information);
136 $draft_as_array[
'create_date'] = $draft->getPostDate();
143 $params[
'cmd'] =
'editThreadDraft';
144 $params[
'draft_id'] = $draft->getDraftId();
149 $params[
'thr_pk'] = $draft->getThreadId();
150 $params[
'pos_pk'] = $draft->getPostId();
155 $data[] = $draft_as_array;
162 $this->
setRowTemplate(
'tpl.pd_frm_posting_drafts_row.html',
'Modules/Forum');
167 parent::fillDataSection();
172 if(count($this->
data) == 0)
183 protected function getOverview()
190 $tpl =
new ilTemplate(
'tpl.pd_frm_posting_drafts_row.html',
true,
true,
'Modules/Forum');
191 $tpl->setCurrentBlock(
'overview');
192 $tpl->setVariable(
'NUM_FRM_POSTING_DRAFTS', count($this->
data));
193 if(count($this->
data) == 1)
195 $tpl->setVariable(
'TXT_FRM_POSTING_DRAFTS', $lng->txt(
'frm_posting_draft'));
199 $tpl->setVariable(
'TXT_FRM_POSTING_DRAFTS', $lng->txt(
'frm_posting_drafts'));
201 $tpl->parseCurrentBlock();
static getDraftInstancesByUserId($user_id)
static _lookupObjIdForForumId($a_for_id)
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
static _getAllReferences($a_id)
get all reference ids of object
setColSpan($a_colspan)
Set Columns Span.
static collectPostInformationByPostId($post_id)
setImage($a_image)
Set Image.
setTitle($a_title)
Set Title.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setData($a_data)
Set Data.
special template class to simplify handling of ITX/PEAR
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
static formatDate(ilDateTime $date)
Format a date public.
Create styles array
The data for the language used.
__construct()
Constructor.
getHTML()
Handle config status.
setLimit($a_limit)
Set Limit.
static isRepositoryObject()
{}
This class represents a block method of a block.
Class ilForumPostingDraftsBlockGUI.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
getCurrentDetailLevel()
Get Current Detail Level.