ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPDExternalFeedBlockGUI Class Reference

BlockGUI class for external feed block on the personal desktop. More...

+ Inheritance diagram for ilPDExternalFeedBlockGUI:
+ Collaboration diagram for ilPDExternalFeedBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setBlock ($a_block)
 Do most of the initialisation. More...
 
 executeCommand ()
 execute command More...
 
 fillDataSection ()
 Fill data section. More...
 
 getHTML ()
 Get block HTML code. More...
 
 getDynamic ()
 
 getDynamicReload ()
 
 getJSEnabler ()
 
 disableJS ()
 
 enableJS ()
 
 fillRow ($item)
 Fill feed item row. More...
 
 getOverview ()
 Get overview. More...
 
 showFeedItem ()
 Show Feed Item. More...
 
 create ()
 Create Form for Block. More...
 
 initFormFeedBlock ($a_mode)
 FORM FeedBlock: Init form. More...
 
 prepareSaveFeedBlock (&$a_feed_block)
 FORM FeedBlock: Prepare Saving of FeedBlock. More...
 
 confirmDeleteFeedBlock ()
 Confirmation of feed block deletion. More...
 
 exitDeleteFeedBlock ()
 Cancel deletion of feed block. More...
 
 deleteFeedBlock ()
 Delete feed block. More...
 
