ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPDNewsBlockGUI Class Reference

BlockGUI class for block NewsForContext. More...

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

Public Member Functions

 __construct ()
 Constructor. More...
 
 getNewsData ()
 Get news for context. More...
 
 getBlockType ()
 
 executeCommand ()
 execute command More...
 
 fillDataSection ()
 Fill data section. More...
 
 getHTML ()
 Get bloch HTML code. More...
 
 showFeedUrl ()
 Show feed URL. More...
 
 showNews ()
 show news More...
 
 editSettings (ilPropertyFormGUI $a_private_form=null)
 Show settings screen. More...
 
 cancelSettings ()
 Cancel settings. More...
 
 saveSettings ()
 Save settings. More...
 
 changeFeedSettings ()
 change user password More...
 
- Public Member Functions inherited from ilNewsForContextBlockGUI
 __construct ()
 Constructor. More...
 
 getNewsData ()
 Get news for context. More...
 
 getBlockType ()
 
 executeCommand ()
 execute command More...
 
 setEnableEdit ($a_enable_edit=0)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 fillDataSection ()
 Fill data section. More...
 
 getHTML ()
 Get bloch HTML code. More...
 
 handleView ()
 Handles show/hide notification view and removes notifications if hidden. More...
 
 fillRow ($data)
 get flat list for personal desktop More...
 
 getInfoForData ($news)
 
 getOverview ()
 Get overview. More...
 
 showNews ()
 show news More...
 
 makeClickable ($a_str)
 Make clickable. More...
 
 unsubscribeNews ()
 Unsubscribe current user from news. More...
 
 subscribeNews ()
 Subscribe current user from news. More...
 
 showNotifications ()
 
 hideNotifications ()
 
 editSettings ()
 Show settings screen. More...
 
 initSettingsForm ()
 Init setting form. More...
 
 cancelSettings ()
 Cancel settings. More...
 
 saveSettings ()
 Save settings. More...
 
 showFeedUrl ()
 Show feed URL. More...
 
 getDynamic ()
 
 getDynamicReload ()
 
 getJSEnabler ()
 
 disableJS ()
 
 enableJS ()
 
- Public Member Functions inherited from ilBlockGUI
 getBlockType ()
 
 __construct ()
 Constructor. More...
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setPresentation (int $type)
 Set presentation. More...
 
 getPresentation ()
 Get presentation type. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands (bool $a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 getHTML ()
 Get HTML. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($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 ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 Get HTML. More...
 

Static Public Member Functions

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

Static Public Attributes

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

Protected Member Functions

 isRepositoryObject ()
 
 initPrivateSettingsForm ()
 
- Protected Member Functions inherited from ilNewsForContextBlockGUI
 isRepositoryObject ()
 
 getMediaPath (int $mob_id)
 
 getListItemForData (array $data)
 
 getNoItemFoundContent ()
 No item entry. More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 initCommands ()
 Init commands. More...
 
 fillRowColor ($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...
 
 getNoItemFoundContent ()
 No item entry. More...
 

Protected Attributes

 $acc_results = false
 
- Protected Attributes inherited from ilNewsForContextBlockGUI
 $help
 
 $settings
 
 $tabs
 
 $obj_definition
 
 $new_rendering = true
 
- Protected Attributes inherited from ilBlockGUI
 $ui
 
 $data = array()
 
 $enablenuminfo = true
 
 $footer_links = array()
 
 $block_id = 0
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $title = ""
 
 $admincommands = false
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 
 $presentation
 
 $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
 

Detailed Description

BlockGUI class for block NewsForContext.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id
class.ilNewsForContextBlockGUI.php 12920 2007-01-03 19:13:46Z akill

ilPDNewsBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPDNewsBlockGUI::__construct ( )

Constructor.

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

References ilBlockGUI\$data, $DIC, $ilUser, ilBlockGUI\$lng, ilBlockGUI\__construct(), ilNewsForContextBlockGUI\getDynamic(), getNewsData(), ilNewsForContextBlockGUI\handleView(), ilNewsItem\prepareNewsDataFromCache(), ilBlockGUI\setData(), ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), ilBlockGUI\setRowTemplate(), settings(), ilBlockGUI\setTitle(), and user().

26  {
27  global $DIC;
28 
29  $this->lng = $DIC->language();
30  $this->user = $DIC->user();
31  $this->access = $DIC->access();
32  $this->ctrl = $DIC->ctrl();
33  $this->settings = $DIC->settings();
34  $lng = $DIC->language();
35  $ilUser = $DIC->user();
36  $ilAccess = $DIC->access();
37  $this->obj_definition = $DIC["objDefinition"];
38 
39  // NOT ilNewsForContextBlockGUI::__construct() !
41 
42  $lng->loadLanguageModule("news");
43  include_once("./Services/News/classes/class.ilNewsItem.php");
44 
45  $this->setLimit(5);
46 
47  $this->dynamic = false;
48 
49  include_once("./Services/News/classes/class.ilNewsCache.php");
50  $this->acache = new ilNewsCache();
51  $cres = unserialize($this->acache->getEntry($ilUser->getId() . ":0"));
52  $this->cache_hit = false;
53  if ($this->acache->getLastAccessStatus() == "hit" && is_array($cres)) {
54  self::$st_data = ilNewsItem::prepareNewsDataFromCache($cres);
55  ;
56  $this->cache_hit = true;
57  }
58 
59  if ($this->getDynamic() && !$this->cache_hit) {
60  $this->dynamic = true;
61  $data = array();
62  } else {
63  // do not ask two times for the data (e.g. if user displays a
64  // single item on the personal desktop and the news block is
65  // displayed at the same time)
66  if (empty(self::$st_data)) {
67  self::$st_data = $this->getNewsData();
68  $data = self::$st_data;
69  } else {
70  $data = self::$st_data;
71  }
72  }
73 
74  $this->setTitle($lng->txt("news_internal_news"));
75  $this->setRowTemplate("tpl.block_row_news_for_context.html", "Services/News");
76 
77  $this->setData($data);
78 
79  $this->handleView();
80 
81  // reset access check results
82  $ilAccess->setResults($this->acc_results);
83 
84  $this->setPresentation(self::PRES_SEC_LIST);
85  }
settings()
Definition: settings.php:2
handleView()
Handles show/hide notification view and removes notifications if hidden.
static prepareNewsDataFromCache($a_cres)
Prepare news data from cache.
user()
Definition: user.php:4
News cache.
setTitle($a_title)
Set Title.
setData($a_data)
Set Data.
$ilUser
Definition: imgupload.php:18
__construct()
Constructor.
getNewsData()
Get news for context.
setLimit($a_limit)
Set Limit.
$DIC
Definition: xapitoken.php:46
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setPresentation(int $type)
Set presentation.
+ Here is the call graph for this function:

Member Function Documentation

◆ cancelSettings()

ilPDNewsBlockGUI::cancelSettings ( )

Cancel settings.

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

References ilBlockGUI\$ctrl, and $ilCtrl.

422  {
424 
425  $ilCtrl->returnToParent($this);
426  }
global $ilCtrl
Definition: ilias.php:18

◆ changeFeedSettings()

ilPDNewsBlockGUI::changeFeedSettings ( )

change user password

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

References ilBlockGUI\$ctrl, $ilCtrl, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$user, ilNewsForContextBlockGUI\editSettings(), ilUserPasswordManager\getInstance(), initPrivateSettingsForm(), and ilUtil\sendFailure().

458  {
460  $lng = $this->lng;
462 
463  $form = $this->initPrivateSettingsForm();
464  if ($form->checkInput()) {
465  // Deactivate private Feed - just delete the password
466  if (!$form->getInput("enable_private_feed")) {
467  $ilUser->_setFeedPass($ilUser->getId(), "");
468  ilUtil::sendSuccess($lng->txt("priv_feed_disabled"), true);
469  // $ilCtrl->returnToParent($this);
470  $ilCtrl->redirect($this, "showFeedUrl");
471  } else {
472  $passwd = $form->getInput("desired_password");
473  require_once 'Services/User/classes/class.ilUserPasswordManager.php';
474  if (ilUserPasswordManager::getInstance()->verifyPassword($ilUser, $passwd)) {
475  $form->getItemByPostVar("desired_password")->setAlert($lng->txt("passwd_equals_ilpasswd"));
476  ilUtil::sendFailure($lng->txt("form_input_not_valid"));
477  } else {
478  $ilUser->_setFeedPass($ilUser->getId(), $passwd);
479  ilUtil::sendSuccess($lng->txt("saved_successfully"), true);
480  // $ilCtrl->returnToParent($this);
481  $ilCtrl->redirect($this, "showFeedUrl");
482  }
483  }
484  }
485 
486  $form->setValuesByPost();
487  return $this->editSettings($form);
488  }
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Single method to reduce footprint (included files, created instances)
+ Here is the call graph for this function:

◆ editSettings()

ilPDNewsBlockGUI::editSettings ( ilPropertyFormGUI  $a_private_form = null)

Show settings screen.

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

References ilBlockGUI\$ctrl, $ilCtrl, $ilSetting, $ilUser, ilBlockGUI\$lng, ilNewsForContextBlockGUI\$settings, ilBlockGUI\$user, ilNewsItem\_lookupDefaultPDPeriod(), ilNewsItem\_lookupUserPDPeriod(), and initPrivateSettingsForm().

314  {
316  $lng = $this->lng;
319 
320  $news_set = new ilSetting("news");
321  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
322  $allow_shorter_periods = $news_set->get("allow_shorter_periods");
323  $allow_longer_periods = $news_set->get("allow_longer_periods");
324  $enable_private_feed = $news_set->get("enable_private_feed");
325 
326  if (!$a_private_form && ($allow_shorter_periods || $allow_longer_periods)) {
327  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
328  $form = new ilPropertyFormGUI();
329  $form->setFormAction($ilCtrl->getFormaction($this));
330  $form->setTitle($lng->txt("news_settings"));
331 
332  include_once("./Services/News/classes/class.ilNewsItem.php");
333  $default_per = ilNewsItem::_lookupDefaultPDPeriod();
334  $per = ilNewsItem::_lookupUserPDPeriod($ilUser->getId());
335 
336  $form->setTableWidth("100%");
337 
338  $per_opts = array(
339  7 => "1 " . $lng->txt("week"),
340  30 => "1 " . $lng->txt("month"),
341  366 => "1 " . $lng->txt("year"));
342 
343  $unset = array();
344  foreach ($per_opts as $k => $opt) {
345  if (!$allow_shorter_periods && ($k < $default_per)) {
346  $unset[$k] = $k;
347  }
348  if (!$allow_longer_periods && ($k > $default_per)) {
349  $unset[$k] = $k;
350  }
351  }
352  foreach ($unset as $k) {
353  unset($per_opts[$k]);
354  }
355 
356  $per_sel = new ilSelectInputGUI(
357  $lng->txt("news_pd_period"),
358  "news_pd_period"
359  );
360  //$per_sel->setInfo($lng->txt("news_pd_period_info"));
361  $per_sel->setOptions($per_opts);
362  $per_sel->setValue((int) $per);
363  $form->addItem($per_sel);
364 
365  //$form->addCheckboxProperty($lng->txt("news_public_feed"), "notifications_public_feed",
366  // "1", $public_feed, $lng->txt("news_public_feed_info"));
367  //if ($this->getProperty("public_notifications_option"))
368  //{
369  // $form->addCheckboxProperty($lng->txt("news_notifications_public"), "notifications_public",
370  // "1", $public, $lng->txt("news_notifications_public_info"));
371  //}
372  $form->addCommandButton("saveSettings", $lng->txt("save"));
373  $form->addCommandButton("cancelSettings", $lng->txt("cancel"));
374 
375  $returnForm = $form->getHTML();
376  }
377 
378  if ($enable_private_feed) {
379  if (!$a_private_form) {
380  $a_private_form = $this->initPrivateSettingsForm();
381  }
382  $returnForm .= ($returnForm == "")
383  ? $a_private_form->getHTML()
384  : "<br>" . $a_private_form->getHTML();
385  }
386 
387  return $returnForm;
388  }
This class represents a property form user interface.
static _lookupUserPDPeriod($a_user_id)
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
static _lookupDefaultPDPeriod()
+ Here is the call graph for this function:

◆ executeCommand()

ilPDNewsBlockGUI::executeCommand ( )

execute command

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

References ilBlockGUI\$ctrl, and $ilCtrl.

159  {
161 
162  $next_class = $ilCtrl->getNextClass();
163  $cmd = $ilCtrl->getCmd("getHTML");
164 
165  switch ($next_class) {
166  default:
167  return $this->$cmd();
168  }
169  }
global $ilCtrl
Definition: ilias.php:18

◆ fillDataSection()

ilPDNewsBlockGUI::fillDataSection ( )

Fill data section.

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

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

175  {
176  if ($this->dynamic) {
177  $this->setDataSection($this->getDynamicReload());
178  } elseif (count($this->getData()) > 0) {
179  parent::fillDataSection();
180  } else {
181  $this->setEnableNumInfo(false);
182  $this->setDataSection($this->getOverview());
183  }
184  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
getData()
Get Data.
+ Here is the call graph for this function:

◆ getBlockType()

ilPDNewsBlockGUI::getBlockType ( )

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

Referenced by saveSettings().

116  : string
117  {
118  return self::$block_type;
119  }
+ Here is the caller graph for this function:

◆ getHTML()

ilPDNewsBlockGUI::getHTML ( )

Get bloch HTML code.

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

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

190  {
192  $lng = $this->lng;
194 
195  // @todo: find another solution for this
196  //$this->setFooterInfo($lng->txt("news_block_information"), true);
197 
198  $news_set = new ilSetting("news");
199  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
200  $allow_shorter_periods = $news_set->get("allow_shorter_periods");
201  $allow_longer_periods = $news_set->get("allow_longer_periods");
202  $enable_private_feed = $news_set->get("enable_private_feed");
203 
204  // subscribe/unsibscribe link
205  include_once("./Services/News/classes/class.ilNewsSubscription.php");
206 
207  // show feed url
208  if ($enable_internal_rss) {
209  include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
210  // @todo: rss icon html ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_RSS)
211  $this->addBlockCommand(
212  $ilCtrl->getLinkTarget($this, "showFeedUrl"),
213  $lng->txt("news_get_feed_url")
214  );
215  }
216 
217  if ($allow_shorter_periods || $allow_longer_periods || $enable_private_feed) {
218  $this->addBlockCommand(
219  $ilCtrl->getLinkTarget($this, "editSettings"),
220  $lng->txt("settings")
221  );
222  }
223 
224  $en = "";
225  if ($ilUser->getPref("il_feed_js") == "n") {
226  $en = $this->getJSEnabler();
227  }
228 
229  return ilBlockGUI::getHTML() . $en;
230  }
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
getHTML()
Get HTML.
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
+ Here is the call graph for this function:

◆ getNewsData()

ilPDNewsBlockGUI::getNewsData ( )

Get news for context.

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

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

Referenced by __construct().

91  {
93 
94  include_once("./Services/News/classes/class.ilNewsCache.php");
95  $this->acache = new ilNewsCache();
96 
99  $ilUser->getId(),
100  false,
101  false,
102  $per
103  );
104 
105  $this->acache->storeEntry(
106  $ilUser->getId() . ":0",
107  serialize($data)
108  );
109 
110  return $data;
111  }
static _getNewsItemsOfUser( $a_user_id, $a_only_public=false, $a_prevent_aggregation=false, $a_per=0, &$a_cnt=null)
Get all news items for a user.
static _lookupUserPDPeriod($a_user_id)
News cache.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDNewsBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

References $_GET, $_POST, $DIC, $ilCtrl, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

133  {
134  global $DIC;
135 
136  $ilCtrl = $DIC->ctrl();
137 
138  $cmd = $_GET["cmd"];
139  if ($cmd == "post" && is_array($_POST["cmd"])) {
140  $cmd = array_pop(array_keys($_POST["cmd"]));
141  }
142 
143  switch ($cmd) {
144  case "showNews":
145  case "showFeedUrl":
146  case "editSettings":
147  case "changeFeedSettings":
148  return IL_SCREEN_CENTER;
149 
150  default:
151  return IL_SCREEN_SIDE;
152  }
153  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_CENTER
$DIC
Definition: xapitoken.php:46
const IL_SCREEN_SIDE
$_POST["username"]

◆ initPrivateSettingsForm()

ilPDNewsBlockGUI::initPrivateSettingsForm ( )
protected

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

References ilBlockGUI\$ctrl, $ilCtrl, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$user, ilUtil\getPasswordRequirementsInfo(), ilCheckboxInputGUI\setChecked(), and ilFormPropertyGUI\setRequired().

Referenced by changeFeedSettings(), and editSettings().

391  {
393  $lng = $this->lng;
395 
396  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
397  $feed_form = new ilPropertyFormGUI();
398  $feed_form->setFormAction($ilCtrl->getFormaction($this));
399  $feed_form->setTitle($lng->txt("priv_feed_settings"));
400 
401  $feed_form->setTableWidth("100%");
402 
403  $enable_private_feed = new ilCheckboxInputGUI($lng->txt("news_enable_private_feed"), "enable_private_feed");
404  $enable_private_feed->setChecked($ilUser->_getFeedPass($ilUser->getId()));
405  $feed_form->addItem($enable_private_feed);
406 
407  $passwd = new ilPasswordInputGUI($lng->txt("password"), "desired_password");
408  $passwd->setRequired(true);
409  $passwd->setInfo(ilUtil::getPasswordRequirementsInfo());
410  $enable_private_feed->addSubItem($passwd);
411 
412  $feed_form->addCommandButton("changeFeedSettings", $lng->txt("save"));
413  $feed_form->addCommandButton("cancelSettings", $lng->txt("cancel"));
414 
415  return $feed_form;
416  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()
global $ilCtrl
Definition: ilias.php:18
setChecked($a_checked)
Set Checked.
This class represents a password property in a property form.
$ilUser
Definition: imgupload.php:18
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

ilPDNewsBlockGUI::isRepositoryObject ( )
protected

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

124  : bool
125  {
126  return false;
127  }

◆ saveSettings()

ilPDNewsBlockGUI::saveSettings ( )

Save settings.

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

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

432  {
435 
436  $news_set = new ilSetting("news");
437  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
438 
440  $this->getBlockType(),
441  "news_pd_period",
442  $_POST["news_pd_period"],
443  $ilUser->getId(),
445  );
446 
447  include_once("./Services/News/classes/class.ilNewsCache.php");
448  $cache = new ilNewsCache();
449  $cache->deleteEntry($ilUser->getId() . ":0");
450 
451  $ilCtrl->returnToParent($this);
452  }
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
News cache.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ showFeedUrl()

ilPDNewsBlockGUI::showFeedUrl ( )

Show feed URL.

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

References ilBlockGUI\$ctrl, $GLOBALS, $ilCtrl, $ilSetting, $ilUser, ilBlockGUI\$lng, ilNewsForContextBlockGUI\$settings, ilBlockGUI\$tpl, ilBlockGUI\$user, ilObjUser\_lookupFeedHash(), and ILIAS_HTTP_PATH.

237  {
238  $lng = $this->lng;
242 
243  $news_set = new ilSetting("news");
244 
245 
246  include_once("./Services/News/classes/class.ilNewsItem.php");
247 
248  if ($news_set->get("enable_private_feed")) {
249  $tpl = new ilTemplate("tpl.show_priv_feed_url.html", true, true, "Services/News");
250 
251  $tpl->setVariable("TXT_PRIV_TITLE", $lng->txt("news_get_priv_feed_title"));
252 
253  // #14365
254  if ($ilUser->_getFeedPass($GLOBALS['DIC']['ilUser']->getId())) {
255  $tpl->setVariable("TXT_PRIV_INFO", $lng->txt("news_get_priv_feed_info"));
256  $tpl->setVariable("TXT_PRIV_FEED_URL", $lng->txt("news_feed_url"));
257  $tpl->setVariable(
258  "VAL_PRIV_FEED_URL",
259  str_replace("://", "://" . $ilUser->getLogin() . ":-password-@", ILIAS_HTTP_PATH) . "/privfeed.php?client_id=" . rawurlencode(CLIENT_ID) . "&user_id=" . $ilUser->getId() .
260  "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)
261  );
262  $tpl->setVariable(
263  "VAL_PRIV_FEED_URL_TXT",
264  str_replace("://", "://" . $ilUser->getLogin() . ":-password-@", ILIAS_HTTP_PATH) . "/privfeed.php?client_id=" . rawurlencode(CLIENT_ID) . "&<br />user_id=" . $ilUser->getId() .
265  "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)
266  );
267  } else {
268  $tpl->setVariable("TXT_PRIV_INFO", $lng->txt("news_inactive_private_feed_info"));
269  $tpl->setVariable("EDIT_SETTINGS_URL", $ilCtrl->getLinkTarget($this, "editSettings"));
270  $tpl->setVariable("EDIT_SETTINGS_TXT", $lng->txt("news_edit_news_settings"));
271  }
272  } else {
273  $tpl = new ilTemplate("tpl.show_feed_url.html", true, true, "Services/News");
274  }
275  $tpl->setVariable("TXT_TITLE", $lng->txt("news_get_feed_title"));
276  $tpl->setVariable("TXT_INFO", $lng->txt("news_get_feed_info"));
277  $tpl->setVariable("TXT_FEED_URL", $lng->txt("news_feed_url"));
278  $tpl->setVariable(
279  "VAL_FEED_URL",
280  ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&user_id=" . $ilUser->getId() .
281  "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)
282  );
283  $tpl->setVariable(
284  "VAL_FEED_URL_TXT",
285  ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&<br />user_id=" . $ilUser->getId() .
286  "&hash=" . ilObjUser::_lookupFeedHash($ilUser->getId(), true)
287  );
288 
289  $content_block = new ilDashboardContentBlockGUI();
290  $content_block->setContent($tpl->get());
291  $content_block->setTitle($lng->txt("news_internal_news"));
292 
293  return $content_block->getHTML();
294  }
global $ilCtrl
Definition: ilias.php:18
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
static _lookupFeedHash($a_user_id, $a_create=false)
Lookup news feed hash for user.
BlockGUI class for (centered) Content on Personal Desktop.
+ Here is the call graph for this function:

◆ showNews()

ilPDNewsBlockGUI::showNews ( )

show news

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

300  {
301  // workaround for dynamic mode (if cache is disabled, showNews has no data)
302  // if (empty(self::$st_data))
303  // {
304  // $this->setData($this->getNewsData());
305  // }
306 
307  return parent::showNews();
308  }

Field Documentation

◆ $acc_results

ilPDNewsBlockGUI::$acc_results = false
protected

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

◆ $block_type

ilPDNewsBlockGUI::$block_type = "pdnews"
static

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

◆ $st_data

ilPDNewsBlockGUI::$st_data
static

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


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