ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPDNewsTableGUI Class Reference

Personal desktop news table. More...

+ Inheritance diagram for ilPDNewsTableGUI:
+ Collaboration diagram for ilPDNewsTableGUI:

Public Member Functions

 __construct (ilPDNewsGUI $a_parent_obj, string $a_parent_cmd, array $a_contexts, string $a_selected_context)
 
 initFilter ()
 
 makeClickable (string $a_str)
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 addColumn (string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 setShowTemplates (bool $a_value)
 
 getShowTemplates ()
 
 restoreTemplate (string $a_name)
 Restore state from template. More...
 
 saveTemplate (string $a_name)
 Save current state as template. More...
 
 deleteTemplate (string $a_name)
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 setPrefix (string $a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Protected Member Functions

 fillRow (array $a_set)
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

string $selected_context
 
array $contexts
 
ilObjUser $user
 
StandardGUIRequest $std_request
 
- Protected Attributes inherited from ilTable2GUI
string $requested_tmpl_delete
 
string $requested_tmpl_create
 
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_templates = false
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Detailed Description

Personal desktop news table.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilPDNewsTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPDNewsTableGUI::__construct ( ilPDNewsGUI  $a_parent_obj,
string  $a_parent_cmd,
array  $a_contexts,
string  $a_selected_context 
)

Definition at line 35 of file class.ilPDNewsTableGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\addColumn(), ILIAS\Repository\ctrl(), initFilter(), ILIAS\Repository\lng(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setFormAction(), ilTable2GUI\setIsDataTable(), ilTable2GUI\setRowTemplate(), and ILIAS\Repository\user().

40  {
41  global $DIC;
42 
43  $this->ctrl = $DIC->ctrl();
44  $this->lng = $DIC->language();
45  $this->user = $DIC->user();
46  $ilCtrl = $DIC->ctrl();
47  $this->std_request = new StandardGUIRequest(
48  $DIC->http(),
49  $DIC->refinery()
50  );
51 
52  parent::__construct($a_parent_obj, $a_parent_cmd);
53 
54  $this->contexts = $a_contexts;
55  $this->selected_context = $a_selected_context;
56  $this->addColumn("");
57  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
58  $this->setRowTemplate(
59  "tpl.table_row_pd_news.html",
60  "Services/News"
61  );
62  $this->setDefaultOrderField("update_date");
63  $this->setDefaultOrderDirection("desc");
64  $this->setEnableTitle(false);
65  $this->setEnableHeader(false);
66  $this->setIsDataTable(false);
67  $this->initFilter();
68  }
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
global $DIC
Definition: feed.php:28
setIsDataTable(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(Container $dic, ilPlugin $plugin)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilPDNewsTableGUI::fillRow ( array  $a_set)
protected

Definition at line 122 of file class.ilPDNewsTableGUI.php.

References ilTable2GUI\$ctrl, ilTableGUI\$lng, $post, $url, ilObject\_exists(), ilObjMediaObject\_getDirectory(), ilObject\_getIcon(), ilObjForumAccess\_getThreadForPosting(), ilForumProperties\_isAnonymized(), ilBlockSetting\_lookup(), ilObjUser\_lookupLogin(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), CLIENT_ID, ilNewsItem\determineNewsContent(), ilNewsItem\determineNewsTitle(), ilDatePresentation\formatDate(), ilLinkButton\getInstance(), IL_CAL_DATETIME, ilWikiPage\lookupTitle(), ilUtil\makeClickable(), makeClickable(), ilWikiUtil\makeUrlTitle(), NEWS_AUDIO, NEWS_PUBLIC, ilUtil\stripSlashes(), and ilLanguage\txt().

122  : void
123  {
124  $lng = $this->lng;
125  $ilCtrl = $this->ctrl;
126 
127  $news_set = new ilSetting("news");
128  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
129 
130  // context
131  $obj_id = ilObject::_lookupObjId((int) $a_set["ref_id"]);
132  $obj_type = ilObject::_lookupType($obj_id);
133  $obj_title = ilObject::_lookupTitle($obj_id);
134 
135  // user
136  if ($a_set["user_id"] > 0) {
137  $this->tpl->setCurrentBlock("user_info");
138  if ($obj_type === "frm") {
139  if (ilForumProperties::_isAnonymized((int) $a_set["context_obj_id"])) {
140  if ($a_set["context_sub_obj_type"] === "pos" &&
141  $a_set["context_sub_obj_id"] > 0) {
142  $post = new ilForumPost((int) $a_set["context_sub_obj_id"]);
143  if (is_string($post->getUserAlias()) && $post->getUserAlias() !== '') {
144  $this->tpl->setVariable("VAL_AUTHOR", ilUtil::stripSlashes($post->getUserAlias()));
145  } else {
146  $this->tpl->setVariable("VAL_AUTHOR", $lng->txt("forums_anonymous"));
147  }
148  } else {
149  $this->tpl->setVariable("VAL_AUTHOR", $lng->txt("forums_anonymous"));
150  }
151  } elseif (ilObject::_exists((int) $a_set["user_id"])) {
152  $user_obj = new ilObjUser((int) $a_set["user_id"]);
153  $this->tpl->setVariable("VAL_AUTHOR", $user_obj->getLogin());
154  }
155  } elseif (ilObject::_exists((int) $a_set["user_id"])) {
156  $this->tpl->setVariable("VAL_AUTHOR", ilObjUser::_lookupLogin((int) $a_set["user_id"]));
157  }
158  $this->tpl->setVariable("TXT_AUTHOR", $lng->txt("author"));
159  $this->tpl->parseCurrentBlock();
160  }
161 
162  // media player
163  if ($a_set["content_type"] === NEWS_AUDIO &&
164  $a_set["mob_id"] > 0 && ilObject::_exists((int) $a_set["mob_id"])) {
165  $mob = new ilObjMediaObject((int) $a_set["mob_id"]);
166  $med = $mob->getMediaItem("Standard");
167  $mpl = new ilMediaPlayerGUI();
168  $mpl->setFile(ilObjMediaObject::_getDirectory((int) $a_set["mob_id"]) . "/" .
169  $med->getLocation());
170  $this->tpl->setCurrentBlock("player");
171  $this->tpl->setVariable(
172  "PLAYER",
173  $mpl->getMp3PlayerHtml()
174  );
175  $this->tpl->parseCurrentBlock();
176  }
177 
178  // access
179  if ($enable_internal_rss) {
180  $this->tpl->setCurrentBlock("access");
181  $this->tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility"));
182  if ($a_set["visibility"] === NEWS_PUBLIC ||
183  ((int) $a_set["priority"] === 0 &&
185  "news",
186  "public_notifications",
187  0,
188  $obj_id
189  ))) {
190  $this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public"));
191  } else {
192  $this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users"));
193  }
194  $this->tpl->parseCurrentBlock();
195  }
196 
197  // content
198  if ($a_set["content"] != "") {
199  $this->tpl->setCurrentBlock("content");
200  $this->tpl->setVariable(
201  "VAL_CONTENT",
202  nl2br($this->makeClickable(
204  $a_set["context_obj_type"],
205  $a_set["content"],
206  (bool) $a_set["content_text_is_lang_var"]
207  )
208  ))
209  );
210  $this->tpl->parseCurrentBlock();
211  }
212  if ($a_set["content_long"] != "") {
213  $this->tpl->setCurrentBlock("long");
214  $this->tpl->setVariable("VAL_LONG_CONTENT", ilUtil::makeClickable($a_set["content_long"], true));
215  $this->tpl->parseCurrentBlock();
216  }
217  if ($a_set["update_date"] != $a_set["creation_date"]) { // update date
218  $this->tpl->setCurrentBlock("ni_update");
219  $this->tpl->setVariable("TXT_LAST_UPDATE", $lng->txt("last_update"));
220  $this->tpl->setVariable(
221  "VAL_LAST_UPDATE",
222  ilDatePresentation::formatDate(new ilDateTime($a_set["update_date"], IL_CAL_DATETIME))
223  );
224  $this->tpl->parseCurrentBlock();
225  }
226 
227  // forum hack, not nice
228  $add = "";
229  if ($obj_type === "frm" && $a_set["context_sub_obj_type"] === "pos"
230  && $a_set["context_sub_obj_id"] > 0) {
231  $pos = $a_set["context_sub_obj_id"];
232  $thread = ilObjForumAccess::_getThreadForPosting((int) $pos);
233  if ($thread > 0) {
234  $add = "_" . $thread . "_" . $pos;
235  }
236  }
237 
238  // file hack, not nice
239  if ($obj_type === "file") {
240  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_set["ref_id"]);
241  $url = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "sendfile");
242  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->std_request->getRefId());
243 
244  $button = ilLinkButton::getInstance();
245  $button->setUrl($url);
246  $button->setCaption("download");
247 
248  $this->tpl->setCurrentBlock("download");
249  $this->tpl->setVariable("BUTTON_DOWNLOAD", $button->render());
250  $this->tpl->parseCurrentBlock();
251  }
252 
253  // wiki hack, not nice
254  if ($obj_type === "wiki" && $a_set["context_sub_obj_type"] === "wpg"
255  && $a_set["context_sub_obj_id"] > 0) {
256  $wptitle = ilWikiPage::lookupTitle((int) $a_set["context_sub_obj_id"]);
257  if ($wptitle != "") {
258  $add = "_" . ilWikiUtil::makeUrlTitle($wptitle);
259  }
260  }
261 
262 
263  $url_target = "./goto.php?client_id=" . rawurlencode(CLIENT_ID) . "&target=" .
264  $obj_type . "_" . $a_set["ref_id"] . $add;
265 
266  // lm page hack, not nice
267  if ($a_set["context_sub_obj_type"] === "pg" &&
268  $a_set["context_sub_obj_id"] > 0 &&
269  in_array($obj_type, ["dbk", "lm"], true)) {
270  $url_target = "./goto.php?client_id=" . rawurlencode(CLIENT_ID) . "&target=" .
271  "pg_" . $a_set["context_sub_obj_id"] . "_" . $a_set["ref_id"];
272  }
273 
274 
275  $this->tpl->setCurrentBlock("context");
276  $cont_loc = new ilLocatorGUI();
277  $cont_loc->addContextItems($a_set["ref_id"], true);
278  $this->tpl->setVariable(
279  "CONTEXT_LOCATOR",
280  $cont_loc->getHTML()
281  );
282  $this->tpl->setVariable("HREF_CONTEXT_TITLE", $url_target);
283  $this->tpl->setVariable("CONTEXT_TITLE", $obj_title);
284  $this->tpl->setVariable(
285  "ALT_CONTEXT_TITLE",
286  $lng->txt("icon") . " " . $lng->txt("obj_" . $obj_type)
287  );
288  $this->tpl->setVariable(
289  "IMG_CONTEXT_TITLE",
290  ilObject::_getIcon((int) $a_set["context_obj_id"])
291  );
292  $this->tpl->parseCurrentBlock();
293 
294  $this->tpl->setVariable("HREF_TITLE", $url_target);
295 
296  // title
297  $this->tpl->setVariable(
298  "VAL_TITLE",
299  ilNewsItem::determineNewsTitle($a_set["context_obj_type"], $a_set["title"], $a_set["content_is_lang_var"])
300  );
301 
302  // creation date
303  $this->tpl->setVariable(
304  "VAL_CREATION_DATE",
305  ilDatePresentation::formatDate(new ilDateTime($a_set["creation_date"], IL_CAL_DATETIME))
306  );
307  $this->tpl->setVariable("TXT_CREATED", $lng->txt("created"));
308 
309  $this->tpl->parseCurrentBlock();
310  }
const IL_CAL_DATETIME
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static determineNewsTitle(string $a_context_obj_type, string $a_title, bool $a_content_is_lang_var, int $a_agg_ref_id=0, array $a_aggregation=[])
Determine title for news item entry.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
ilLanguage $lng
makeClickable(string $a_str)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _isAnonymized(int $a_obj_id)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static _getDirectory(int $a_mob_id)
Get absolute directory.
const NEWS_PUBLIC
static _lookup(string $a_type, string $a_setting, int $a_user=0, int $a_block_id=0)
Lookup setting from database.
static _lookupTitle(int $obj_id)
const CLIENT_ID
Definition: constants.php:41
static _getThreadForPosting(int $a_pos_id)
static lookupTitle(int $a_page_id)
static makeUrlTitle(string $a_par)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const NEWS_AUDIO
$url
static determineNewsContent(string $a_context_obj_type, string $a_content, bool $a_is_lang_var)
Determine new content.
static _lookupType(int $id, bool $reference=false)
$post
Definition: ltitoken.php:49
static makeClickable(string $a_text, bool $detectGotoLinks=false)
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:

