ILIAS  release_8 Revision v8.24
ilPDNewsBlockGUI Class Reference

BlockGUI class for block NewsForContext. More...

+ Inheritance diagram for ilPDNewsBlockGUI:
+ Collaboration diagram for ilPDNewsBlockGUI:

Public Member Functions

 __construct ()
 
 getNewsData ()
 
 getBlockType ()
 
 executeCommand ()
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 getHTML ()
 
 showFeedUrl ()
 
 editSettings (ilPropertyFormGUI $a_private_form=null)
 
 saveSettings ()
 
 changeFeedSettings ()
 
- Public Member Functions inherited from ilNewsForContextBlockGUI
 __construct ()
 
 getNewsData ()
 
 getBlockType ()
 
 executeCommand ()
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 getHTML ()
 
 handleView ()
 Handles show/hide notification view and removes notifications if hidden. More...
 
 fillRow (array $a_set)
 get flat list for dashboard More...
 
 getInfoForData (array $news)
 
 getOverview ()
 
 showNews ()
 
 makeClickable (string $a_str)
 
 showNotifications ()
 
 hideNotifications ()
 
 editSettings ()
 Show settings screen. More...
 
 initSettingsForm ()
 Init setting form. More...
 
 cancelSettings ()
 
 saveSettings ()
 
 showFeedUrl ()
 
 getDynamic ()
 
 getDynamicReload ()
 
 getJSEnabler ()
 
 disableJS ()
 
 enableJS ()
 
 getNoItemFoundContent ()
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 correctOffset ()
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 
 getBlockCommands ()
 
 getHTML ()
 
 fillHeaderCommands ()
 
 fillHeaderTitleBlock ()
 
 setDataSection (string $a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow (array $a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 
 setPreviousNextLinks ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 
 getNoItemFoundContent ()
 

Static Public Member Functions

static getScreenMode ()
 
- Static Public Member Functions inherited from ilNewsForContextBlockGUI
static getScreenMode ()
 
static addToSettingsForm (ilFormPropertyGUI $a_input)
 Add inputs to the container news settings form to configure also the contextBlock options. More...
 
static writeSettings (array $a_values)
 
static getScreenMode ()
 

Static Public Attributes

static string $block_type = "pdnews"
 
- Static Public Attributes inherited from ilNewsForContextBlockGUI
static string $block_type = "news"
 
static array $st_data
 

Protected Member Functions

 initPrivateSettingsForm ()
 
- Protected Member Functions inherited from ilNewsForContextBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 getMediaPath (int $mob_id)
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 fillRowColor (string $a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getViewControls ()
 Get view controls. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 send (string $output)
 Send. More...
 

Protected Attributes

bool $cache_hit = false
 
ilNewsCache $acache
 
bool $dynamic = false
 
bool $acc_results = false
 
StandardGUIRequest $std_request
 
- Protected Attributes inherited from ilNewsForContextBlockGUI
NewsAccess $news_access
 
bool $cache_hit = false
 
bool $dynamic = false
 
ilNewsCache $acache
 
bool $show_view_selection
 
bool $new_rendering = true
 
string $view
 
ilPropertyFormGUI $settings_form
 
ilHelpGUI $help
 
ilSetting $settings
 
ilTabsGUI $tabs
 
ilObjectDefinition $obj_definition
 
StandardGUIRequest $std_request
 
- Protected Attributes inherited from ilBlockGUI
object $gui_object
 
ILIAS Block StandardGUIRequest $request
 
ILIAS Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 
bool $new_rendering = false
 

Additional Inherited Members

- Data Fields inherited from ilNewsForContextBlockGUI
const OBJECTS_WITH_NEWS_SUBTAB = ["category", "course", "group", "forum"]
 object type names with settings->news settings subtab More...
 
- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 
const PRES_MAIN_TILE = 4
 

Detailed Description

BlockGUI class for block NewsForContext.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_IsCalledBy ilPDNewsBlockGUI: ilColumnGUI

Definition at line 27 of file class.ilPDNewsBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPDNewsBlockGUI::__construct ( )

Reimplemented from ilNewsForContextBlockGUI.

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

37 {
38 global $DIC;
39
41
42 $lng = $DIC->language();
43 $ilAccess = $DIC->access();
44 $this->obj_definition = $DIC["objDefinition"];
45
46 // NOT ilNewsForContextBlockGUI::__construct() !
48
49 $lng->loadLanguageModule("news");
50 $this->setLimit(5);
51
52 $this->dynamic = false;
53
54 $this->std_request = new StandardGUIRequest(
55 $DIC->http(),
56 $DIC->refinery()
57 );
58
59 $this->acache = new ilNewsCache();
60 $cres = unserialize($this->acache->getEntry($this->user->getId() . ":0"), ["allowed_classes" => false]);
61 $this->cache_hit = false;
62 if (is_array($cres) && $this->acache->getLastAccessStatus() === "hit") {
63 self::$st_data = ilNewsItem::prepareNewsDataFromCache($cres);
64 $this->cache_hit = true;
65 }
66
67 if (!$this->cache_hit && $this->getDynamic()) {
68 $this->dynamic = true;
69 $data = [];
70 } else {
71 // do not ask two times for the data (e.g. if user displays a
72 // single item on the personal desktop and the news block is
73 // displayed at the same time)
74 if (empty(self::$st_data)) {
75 self::$st_data = $this->getNewsData();
76 }
78 }
79
80 $this->setTitle($lng->txt("news_internal_news"));
81 $this->setRowTemplate("tpl.block_row_news_for_context.html", "Services/News");
82
83 $this->setData($data);
84
85 $this->handleView();
86
87 // reset access check results
88 $ilAccess->setResults((array) $this->acc_results);
89
90 $this->setPresentation(self::PRES_SEC_LIST);
91 }
setData(array $a_data)
ilLanguage $lng
setTitle(string $a_title)
setPresentation(int $type)
setLimit(int $a_limit)
setRowTemplate(string $a_rowtemplatename, string $a_rowtemplatedir="")
Set Row Template Name.
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handleView()
Handles show/hide notification view and removes notifications if hidden.
static prepareNewsDataFromCache(array $a_cres)
Prepare news data from cache.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ilBlockGUI\$data, $DIC, ilBlockGUI\$lng, ilNewsForContextBlockGUI\$st_data, ilBlockGUI\__construct(), ILIAS\GlobalScreen\Provider\__construct(), ilNewsForContextBlockGUI\getDynamic(), getNewsData(), ilNewsForContextBlockGUI\handleView(), ilLanguage\loadLanguageModule(), ilNewsItem\prepareNewsDataFromCache(), ilBlockGUI\setData(), ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), ilBlockGUI\setRowTemplate(), ilBlockGUI\setTitle(), and ilLanguage\txt().

+ Here is the call graph for this function:

Member Function Documentation

◆ changeFeedSettings()

ilPDNewsBlockGUI::changeFeedSettings ( )

Definition at line 383 of file class.ilPDNewsBlockGUI.php.

383 : string
384 {
385 $ilCtrl = $this->ctrl;
388
389 $form = $this->initPrivateSettingsForm();
390 if ($form->checkInput()) {
391 // Deactivate private Feed - just delete the password
392 if (!$form->getInput("enable_private_feed")) {
393 ilObjUser::_setFeedPass($ilUser->getId(), "");
394 $this->main_tpl->setOnScreenMessage('success', $lng->txt("priv_feed_disabled"), true);
395 // $ilCtrl->returnToParent($this);
396 $ilCtrl->redirect($this, "showFeedUrl");
397 } else {
398 $passwd = $form->getInput("desired_password");
399 if (ilUserPasswordManager::getInstance()->verifyPassword($ilUser, $passwd)) {
400 $form->getItemByPostVar("desired_password")->setAlert($lng->txt("passwd_equals_ilpasswd"));
401 $this->main_tpl->setOnScreenMessage('failure', $lng->txt("form_input_not_valid"));
402 } else {
403 ilObjUser::_setFeedPass($ilUser->getId(), $passwd);
404 $this->main_tpl->setOnScreenMessage('success', $lng->txt("saved_successfully"), true);
405 $ilCtrl->redirect($this, "showFeedUrl");
406 }
407 }
408 }
409
410 $form->setValuesByPost();
411 return $this->editSettings($form);
412 }
ilObjUser $user
static _setFeedPass(int $a_user_id, string $a_password)
Set news feed password for user.
static getInstance()
Singleton method to reduce footprint (included files, created instances)
$ilUser
Definition: imgupload.php:34

References ilBlockGUI\$ctrl, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$user, ilObjUser\_setFeedPass(), ilNewsForContextBlockGUI\editSettings(), ilUserPasswordManager\getInstance(), initPrivateSettingsForm(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ editSettings()

ilPDNewsBlockGUI::editSettings ( ilPropertyFormGUI  $a_private_form = null)

Definition at line 260 of file class.ilPDNewsBlockGUI.php.

260 : string
261 {
264 $ilCtrl = $this->ctrl;
265 $returnForm = "";
266
267 $news_set = new ilSetting("news");
268 $allow_shorter_periods = $news_set->get("allow_shorter_periods");
269 $allow_longer_periods = $news_set->get("allow_longer_periods");
270 $enable_private_feed = $news_set->get("enable_private_feed");
271
272 if (!$a_private_form && ($allow_shorter_periods || $allow_longer_periods)) {
273 $form = new ilPropertyFormGUI();
274 $form->setFormAction($ilCtrl->getFormAction($this));
275 $form->setTitle($lng->txt("news_settings"));
276
277 $default_per = ilNewsItem::_lookupDefaultPDPeriod();
279
280 $form->setTableWidth("100%");
281
282 $per_opts = [
283 2 => "2 " . $lng->txt("days"),
284 3 => "3 " . $lng->txt("days"),
285 5 => "5 " . $lng->txt("days"),
286 7 => "1 " . $lng->txt("week"),
287 14 => "2 " . $lng->txt("weeks"),
288 30 => "1 " . $lng->txt("month"),
289 60 => "2 " . $lng->txt("months"),
290 120 => "4 " . $lng->txt("months"),
291 180 => "6 " . $lng->txt("months"),
292 366 => "1 " . $lng->txt("year")
293 ];
294
295 $unset = [];
296 foreach ($per_opts as $k => $opt) {
297 if (!$allow_shorter_periods && ($k < $default_per)) {
298 $unset[$k] = $k;
299 }
300 if (!$allow_longer_periods && ($k > $default_per)) {
301 $unset[$k] = $k;
302 }
303 }
304 foreach ($unset as $k) {
305 unset($per_opts[$k]);
306 }
307
308 $per_sel = new ilSelectInputGUI(
309 $lng->txt("news_pd_period"),
310 "news_pd_period"
311 );
312 $per_sel->setOptions($per_opts);
313 $per_sel->setValue((string) $per);
314 $form->addItem($per_sel);
315
316 $form->addCommandButton("saveSettings", $lng->txt("save"));
317 $form->addCommandButton("cancelSettings", $lng->txt("cancel"));
318
319 $returnForm = $form->getHTML();
320 }
321
322 if ($enable_private_feed) {
323 if (!$a_private_form) {
324 $a_private_form = $this->initPrivateSettingsForm();
325 }
326 $returnForm .= ($returnForm === "")
327 ? $a_private_form->getHTML()
328 : "<br>" . $a_private_form->getHTML();
329 }
330
331 return $returnForm;
332 }
static _lookupUserPDPeriod(int $a_user_id)
static _lookupDefaultPDPeriod()
This class represents a property form user interface.
This class represents a selection list property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilBlockGUI\$ctrl, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$user, ilNewsItem\_lookupDefaultPDPeriod(), ilNewsItem\_lookupUserPDPeriod(), initPrivateSettingsForm(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ executeCommand()

ilPDNewsBlockGUI::executeCommand ( )

Reimplemented from ilNewsForContextBlockGUI.

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

139 {
140 $ilCtrl = $this->ctrl;
141
142 $next_class = $ilCtrl->getNextClass();
143 $cmd = $ilCtrl->getCmd("getHTML");
144
145 switch ($next_class) {
146 default:
147 return $this->$cmd();
148 }
149 }
getNextClass($a_gui_class=null)
@inheritDoc

References ilBlockGUI\$ctrl, and ilCtrl\getNextClass().

+ Here is the call graph for this function:

◆ fillDataSection()

ilPDNewsBlockGUI::fillDataSection ( )

Standard implementation for row based data.

Overwrite this and call setContent for other data.

Reimplemented from ilNewsForContextBlockGUI.

Definition at line 151 of file class.ilPDNewsBlockGUI.php.

151 : void
152 {
153 if ($this->dynamic) {
154 $this->setDataSection($this->getDynamicReload());
155 } elseif (count($this->getData()) > 0) {
156 parent::fillDataSection();
157 } else {
158 $this->setEnableNumInfo(false);
159 $this->setDataSection($this->getOverview());
160 }
161 }
setDataSection(string $a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo(bool $a_enablenuminfo)

References ilBlockGUI\getData(), ilNewsForContextBlockGUI\getDynamicReload(), ilNewsForContextBlockGUI\getOverview(), ilBlockGUI\setDataSection(), and ilBlockGUI\setEnableNumInfo().

+ Here is the call graph for this function:

◆ getBlockType()

ilPDNewsBlockGUI::getBlockType ( )

Reimplemented from ilNewsForContextBlockGUI.

Definition at line 115 of file class.ilPDNewsBlockGUI.php.

115 : string
116 {
117 return self::$block_type;
118 }

References $block_type.

Referenced by saveSettings().

+ Here is the caller graph for this function:

◆ getHTML()

ilPDNewsBlockGUI::getHTML ( )

Reimplemented from ilNewsForContextBlockGUI.

Definition at line 163 of file class.ilPDNewsBlockGUI.php.

163 : string
164 {
165 $ilCtrl = $this->ctrl;
168
169 // @todo: find another solution for this
170 //$this->setFooterInfo($lng->txt("news_block_information"), true);
171
172 $news_set = new ilSetting("news");
173 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
174 $allow_shorter_periods = $news_set->get("allow_shorter_periods");
175 $allow_longer_periods = $news_set->get("allow_longer_periods");
176 $enable_private_feed = $news_set->get("enable_private_feed");
177 // show feed url
178 if ($enable_internal_rss) {
179 // @todo: rss icon html ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_RSS)
180 $this->addBlockCommand(
181 $ilCtrl->getLinkTarget($this, "showFeedUrl"),
182 $lng->txt("news_get_feed_url")
183 );
184 }
185
186 if ($allow_shorter_periods || $allow_longer_periods || $enable_private_feed) {
187 $this->addBlockCommand(
188 $ilCtrl->getLinkTarget($this, "editSettings"),
189 $lng->txt("settings")
190 );
191 }
192
193 $en = "";
194 if ($ilUser->getPref("il_feed_js") === "n") {
195 $en = $this->getJSEnabler();
196 }
197
198 return ilBlockGUI::getHTML() . $en;
199 }
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")

References ilBlockGUI\$ctrl, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$user, ilBlockGUI\addBlockCommand(), ilBlockGUI\getHTML(), ilNewsForContextBlockGUI\getJSEnabler(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getNewsData()

ilPDNewsBlockGUI::getNewsData ( )

Reimplemented from ilNewsForContextBlockGUI.

Definition at line 93 of file class.ilPDNewsBlockGUI.php.

93 : array
94 {
96
97 $this->acache = new ilNewsCache();
98
101 $ilUser->getId(),
102 false,
103 false,
104 $per
105 );
106
107 $this->acache->storeEntry(
108 $ilUser->getId() . ":0",
109 serialize($data)
110 );
111
112 return $data;
113 }
static _getNewsItemsOfUser(int $a_user_id, bool $a_only_public=false, bool $a_prevent_aggregation=false, int $a_per=0, array &$a_cnt=[])
Get all news items for a user.

References ilBlockGUI\$data, $ilUser, ilBlockGUI\$user, ilNewsItem\_getNewsItemsOfUser(), and ilNewsItem\_lookupUserPDPeriod().

Referenced by __construct().

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

◆ getScreenMode()

static ilPDNewsBlockGUI::getScreenMode ( )
static

Reimplemented from ilNewsForContextBlockGUI.

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

120 : string
121 {
122 global $DIC;
123
124 $cmd = $DIC->ctrl()->getCmd();
125
126 switch ($cmd) {
127 case "showNews":
128 case "showFeedUrl":
129 case "editSettings":
130 case "changeFeedSettings":
131 return IL_SCREEN_CENTER;
132
133 default:
134 return IL_SCREEN_SIDE;
135 }
136 }
const IL_SCREEN_SIDE
const IL_SCREEN_CENTER

References $DIC, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

◆ initPrivateSettingsForm()

ilPDNewsBlockGUI::initPrivateSettingsForm ( )
protected

Definition at line 334 of file class.ilPDNewsBlockGUI.php.

335 {
336 $ilCtrl = $this->ctrl;
339
340 $feed_form = new ilPropertyFormGUI();
341 $feed_form->setFormAction($ilCtrl->getFormAction($this));
342 $feed_form->setTitle($lng->txt("priv_feed_settings"));
343
344 $feed_form->setTableWidth("100%");
345
346 $enable_private_feed = new ilCheckboxInputGUI($lng->txt("news_enable_private_feed"), "enable_private_feed");
347 $enable_private_feed->setChecked((bool) ilObjUser::_getFeedPass($ilUser->getId()));
348 $feed_form->addItem($enable_private_feed);
349
350 $passwd = new ilPasswordInputGUI($lng->txt("password"), "desired_password");
351 $passwd->setRequired(true);
353 $enable_private_feed->addSubItem($passwd);
354
355 $feed_form->addCommandButton("changeFeedSettings", $lng->txt("save"));
356 $feed_form->addCommandButton("cancelSettings", $lng->txt("cancel"));
357
358 return $feed_form;
359 }
This class represents a checkbox property in a property form.
static _getFeedPass(int $a_user_id)
Lookup news feed password for user.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()

References ilBlockGUI\$ctrl, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$user, ilObjUser\_getFeedPass(), ilSecuritySettingsChecker\getPasswordRequirementsInfo(), and ilLanguage\txt().

Referenced by changeFeedSettings(), and editSettings().

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

◆ saveSettings()

ilPDNewsBlockGUI::saveSettings ( )

Reimplemented from ilNewsForContextBlockGUI.

Definition at line 361 of file class.ilPDNewsBlockGUI.php.

361 : string
362 {
363 $ilCtrl = $this->ctrl;
365
366 $news_set = new ilSetting("news");
367
369 $this->getBlockType(),
370 "news_pd_period",
371 $this->std_request->getDashboardPeriod(),
372 $ilUser->getId(),
373 0
374 );
375
376 $cache = new ilNewsCache();
377 $cache->deleteEntry($ilUser->getId() . ":0");
378
379 $ilCtrl->returnToParent($this);
380 return "";
381 }
static _write(string $a_type, string $a_setting, string $a_value, int $a_user=0, int $a_block_id=0)
Write setting to database.

References ilBlockGUI\$ctrl, $ilUser, ilBlockGUI\$user, ilBlockSetting\_write(), and getBlockType().

+ Here is the call graph for this function:

◆ showFeedUrl()

ilPDNewsBlockGUI::showFeedUrl ( )

Reimplemented from ilNewsForContextBlockGUI.

Definition at line 202 of file class.ilPDNewsBlockGUI.php.

202 : string
203 {
205 $ilCtrl = $this->ctrl;
207
208 $news_set = new ilSetting("news");
209
210 if ($news_set->get("enable_private_feed")) {
211 $tpl = new ilTemplate("tpl.show_priv_feed_url.html", true, true, "Services/News");
212
213 $tpl->setVariable("TXT_PRIV_TITLE", $lng->txt("news_get_priv_feed_title"));
214
215 // #14365
216 if (ilObjUser::_getFeedPass($GLOBALS['DIC']['ilUser']->getId())) {
217 $tpl->setVariable("TXT_PRIV_INFO", $lng->txt("news_get_priv_feed_info"));
218 $tpl->setVariable("TXT_PRIV_FEED_URL", $lng->txt("news_feed_url"));
220 "VAL_PRIV_FEED_URL",
221 str_replace("://", "://" . $ilUser->getLogin() . ":-password-@", ILIAS_HTTP_PATH) . "/privfeed.php?client_id=" . rawurlencode(CLIENT_ID) . "&user_id=" . $ilUser->getId() .
222 "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)
223 );
225 "VAL_PRIV_FEED_URL_TXT",
226 str_replace("://", "://" . $ilUser->getLogin() . ":-password-@", ILIAS_HTTP_PATH) . "/privfeed.php?client_id=" . rawurlencode(CLIENT_ID) . "&<br />user_id=" . $ilUser->getId() .
227 "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)
228 );
229 } else {
230 $tpl->setVariable("TXT_PRIV_INFO", $lng->txt("news_inactive_private_feed_info"));
231 $tpl->setVariable("EDIT_SETTINGS_URL", $ilCtrl->getLinkTarget($this, "editSettings"));
232 $tpl->setVariable("EDIT_SETTINGS_TXT", $lng->txt("news_edit_news_settings"));
233 }
234 } else {
235 $tpl = new ilTemplate("tpl.show_feed_url.html", true, true, "Services/News");
236 }
237 $tpl->setVariable("TXT_TITLE", $lng->txt("news_get_feed_title"));
238 $tpl->setVariable("TXT_INFO", $lng->txt("news_get_feed_info"));
239 $tpl->setVariable("TXT_FEED_URL", $lng->txt("news_feed_url"));
241 "VAL_FEED_URL",
242 ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&user_id=" . $ilUser->getId() .
243 "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)
244 );
246 "VAL_FEED_URL_TXT",
247 ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&<br />user_id=" . $ilUser->getId() .
248 "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)
249 );
250
251
252 $panel = $this->ui->factory()->panel()->standard(
253 $lng->txt("news_internal_news"),
254 $this->ui->factory()->legacy($tpl->get())
255 );
256
257 return $this->ui->renderer()->render($panel);
258 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
ilTemplate $tpl
static _lookupFeedHash(int $a_user_id, bool $a_create=false)
Lookup news feed hash for user.
special template class to simplify handling of ITX/PEAR
get(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
Returns a block with all replacements done.
const CLIENT_ID
Definition: constants.php:41
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:198

References ilBlockGUI\$ctrl, $GLOBALS, $ilUser, ilBlockGUI\$lng, $panel, ilBlockGUI\$tpl, ilBlockGUI\$user, ilObjUser\_getFeedPass(), ilObjUser\_lookupFeedHash(), CLIENT_ID, ilTemplate\get(), ILIAS\Survey\Mode\getId(), HTML_Template_IT\setVariable(), ilLanguage\txt(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

Field Documentation

◆ $acache

ilNewsCache ilPDNewsBlockGUI::$acache
protected

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

◆ $acc_results

bool ilPDNewsBlockGUI::$acc_results = false
protected

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

◆ $block_type

string ilPDNewsBlockGUI::$block_type = "pdnews"
static

Definition at line 29 of file class.ilPDNewsBlockGUI.php.

Referenced by getBlockType().

◆ $cache_hit

bool ilPDNewsBlockGUI::$cache_hit = false
protected

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

◆ $dynamic

bool ilPDNewsBlockGUI::$dynamic = false
protected

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

◆ $std_request

StandardGUIRequest ilPDNewsBlockGUI::$std_request
protected

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


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