24 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
44 $this->contexts = $a_contexts;
45 $this->selected_context = $a_selected_context;
68 $per = (
$_SESSION[
"news_pd_news_per"] !=
"")
72 $allow_shorter_periods = $news_set->get(
"allow_shorter_periods");
73 $allow_longer_periods = $news_set->get(
"allow_longer_periods");
77 2 => sprintf($lng->txt(
"news_period_x_days"), 2),
78 3 => sprintf($lng->txt(
"news_period_x_days"), 3),
79 5 => sprintf($lng->txt(
"news_period_x_days"), 5),
80 7 => $lng->txt(
"news_period_1_week"),
81 14 => sprintf($lng->txt(
"news_period_x_weeks"), 2),
82 30 => $lng->txt(
"news_period_1_month"),
83 60 => sprintf($lng->txt(
"news_period_x_months"), 2),
84 120 => sprintf($lng->txt(
"news_period_x_months"), 4),
85 180 => sprintf($lng->txt(
"news_period_x_months"), 6),
86 366 => $lng->txt(
"news_period_1_year"));
91 if (!$allow_shorter_periods && ($k < $default_per)) $unset[$k] = $k;
92 if (!$allow_longer_periods && ($k > $default_per)) $unset[$k] = $k;
99 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
107 $si->setOptions($this->contexts);
108 $si->setValue($this->selected_context);
122 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
130 if ($a_set[
"user_id"] > 0)
132 $this->tpl->setCurrentBlock(
"user_info");
133 if ($obj_type ==
"frm")
135 include_once(
"./Modules/Forum/classes/class.ilForumProperties.php");
138 if ($a_set[
"context_sub_obj_type"] ==
"pos" &&
139 $a_set[
"context_sub_obj_id"] > 0)
141 include_once(
"./Modules/Forum/classes/class.ilForumPost.php");
142 $post =
new ilForumPost($a_set[
"context_sub_obj_id"]);
143 if ($post->getUserAlias() !=
"") $this->tpl->setVariable(
"VAL_AUTHOR",
ilUtil::stripSlashes($post->getUserAlias()));
144 else $this->tpl->setVariable(
"VAL_AUTHOR", $lng->txt(
"forums_anonymous"));
148 $this->tpl->setVariable(
"VAL_AUTHOR", $lng->txt(
"forums_anonymous"));
155 $user_obj =
new ilObjUser($a_set[
"user_id"]);
156 $this->tpl->setVariable(
"VAL_AUTHOR", $user_obj->getLogin());
164 $user_obj =
new ilObjUser($a_set[
"user_id"]);
165 $this->tpl->setVariable(
"VAL_AUTHOR", $user_obj->getLogin());
168 $this->tpl->setVariable(
"TXT_AUTHOR", $lng->txt(
"author"));
169 $this->tpl->parseCurrentBlock();
176 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
177 include_once(
"./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
179 $med = $mob->getMediaItem(
"Standard");
182 $med->getLocation());
183 $this->tpl->setCurrentBlock(
"player");
184 $this->tpl->setVariable(
"PLAYER",
185 $mpl->getMp3PlayerHtml());
186 $this->tpl->parseCurrentBlock();
190 if ($enable_internal_rss)
192 $this->tpl->setCurrentBlock(
"access");
193 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
194 $this->tpl->setVariable(
"TXT_ACCESS", $lng->txt(
"news_news_item_visibility"));
196 ($a_set[
"priority"] == 0 &&
200 $this->tpl->setVariable(
"VAL_ACCESS", $lng->txt(
"news_visibility_public"));
204 $this->tpl->setVariable(
"VAL_ACCESS", $lng->txt(
"news_visibility_users"));
206 $this->tpl->parseCurrentBlock();
210 if ($a_set[
"content"] !=
"")
212 $this->tpl->setCurrentBlock(
"content");
214 $this->tpl->parseCurrentBlock();
216 if ($a_set[
"content_long"] !=
"")
218 $this->tpl->setCurrentBlock(
"long");
220 $this->tpl->parseCurrentBlock();
222 if ($a_set[
"update_date"] != $a_set[
"creation_date"])
224 $this->tpl->setCurrentBlock(
"ni_update");
225 $this->tpl->setVariable(
"TXT_LAST_UPDATE", $lng->txt(
"last_update"));
226 $this->tpl->setVariable(
"VAL_LAST_UPDATE",
228 $this->tpl->parseCurrentBlock();
233 if ($obj_type ==
"frm" && $a_set[
"context_sub_obj_type"] ==
"pos"
234 && $a_set[
"context_sub_obj_id"] > 0)
236 include_once(
"./Modules/Forum/classes/class.ilObjForumAccess.php");
237 $pos = $a_set[
"context_sub_obj_id"];
238 $thread = ilObjForumAccess::_getThreadForPosting($pos);
241 $add =
"_".$thread.
"_".$pos;
244 $url_target =
"./goto.php?client_id=".rawurlencode(CLIENT_ID).
"&target=".
245 $obj_type.
"_".$a_set[
"ref_id"].$add;
246 $this->tpl->setCurrentBlock(
"context");
248 $cont_loc->addContextItems($a_set[
"ref_id"],
true);
249 $this->tpl->setVariable(
"CONTEXT_LOCATOR",
250 $cont_loc->getHTML());
251 $this->tpl->setVariable(
"HREF_CONTEXT_TITLE", $url_target);
252 $this->tpl->setVariable(
"CONTEXT_TITLE", $obj_title);
253 $this->tpl->setVariable(
"ALT_CONTEXT_TITLE",
254 $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$obj_type));
255 $this->tpl->setVariable(
"IMG_CONTEXT_TITLE",
257 $this->tpl->parseCurrentBlock();
259 $this->tpl->setVariable(
"HREF_TITLE", $url_target);
262 if ($a_set[
"content_is_lang_var"])
264 $this->tpl->setVariable(
"VAL_TITLE", $lng->txt($a_set[
"title"]));
272 $this->tpl->setVariable(
"VAL_CREATION_DATE",
274 $this->tpl->setVariable(
"TXT_CREATED", $lng->txt(
"created"));
276 $this->tpl->parseCurrentBlock();