29 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
34 $this->
lng->loadLanguageModule(
'news');
35 $this->
lng->loadLanguageModule(
'feed');
40 $next_class = $this->
ctrl->getNextClass($this);
41 $cmd = $this->
ctrl->getCmd();
45 if (!$this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
49 switch ($next_class) {
50 case 'ilpermissiongui':
51 $this->tabs_gui->setTabActive(
'perm_settings');
53 $this->
ctrl->forwardCommand($perm_gui);
57 if ($cmd === null || $cmd ===
'' || $cmd ===
'view') {
58 $cmd =
"editSettings";
70 if ($rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
71 $this->tabs_gui->addTarget(
72 "news_edit_news_settings",
73 $this->
ctrl->getLinkTarget($this,
"editSettings"),
74 [
"editSettings",
"view"]
78 if ($rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
79 $this->tabs_gui->addTarget(
81 $this->
ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
91 $this->tpl->setContent($form->getHTML());
104 $enable_internal_news =
$ilSetting->get(
"block_activated_news");
105 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
106 $rss_title_format = $news_set->get(
"rss_title_format");
107 $enable_private_feed = $news_set->get(
"enable_private_feed");
108 $news_default_visibility = ($news_set->get(
"default_visibility") !=
"")
109 ? $news_set->get(
"default_visibility")
112 $allow_shorter_periods = $news_set->get(
"allow_shorter_periods");
113 $allow_longer_periods = $news_set->get(
"allow_longer_periods");
118 $form->setFormAction($ilCtrl->getFormAction($this));
119 $form->setTitle(
$lng->
txt(
"news_settings"));
123 $lng->
txt(
"news_enable_internal_news"),
124 "enable_internal_news" 127 $cb_prop->setInfo(
$lng->
txt(
"news_enable_internal_news_info"));
128 $cb_prop->setChecked((
bool) $enable_internal_news);
129 $form->addItem($cb_prop);
134 $radio_group->addOption($radio_option);
136 $radio_group->addOption($radio_option);
137 $radio_group->
setInfo(
$lng->
txt(
"news_news_item_visibility_info"));
138 $radio_group->setRequired(
false);
139 $radio_group->setValue($news_default_visibility);
140 $form->addItem($radio_group);
143 $nr_opts = [50 => 50, 100 => 100, 200 => 200];
148 $nr_sel->setInfo(
$lng->
txt(
"news_nr_of_items_info"));
149 $nr_sel->setOptions($nr_opts);
150 $nr_sel->setValue((
string) $news_set->get(
"max_items"));
151 $form->addItem($nr_sel);
154 $min_opts = [0 => 0, 1 => 1, 2 => 2, 5 => 5, 10 => 10, 20 => 20, 30 => 30, 60 => 60];
157 "news_acc_cache_mins" 159 $min_sel->setInfo(
$lng->
txt(
"news_cache_info"));
160 $min_sel->setOptions($min_opts);
161 $min_sel->setValue((
string) $news_set->get(
"acc_cache_mins"));
162 $form->addItem($min_sel);
167 30 =>
"1 " .
$lng->
txt(
"month"),
168 366 =>
"1 " .
$lng->
txt(
"year")
174 $per_sel->setInfo(
$lng->
txt(
"news_pd_period_info"));
175 $per_sel->setOptions($per_opts);
177 $form->addItem($per_sel);
181 $lng->
txt(
"news_allow_shorter_periods"),
182 "allow_shorter_periods" 185 $sp_prop->setInfo(
$lng->
txt(
"news_allow_shorter_periods_info"));
186 $sp_prop->setChecked((
bool) $allow_shorter_periods);
187 $form->addItem($sp_prop);
191 $lng->
txt(
"news_allow_longer_periods"),
192 "allow_longer_periods" 195 $lp_prop->setInfo(
$lng->
txt(
"news_allow_longer_periods_info"));
196 $lp_prop->setChecked((
bool) $allow_longer_periods);
197 $form->addItem($lp_prop);
201 $lng->
txt(
"news_enable_internal_rss"),
202 "enable_internal_rss" 205 $cb_prop->setInfo(
$lng->
txt(
"news_enable_internal_rss_info"));
206 $cb_prop->setChecked((
bool) $enable_internal_rss);
214 14 =>
"2 " .
$lng->
txt(
"weeks"),
215 30 =>
"1 " .
$lng->
txt(
"month"),
216 60 =>
"2 " .
$lng->
txt(
"months"),
217 120 =>
"4 " .
$lng->
txt(
"months"),
218 180 =>
"6 " .
$lng->
txt(
"months"),
219 365 =>
"1 " .
$lng->
txt(
"year")
225 $rssp_sel->setOptions($rssp_opts);
226 $rssp_sel->setValue($rss_period);
227 $cb_prop->addSubItem($rssp_sel);
231 $sh->setTitle(
$lng->
txt(
"news_rss"));
236 "" =>
$lng->
txt(
"news_rss_title_format_obj_news"),
237 "news_obj" =>
$lng->
txt(
"news_rss_title_format_news_obj"),
240 $si->setOptions($options);
241 $si->setValue($rss_title_format);
242 $cb_prop->addSubItem($si);
244 $form->addItem($cb_prop);
248 $lng->
txt(
"news_enable_private_feed"),
249 "enable_private_feed" 252 $cb_prop->setInfo(
$lng->
txt(
"news_enable_private_feed_info"));
253 $cb_prop->setChecked((
bool) $enable_private_feed);
254 $form->addItem($cb_prop);
256 if ($ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
258 $form->addCommandButton(
"saveSettings",
$lng->
txt(
"save"));
259 $form->addCommandButton(
"view",
$lng->
txt(
"cancel"));
270 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
271 $ilCtrl->redirect($this,
"view");
276 $this->acache->deleteAllEntries();
283 if ($form->checkInput()) {
284 $ilSetting->set(
"block_activated_news", $form->getInput(
"enable_internal_news"));
285 $ilSetting->set(
"block_activated_pdnews", $form->getInput(
"enable_internal_news"));
286 $news_set->set(
"enable_rss_for_internal", $form->getInput(
"enable_internal_rss"));
287 $news_set->set(
"max_items", $form->getInput(
"news_max_items"));
288 $news_set->set(
"acc_cache_mins", $form->getInput(
"news_acc_cache_mins"));
289 $news_set->set(
"pd_period", $form->getInput(
"news_pd_period"));
290 $news_set->set(
"default_visibility", $form->getInput(
"news_default_visibility"));
291 $news_set->set(
"allow_shorter_periods", $form->getInput(
"allow_shorter_periods"));
292 $news_set->set(
"allow_longer_periods", $form->getInput(
"allow_longer_periods"));
293 $news_set->set(
"rss_period", $form->getInput(
"news_rss_period"));
294 $news_set->set(
"rss_title_format", $form->getInput(
"rss_title_format"));
296 if ($form->getInput(
"enable_internal_rss")) {
297 $news_set->set(
"enable_private_feed", $form->getInput(
"enable_private_feed"));
299 $news_set->set(
"enable_private_feed",
'0');
302 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
305 $ilCtrl->redirect($this,
"view");
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilRbacSystem $rbac_system
static _lookupRSSPeriod()
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...
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjectGUI Basic methods of all Output classes.
__construct(Container $dic, ilPlugin $plugin)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
static _lookupDefaultPDPeriod()