ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilPDNewsGUI Class Reference

@ilCtrl_Calls ilPDNewsGUI: ilNewsTimelineGUI, ilCommonActionDispatcherGUI, ILIAS\User\Profile\PublicProfileGUI 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

@ilCtrl_Calls ilPDNewsGUI: ilNewsTimelineGUI, ilCommonActionDispatcherGUI, ILIAS\User\Profile\PublicProfileGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPDNewsGUI::__construct ( )

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ applyFilter()

ilPDNewsGUI::applyFilter ( )

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

135 : void
136 {
137 $ilUser = $this->user;
138
139 $news_ref_id = $this->std_request->getNewsRefId();
140 $news_per = $this->std_request->getNewsPer();
141
142 $this->ctrl->setParameter($this, "news_ref_id", $news_ref_id);
143 $ilUser->writePref("news_sel_ref_id", (string) $news_ref_id);
144 if ($news_per > 0) {
145 ilSession::set("news_pd_news_per", $news_per);
146 }
147 $this->ctrl->redirect($this, "view");
148 }
static set(string $a_var, $a_val)
Set a value.

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

+ Here is the call graph for this function:

◆ displayHeader()

ilPDNewsGUI::displayHeader ( )

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

114 : void
115 {
116 $this->tpl->setTitle($this->lng->txt("news"));
117 $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_nwss.svg"));
118 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

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

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPDNewsGUI::executeCommand ( )

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

85 : bool
86 {
87 $next_class = $this->ctrl->getNextClass();
88
89 if (!$this->domain->settings()->get("block_activated_news")) {
90 return false;
91 }
92
93 switch (strtolower($next_class)) {
94 case strtolower(ilNewsTimelineGUI::class):
95 $t = $this->gui->dashboard()->getTimelineGUI();
96 $this->ctrl->forwardCommand($t);
97 break;
98
99 case strtolower(ilCommonActionDispatcherGUI::class):
100 $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
101 $this->ctrl->forwardCommand($gui);
102 break;
103
104 default:
105 $cmd = $this->ctrl->getCmd("view");
106 $this->displayHeader();
107 $this->$cmd();
108 break;
109 }
110 $this->tpl->printToStdout();
111 return true;
112 }
Class ilCommonActionDispatcherGUI.
InternalGUIService $gui

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

+ Here is the call graph for this function:

◆ saveFilterValues()

ilPDNewsGUI::saveFilterValues ( FilterAdapterGUI  $filter)
protected

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

150 : void
151 {
152 $this->dash_news_manager->saveFilterData($filter->getData());
153 }

References ILIAS\Repository\Filter\FilterAdapterGUI\getData().

Referenced by view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilPDNewsGUI::view ( )

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

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

References saveFilterValues().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilPDNewsGUI::$ctrl
protected

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

◆ $dash_news_manager

DashboardNewsManager ilPDNewsGUI::$dash_news_manager
protected

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

◆ $dash_news_repo

ILIAS News Dashboard DashboardSessionRepository ilPDNewsGUI::$dash_news_repo
protected

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

◆ $domain

InternalDomainService ilPDNewsGUI::$domain
protected

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

◆ $fav_manager

ilFavouritesManager ilPDNewsGUI::$fav_manager
protected

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

◆ $gui

InternalGUIService ilPDNewsGUI::$gui
protected

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

Referenced by executeCommand().

◆ $help

ilHelpGUI ilPDNewsGUI::$help
protected

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

◆ $lng

ilLanguage ilPDNewsGUI::$lng
protected

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

Referenced by __construct().

◆ $std_request

StandardGUIRequest ilPDNewsGUI::$std_request
protected

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

◆ $tpl

ilGlobalTemplateInterface ilPDNewsGUI::$tpl
protected

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

Referenced by __construct().

◆ $user

ilObjUser ilPDNewsGUI::$user
protected

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

Referenced by applyFilter().


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