- Public Member Functions inherited from ilExternalFeedBlockGUIGen
 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 setFormEditMode ($a_form_edit_mode)
 Set FormEditMode. More...
 
 getFormEditMode ()
 Get FormEditMode. More...
 
 createFeedBlock ()
 FORM FeedBlock: Create ExternalFeedBlock. More...
 
 editFeedBlock ()
 FORM FeedBlock: Edit form. More...
 
 saveFeedBlock ()
 FORM FeedBlock: Save ExternalFeedBlock. More...
 
 updateFeedBlock ()
 FORM FeedBlock: Update ExternalFeedBlock. More...
 
 initFormFeedBlock ($a_mode)
 FORM FeedBlock: Init form. More...
 
 getValuesFeedBlock ()
 FORM FeedBlock: Get current values for ExternalFeedBlock form. More...
 
 cancelSaveFeedBlock ()
 FORM FeedBlock: Cancel save. More...
 
 cancelUpdateFeedBlock ()
 FORM FeedBlock: Cancel update. More...
 
 exitSaveFeedBlock ()
 FORM FeedBlock: Exit save. More...
 
 exitUpdateFeedBlock ()
 FORM FeedBlock: Exit update. More...
 
 prepareSaveFeedBlock (&$a_external_feed_block)
 FORM FeedBlock: Prepare Saving of ExternalFeedBlock. More...
 
 prepareFormFeedBlock (&$a_form_gui)
 FORM FeedBlock: Prepare form. More...
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. 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...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. 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 ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. 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 ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ( $a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. 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...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

static getBlockType ()
 Get block type. More...
 
static isRepositoryObject ()
 Get block type. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "pdfeed"
 

Protected Attributes

 $settings
 
- Protected Attributes inherited from ilExternalFeedBlockGUIGen
 $gui_object
 
 $form_edit_mode
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Detailed Description

BlockGUI class for external feed block on the personal desktop.

Within the repository ilExternalFeedBlockGUI is used. is used.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilPDExternalFeedBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPDExternalFeedBlockGUI::__construct ( )

Constructor.

Definition at line 51 of file class.ilPDExternalFeedBlockGUI.php.

References $DIC, ilBlockGUI\$lng, ilBlockGUI\setLimit(), ilBlockGUI\setRowTemplate(), settings(), and user().

52  {
53  global $DIC;
54 
55  $this->ctrl = $DIC->ctrl();
56  $this->lng = $DIC->language();
57  $this->user = $DIC->user();
58  $this->access = $DIC->access();
59  $this->settings = $DIC->settings();
60  $lng = $DIC->language();
61 
62  parent::__construct();
63 
64  $lng->loadLanguageModule("feed");
65 
66  $this->setLimit(5);
67  $this->setRowTemplate("tpl.block_external_feed_row.html", "Services/Feeds");
68  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
setLimit($a_limit)
Set Limit.
settings()
Definition: settings.php:2
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
+ Here is the call graph for this function:

Member Function Documentation

◆ confirmDeleteFeedBlock()

ilPDExternalFeedBlockGUI::confirmDeleteFeedBlock ( )

Confirmation of feed block deletion.

Definition at line 473 of file class.ilPDExternalFeedBlockGUI.php.

References ilBlockGUI\$ctrl, $ilCtrl, ilBlockGUI\$lng, and ilUtil\getImagePath().

474  {
476  $lng = $this->lng;
477 
478  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
479  $c_gui = new ilConfirmationGUI();
480 
481  // set confirm/cancel commands
482  $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteFeedBlock"));
483  $c_gui->setHeaderText($lng->txt("info_delete_sure"));
484  $c_gui->setCancel($lng->txt("cancel"), "exitDeleteFeedBlock");
485  $c_gui->setConfirm($lng->txt("confirm"), "deleteFeedBlock");
486 
487  // add items to delete
488  $c_gui->addItem(
489  "external_feed_block_id",
490  $this->feed_block->getId(),
491  $this->feed_block->getTitle(),
492  ilUtil::getImagePath("icon_feed.svg")
493  );
494 
495  return $c_gui->getHTML();
496  }
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Confirmation screen class.
+ Here is the call graph for this function:

◆ create()

ilPDExternalFeedBlockGUI::create ( )

Create Form for Block.

Definition at line 405 of file class.ilPDExternalFeedBlockGUI.php.

References ilExternalFeedBlockGUIGen\createFeedBlock().

406  {
407  return $this->createFeedBlock();
408  }
createFeedBlock()
FORM FeedBlock: Create ExternalFeedBlock.
+ Here is the call graph for this function:

◆ deleteFeedBlock()

ilPDExternalFeedBlockGUI::deleteFeedBlock ( )

Delete feed block.

Definition at line 511 of file class.ilPDExternalFeedBlockGUI.php.

References ilBlockGUI\$ctrl, and $ilCtrl.

512  {
514 
515  $this->feed_block->delete();
516  $ilCtrl->returnToParent($this);
517  }
global $ilCtrl
Definition: ilias.php:18

◆ disableJS()

ilPDExternalFeedBlockGUI::disableJS ( )

Definition at line 298 of file class.ilPDExternalFeedBlockGUI.php.

References $_SESSION, ilBlockGUI\$ctrl, $ilCtrl, $ilUser, and ilBlockGUI\$user.

299  {
302 
303  $_SESSION["il_feed_js"] = "n";
304  $ilUser->writePref("il_feed_js", "n");
305  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
306  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18

◆ enableJS()

ilPDExternalFeedBlockGUI::enableJS ( )

Definition at line 308 of file class.ilPDExternalFeedBlockGUI.php.

References $_SESSION, $ilUser, ilBlockGUI\$user, exit, and getHTML().

309  {
311 
312  $_SESSION["il_feed_js"] = "y";
313  $ilUser->writePref("il_feed_js", "y");
314  echo $this->getHTML();
315  exit;
316  }
$_SESSION["AccountId"]
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ executeCommand()

ilPDExternalFeedBlockGUI::executeCommand ( )

execute command

Definition at line 142 of file class.ilPDExternalFeedBlockGUI.php.

References ilBlockGUI\$ctrl, and $ilCtrl.

143  {
145 
146  $next_class = $ilCtrl->getNextClass();
147  $cmd = $ilCtrl->getCmd("getHTML");
148 
149  switch ($next_class) {
150  default:
151  return $this->$cmd();
152  }
153  }
global $ilCtrl
Definition: ilias.php:18

◆ exitDeleteFeedBlock()

ilPDExternalFeedBlockGUI::exitDeleteFeedBlock ( )

Cancel deletion of feed block.

Definition at line 501 of file class.ilPDExternalFeedBlockGUI.php.

References ilBlockGUI\$ctrl, and $ilCtrl.

502  {
504 
505  $ilCtrl->returnToParent($this);
506  }
global $ilCtrl
Definition: ilias.php:18

◆ fillDataSection()

ilPDExternalFeedBlockGUI::fillDataSection ( )

Fill data section.

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

References ilBlockGUI\getCurrentDetailLevel(), ilBlockGUI\getData(), getDynamic(), getDynamicReload(), getOverview(), and ilBlockGUI\setDataSection().

159  {
160  if ($this->getDynamic()) {
161  $this->setDataSection($this->getDynamicReload());
162  } elseif ($this->getCurrentDetailLevel() > 1 && count($this->getData()) > 0) {
163  parent::fillDataSection();
164  } else {
165  $this->setDataSection($this->getOverview());
166  }
167  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
getData()
Get Data.
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ fillRow()

ilPDExternalFeedBlockGUI::fillRow (   $item)

Fill feed item row.

Definition at line 321 of file class.ilPDExternalFeedBlockGUI.php.

References ilBlockGUI\$ctrl, and $ilCtrl.

322  {
324 
325  $ilCtrl->setParameter($this, "feed_item_id", $item->getId());
326  $this->tpl->setVariable("VAL_TITLE", $item->getTitle());
327  $this->tpl->setVariable(
328  "HREF_SHOW",
329  $ilCtrl->getLinkTarget($this, "showFeedItem")
330  );
331  $ilCtrl->setParameter($this, "feed_item_id", "");
332  }
global $ilCtrl
Definition: ilias.php:18

◆ getBlockType()

static ilPDExternalFeedBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Definition at line 75 of file class.ilPDExternalFeedBlockGUI.php.

76  {
77  return self::$block_type;
78  }

◆ getDynamic()

ilPDExternalFeedBlockGUI::getDynamic ( )

Definition at line 226 of file class.ilPDExternalFeedBlockGUI.php.

References $_SESSION, ilBlockGUI\$ctrl, $ilCtrl, $ilUser, and ilBlockGUI\$user.

Referenced by fillDataSection(), and getHTML().

227  {
230 
231  if ($ilCtrl->getCmdClass() != "ilcolumngui" && $ilCtrl->getCmd() != "enableJS") {
232  $sess_feed_js = "";
233  if (isset($_SESSION["il_feed_js"])) {
234  $sess_feed_js = $_SESSION["il_feed_js"];
235  }
236  if ($sess_feed_js != "n" &&
237  ($ilUser->getPref("il_feed_js") != "n" || $sess_feed_js == "y")) {
238  // do not get feed dynamically, if cache hit is given.
239  if (!$this->feed->checkCacheHit()) {
240  return true;
241  }
242  }
243  }
244 
245  return false;
246  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the caller graph for this function:

◆ getDynamicReload()

ilPDExternalFeedBlockGUI::getDynamicReload ( )

Definition at line 248 of file class.ilPDExternalFeedBlockGUI.php.

References ilBlockGUI\$ctrl, $ilCtrl, ilBlockGUI\$lng, and ilBlockGUI\getBlockId().

Referenced by fillDataSection().

249  {
251  $lng = $this->lng;
252 
253  $ilCtrl->setParameterByClass(
254  "ilcolumngui",
255  "block_id",
256  "block_pdfeed_" . $this->getBlockId()
257  );
258 
259  $rel_tpl = new ilTemplate("tpl.dynamic_reload.html", true, true, "Services/Feeds");
260  $rel_tpl->setVariable("TXT_LOADING", $lng->txt("feed_loading_feed"));
261  $rel_tpl->setVariable("BLOCK_ID", "block_pdfeed_" . $this->getBlockId());
262  $rel_tpl->setVariable(
263  "TARGET",
264  $ilCtrl->getLinkTargetByClass("ilcolumngui", "updateBlock", "", true)
265  );
266 
267  // no JS
268  $rel_tpl->setVariable("TXT_FEED_CLICK_HERE", $lng->txt("feed_no_js_click_here"));
269  $rel_tpl->setVariable(
270  "TARGET_NO_JS",
271  $ilCtrl->getLinkTargetByClass("ilpdexternalfeedblockgui", "disableJS")
272  );
273 
274  return $rel_tpl->get();
275  }
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
getBlockId()
Get Block Id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilPDExternalFeedBlockGUI::getHTML ( )

Get block HTML code.

Definition at line 172 of file class.ilPDExternalFeedBlockGUI.php.

References $_SESSION, ilBlockGUI\$ctrl, $ilCtrl, $ilSetting, $ilUser, ilBlockGUI\$lng, $settings, ilBlockGUI\$user, ilBlockGUI\addBlockCommand(), ilBlockGUI\getBlockId(), ilBlockGUI\getCurrentDetailLevel(), getDynamic(), getJSEnabler(), and ilBlockGUI\setData().

Referenced by enableJS().

173  {
175  $lng = $this->lng;
178 
179 
180  if ($ilSetting->get("block_limit_pdfeed") == 0) {
181  return "";
182  }
183 
184  if ($this->getCurrentDetailLevel() == 0) {
185  return "";
186  }
187 
188 
189  // if no dynamic reload
190  if (!$this->getDynamic()) {
191  $this->feed->fetch();
192  $this->setData($this->feed->getItems());
193  }
194 
195  $ilCtrl->setParameter(
196  $this,
197  "external_feed_block_id",
198  $this->getBlockId()
199  );
200  $this->addBlockCommand(
201  $ilCtrl->getLinkTarget(
202  $this,
203  "editFeedBlock"
204  ),
205  $lng->txt("edit")
206  );
207  $this->addBlockCommand(
208  $ilCtrl->getLinkTarget(
209  $this,
210  "confirmDeleteFeedBlock"
211  ),
212  $lng->txt("delete")
213  );
214  $ilCtrl->setParameter($this, "external_feed_block_id", "");
215 
216  // JS enabler
217  $add = "";
218  if ($_SESSION["il_feed_js"] == "n" ||
219  ($ilUser->getPref("il_feed_js") == "n" && $_SESSION["il_feed_js"] != "y")) {
220  $add = $this->getJSEnabler();
221  }
222 
223  return parent::getHTML() . $add;
224  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
setData($a_data)
Set Data.
$ilUser
Definition: imgupload.php:18
getBlockId()
Get Block Id.
addBlockCommand( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
global $ilSetting
Definition: privfeed.php:17
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getJSEnabler()

ilPDExternalFeedBlockGUI::getJSEnabler ( )

Definition at line 277 of file class.ilPDExternalFeedBlockGUI.php.

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

Referenced by getHTML().

278  {
280 
281  $ilCtrl->setParameterByClass(
282  "ilcolumngui",
283  "block_id",
284  "block_pdfeed_" . $this->getBlockId()
285  );
286 
287  $rel_tpl = new ilTemplate("tpl.js_enabler.html", true, true, "Services/Feeds");
288  $rel_tpl->setVariable("BLOCK_ID", "block_pdfeed_" . $this->getBlockId());
289  $rel_tpl->setVariable(
290  "TARGET",
291  $ilCtrl->getLinkTargetByClass("ilpdexternalfeedblockgui", "enableJS", true)
292  );
293 
294  return $rel_tpl->get();
295  }
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
getBlockId()
Get Block Id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOverview()

ilPDExternalFeedBlockGUI::getOverview ( )

Get overview.

Definition at line 337 of file class.ilPDExternalFeedBlockGUI.php.

References ilBlockGUI\$lng, ilBlockGUI\getData(), and ilBlockGUI\setEnableNumInfo().

Referenced by fillDataSection().

338  {
339  $lng = $this->lng;
340 
341  $this->setEnableNumInfo(false);
342  return '<div class="small">' . ((int) count($this->getData())) . " " . $lng->txt("feed_feed_items") . "</div>";
343  }
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
getData()
Get Data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDExternalFeedBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

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

94  {
95  global $DIC;
96 
97  $ilCtrl = $DIC->ctrl();
98 
99  switch ($ilCtrl->getCmd()) {
100  case "create":
101  case "edit":
102  case "saveFeedBlock":
103  case "updateFeedBlock":
104  case "editFeedBlock":
105  case "showFeedItem":
106  case "confirmDeleteFeedBlock":
107  return IL_SCREEN_CENTER;
108  break;
109 
110  default:
111  return IL_SCREEN_SIDE;
112  break;
113  }
114  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_CENTER
const IL_SCREEN_SIDE

◆ initFormFeedBlock()

ilPDExternalFeedBlockGUI::initFormFeedBlock (   $a_mode)

FORM FeedBlock: Init form.

(We need to overwrite, because Generator does not know FeedUrl Inputs yet.

Parameters
int$a_modeForm Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)

Definition at line 416 of file class.ilPDExternalFeedBlockGUI.php.

References ilBlockGUI\$lng, array, IL_FORM_CREATE, IL_FORM_RE_CREATE, ilExternalFeedBlockGUIGen\prepareFormFeedBlock(), and ilFormPropertyGUI\setInfo().

417  {
418  $lng = $this->lng;
419 
420  $lng->loadLanguageModule("block");
421 
422  require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
423 
424  $this->form_gui = new ilPropertyFormGUI();
425 
426  // Property Title
427  $text_input = new ilTextInputGUI($lng->txt("block_feed_block_title"), "block_title");
428  $text_input->setInfo("");
429  $text_input->setRequired(true);
430  $text_input->setMaxLength(200);
431  $this->form_gui->addItem($text_input);
432 
433  // Property FeedUrl
434  $text_input = new ilFeedUrlInputGUI($lng->txt("block_feed_block_feed_url"), "block_feed_url");
435  $text_input->setInfo($lng->txt("block_feed_block_feed_url_info"));
436  $text_input->setRequired(true);
437  $text_input->setMaxLength(250);
438  $this->form_gui->addItem($text_input);
439 
440 
441  // save and cancel commands
442  if (in_array($a_mode, array(IL_FORM_CREATE,IL_FORM_RE_CREATE))) {
443  $this->form_gui->addCommandButton("saveFeedBlock", $lng->txt("save"));
444  $this->form_gui->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
445  } else {
446  $this->form_gui->addCommandButton("updateFeedBlock", $lng->txt("save"));
447  $this->form_gui->addCommandButton("cancelUpdateFeedBlock", $lng->txt("cancel"));
448  }
449 
450  $this->form_gui->setTitle($lng->txt("block_feed_block_head"));
451  $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
452 
453  $this->prepareFormFeedBlock($this->form_gui);
454  }
This class represents a feed url property in a property form.
prepareFormFeedBlock(&$a_form_gui)
FORM FeedBlock: Prepare form.
This class represents a property form user interface.
setInfo($a_info)
Set Information Text.
This class represents a text property in a property form.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ isRepositoryObject()

static ilPDExternalFeedBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

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

86  {
87  return false;
88  }

◆ prepareSaveFeedBlock()

ilPDExternalFeedBlockGUI::prepareSaveFeedBlock ( $a_feed_block)

FORM FeedBlock: Prepare Saving of FeedBlock.

Parameters
object$a_feed_blockFeedBlock object.

Definition at line 461 of file class.ilPDExternalFeedBlockGUI.php.

References ilBlockGUI\$ctrl, and $ilCtrl.

462  {
464 
465  $a_feed_block->setContextObjId($ilCtrl->getContextObjId());
466  $a_feed_block->setContextObjType($ilCtrl->getContextObjType());
467  $a_feed_block->setType("pdfeed");
468  }
global $ilCtrl
Definition: ilias.php:18

◆ setBlock()

ilPDExternalFeedBlockGUI::setBlock (   $a_block)

Do most of the initialisation.

Definition at line 119 of file class.ilPDExternalFeedBlockGUI.php.

References ilBlockGUI\$ctrl, $ilCtrl, ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setBlockId(), and ilBlockGUI\setTitle().

120  {
122 
123  // init block
124  $this->feed_block = $a_block;
125  $this->setTitle($this->feed_block->getTitle());
126  $this->setBlockId($this->feed_block->getId());
127 
128  // get feed object
129  include_once("./Services/Feeds/classes/class.ilExternalFeed.php");
130  $this->feed = new ilExternalFeed();
131  $this->feed->setUrl($this->feed_block->getFeedUrl());
132 
133  // init details
134  $this->setAvailableDetailLevels(2);
135 
136  $ilCtrl->setParameter($this, "block_id", $this->feed_block->getId());
137  }
Handles external Feeds via Magpie library.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
+ Here is the call graph for this function:

◆ showFeedItem()

ilPDExternalFeedBlockGUI::showFeedItem ( )

Show Feed Item.

Definition at line 348 of file class.ilPDExternalFeedBlockGUI.php.

References $_GET, ilBlockGUI\$ctrl, $ilCtrl, ilBlockGUI\$lng, ilBlockGUI\$tpl, ilUtil\getImagePath(), and ilBlockGUI\getTitle().

349  {
350  $lng = $this->lng;
352 
353  include_once("./Services/News/classes/class.ilNewsItem.php");
354 
355  $this->feed->fetch();
356  foreach ($this->feed->getItems() as $item) {
357  if ($item->getId() == $_GET["feed_item_id"]) {
358  $c_item = $item;
359  break;
360  }
361  }
362 
363  $tpl = new ilTemplate("tpl.show_feed_item.html", true, true, "Services/Feeds");
364 
365  if (is_object($c_item)) {
366  if (trim($c_item->getSummary()) != "") { // summary
367  $tpl->setCurrentBlock("content");
368  $tpl->setVariable("VAL_CONTENT", $c_item->getSummary());
369  $tpl->parseCurrentBlock();
370  }
371  if (trim($c_item->getDate()) != "" || trim($c_item->getAuthor()) != "") { // date
372  $tpl->setCurrentBlock("date_author");
373  if (trim($c_item->getAuthor()) != "") {
374  $tpl->setVariable("VAL_AUTHOR", $c_item->getAuthor() . " - ");
375  }
376  $tpl->setVariable("VAL_DATE", $c_item->getDate());
377  $tpl->parseCurrentBlock();
378  }
379 
380  if (trim($c_item->getLink()) != "") { // link
381  $tpl->setCurrentBlock("plink");
382  $tpl->setVariable("HREF_LINK", $c_item->getLink());
383  $tpl->setVariable("TXT_LINK", $lng->txt("feed_open_source_page"));
384  $tpl->parseCurrentBlock();
385  }
386  $tpl->setVariable("VAL_TITLE", $c_item->getTitle()); // title
387  }
388 
389  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
390  $content_block = new ilPDContentBlockGUI();
391  $content_block->setContent($tpl->get());
392  $content_block->setTitle($this->getTitle());
393  $content_block->setImage(ilUtil::getImagePath("icon_feed.svg"));
394  $content_block->addHeaderCommand(
395  $ilCtrl->getParentReturn($this),
396  $lng->txt("selected_items_back")
397  );
398 
399  return $content_block->getHTML();
400  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
BlockGUI class for (centered) Content on Personal Desktop.
getTitle()
Get Title.
+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilPDExternalFeedBlockGUI::$block_type = "pdfeed"
static

Definition at line 46 of file class.ilPDExternalFeedBlockGUI.php.

◆ $settings

ilPDExternalFeedBlockGUI::$settings
protected

Definition at line 44 of file class.ilPDExternalFeedBlockGUI.php.

Referenced by getHTML().


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