27 $ilHelp->setScreenIdComponent(
"news");
34 $lng->loadLanguageModule(
"news");
36 $this->ctrl->saveParameter($this,
"news_ref_id");
44 $next_class = $this->ctrl->getNextClass();
50 $cmd = $this->ctrl->getCmd(
"view");
55 $this->tpl->show(
true);
64 $this->tpl->setTitle($this->lng->txt(
"news"));
79 $pd_items = $ilUser->getDesktopItems();
80 foreach($pd_items as $item)
82 $ref_ids[] = $item[
"ref_id"];
83 $obj_ids[] = $item[
"obj_id"];
86 $sel_ref_id = (
$_GET[
"news_ref_id"] > 0)
87 ?
$_GET[
"news_ref_id"]
88 : $ilUser->getPref(
"news_sel_ref_id");
90 include_once(
"./Services/News/classes/class.ilNewsItem.php");
91 $per = (
$_SESSION[
"news_pd_news_per"] !=
"")
97 $contexts[0] = $lng->txt(
"news_all_items");
100 $sel_has_news =
false;
107 if ($sel_ref_id == $ref_id)
109 $sel_has_news =
true;
115 $news_items = $nitem->_getNewsItemsOfUser($ilUser->getId(),
false,
124 foreach($conts as $ref_id => $title)
126 $contexts[
$ref_id] = $title.
" (".(int) $cnt[$ref_id].
")";
134 $nitem->setContextObjId($obj_id);
135 $nitem->setContextObjType($obj_type);
136 $news_items = $nitem->getNewsForRefId($sel_ref_id,
false,
140 include_once(
"./Services/News/classes/class.ilPDNewsTableGUI.php");
141 $pd_news_table =
new ilPDNewsTableGUI($this,
"view", $contexts, $sel_ref_id);
142 $pd_news_table->setData($news_items);
143 $pd_news_table->setNoEntriesText($lng->txt(
"news_no_news_items"));
145 $tpl->setContent($pd_news_table->getHTML());
155 $this->ctrl->setParameter($this,
"news_ref_id",
$_POST[
"news_ref_id"]);
156 $ilUser->writePref(
"news_sel_ref_id",
$_POST[
"news_ref_id"]);
157 if (
$_POST[
"news_per"] > 0)
161 $this->ctrl->redirect($this,
"view");
170 $this->ctrl->setParameter($this,
"news_ref_id", 0);
171 $ilUser->writePref(
"news_sel_ref_id", 0);
173 $this->ctrl->redirect($this,
"view");