57 $this->
help = $DIC[
"ilHelp"];
58 $this->
user = $DIC->user();
60 $lng = $DIC->language();
61 $ilCtrl = $DIC->ctrl();
62 $ilHelp = $DIC[
"ilHelp"];
64 $ilHelp->setScreenIdComponent(
"news");
69 $this->ctrl = $ilCtrl;
71 $lng->loadLanguageModule(
"news");
73 $this->ctrl->saveParameter($this,
"news_ref_id");
82 $next_class = $this->ctrl->getNextClass();
84 switch ($next_class) {
87 $cmd = $this->ctrl->getCmd(
"view");
92 $this->tpl->printToStdout();
101 $this->tpl->setTitle($this->lng->txt(
"news"));
120 $pd_items = $this->fav_manager->getFavouritesOfUser(
$ilUser->getId());
121 foreach ($pd_items as $item) {
122 $ref_ids[] = $item[
"ref_id"];
123 $obj_ids[] = $item[
"obj_id"];
126 $sel_ref_id = (
$_GET[
"news_ref_id"] > 0)
127 ?
$_GET[
"news_ref_id"]
128 :
$ilUser->getPref(
"news_sel_ref_id");
130 include_once(
"./Services/News/classes/class.ilNewsItem.php");
131 $per = (
$_SESSION[
"news_pd_news_per"] !=
"")
137 $contexts[0] =
$lng->txt(
"news_all_items");
140 $sel_has_news =
false;
141 foreach ($ref_ids as $ref_id) {
145 $conts[$ref_id] = $title;
146 if ($sel_ref_id == $ref_id) {
147 $sel_has_news =
true;
153 $news_items = $nitem->_getNewsItemsOfUser(
162 if (!$sel_has_news) {
166 foreach ($conts as $ref_id => $title) {
167 $contexts[$ref_id] = $title .
" (" . (int) $cnt[$ref_id] .
")";
171 if ($sel_ref_id > 0) {
174 $nitem->setContextObjId($obj_id);
175 $nitem->setContextObjType($obj_type);
176 $news_items = $nitem->getNewsForRefId(
185 include_once(
"./Services/News/classes/class.ilPDNewsTableGUI.php");
186 $pd_news_table =
new ilPDNewsTableGUI($this,
"view", $contexts, $sel_ref_id);
187 $pd_news_table->setData($news_items);
188 $pd_news_table->setNoEntriesText(
$lng->txt(
"news_no_news_items"));
190 $tpl->setContent($pd_news_table->getHTML());
200 $this->ctrl->setParameter($this,
"news_ref_id",
$_POST[
"news_ref_id"]);
201 $ilUser->writePref(
"news_sel_ref_id",
$_POST[
"news_ref_id"]);
202 if (
$_POST[
"news_per"] > 0) {
205 $this->ctrl->redirect($this,
"view");
214 $this->ctrl->setParameter($this,
"news_ref_id", 0);
215 $ilUser->writePref(
"news_sel_ref_id", 0);
217 $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
Manages favourites, currently the interface for other components, needs discussion.
Personal desktop news table.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
static infoPanel($a_keep=true)
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