ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 Set table data. More...
 
 getData ()
 
 dataExists ()
 
 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...
 
 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 ()
 get the name of the parent form More...
 
 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 ()
 
 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)
 set max. More...
 
- 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)
 Standard Version of Fill Row. More...
 
- 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

ILIAS News InternalGUIService $gui
 
string $selected_context
 
array $contexts
 
ilObjUser $user
 
StandardGUIRequest $std_request
 
- Protected Attributes inherited from ilTable2GUI
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_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 36 of file class.ilPDNewsTableGUI.php.

41 {
42 global $DIC;
43
44 $this->ctrl = $DIC->ctrl();
45 $this->lng = $DIC->language();
46 $this->user = $DIC->user();
47 $ilCtrl = $DIC->ctrl();
48 $this->std_request = $DIC->news()
49 ->internal()
50 ->gui()
51 ->standardRequest();
52
53 parent::__construct($a_parent_obj, $a_parent_cmd);
54
55 $this->contexts = $a_contexts;
56 $this->selected_context = $a_selected_context;
57 $this->addColumn("");
58 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
59 $this->setRowTemplate(
60 "tpl.table_row_pd_news.html",
61 "components/ILIAS/News"
62 );
63 $this->setDefaultOrderField("update_date");
64 $this->setDefaultOrderDirection("desc");
65 $this->setEnableTitle(false);
66 $this->setEnableHeader(false);
67 $this->setIsDataTable(false);
68 $this->initFilter();
69 $this->gui = $DIC->news()->internal()->gui();
70 }
setIsDataTable(bool $a_val)
setEnableTitle(bool $a_enabletitle)
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilPDNewsTableGUI::fillRow ( array  $a_set)
protected

Standard Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
array<string,mixed>$a_set data array

Reimplemented from ilTable2GUI.

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

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

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

+ Here is the call graph for this function:

◆ initFilter()

ilPDNewsTableGUI::initFilter ( )

Reimplemented from ilTable2GUI.

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

72 : void
73 {
75 $ilUser = $this->user;
76
77 // period
78 $per = (ilSession::get("news_pd_news_per") != "")
79 ? ilSession::get("news_pd_news_per")
80 : ilNewsItem::_lookupUserPDPeriod($ilUser->getId());
81 $news_set = new ilSetting("news");
82 $allow_shorter_periods = $news_set->get("allow_shorter_periods");
83 $allow_longer_periods = $news_set->get("allow_longer_periods");
85
86 $options = [
87 2 => sprintf($lng->txt("news_period_x_days"), 2),
88 3 => sprintf($lng->txt("news_period_x_days"), 3),
89 5 => sprintf($lng->txt("news_period_x_days"), 5),
90 7 => $lng->txt("news_period_1_week"),
91 14 => sprintf($lng->txt("news_period_x_weeks"), 2),
92 30 => $lng->txt("news_period_1_month"),
93 60 => sprintf($lng->txt("news_period_x_months"), 2),
94 120 => sprintf($lng->txt("news_period_x_months"), 4),
95 180 => sprintf($lng->txt("news_period_x_months"), 6),
96 366 => $lng->txt("news_period_1_year")
97 ];
98
99 $unset = [];
100 foreach ($options as $k => $opt) {
101 if (!$allow_shorter_periods && ($k < $default_per)) {
102 $unset[$k] = $k;
103 }
104 if (!$allow_longer_periods && ($k > $default_per)) {
105 $unset[$k] = $k;
106 }
107 }
108 foreach ($unset as $k) {
109 unset($options[$k]);
110 }
111
112 $si = new ilSelectInputGUI($this->lng->txt("news_time_period"), "news_per");
113 $si->setOptions($options);
114 $si->setValue((string) $per);
115 $this->addFilterItem($si);
116
117 // related to...
118 $si = new ilSelectInputGUI($this->lng->txt("context"), "news_ref_id");
119 $si->setOptions($this->contexts);
120 $si->setValue($this->selected_context);
121 $this->addFilterItem($si);
122 }
static _lookupUserPDPeriod(int $a_user_id)
static _lookupDefaultPDPeriod()
This class represents a selection list property in a property form.
static get(string $a_var)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)

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

Referenced by __construct().

+ 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 306 of file class.ilPDNewsTableGUI.php.

306 : string
307 {
308 // this fixes bug 8744. We assume that strings that contain < and >
309 // already contain html, we do not handle these
310 if (is_int(strpos($a_str, ">")) && is_int(strpos($a_str, "<"))) {
311 return $a_str;
312 }
313
314 return ilUtil::makeClickable($a_str);
315 }

References ilUtil\makeClickable().

Referenced by fillRow().

+ 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 32 of file class.ilPDNewsTableGUI.php.

◆ $gui

ILIAS News InternalGUIService ilPDNewsTableGUI::$gui
protected

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

◆ $selected_context

string ilPDNewsTableGUI::$selected_context
protected

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

◆ $std_request

StandardGUIRequest ilPDNewsTableGUI::$std_request
protected

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

◆ $user

ilObjUser ilPDNewsTableGUI::$user
protected

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

Referenced by initFilter().


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