ILIAS  release_4-4 Revision
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

 ilPDExternalFeedBlockGUI ()
 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
 ilBlockGUI ()
 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)
 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"
 

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
- 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
 

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.

Member Function Documentation

◆ confirmDeleteFeedBlock()

ilPDExternalFeedBlockGUI::confirmDeleteFeedBlock ( )

Confirmation of feed block deletion.

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

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

458  {
459  global $ilCtrl, $lng;
460 
461  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
462  $c_gui = new ilConfirmationGUI();
463 
464  // set confirm/cancel commands
465  $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteFeedBlock"));
466  $c_gui->setHeaderText($lng->txt("info_delete_sure"));
467  $c_gui->setCancel($lng->txt("cancel"), "exitDeleteFeedBlock");
468  $c_gui->setConfirm($lng->txt("confirm"), "deleteFeedBlock");
469 
470  // add items to delete
471  $c_gui->addItem("external_feed_block_id",
472  $this->feed_block->getId(), $this->feed_block->getTitle(),
473  ilUtil::getImagePath("icon_feed.png"));
474 
475  return $c_gui->getHTML();
476  }
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)
global $lng
Definition: privfeed.php:40
Confirmation screen class.
+ Here is the call graph for this function:

◆ create()

ilPDExternalFeedBlockGUI::create ( )

Create Form for Block.

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

References ilExternalFeedBlockGUIGen\createFeedBlock().

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

◆ deleteFeedBlock()

ilPDExternalFeedBlockGUI::deleteFeedBlock ( )

Delete feed block.

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

References $ilCtrl.

492  {
493  global $ilCtrl;
494 
495  $this->feed_block->delete();
496  $ilCtrl->returnToParent($this);
497  }
global $ilCtrl
Definition: ilias.php:18

◆ disableJS()

ilPDExternalFeedBlockGUI::disableJS ( )

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

References $_SESSION, $ilCtrl, and $ilUser.

