ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilForumPostingDraftsBlockGUI Class Reference

Class ilForumPostingDraftsBlockGUI. More...

+ Inheritance diagram for ilForumPostingDraftsBlockGUI:
+ Collaboration diagram for ilForumPostingDraftsBlockGUI:

Public Member Functions

 fillRow ($draft)
 {} More...
 
 fillDataSection ()
 {} More...
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

static getBlockType ()
 {} More...
 
static isRepositoryObject ()
 {} More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = 'pdfrmpostdraft'
 

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 

Detailed Description

Member Function Documentation

◆ fillDataSection()

ilForumPostingDraftsBlockGUI::fillDataSection ( )

{}

Definition at line 109 of file class.ilForumPostingDraftsBlockGUI.php.

References ilBlockGUI\$data, $ilUser, $lng, $params, $ref_id, $tpl, ilObject\_getAllReferences(), ilLink\_getLink(), ilForum\_lookupObjIdForForumId(), array, ilForumUtil\collectPostInformationByPostId(), data, ilBlockGUI\getCurrentDetailLevel(), ilForumPostDraft\getDraftInstancesByUserId(), ilBlockGUI\setColSpan(), ilBlockGUI\setData(), ilBlockGUI\setDataSection(), ilBlockGUI\setEnableDetailRow(), ilBlockGUI\setEnableNumInfo(), and ilBlockGUI\setRowTemplate().

110  {
111  global $ilUser;
112 
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';
116 
117  $drafts_instances = ilForumPostDraft::getDraftInstancesByUserId($ilUser->getId());
118 
119  $draft_as_array = array();
120  $data = array();
121  if(is_array($drafts_instances) || count($drafts_instances) > 0 )
122  {
123  foreach($drafts_instances as $draft)
124  {
125  $is_thread = false;
126  if((int)$draft->getThreadId() == 0)
127  {
128  $is_thread = true;
129  }
130 
131  $draft_as_array['subject'] = $draft->getPostSubject();
132  $draft_as_array['draft_id'] = $draft->getDraftId();
133 
134  $information = ilForumUtil::collectPostInformationByPostId($draft->getPostId());
135  $draft_as_array['source'] = implode('/', $information);
136  $draft_as_array['create_date'] = $draft->getPostDate();
137 
138  $obj_id = ilForum::_lookupObjIdForForumId($draft->getForumId());
139  $ref_id = end(ilObject::_getAllReferences($obj_id));
140 
141  if($is_thread)
142  {
143  $params['cmd'] = 'editThreadDraft';
144  $params['draft_id'] = $draft->getDraftId();
145  $draft_as_array['href'] = ilLink::_getLink($ref_id, 'frm', $params);
146  }
147  else
148  {
149  $params['thr_pk'] = $draft->getThreadId();
150  $params['pos_pk'] = $draft->getPostId();
151  $params['cmd'] = 'viewThread';
152  $draft_as_array['href'] = ilLink::_getLink($ref_id, 'frm', $params) . '#draft_' . $draft->getDraftId();
153  }
154 
155  $data[] = $draft_as_array;
156  }
157  }
158  $this->setData($data);
159 
160  if($this->getCurrentDetailLevel() > 1 && count($this->data) > 0)
161  {
162  $this->setRowTemplate('tpl.pd_frm_posting_drafts_row.html', 'Modules/Forum');
163  if($this->getCurrentDetailLevel() > 2)
164  {
165  $this->setColSpan(2);
166  }
167  parent::fillDataSection();
168  }
169  else
170  {
171  $this->setEnableNumInfo(false);
172  if(count($this->data) == 0)
173  {
174  $this->setEnableDetailRow(false);
175  }
176  $this->setDataSection($this->getOverview());
177  }
178  }
static getDraftInstancesByUserId($user_id)
Add some data
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)
setData($a_data)
Set Data.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
$ref_id
Definition: sahs_server.php:39
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
$params
Definition: example_049.php:96
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ fillRow()

ilForumPostingDraftsBlockGUI::fillRow (   $draft)

{}

Definition at line 95 of file class.ilForumPostingDraftsBlockGUI.php.

References ilDatePresentation\formatDate(), ilBlockGUI\getCurrentDetailLevel(), and IL_CAL_DATETIME.

96  {
97  $this->tpl->setVariable('SUBJECT', $draft['subject']);
98  $this->tpl->setVariable('SOURCE', $draft['source']);
99  $this->tpl->setVariable("HREF", $draft['href']);
100  if($this->getCurrentDetailLevel() > 2)
101  {
102  $this->tpl->setVariable('CREATE_DATE', ilDatePresentation::formatDate(new ilDateTime($draft['create_date'], IL_CAL_DATETIME)));
103  }
104  }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ getBlockType()

static ilForumPostingDraftsBlockGUI::getBlockType ( )
static

{}

Definition at line 59 of file class.ilForumPostingDraftsBlockGUI.php.

60  {
61  return self::$block_type;
62  }

◆ isRepositoryObject()

static ilForumPostingDraftsBlockGUI::isRepositoryObject ( )
static

{}

Definition at line 67 of file class.ilForumPostingDraftsBlockGUI.php.

References $ilSetting, ilBlockGUI\getCurrentDetailLevel(), and ilBlockGUI\getHTML().

68  {
69  return false;
70  }
+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilForumPostingDraftsBlockGUI::$block_type = 'pdfrmpostdraft'
static

Definition at line 18 of file class.ilForumPostingDraftsBlockGUI.php.


The documentation for this class was generated from the following file: