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);
68 $this->tpl->setTitle($this->lng->txt(
"news"));
83 $pd_items = $ilUser->getDesktopItems();
84 foreach($pd_items as $item)
86 $ref_ids[] = $item[
"ref_id"];
87 $obj_ids[] = $item[
"obj_id"];
90 $sel_ref_id = (
$_GET[
"news_ref_id"] > 0)
91 ?
$_GET[
"news_ref_id"]
92 : $ilUser->getPref(
"news_sel_ref_id");
94 include_once(
"./Services/News/classes/class.ilNewsItem.php");
95 $per = (
$_SESSION[
"news_pd_news_per"] !=
"")
101 $contexts[0] = $lng->txt(
"news_all_items");
104 $sel_has_news =
false;
111 if ($sel_ref_id == $ref_id)
113 $sel_has_news =
true;
119 $news_items = $nitem->_getNewsItemsOfUser($ilUser->getId(),
false,
128 foreach($conts as $ref_id => $title)
130 $contexts[
$ref_id] = $title.
" (".(int) $cnt[$ref_id].
")";
138 $nitem->setContextObjId($obj_id);
139 $nitem->setContextObjType($obj_type);
140 $news_items = $nitem->getNewsForRefId($sel_ref_id,
false,
144 include_once(
"./Services/News/classes/class.ilPDNewsTableGUI.php");
145 $pd_news_table =
new ilPDNewsTableGUI($this,
"view", $contexts, $sel_ref_id);
146 $pd_news_table->setData($news_items);
147 $pd_news_table->setNoEntriesText($lng->txt(
"news_no_news_items"));
149 $tpl->setContent($pd_news_table->getHTML());
159 $this->ctrl->setParameter($this,
"news_ref_id",
$_POST[
"news_ref_id"]);
160 $ilUser->writePref(
"news_sel_ref_id",
$_POST[
"news_ref_id"]);
161 if (
$_POST[
"news_per"] > 0)
165 $this->ctrl->redirect($this,
"view");
174 $this->ctrl->setParameter($this,
"news_ref_id", 0);
175 $ilUser->writePref(
"news_sel_ref_id", 0);
177 $this->ctrl->redirect($this,
"view");