ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilExternalFeedBlockGUI Class Reference

BlockGUI class for external feed block. More...

+ Inheritance diagram for ilExternalFeedBlockGUI:
+ Collaboration diagram for ilExternalFeedBlockGUI:

Public Member Functions

 ilExternalFeedBlockGUI ()
 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...
 
 initImportForm ($a_new_type="")
 Init object import form. More...
 
 importFile ()
 Import. More...
 
 initFormFeedBlock ($a_mode)
 FORM FeedBlock: Init form. More...
 
 prepareSaveFeedBlock (&$a_feed_block)
 FORM FeedBlock: Prepare Saving of FeedBlock. More...
 
 exitSaveFeedBlock ()
 FORM FeedBlock: Exit save. More...
 
 cancelUpdateFeedBlock ()
 FORM FeedBlock: Exit save. More...
 
 exitUpdateFeedBlock ()
 FORM FeedBlock: Exit save. 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, $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 = "feed"
 

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.

This is the one that is used within the repository. On the personal desktop ilPDExternalFeedBlockGUI is used.

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

ilExternalFeedBlockGUI: ilColumnGUI

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

Member Function Documentation

◆ cancelUpdateFeedBlock()

ilExternalFeedBlockGUI::cancelUpdateFeedBlock ( )

FORM FeedBlock: Exit save.

(Can be overwritten in derived classes)

Definition at line 538 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, and ilExternalFeedBlockGUIGen\getGuiObject().