◆ initFilter()

ilPDNewsTableGUI::initFilter ( )

Definition at line 70 of file class.ilPDNewsTableGUI.php.

References $ilUser, ilTableGUI\$lng, $user, ilNewsItem\_lookupDefaultPDPeriod(), ilNewsItem\_lookupUserPDPeriod(), ilTable2GUI\addFilterItem(), ilSession\get(), ILIAS\Repository\lng(), and ilLanguage\txt().

Referenced by __construct().

70  : void
71  {
72  $lng = $this->lng;
74 
75  // period
76  $per = (ilSession::get("news_pd_news_per") != "")
77  ? ilSession::get("news_pd_news_per")
79  $news_set = new ilSetting("news");
80  $allow_shorter_periods = $news_set->get("allow_shorter_periods");
81  $allow_longer_periods = $news_set->get("allow_longer_periods");
82  $default_per = ilNewsItem::_lookupDefaultPDPeriod();
83 
84  $options = [
85  2 => sprintf($lng->txt("news_period_x_days"), 2),
86  3 => sprintf($lng->txt("news_period_x_days"), 3),
87  5 => sprintf($lng->txt("news_period_x_days"), 5),
88  7 => $lng->txt("news_period_1_week"),
89  14 => sprintf($lng->txt("news_period_x_weeks"), 2),
90  30 => $lng->txt("news_period_1_month"),
91  60 => sprintf($lng->txt("news_period_x_months"), 2),
92  120 => sprintf($lng->txt("news_period_x_months"), 4),
93  180 => sprintf($lng->txt("news_period_x_months"), 6),
94  366 => $lng->txt("news_period_1_year")
95  ];
96 
97  $unset = [];
98  foreach ($options as $k => $opt) {
99  if (!$allow_shorter_periods && ($k < $default_per)) {
100  $unset[$k] = $k;
101  }
102  if (!$allow_longer_periods && ($k > $default_per)) {
103  $unset[$k] = $k;
104  }
105  }
106  foreach ($unset as $k) {
107  unset($options[$k]);
108  }
109 
110  $si = new ilSelectInputGUI($this->lng->txt("news_time_period"), "news_per");
111  $si->setOptions($options);
112  $si->setValue((string) $per);
113  $this->addFilterItem($si);
114 
115  // related to...
116  $si = new ilSelectInputGUI($this->lng->txt("context"), "news_ref_id");
117  $si->setOptions($this->contexts);
118  $si->setValue($this->selected_context);
119  $this->addFilterItem($si);
120  }
static get(string $a_var)
static _lookupUserPDPeriod(int $a_user_id)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
ilLanguage $lng
$ilUser
Definition: imgupload.php:34
static _lookupDefaultPDPeriod()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeClickable()

ilPDNewsTableGUI::makeClickable ( string  $a_str)

Definition at line 312 of file class.ilPDNewsTableGUI.php.

References ilUtil\makeClickable().

Referenced by fillRow().

312  : string
313  {
314  // this fixes bug 8744. We assume that strings that contain < and >
315  // already contain html, we do not handle these
316  if (is_int(strpos($a_str, ">")) && is_int(strpos($a_str, "<"))) {
317  return $a_str;
318  }
319 
320  return ilUtil::makeClickable($a_str);
321  }
static makeClickable(string $a_text, bool $detectGotoLinks=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $contexts

array ilPDNewsTableGUI::$contexts
protected

Definition at line 31 of file class.ilPDNewsTableGUI.php.

◆ $selected_context

string ilPDNewsTableGUI::$selected_context
protected

Definition at line 27 of file class.ilPDNewsTableGUI.php.

◆ $std_request

StandardGUIRequest ilPDNewsTableGUI::$std_request
protected

Definition at line 33 of file class.ilPDNewsTableGUI.php.

◆ $user

ilObjUser ilPDNewsTableGUI::$user
protected

Definition at line 32 of file class.ilPDNewsTableGUI.php.

Referenced by initFilter().


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