39 string $a_selected_context
43 $this->
ctrl = $DIC->ctrl();
44 $this->
lng = $DIC->language();
45 $this->
user = $DIC->user();
46 $ilCtrl = $DIC->ctrl();
54 $this->contexts = $a_contexts;
55 $this->selected_context = $a_selected_context;
59 "tpl.table_row_pd_news.html",
80 $allow_shorter_periods = $news_set->get(
"allow_shorter_periods");
81 $allow_longer_periods = $news_set->get(
"allow_longer_periods");
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")
98 foreach ($options as $k => $opt) {
99 if (!$allow_shorter_periods && ($k < $default_per)) {
102 if (!$allow_longer_periods && ($k > $default_per)) {
106 foreach ($unset as $k) {
111 $si->setOptions($options);
112 $si->setValue((
string) $per);
117 $si->setOptions($this->contexts);
118 $si->setValue($this->selected_context);
122 protected function fillRow(array $a_set): void
128 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
136 if ($a_set[
"user_id"] > 0) {
137 $this->tpl->setCurrentBlock(
"user_info");
138 if ($obj_type ===
"frm") {
140 if ($a_set[
"context_sub_obj_type"] ===
"pos" &&
141 $a_set[
"context_sub_obj_id"] > 0) {
143 if (is_string(
$post->getUserAlias()) &&
$post->getUserAlias() !==
'') {
146 $this->tpl->setVariable(
"VAL_AUTHOR",
$lng->
txt(
"forums_anonymous"));
149 $this->tpl->setVariable(
"VAL_AUTHOR",
$lng->
txt(
"forums_anonymous"));
152 $user_obj =
new ilObjUser((
int) $a_set[
"user_id"]);
153 $this->tpl->setVariable(
"VAL_AUTHOR", $user_obj->getLogin());
158 $this->tpl->setVariable(
"TXT_AUTHOR",
$lng->
txt(
"author"));
159 $this->tpl->parseCurrentBlock();
166 $med = $mob->getMediaItem(
"Standard");
169 $med->getLocation());
170 $this->tpl->setCurrentBlock(
"player");
171 $this->tpl->setVariable(
173 $mpl->getMp3PlayerHtml()
175 $this->tpl->parseCurrentBlock();
179 if ($enable_internal_rss) {
180 $this->tpl->setCurrentBlock(
"access");
181 $this->tpl->setVariable(
"TXT_ACCESS",
$lng->
txt(
"news_news_item_visibility"));
183 ((
int) $a_set[
"priority"] === 0 &&
186 "public_notifications",
190 $this->tpl->setVariable(
"VAL_ACCESS",
$lng->
txt(
"news_visibility_public"));
192 $this->tpl->setVariable(
"VAL_ACCESS",
$lng->
txt(
"news_visibility_users"));
194 $this->tpl->parseCurrentBlock();
198 if ($a_set[
"content"] !=
"") {
199 $this->tpl->setCurrentBlock(
"content");
200 $this->tpl->setVariable(
204 $a_set[
"context_obj_type"],
206 (
bool) $a_set[
"content_text_is_lang_var"]
210 $this->tpl->parseCurrentBlock();
212 if ($a_set[
"content_long"] !=
"") {
213 $this->tpl->setCurrentBlock(
"long");
215 $this->tpl->parseCurrentBlock();
217 if ($a_set[
"update_date"] != $a_set[
"creation_date"]) {
218 $this->tpl->setCurrentBlock(
"ni_update");
219 $this->tpl->setVariable(
"TXT_LAST_UPDATE",
$lng->
txt(
"last_update"));
220 $this->tpl->setVariable(
224 $this->tpl->parseCurrentBlock();
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"];
234 $add =
"_" . $thread .
"_" . $pos;
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());
245 $button->setUrl(
$url);
246 $button->setCaption(
"download");
248 $this->tpl->setCurrentBlock(
"download");
249 $this->tpl->setVariable(
"BUTTON_DOWNLOAD", $button->render());
250 $this->tpl->parseCurrentBlock();
254 if ($obj_type ===
"wiki" && $a_set[
"context_sub_obj_type"] ===
"wpg" 255 && $a_set[
"context_sub_obj_id"] > 0) {
257 if ($wptitle !=
"") {
263 $url_target =
"./goto.php?client_id=" . rawurlencode(
CLIENT_ID) .
"&target=" .
264 $obj_type .
"_" . $a_set[
"ref_id"] . $add;
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"];
275 $this->tpl->setCurrentBlock(
"context");
277 $cont_loc->addContextItems($a_set[
"ref_id"],
true);
278 $this->tpl->setVariable(
282 $this->tpl->setVariable(
"HREF_CONTEXT_TITLE", $url_target);
283 $this->tpl->setVariable(
"CONTEXT_TITLE", $obj_title);
284 $this->tpl->setVariable(
288 $this->tpl->setVariable(
292 $this->tpl->parseCurrentBlock();
294 $this->tpl->setVariable(
"HREF_TITLE", $url_target);
297 $this->tpl->setVariable(
303 $this->tpl->setVariable(
307 $this->tpl->setVariable(
"TXT_CREATED",
$lng->
txt(
"created"));
309 $this->tpl->parseCurrentBlock();
316 if (is_int(strpos($a_str,
">")) && is_int(strpos($a_str,
"<"))) {
static get(string $a_var)
static _lookupUserPDPeriod(int $a_user_id)
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...
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
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.
setEnableTitle(bool $a_enabletitle)
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)
makeClickable(string $a_str)
Personal desktop news table.
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)
setIsDataTable(bool $a_val)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
__construct(ilPDNewsGUI $a_parent_obj, string $a_parent_cmd, array $a_contexts, string $a_selected_context)
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)
setDefaultOrderField(string $a_defaultorderfield)
StandardGUIRequest $std_request
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
static _getThreadForPosting(int $a_pos_id)
static lookupTitle(int $a_page_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static makeUrlTitle(string $a_par)
__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)
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)
static makeClickable(string $a_text, bool $detectGotoLinks=false)
setEnableHeader(bool $a_enableheader)
static _lookupDefaultPDPeriod()
static _lookupLogin(int $a_user_id)