539  {
540  global $ilCtrl;
541 
542  $this->getGuiObject()->cancelUpdate();
543  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ create()

ilExternalFeedBlockGUI::create ( )

Create Form for Block.

Definition at line 370 of file class.ilExternalFeedBlockGUI.php.

References ilExternalFeedBlockGUIGen\createFeedBlock(), and initImportForm().

371  {
372  $html1 = $this->createFeedBlock();
373 
374  $html2 = "";
375  if (DEVMODE == 1)
376  {
377  $this->initImportForm("feed");
378  $html2 = "<br/>".$this->form->getHTML();
379  }
380 
381  return $html1.$html2;
382  }
createFeedBlock()
FORM FeedBlock: Create ExternalFeedBlock.
initImportForm($a_new_type="")
Init object import form.
+ Here is the call graph for this function:

◆ disableJS()

ilExternalFeedBlockGUI::disableJS ( )

Definition at line 253 of file class.ilExternalFeedBlockGUI.php.

References $_SESSION, $ilCtrl, and $ilUser.

254  {
255  global $ilCtrl, $ilUser;
256 
257  $_SESSION["il_feed_js"] = "n";
258  $ilUser->writePref("il_feed_js", "n");
259  $ilCtrl->returnToParent($this);
260  }
< 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()

ilExternalFeedBlockGUI::enableJS ( )

Definition at line 262 of file class.ilExternalFeedBlockGUI.php.

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

263  {
264  global $ilUser;
265 
266  $_SESSION["il_feed_js"] = "y";
267  $ilUser->writePref("il_feed_js", "y");
268  echo $this->getHTML();
269  exit;
270  }
< 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()

& ilExternalFeedBlockGUI::executeCommand ( )

execute command

Definition at line 110 of file class.ilExternalFeedBlockGUI.php.

References $cmd, and $ilCtrl.

111  {
112  global $ilCtrl;
113 
114  $next_class = $ilCtrl->getNextClass();
115  $cmd = $ilCtrl->getCmd("getHTML");
116 
117  switch ($next_class)
118  {
119  default:
120  return $this->$cmd();
121  }
122  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18

◆ exitSaveFeedBlock()

ilExternalFeedBlockGUI::exitSaveFeedBlock ( )

FORM FeedBlock: Exit save.

(Can be overwritten in derived classes)

Definition at line 527 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, and ilExternalFeedBlockGUIGen\getGuiObject().

Referenced by importFile().

528  {
529  global $ilCtrl;
530 
531  $this->getGuiObject()->exitSave();
532  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exitUpdateFeedBlock()

ilExternalFeedBlockGUI::exitUpdateFeedBlock ( )

FORM FeedBlock: Exit save.

(Can be overwritten in derived classes)

Definition at line 549 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, and ilExternalFeedBlockGUIGen\getGuiObject().

550  {
551  global $ilCtrl;
552 
553  $this->getGuiObject()->update($this->external_feed_block);
554  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ fillDataSection()

ilExternalFeedBlockGUI::fillDataSection ( )

Fill data section.

Definition at line 127 of file class.ilExternalFeedBlockGUI.php.

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

128  {
129  if ($this->getDynamic())
130  {
131  $this->setDataSection($this->getDynamicReload());
132  }
133  else if ($this->getCurrentDetailLevel() > 1 && count($this->getData()) > 0)
134  {
135  parent::fillDataSection();
136  }
137  else
138  {
139  $this->setDataSection($this->getOverview());
140  }
141  }
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()

ilExternalFeedBlockGUI::fillRow (   $item)

Fill feed item row.

Definition at line 275 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, $ilUser, $lng, and isRepositoryObject().

276  {
277  global $ilUser, $ilCtrl, $lng, $ilAccess;
278 
279  if ($this->isRepositoryObject() && !$ilAccess->checkAccess("read", "", $this->getRefId()))
280  {
281  $this->tpl->setVariable("TXT_TITLE", $item->getTitle());
282  }
283  else
284  {
285  $ilCtrl->setParameter($this, "feed_item_id", $item->getId());
286  $this->tpl->setCurrentBlock("feed_link");
287  $this->tpl->setVariable("VAL_TITLE", $item->getTitle());
288  $this->tpl->setVariable("HREF_SHOW",
289  $ilCtrl->getLinkTarget($this, "showFeedItem"));
290  $ilCtrl->setParameter($this, "feed_item_id", "");
291  $this->tpl->parseCurrentBlock();
292  }
293  }
static isRepositoryObject()
Get block type.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getBlockType()

static ilExternalFeedBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

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

Referenced by prepareSaveFeedBlock().

45  {
46  return self::$block_type;
47  }
+ Here is the caller graph for this function:

◆ getDynamic()

ilExternalFeedBlockGUI::getDynamic ( )

Definition at line 196 of file class.ilExternalFeedBlockGUI.php.

References $_SESSION, $ilCtrl, and $ilUser.

Referenced by fillDataSection(), and getHTML().

197  {
198  global $ilCtrl, $ilUser;
199 
200  if ($ilCtrl->getCmdClass() != "ilcolumngui" && $ilCtrl->getCmd() != "enableJS")
201  {
202  if ($_SESSION["il_feed_js"] != "n" &&
203  ($ilUser->getPref("il_feed_js") != "n" || $_SESSION["il_feed_js"] == "y"))
204  {
205  // do not get feed dynamically, if cache hit is given.
206  if (!$this->feed->checkCacheHit())
207  {
208  return true;
209  }
210  }
211  }
212 
213  return false;
214  }
< 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()

ilExternalFeedBlockGUI::getDynamicReload ( )

Definition at line 216 of file class.ilExternalFeedBlockGUI.php.

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

Referenced by fillDataSection().

217  {
218  global $ilCtrl, $lng;
219 
220  $ilCtrl->setParameterByClass("ilcolumngui", "block_id",
221  "block_feed_".$this->getBlockId());
222 
223  $rel_tpl = new ilTemplate("tpl.dynamic_reload.html", true, true, "Services/Feeds");
224  $rel_tpl->setVariable("TXT_LOADING", $lng->txt("feed_loading_feed"));
225  $rel_tpl->setVariable("BLOCK_ID", "block_feed_".$this->getBlockId());
226  $rel_tpl->setVariable("TARGET",
227  $ilCtrl->getLinkTargetByClass("ilcolumngui", "updateBlock", "", true));
228 
229  // no JS
230  $rel_tpl->setVariable("TXT_FEED_CLICK_HERE", $lng->txt("feed_no_js_click_here"));
231  $rel_tpl->setVariable("TARGET_NO_JS",
232  $ilCtrl->getLinkTargetByClass("ilexternalfeedblockgui", "disableJS"));
233 
234  return $rel_tpl->get();
235  }
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()

ilExternalFeedBlockGUI::getHTML ( )

Get block HTML code.

Definition at line 146 of file class.ilExternalFeedBlockGUI.php.

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

Referenced by enableJS().

147  {
148  global $ilCtrl, $lng, $ilUser, $ilAccess, $ilSetting;
149 
150  if ($this->getCurrentDetailLevel() == 0)
151  {
152  return "";
153  }
154 
155  $feed_set = new ilSetting("feed");
156 
157  if ($feed_set->get("disable_rep_feeds"))
158  {
159  return "";
160  }
161 
162  // if no dynamic reload
163  if (!$this->getDynamic())
164  {
165  $this->feed->fetch();
166  $this->setData($this->feed->getItems());
167  }
168 
169  //$this->setTitle($this->feed->getChannelTitle());
170  $this->setData($this->feed->getItems());
171 
172  if ($ilAccess->checkAccess("write", "", $this->getRefId()))
173  {
174  $ilCtrl->setParameterByClass("ilobjexternalfeedgui",
175  "ref_id", $this->getRefId());
176  $ilCtrl->setParameter($this, "external_feed_block_id", $this->getBlockId());
177  $this->addBlockCommand(
178  $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjexternalfeedgui",
179  "ilexternalfeedblockgui"),
180  "editFeedBlock"),
181  $lng->txt("settings"));
182  $ilCtrl->clearParametersByClass("ilobjexternalfeedgui");
183  }
184 
185  // JS enabler
186  $add = "";
187  if ($_SESSION["il_feed_js"] == "n" ||
188  ($ilUser->getPref("il_feed_js") == "n" && $_SESSION["il_feed_js"] != "y"))
189  {
190  $add = $this->getJSEnabler();
191  }
192 
193  return parent::getHTML().$add;
194  }
< 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']
ILIAS Setting Class.
addBlockCommand($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
global $ilCtrl
Definition: ilias.php:18
setData($a_data)
Set Data.
$feed_set
Definition: privfeed.php:42
getBlockId()
Get Block Id.
getRefId()
Get Ref Id (only used if isRepositoryObject() is true).
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()

ilExternalFeedBlockGUI::getJSEnabler ( )

Definition at line 237 of file class.ilExternalFeedBlockGUI.php.

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

Referenced by getHTML().

238  {
239  global $ilCtrl, $lng;
240 
241  $ilCtrl->setParameterByClass("ilcolumngui", "block_id",
242  "block_feed_".$this->getBlockId());
243 
244  $rel_tpl = new ilTemplate("tpl.js_enabler.html", true, true, "Services/Feeds");
245  $rel_tpl->setVariable("BLOCK_ID", "block_feed_".$this->getBlockId());
246  $rel_tpl->setVariable("TARGET",
247  $ilCtrl->getLinkTargetByClass("ilexternalfeedblockgui", "enableJS", true, "", false));
248 
249  return $rel_tpl->get();
250  }
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()

ilExternalFeedBlockGUI::getOverview ( )

Get overview.

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

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

Referenced by fillDataSection().

299  {
300  global $ilUser, $lng, $ilCtrl;
301 
302  $this->setEnableNumInfo(false);
303  return '<div class="small">'.((int) count($this->getData()))." ".$lng->txt("feed_feed_items")."</div>";
304  }
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 ilExternalFeedBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Definition at line 62 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

63  {
64  global $ilCtrl;
65 
66  switch($ilCtrl->getCmd())
67  {
68  case "create":
69  case "edit":
70  case "saveFeedBlock":
71  case "updateFeedBlock":
72  case "editFeedBlock":
73  case "showFeedItem":
74  case "confirmDeleteFeedBlock":
75  return IL_SCREEN_CENTER;
76  break;
77 
78  default:
79  return IL_SCREEN_SIDE;
80  break;
81  }
82  }
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_CENTER
const IL_SCREEN_SIDE

◆ ilExternalFeedBlockGUI()

ilExternalFeedBlockGUI::ilExternalFeedBlockGUI ( )

Constructor.

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

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

28  {
29  global $ilCtrl, $lng;
30 
31  parent::__construct();
32  parent::ilBlockGUI();
33 
34  $lng->loadLanguageModule("feed");
35  $this->setLimit(5);
36  $this->setRowTemplate("tpl.block_external_feed_row.html", "Services/Feeds");
37  }
global $ilCtrl
Definition: ilias.php:18
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:

◆ importFile()

ilExternalFeedBlockGUI::importFile ( )

Import.

public

Definition at line 419 of file class.ilExternalFeedBlockGUI.php.

References $_GET, $_POST, $lng, $tpl, exitSaveFeedBlock(), ilObjectFactory\getInstanceByObjId(), initImportForm(), and ilUtil\sendSuccess().

420  {
421  global $rbacsystem, $objDefinition, $tpl, $lng;
422 
423  $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
424 
425  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
426  if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
427  {
428  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
429  }
430  $this->ctrl->setParameter($this, "new_type", $new_type);
431  $this->initImportForm($new_type);
432  if ($this->form->checkInput())
433  {
434  // todo: make some check on manifest file
435  include_once("./Services/Export/classes/class.ilImport.php");
436  $imp = new ilImport((int) $_GET['ref_id']);
437  $new_id = $imp->importObject($newObj, $_FILES["importfile"]["tmp_name"],
438  $_FILES["importfile"]["name"], $new_type);
439 
440  // put new object id into tree
441  if ($new_id > 0)
442  {
443  $newObj = ilObjectFactory::getInstanceByObjId($new_id);
444  $newObj->createReference();
445  $newObj->putInTree($_GET["ref_id"]);
446  $newObj->setPermissions($_GET["ref_id"]);
447  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
448  $this->exitSaveFeedBlock();
449  }
450  return;
451  }
452 
453  $this->form->setValuesByPost();
454  $tpl->setContent($this->form->getHtml());
455  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
exitSaveFeedBlock()
FORM FeedBlock: Exit save.
$_GET["client_id"]
Import class.
global $tpl
Definition: ilias.php:8
initImportForm($a_new_type="")
Init object import form.
redirection script todo: (a better solution should control the processing via a xml file) ...
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ initFormFeedBlock()

ilExternalFeedBlockGUI::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 464 of file class.ilExternalFeedBlockGUI.php.

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

465  {
466  global $lng;
467 
468  $lng->loadLanguageModule("block");
469 
470  include("Services/Form/classes/class.ilPropertyFormGUI.php");
471 
472  $this->form_gui = new ilPropertyFormGUI();
473 
474  // Property Title
475  $text_input = new ilTextInputGUI($lng->txt("block_feed_block_title"), "block_title");
476  $text_input->setInfo("");
477  $text_input->setRequired(true);
478  $text_input->setMaxLength(200);
479  $this->form_gui->addItem($text_input);
480 
481  // Property FeedUrl
482  $text_input = new ilFeedUrlInputGUI($lng->txt("block_feed_block_feed_url"), "block_feed_url");
483  $text_input->setInfo($lng->txt("block_feed_block_feed_url_info"));
484  $text_input->setRequired(true);
485  $text_input->setMaxLength(250);
486  $this->form_gui->addItem($text_input);
487 
488 
489  // save and cancel commands
490  if (in_array($a_mode, array(IL_FORM_CREATE,IL_FORM_RE_CREATE)))
491  {
492  $this->form_gui->addCommandButton("saveFeedBlock", $lng->txt("save"));
493  $this->form_gui->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
494  }
495  else
496  {
497  $this->form_gui->addCommandButton("updateFeedBlock", $lng->txt("save"));
498  $this->form_gui->addCommandButton("cancelUpdateFeedBlock", $lng->txt("cancel"));
499  }
500 
501  $this->form_gui->setTitle($lng->txt("block_feed_block_head"));
502  $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
503 
504  $this->prepareFormFeedBlock($this->form_gui);
505 
506  }
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:

◆ initImportForm()

ilExternalFeedBlockGUI::initImportForm (   $a_new_type = "")

Init object import form.

Parameters
stringnew type

Definition at line 389 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, $lng, and ilFileInputGUI\setSuffixes().

Referenced by create(), and importFile().

390  {
391  global $lng, $ilCtrl;
392 
393  $lng->loadLanguageModule("feed");
394 
395  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
396  $this->form = new ilPropertyFormGUI();
397  $this->form->setTarget("_top");
398 
399  // Import file
400  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
401  $fi = new ilFileInputGUI($lng->txt("import_file"), "importfile");
402  $fi->setSuffixes(array("zip"));
403  $fi->setRequired(true);
404  $this->form->addItem($fi);
405 
406  $this->form->addCommandButton("importFile", $lng->txt("import"));
407  $this->form->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
408  $this->form->setTitle($lng->txt($a_new_type."_import"));
409 
410  $ilCtrl->setParameter($this, "new_type", $a_new_type);
411  $this->form->setFormAction($ilCtrl->getFormAction($this));
412  }
This class represents a property form user interface.
This class represents a file property in a property form.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

static ilExternalFeedBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

Definition at line 54 of file class.ilExternalFeedBlockGUI.php.

Referenced by fillRow().

55  {
56  return true;
57  }
+ Here is the caller graph for this function:

◆ prepareSaveFeedBlock()

ilExternalFeedBlockGUI::prepareSaveFeedBlock ( $a_feed_block)

FORM FeedBlock: Prepare Saving of FeedBlock.

Parameters
object$a_feed_blockFeedBlock object.

Definition at line 513 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, $ref_id, getBlockType(), and ilExternalFeedBlockGUIGen\getGuiObject().

514  {
515  global $ilCtrl;
516 
517  $ref_id = $this->getGuiObject()->save($a_feed_block);
518  $a_feed_block->setType($this->getBlockType());
519  //$a_feed_block->setContextObjId($ilCtrl->getContextObjId());
520  //$a_feed_block->setContextObjType($ilCtrl->getContextObjType());
521  }
global $ilCtrl
Definition: ilias.php:18
$ref_id
Definition: sahs_server.php:39
static getBlockType()
Get block type.
+ Here is the call graph for this function:

◆ setBlock()

ilExternalFeedBlockGUI::setBlock (   $a_block)

Do most of the initialisation.

Definition at line 87 of file class.ilExternalFeedBlockGUI.php.

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

88  {
89  global $ilCtrl;
90 
91  // init block
92  $this->feed_block = $a_block;
93  $this->setTitle($this->feed_block->getTitle());
94  $this->setBlockId($this->feed_block->getId());
95 
96  // get feed object
97  include_once("./Services/Feeds/classes/class.ilExternalFeed.php");
98  $this->feed = new ilExternalFeed();
99  $this->feed->setUrl($this->feed_block->getFeedUrl());
100 
101  // init details
102  $this->setAvailableDetailLevels(2);
103 
104  $ilCtrl->setParameter($this, "block_id", $this->feed_block->getId());
105  }
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()

ilExternalFeedBlockGUI::showFeedItem ( )

Show Feed Item.

Definition at line 309 of file class.ilExternalFeedBlockGUI.php.

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

310  {
311  global $lng, $ilCtrl;
312 
313  include_once("./Services/News/classes/class.ilNewsItem.php");
314 
315  $this->feed->fetch();
316  foreach($this->feed->getItems() as $item)
317  {
318  if ($item->getId() == $_GET["feed_item_id"])
319  {
320  $c_item = $item;
321  break;
322  }
323  }
324 
325  $tpl = new ilTemplate("tpl.show_feed_item.html", true, true, "Services/Feeds");
326 
327  if (is_object($c_item))
328  {
329  if (trim($c_item->getSummary()) != "") // summary
330  {
331  $tpl->setCurrentBlock("content");
332  $tpl->setVariable("VAL_CONTENT", $c_item->getSummary());
333  $tpl->parseCurrentBlock();
334  }
335  if (trim($c_item->getDate()) != "" || trim($c_item->getAuthor()) != "") // date
336  {
337  $tpl->setCurrentBlock("date_author");
338  if (trim($c_item->getAuthor()) != "")
339  {
340  $tpl->setVariable("VAL_AUTHOR", $c_item->getAuthor()." - ");
341  }
342  $tpl->setVariable("VAL_DATE", $c_item->getDate());
343  $tpl->parseCurrentBlock();
344  }
345 
346  if (trim($c_item->getLink()) != "") // link
347  {
348  $tpl->setCurrentBlock("plink");
349  $tpl->setVariable("HREF_LINK", $c_item->getLink());
350  $tpl->setVariable("TXT_LINK", $lng->txt("feed_open_source_page"));
351  $tpl->parseCurrentBlock();
352  }
353  $tpl->setVariable("VAL_TITLE", $c_item->getTitle()); // title
354  }
355 
356  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
357  $content_block = new ilPDContentBlockGUI();
358  $content_block->setContent($tpl->get());
359  $content_block->setTitle($this->getTitle());
360  $content_block->setImage(ilUtil::getImagePath("icon_feed.svg"));
361  $content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
362  $lng->txt("close"), true);
363 
364  return $content_block->getHTML();
365  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
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
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

ilExternalFeedBlockGUI::$block_type = "feed"
static

Definition at line 22 of file class.ilExternalFeedBlockGUI.php.


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