ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilPDNewsGUI Class Reference

News on PD. More...

+ Collaboration diagram for ilPDNewsGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 displayHeader ()
 
 view ()
 
 applyFilter ()
 

Protected Member Functions

 saveFilterValues (FilterAdapterGUI $filter)
 

Protected Attributes

InternalDomainService $domain
 
DashboardNewsManager $dash_news_manager
 
ILIAS News Dashboard DashboardSessionRepository $dash_news_repo
 
InternalGUIService $gui
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilHelpGUI $help
 
ilObjUser $user
 
ilFavouritesManager $fav_manager
 
StandardGUIRequest $std_request
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPDNewsGUI::__construct ( )

Definition at line 45 of file class.ilPDNewsGUI.php.

References $DIC, $lng, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), and ILIAS\Repository\user().

46  {
47  global $DIC;
48 
49  $this->help = $DIC["ilHelp"];
50  $this->user = $DIC->user();
51  $tpl = $DIC->ui()->mainTemplate();
52  $lng = $DIC->language();
53  $ilCtrl = $DIC->ctrl();
54  $ilHelp = $DIC["ilHelp"];
55 
56  $ilHelp->setScreenIdComponent("news");
57 
58  $this->std_request = $DIC->news()
59  ->internal()
60  ->gui()
61  ->standardRequest();
62 
63  // initiate variables
64  $this->tpl = $tpl;
65  $this->lng = $lng;
66  $this->ctrl = $ilCtrl;
67 
68  $lng->loadLanguageModule("news");
69 
70  $this->ctrl->saveParameter($this, "news_ref_id");
71  $this->fav_manager = new ilFavouritesManager();
72  $this->gui = $DIC->news()
73  ->internal()
74  ->gui();
75  $this->domain = $DIC->news()
76  ->internal()
77  ->domain();
78  $this->dash_news_repo = $DIC->news()
79  ->internal()
80  ->repo()
81  ->dashboard();
82  $this->dash_news_manager = $DIC->news()
83  ->internal()
84  ->domain()
85  ->dashboard();
86  }
loadLanguageModule(string $a_module)
Load language module.
ilGlobalTemplateInterface $tpl
global $DIC
Definition: shib_login.php:26
ilLanguage $lng
+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilPDNewsGUI::applyFilter ( )

Definition at line 138 of file class.ilPDNewsGUI.php.

References $user, ILIAS\Repository\ctrl(), and ilSession\set().

138  : void
139  {
140  $ilUser = $this->user;
141 
142  $news_ref_id = $this->std_request->getNewsRefId();
143  $news_per = $this->std_request->getNewsPer();
144 
145  $this->ctrl->setParameter($this, "news_ref_id", $news_ref_id);
146  $ilUser->writePref("news_sel_ref_id", (string) $news_ref_id);
147  if ($news_per > 0) {
148  ilSession::set("news_pd_news_per", $news_per);
149  }
150  $this->ctrl->redirect($this, "view");
151  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ displayHeader()

ilPDNewsGUI::displayHeader ( )

Definition at line 117 of file class.ilPDNewsGUI.php.

References ilUtil\getImagePath(), and ILIAS\Repository\lng().

Referenced by executeCommand().

117  : void
118  {
119  $this->tpl->setTitle($this->lng->txt("news"));
120  $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_nwss.svg"));
121  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPDNewsGUI::executeCommand ( )

Definition at line 88 of file class.ilPDNewsGUI.php.

References ILIAS\Repository\ctrl(), displayHeader(), and ilCommonActionDispatcherGUI\getInstanceFromAjaxCall().

88  : bool
89  {
90  $next_class = $this->ctrl->getNextClass();
91 
92  if (!$this->domain->settings()->get("block_activated_news")) {
93  return false;
94  }
95 
96  switch ($next_class) {
97  case "ilnewstimelinegui":
98  $t = $this->gui->dashboard()->getTimelineGUI();
99  $this->ctrl->forwardCommand($t);
100  break;
101 
102  case "ilcommonactiondispatchergui":
104  $this->ctrl->forwardCommand($gui);
105  break;
106 
107  default:
108  $cmd = $this->ctrl->getCmd("view");
109  $this->displayHeader();
110  $this->$cmd();
111  break;
112  }
113  $this->tpl->printToStdout();
114  return true;
115  }
InternalGUIService $gui
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ saveFilterValues()

ilPDNewsGUI::saveFilterValues ( FilterAdapterGUI  $filter)
protected

Definition at line 153 of file class.ilPDNewsGUI.php.

References ILIAS\Tracking\View\DataRetrieval\Filter\FilterAdapterGUI\getData().

Referenced by view().

153  : void
154  {
155  $this->dash_news_manager->saveFilterData($filter->getData());
156  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilPDNewsGUI::view ( )

Definition at line 123 of file class.ilPDNewsGUI.php.

References ILIAS\Repository\ctrl(), and saveFilterValues().

123  : void
124  {
125  $filter = $this->gui->dashboard()->getFilter();
126  $this->saveFilterValues($filter);
127  // we need to get the filte again, since the saving above influences
128  // the drop down (number of news per object displayed in parentheses dependeds on period)
129  $filter = $this->gui->dashboard()->getFilter(true);
130  $t = $this->gui->dashboard()->getTimelineGUI();
131 
132  $this->tpl->setContent(
133  $filter->render() .
134  $this->ctrl->getHTML($t)
135  );
136  }
saveFilterValues(FilterAdapterGUI $filter)
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilPDNewsGUI::$ctrl
protected

Definition at line 39 of file class.ilPDNewsGUI.php.

◆ $dash_news_manager

DashboardNewsManager ilPDNewsGUI::$dash_news_manager
protected

Definition at line 34 of file class.ilPDNewsGUI.php.

◆ $dash_news_repo

ILIAS News Dashboard DashboardSessionRepository ilPDNewsGUI::$dash_news_repo
protected

Definition at line 35 of file class.ilPDNewsGUI.php.

◆ $domain

InternalDomainService ilPDNewsGUI::$domain
protected

Definition at line 33 of file class.ilPDNewsGUI.php.

◆ $fav_manager

ilFavouritesManager ilPDNewsGUI::$fav_manager
protected

Definition at line 42 of file class.ilPDNewsGUI.php.

◆ $gui

InternalGUIService ilPDNewsGUI::$gui
protected

Definition at line 36 of file class.ilPDNewsGUI.php.

◆ $help

ilHelpGUI ilPDNewsGUI::$help
protected

Definition at line 40 of file class.ilPDNewsGUI.php.

◆ $lng

ilLanguage ilPDNewsGUI::$lng
protected

Definition at line 38 of file class.ilPDNewsGUI.php.

Referenced by __construct().

◆ $std_request

StandardGUIRequest ilPDNewsGUI::$std_request
protected

Definition at line 43 of file class.ilPDNewsGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilPDNewsGUI::$tpl
protected

Definition at line 37 of file class.ilPDNewsGUI.php.

Referenced by __construct().

◆ $user

ilObjUser ilPDNewsGUI::$user
protected

Definition at line 41 of file class.ilPDNewsGUI.php.

Referenced by applyFilter().


The documentation for this class was generated from the following file: