24 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
44 $this->contexts = $a_contexts;
45 $this->selected_context = $a_selected_context;
69 $per = (
$_SESSION[
"news_pd_news_per"] !=
"")
73 $allow_shorter_periods = $news_set->get(
"allow_shorter_periods");
74 $allow_longer_periods = $news_set->get(
"allow_longer_periods");
78 2 => sprintf($lng->txt(
"news_period_x_days"), 2),
79 3 => sprintf($lng->txt(
"news_period_x_days"), 3),
80 5 => sprintf($lng->txt(
"news_period_x_days"), 5),
81 7 => $lng->txt(
"news_period_1_week"),
82 14 => sprintf($lng->txt(
"news_period_x_weeks"), 2),
83 30 => $lng->txt(
"news_period_1_month"),
84 60 => sprintf($lng->txt(
"news_period_x_months"), 2),
85 120 => sprintf($lng->txt(
"news_period_x_months"), 4),
86 180 => sprintf($lng->txt(
"news_period_x_months"), 6),
87 366 => $lng->txt(
"news_period_1_year"));
90 foreach($options as $k => $opt)
92 if (!$allow_shorter_periods && ($k < $default_per)) $unset[$k] = $k;
93 if (!$allow_longer_periods && ($k > $default_per)) $unset[$k] = $k;
100 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
102 $si->setOptions($options);
108 $si->setOptions($this->contexts);
109 $si->setValue($this->selected_context);
123 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
131 if ($a_set[
"user_id"] > 0)
133 $this->tpl->setCurrentBlock(
"user_info");
134 if ($obj_type ==
"frm")
136 include_once(
"./Modules/Forum/classes/class.ilForumProperties.php");
139 if ($a_set[
"context_sub_obj_type"] ==
"pos" &&
140 $a_set[
"context_sub_obj_id"] > 0)
142 include_once(
"./Modules/Forum/classes/class.ilForumPost.php");
143 $post =
new ilForumPost($a_set[
"context_sub_obj_id"]);
144 if ($post->getUserAlias() !=
"") $this->tpl->setVariable(
"VAL_AUTHOR",
ilUtil::stripSlashes($post->getUserAlias()));
145 else $this->tpl->setVariable(
"VAL_AUTHOR", $lng->txt(
"forums_anonymous"));
149 $this->tpl->setVariable(
"VAL_AUTHOR", $lng->txt(
"forums_anonymous"));
156 $user_obj =
new ilObjUser($a_set[
"user_id"]);
157 $this->tpl->setVariable(
"VAL_AUTHOR", $user_obj->getLogin());
165 $user_obj =
new ilObjUser($a_set[
"user_id"]);
166 $this->tpl->setVariable(
"VAL_AUTHOR", $user_obj->getLogin());
169 $this->tpl->setVariable(
"TXT_AUTHOR", $lng->txt(
"author"));
170 $this->tpl->parseCurrentBlock();
177 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
178 include_once(
"./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
180 $med = $mob->getMediaItem(
"Standard");
183 $med->getLocation());
184 $this->tpl->setCurrentBlock(
"player");
185 $this->tpl->setVariable(
"PLAYER",
186 $mpl->getMp3PlayerHtml());
187 $this->tpl->parseCurrentBlock();
191 if ($enable_internal_rss)
193 $this->tpl->setCurrentBlock(
"access");
194 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
195 $this->tpl->setVariable(
"TXT_ACCESS", $lng->txt(
"news_news_item_visibility"));
197 ($a_set[
"priority"] == 0 &&
201 $this->tpl->setVariable(
"VAL_ACCESS", $lng->txt(
"news_visibility_public"));
205 $this->tpl->setVariable(
"VAL_ACCESS", $lng->txt(
"news_visibility_users"));
207 $this->tpl->parseCurrentBlock();
211 if ($a_set[
"content"] !=
"")
213 $this->tpl->setCurrentBlock(
"content");
215 $this->tpl->parseCurrentBlock();
217 if ($a_set[
"content_long"] !=
"")
219 $this->tpl->setCurrentBlock(
"long");
221 $this->tpl->parseCurrentBlock();
223 if ($a_set[
"update_date"] != $a_set[
"creation_date"])
225 $this->tpl->setCurrentBlock(
"ni_update");
226 $this->tpl->setVariable(
"TXT_LAST_UPDATE", $lng->txt(
"last_update"));
227 $this->tpl->setVariable(
"VAL_LAST_UPDATE",
229 $this->tpl->parseCurrentBlock();
234 if ($obj_type ==
"frm" && $a_set[
"context_sub_obj_type"] ==
"pos"
235 && $a_set[
"context_sub_obj_id"] > 0)
237 include_once(
"./Modules/Forum/classes/class.ilObjForumAccess.php");
238 $pos = $a_set[
"context_sub_obj_id"];
239 $thread = ilObjForumAccess::_getThreadForPosting($pos);
242 $add =
"_".$thread.
"_".$pos;
245 $url_target =
"./goto.php?client_id=".rawurlencode(CLIENT_ID).
"&target=".
246 $obj_type.
"_".$a_set[
"ref_id"].$add;
247 $this->tpl->setCurrentBlock(
"context");
249 $cont_loc->addContextItems($a_set[
"ref_id"],
true);
250 $this->tpl->setVariable(
"CONTEXT_LOCATOR",
251 $cont_loc->getHTML());
252 $this->tpl->setVariable(
"HREF_CONTEXT_TITLE", $url_target);
253 $this->tpl->setVariable(
"CONTEXT_TITLE", $obj_title);
254 $this->tpl->setVariable(
"ALT_CONTEXT_TITLE",
255 $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$obj_type));
256 $this->tpl->setVariable(
"IMG_CONTEXT_TITLE",
258 $this->tpl->parseCurrentBlock();
260 $this->tpl->setVariable(
"HREF_TITLE", $url_target);
263 if ($a_set[
"content_is_lang_var"])
265 $this->tpl->setVariable(
"VAL_TITLE", $lng->txt($a_set[
"title"]));
273 $this->tpl->setVariable(
"VAL_CREATION_DATE",
275 $this->tpl->setVariable(
"TXT_CREATED", $lng->txt(
"created"));
277 $this->tpl->parseCurrentBlock();