278  {
279  global $ilCtrl, $ilUser;
280 
281  $_SESSION["il_feed_js"] = "n";
282  $ilUser->writePref("il_feed_js", "n");
283  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
284  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15

◆ enableJS()

ilPDExternalFeedBlockGUI::enableJS ( )

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

References $_SESSION, $ilUser, exit, and getHTML().

287  {
288  global $ilUser;
289 
290  $_SESSION["il_feed_js"] = "y";
291  $ilUser->writePref("il_feed_js", "y");
292  echo $this->getHTML();
293  exit;
294  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
exit
Definition: login.php:54
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ executeCommand()

& ilPDExternalFeedBlockGUI::executeCommand ( )

execute command

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

References $cmd, and $ilCtrl.

133  {
134  global $ilCtrl;
135 
136  $next_class = $ilCtrl->getNextClass();
137  $cmd = $ilCtrl->getCmd("getHTML");
138 
139  switch ($next_class)
140  {
141  default:
142  return $this->$cmd();
143  }
144  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18

◆ exitDeleteFeedBlock()

ilPDExternalFeedBlockGUI::exitDeleteFeedBlock ( )

Cancel deletion of feed block.

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

References $ilCtrl.

482  {
483  global $ilCtrl;
484 
485  $ilCtrl->returnToParent($this);
486  }
global $ilCtrl
Definition: ilias.php:18

◆ fillDataSection()

ilPDExternalFeedBlockGUI::fillDataSection ( )

Fill data section.

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

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

150  {
151  if ($this->getDynamic())
152  {
153  $this->setDataSection($this->getDynamicReload());
154  }
155  else if ($this->getCurrentDetailLevel() > 1 && count($this->getData()) > 0)
156  {
157  parent::fillDataSection();
158  }
159  else
160  {
161  $this->setDataSection($this->getOverview());
162  }
163  }
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 299 of file class.ilPDExternalFeedBlockGUI.php.

References $ilCtrl, $ilUser, and $lng.

300  {
301  global $ilUser, $ilCtrl, $lng;
302 
303  $ilCtrl->setParameter($this, "feed_item_id", $item->getId());
304  $this->tpl->setVariable("VAL_TITLE", $item->getTitle());
305  $this->tpl->setVariable("HREF_SHOW",
306  $ilCtrl->getLinkTarget($this, "showFeedItem"));
307  $ilCtrl->setParameter($this, "feed_item_id", "");
308  }
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40

◆ getBlockType()

static ilPDExternalFeedBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

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

67  {
68  return self::$block_type;
69  }

◆ getDynamic()

ilPDExternalFeedBlockGUI::getDynamic ( )

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

References $_SESSION, $ilCtrl, and $ilUser.

Referenced by fillDataSection(), and getHTML().

216  {
217  global $ilCtrl, $ilUser;
218 
219  if ($ilCtrl->getCmdClass() != "ilcolumngui" && $ilCtrl->getCmd() != "enableJS")
220  {
221  $sess_feed_js = "";
222  if (isset($_SESSION["il_feed_js"]))
223  {
224  $sess_feed_js = $_SESSION["il_feed_js"];
225  }
226  if ($sess_feed_js != "n" &&
227  ($ilUser->getPref("il_feed_js") != "n" || $sess_feed_js == "y"))
228  {
229  // do not get feed dynamically, if cache hit is given.
230  if (!$this->feed->checkCacheHit())
231  {
232  return true;
233  }
234  }
235  }
236 
237  return false;
238  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ getDynamicReload()

ilPDExternalFeedBlockGUI::getDynamicReload ( )

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

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

Referenced by fillDataSection().

241  {
242  global $ilCtrl, $lng;
243 
244  $ilCtrl->setParameterByClass("ilcolumngui", "block_id",
245  "block_pdfeed_".$this->getBlockId());
246 
247  $rel_tpl = new ilTemplate("tpl.dynamic_reload.html", true, true, "Services/Feeds");
248  $rel_tpl->setVariable("TXT_LOADING", $lng->txt("feed_loading_feed"));
249  $rel_tpl->setVariable("BLOCK_ID", "block_pdfeed_".$this->getBlockId());
250  $rel_tpl->setVariable("TARGET",
251  $ilCtrl->getLinkTargetByClass("ilcolumngui", "updateBlock", "", true));
252 
253  // no JS
254  $rel_tpl->setVariable("TXT_FEED_CLICK_HERE", $lng->txt("feed_no_js_click_here"));
255  $rel_tpl->setVariable("TARGET_NO_JS",
256  $ilCtrl->getLinkTargetByClass("ilpdexternalfeedblockgui", "disableJS"));
257 
258  return $rel_tpl->get();
259  }
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
getBlockId()
Get Block Id.
global $lng
Definition: privfeed.php:40
+ 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 168 of file class.ilPDExternalFeedBlockGUI.php.

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

Referenced by enableJS().

169  {
170  global $ilCtrl, $lng, $ilUser, $ilAccess, $ilSetting;
171 
172  $feed_set = new ilSetting("feed");
173 
174  if ($ilSetting->get("block_limit_pdfeed") == 0)
175  {
176  return "";
177  }
178 
179  if ($this->getCurrentDetailLevel() == 0)
180  {
181  return "";
182  }
183 
184 
185  // if no dynamic reload
186  if (!$this->getDynamic())
187  {
188  $this->feed->fetch();
189  $this->setData($this->feed->getItems());
190  }
191 
192  $ilCtrl->setParameter($this, "external_feed_block_id",
193  $this->getBlockId());
194  $this->addBlockCommand(
195  $ilCtrl->getLinkTarget($this,
196  "editFeedBlock"),
197  $lng->txt("edit"));
198  $this->addBlockCommand(
199  $ilCtrl->getLinkTarget($this,
200  "confirmDeleteFeedBlock"),
201  $lng->txt("delete"));
202  $ilCtrl->setParameter($this, "external_feed_block_id", "");
203 
204  // JS enabler
205  $add = "";
206  if ($_SESSION["il_feed_js"] == "n" ||
207  ($ilUser->getPref("il_feed_js") == "n" && $_SESSION["il_feed_js"] != "y"))
208  {
209  $add = $this->getJSEnabler();
210  }
211 
212  return parent::getHTML().$add;
213  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
addBlockCommand($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false)
Add Block Command.
ILIAS Setting Class.
global $ilCtrl
Definition: ilias.php:18
setData($a_data)
Set Data.
$feed_set
Definition: privfeed.php:42
getBlockId()
Get Block Id.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
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 261 of file class.ilPDExternalFeedBlockGUI.php.

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

Referenced by getHTML().

262  {
263  global $ilCtrl, $lng;
264 
265  $ilCtrl->setParameterByClass("ilcolumngui", "block_id",
266  "block_pdfeed_".$this->getBlockId());
267 
268  $rel_tpl = new ilTemplate("tpl.js_enabler.html", true, true, "Services/Feeds");
269  $rel_tpl->setVariable("BLOCK_ID", "block_pdfeed_".$this->getBlockId());
270  $rel_tpl->setVariable("TARGET",
271  $ilCtrl->getLinkTargetByClass("ilpdexternalfeedblockgui", "enableJS", true));
272 
273  return $rel_tpl->get();
274  }
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
getBlockId()
Get Block Id.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOverview()

ilPDExternalFeedBlockGUI::getOverview ( )

Get overview.

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

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

Referenced by fillDataSection().

314  {
315  global $ilUser, $lng, $ilCtrl;
316 
317  $this->setEnableNumInfo(false);
318  return '<div class="small">'.((int) count($this->getData()))." ".$lng->txt("feed_feed_items")."</div>";
319  }
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $ilCtrl
Definition: ilias.php:18
getData()
Get Data.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ 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 84 of file class.ilPDExternalFeedBlockGUI.php.

References $ilCtrl, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

85  {
86  global $ilCtrl;
87 
88  switch($ilCtrl->getCmd())
89  {
90  case "create":
91  case "edit":
92  case "saveFeedBlock":
93  case "updateFeedBlock":
94  case "editFeedBlock":
95  case "showFeedItem":
96  case "confirmDeleteFeedBlock":
97  return IL_SCREEN_CENTER;
98  break;
99 
100  default:
101  return IL_SCREEN_SIDE;
102  break;
103  }
104  }
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_CENTER
const IL_SCREEN_SIDE

◆ ilPDExternalFeedBlockGUI()

ilPDExternalFeedBlockGUI::ilPDExternalFeedBlockGUI ( )

Constructor.

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

References $ilCtrl, $lng, ilUtil\getImagePath(), ilBlockGUI\setImage(), ilBlockGUI\setLimit(), and ilBlockGUI\setRowTemplate().

47  {
48  global $ilCtrl, $lng;
49 
50  parent::__construct();
51  parent::ilBlockGUI();
52 
53  $this->setImage(ilUtil::getImagePath("icon_feed_s.png"));
54 
55  $lng->loadLanguageModule("feed");
56 
57  $this->setLimit(5);
58  $this->setRowTemplate("tpl.block_external_feed_row.html", "Services/Feeds");
59  }
global $ilCtrl
Definition: ilias.php:18
setImage($a_image)
Set Image.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setLimit($a_limit)
Set Limit.
global $lng
Definition: privfeed.php:40
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
+ Here is the call graph for this function:

◆ 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 396 of file class.ilPDExternalFeedBlockGUI.php.

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

397  {
398  global $lng;
399 
400  $lng->loadLanguageModule("block");
401 
402  include("Services/Form/classes/class.ilPropertyFormGUI.php");
403 
404  $this->form_gui = new ilPropertyFormGUI();
405 
406  // Property Title
407  $text_input = new ilTextInputGUI($lng->txt("block_feed_block_title"), "block_title");
408  $text_input->setInfo("");
409  $text_input->setRequired(true);
410  $text_input->setMaxLength(200);
411  $this->form_gui->addItem($text_input);
412 
413  // Property FeedUrl
414  $text_input = new ilFeedUrlInputGUI($lng->txt("block_feed_block_feed_url"), "block_feed_url");
415  $text_input->setInfo($lng->txt("block_feed_block_feed_url_info"));
416  $text_input->setRequired(true);
417  $text_input->setMaxLength(250);
418  $this->form_gui->addItem($text_input);
419 
420 
421  // save and cancel commands
422  if (in_array($a_mode, array(IL_FORM_CREATE,IL_FORM_RE_CREATE)))
423  {
424  $this->form_gui->addCommandButton("saveFeedBlock", $lng->txt("save"));
425  $this->form_gui->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
426  }
427  else
428  {
429  $this->form_gui->addCommandButton("updateFeedBlock", $lng->txt("save"));
430  $this->form_gui->addCommandButton("cancelUpdateFeedBlock", $lng->txt("cancel"));
431  }
432 
433  $this->form_gui->setTitle($lng->txt("block_feed_block_head"));
434  $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
435 
436  $this->prepareFormFeedBlock($this->form_gui);
437 
438  }
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.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ isRepositoryObject()

static ilPDExternalFeedBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

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

77  {
78  return false;
79  }

◆ prepareSaveFeedBlock()

ilPDExternalFeedBlockGUI::prepareSaveFeedBlock ( $a_feed_block)

FORM FeedBlock: Prepare Saving of FeedBlock.

Parameters
object$a_feed_blockFeedBlock object.

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

References $ilCtrl.

446  {
447  global $ilCtrl;
448 
449  $a_feed_block->setContextObjId($ilCtrl->getContextObjId());
450  $a_feed_block->setContextObjType($ilCtrl->getContextObjType());
451  $a_feed_block->setType("pdfeed");
452  }
global $ilCtrl
Definition: ilias.php:18

◆ setBlock()

ilPDExternalFeedBlockGUI::setBlock (   $a_block)

Do most of the initialisation.

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

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

110  {
111  global $ilCtrl;
112 
113  // init block
114  $this->feed_block = $a_block;
115  $this->setTitle($this->feed_block->getTitle());
116  $this->setBlockId($this->feed_block->getId());
117 
118  // get feed object
119  include_once("./Services/Feeds/classes/class.ilExternalFeed.php");
120  $this->feed = new ilExternalFeed();
121  $this->feed->setUrl($this->feed_block->getFeedUrl());
122 
123  // init details
124  $this->setAvailableDetailLevels(2);
125 
126  $ilCtrl->setParameter($this, "block_id", $this->feed_block->getId());
127  }
Handles external Feeds via Magpie libaray.
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 324 of file class.ilPDExternalFeedBlockGUI.php.

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

325  {
326  global $lng, $ilCtrl;
327 
328  include_once("./Services/News/classes/class.ilNewsItem.php");
329 
330  $this->feed->fetch();
331  foreach($this->feed->getItems() as $item)
332  {
333  if ($item->getId() == $_GET["feed_item_id"])
334  {
335  $c_item = $item;
336  break;
337  }
338  }
339 
340  $tpl = new ilTemplate("tpl.show_feed_item.html", true, true, "Services/Feeds");
341 
342  if (is_object($c_item))
343  {
344  if (trim($c_item->getSummary()) != "") // summary
345  {
346  $tpl->setCurrentBlock("content");
347  $tpl->setVariable("VAL_CONTENT", $c_item->getSummary());
348  $tpl->parseCurrentBlock();
349  }
350  if (trim($c_item->getDate()) != "" || trim($c_item->getAuthor()) != "") // date
351  {
352  $tpl->setCurrentBlock("date_author");
353  if (trim($c_item->getAuthor()) != "")
354  {
355  $tpl->setVariable("VAL_AUTHOR", $c_item->getAuthor()." - ");
356  }
357  $tpl->setVariable("VAL_DATE", $c_item->getDate());
358  $tpl->parseCurrentBlock();
359  }
360 
361  if (trim($c_item->getLink()) != "") // link
362  {
363  $tpl->setCurrentBlock("plink");
364  $tpl->setVariable("HREF_LINK", $c_item->getLink());
365  $tpl->setVariable("TXT_LINK", $lng->txt("feed_open_source_page"));
366  $tpl->parseCurrentBlock();
367  }
368  $tpl->setVariable("VAL_TITLE", $c_item->getTitle()); // title
369  }
370 
371  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
372  $content_block = new ilPDContentBlockGUI();
373  $content_block->setContent($tpl->get());
374  $content_block->setTitle($this->getTitle());
375  $content_block->setImage(ilUtil::getImagePath("icon_feed.png"));
376  $content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
377  $lng->txt("selected_items_back"));
378 
379  return $content_block->getHTML();
380  }
$_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
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $lng
Definition: privfeed.php:40
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 41 of file class.ilPDExternalFeedBlockGUI.php.


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