52 $this->help = $DIC[
"ilHelp"];
53 $this->
user = $DIC->user();
55 $lng = $DIC->language();
57 $ilHelp = $DIC[
"ilHelp"];
59 $ilHelp->setScreenIdComponent(
"news");
66 $lng->loadLanguageModule(
"news");
68 $this->ctrl->saveParameter($this,
"news_ref_id");
76 $next_class = $this->ctrl->getNextClass();
78 switch ($next_class) {
81 $cmd = $this->ctrl->getCmd(
"view");
86 $this->tpl->show(
true);
95 $this->tpl->setTitle($this->lng->txt(
"news"));
113 $pd_items =
$ilUser->getDesktopItems();
114 foreach ($pd_items as $item) {
115 $ref_ids[] = $item[
"ref_id"];
116 $obj_ids[] = $item[
"obj_id"];
119 $sel_ref_id = (
$_GET[
"news_ref_id"] > 0)
120 ?
$_GET[
"news_ref_id"]
121 :
$ilUser->getPref(
"news_sel_ref_id");
123 include_once(
"./Services/News/classes/class.ilNewsItem.php");
124 $per = (
$_SESSION[
"news_pd_news_per"] !=
"")
130 $contexts[0] =
$lng->txt(
"news_all_items");
133 $sel_has_news =
false;
134 foreach ($ref_ids as $ref_id) {
139 if ($sel_ref_id == $ref_id) {
140 $sel_has_news =
true;
146 $news_items = $nitem->_getNewsItemsOfUser(
155 if (!$sel_has_news) {
159 foreach ($conts as $ref_id =>
$title) {
160 $contexts[$ref_id] =
$title .
" (" . (int) $cnt[$ref_id] .
")";
164 if ($sel_ref_id > 0) {
167 $nitem->setContextObjId($obj_id);
168 $nitem->setContextObjType($obj_type);
169 $news_items = $nitem->getNewsForRefId(
178 include_once(
"./Services/News/classes/class.ilPDNewsTableGUI.php");
179 $pd_news_table =
new ilPDNewsTableGUI($this,
"view", $contexts, $sel_ref_id);
180 $pd_news_table->setData($news_items);
181 $pd_news_table->setNoEntriesText(
$lng->txt(
"news_no_news_items"));
183 $tpl->setContent($pd_news_table->getHTML());
193 $this->ctrl->setParameter($this,
"news_ref_id",
$_POST[
"news_ref_id"]);
194 $ilUser->writePref(
"news_sel_ref_id",
$_POST[
"news_ref_id"]);
195 if (
$_POST[
"news_per"] > 0) {
198 $this->ctrl->redirect($this,
"view");
207 $this->ctrl->setParameter($this,
"news_ref_id", 0);
208 $ilUser->writePref(
"news_sel_ref_id", 0);
210 $this->ctrl->redirect($this,
"view");
executeCommand()
execute command
displayHeader()
display header and locator
static _lookupUserPDPeriod($a_user_id)
static _lookupTitle($a_id)
lookup object title
Personal desktop news table.
static _lookupObjId($a_id)
static infoPanel($a_keep=true)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
__construct()
Constructor.
static filterObjIdsPerNews($a_obj_ids, $a_time_period=0, $a_starting_date="", $a_ending_date='', $ignore_period=false)
Checks whether news are available for.
applyFilter()
change related object
resetFilter()
reset filter