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");
101 $si =
new ilSelectInputGUI($this->lng->txt(
"news_time_period"),
"news_per");
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");
136 $user_obj =
new ilObjUser($a_set[
"user_id"]);
137 $this->tpl->setVariable(
"VAL_AUTHOR", $user_obj->getLogin());
139 $this->tpl->setVariable(
"TXT_AUTHOR", $lng->txt(
"author"));
140 $this->tpl->parseCurrentBlock();
147 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
148 include_once(
"./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
150 $med = $mob->getMediaItem(
"Standard");
153 $med->getLocation());
154 $this->tpl->setCurrentBlock(
"player");
155 $this->tpl->setVariable(
"PLAYER",
156 $mpl->getMp3PlayerHtml());
157 $this->tpl->parseCurrentBlock();
161 if ($enable_internal_rss)
163 $this->tpl->setCurrentBlock(
"access");
164 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
165 $this->tpl->setVariable(
"TXT_ACCESS", $lng->txt(
"news_news_item_visibility"));
167 ($a_set[
"priority"] == 0 &&
171 $this->tpl->setVariable(
"VAL_ACCESS", $lng->txt(
"news_visibility_public"));
175 $this->tpl->setVariable(
"VAL_ACCESS", $lng->txt(
"news_visibility_users"));
177 $this->tpl->parseCurrentBlock();
181 if ($a_set[
"content"] !=
"")
183 $this->tpl->setCurrentBlock(
"content");
185 $this->tpl->parseCurrentBlock();
187 if ($a_set[
"content_long"] !=
"")
189 $this->tpl->setCurrentBlock(
"long");
191 $this->tpl->parseCurrentBlock();
193 if ($a_set[
"update_date"] != $a_set[
"creation_date"])
195 $this->tpl->setCurrentBlock(
"ni_update");
196 $this->tpl->setVariable(
"TXT_LAST_UPDATE", $lng->txt(
"last_update"));
197 $this->tpl->setVariable(
"VAL_LAST_UPDATE",
199 $this->tpl->parseCurrentBlock();
203 $url_target =
"./goto.php?client_id=".rawurlencode(CLIENT_ID).
"&target=".
204 $obj_type.
"_".$a_set[
"ref_id"].$add;
205 $this->tpl->setCurrentBlock(
"context");
207 $cont_loc->addContextItems($a_set[
"ref_id"],
true);
208 $this->tpl->setVariable(
"CONTEXT_LOCATOR",
209 $cont_loc->getHTML());
210 $this->tpl->setVariable(
"HREF_CONTEXT_TITLE", $url_target);
211 $this->tpl->setVariable(
"CONTEXT_TITLE", $obj_title);
212 $this->tpl->setVariable(
"ALT_CONTEXT_TITLE",
213 $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$obj_type));
214 $this->tpl->setVariable(
"IMG_CONTEXT_TITLE",
216 $this->tpl->parseCurrentBlock();
218 $this->tpl->setVariable(
"HREF_TITLE", $url_target);
221 if ($a_set[
"content_is_lang_var"])
223 $this->tpl->setVariable(
"VAL_TITLE", $lng->txt($a_set[
"title"]));
231 $this->tpl->setVariable(
"VAL_CREATION_DATE",
233 $this->tpl->setVariable(
"TXT_CREATED", $lng->txt(
"created"));
235 $this->tpl->parseCurrentBlock();