32 $lng->loadLanguageModule(
"news");
34 $this->ctrl->saveParameter($this,
"news_ref_id");
42 $next_class = $this->ctrl->getNextClass();
48 $cmd = $this->ctrl->getCmd(
"view");
53 $this->tpl->show(
true);
66 $this->tpl->setTitle($this->lng->txt(
"news"));
81 $pd_items = $ilUser->getDesktopItems();
82 foreach($pd_items as $item)
84 $ref_ids[] = $item[
"ref_id"];
85 $obj_ids[] = $item[
"obj_id"];
88 $sel_ref_id = (
$_GET[
"news_ref_id"] > 0)
89 ?
$_GET[
"news_ref_id"]
90 : $ilUser->getPref(
"news_sel_ref_id");
92 include_once(
"./Services/News/classes/class.ilNewsItem.php");
93 $per = (
$_SESSION[
"news_pd_news_per"] !=
"")
99 $contexts[0] = $lng->txt(
"news_all_items");
102 $sel_has_news =
false;
109 if ($sel_ref_id == $ref_id)
111 $sel_has_news =
true;
117 $news_items = $nitem->_getNewsItemsOfUser($ilUser->getId(),
false,
126 foreach($conts as $ref_id =>
$title)
136 $nitem->setContextObjId($obj_id);
137 $nitem->setContextObjType($obj_type);
138 $news_items = $nitem->getNewsForRefId($sel_ref_id,
false,
142 include_once(
"./Services/News/classes/class.ilPDNewsTableGUI.php");
143 $pd_news_table =
new ilPDNewsTableGUI($this,
"view", $contexts, $sel_ref_id);
144 $pd_news_table->setData($news_items);
145 $pd_news_table->setNoEntriesText($lng->txt(
"news_no_news_items"));
147 $tpl->setContent($pd_news_table->getHTML());
157 $this->ctrl->setParameter($this,
"news_ref_id",
$_POST[
"news_ref_id"]);
158 $ilUser->writePref(
"news_sel_ref_id",
$_POST[
"news_ref_id"]);
159 if (
$_POST[
"news_per"] > 0)
163 $this->ctrl->redirect($this,
"view");
172 $this->ctrl->setParameter($this,
"news_ref_id", 0);
173 $ilUser->writePref(
"news_sel_ref_id", 0);
175 $this->ctrl->redirect($this,
"view");