4require_once
'Services/Block/classes/class.ilBlockGUI.php';
5require_once
'./Modules/Forum/classes/class.ilForum.php';
32 parent::__construct();
36 $this->lng->loadLanguageModule(
'forum');
40 $this->
setTitle($this->lng->txt(
'frm_my_posting_drafts'));
42 $this->allow_moving =
true;
50 $cmd = $this->ctrl->getCmd(
'getHTML');
75 if ($this->
getCurrentDetailLevel() == 0 || !$this->
settings->get(
'save_post_drafts', 0) || !$this->settings->get(
'block_activated_pdfrmpostdraft', 0)) {
78 return parent::getHTML();
87 $this->tpl->setVariable(
'SUBJECT', $draft[
'subject']);
88 $this->tpl->setVariable(
'SOURCE', $draft[
'source']);
89 $this->tpl->setVariable(
"HREF", $draft[
'href']);
100 require_once
'./Modules/Forum/classes/class.ilForumPostDraft.php';
101 require_once
'./Modules/Forum/classes/class.ilForumUtil.php';
102 require_once
'./Services/Link/classes/class.ilLink.php';
106 $draft_as_array = array();
108 if (is_array($drafts_instances) && count($drafts_instances) > 0) {
109 foreach ($drafts_instances as $draft) {
111 if ((
int) $draft->getThreadId() == 0) {
115 $draft_as_array[
'subject'] = $draft->getPostSubject();
116 $draft_as_array[
'draft_id'] = $draft->getDraftId();
119 $draft_as_array[
'source'] = implode(
'/', $information);
120 $draft_as_array[
'create_date'] = $draft->getPostDate();
126 $params[
'cmd'] =
'editThreadDraft';
127 $params[
'draft_id'] = $draft->getDraftId();
130 $params[
'thr_pk'] = $draft->getThreadId();
131 $params[
'pos_pk'] = $draft->getPostId();
136 $data[] = $draft_as_array;
142 $this->
setRowTemplate(
'tpl.pd_frm_posting_drafts_row.html',
'Modules/Forum');
146 parent::fillDataSection();
149 if (count($this->
data) == 0) {
161 $tpl =
new ilTemplate(
'tpl.pd_frm_posting_drafts_row.html',
true,
true,
'Modules/Forum');
162 $tpl->setCurrentBlock(
'overview');
163 $tpl->setVariable(
'NUM_FRM_POSTING_DRAFTS', count($this->
data));
164 if (count($this->
data) == 1) {
165 $tpl->setVariable(
'TXT_FRM_POSTING_DRAFTS', $this->lng->txt(
'frm_posting_draft'));
167 $tpl->setVariable(
'TXT_FRM_POSTING_DRAFTS', $this->lng->txt(
'frm_posting_drafts'));
169 $tpl->parseCurrentBlock();
An exception for terminatinating execution or to throw for unit testing.
This class represents a block method of a block.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
setImage($a_image)
Set Image.
getCurrentDetailLevel()
Get Current Detail Level.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
setData($a_data)
Set Data.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setColSpan($a_colspan)
Set Columns Span.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
@classDescription Date and time handling
static getDraftInstancesByUserId($user_id)
Class ilForumPostingDraftsBlockGUI.
getOverview()
Get overview.
getHTML()
{Handle config status.Get HTML.}
fillDataSection()
{Standard implementation for row based data.Overwrite this and call setContent for other data....
__construct()
Constructor.
static isRepositoryObject()
{}
static collectPostInformationByPostId($post_id)
static _lookupObjIdForForumId($a_for_id)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _getAllReferences($a_id)
get all reference ids of object
special template class to simplify handling of ITX/PEAR
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)