ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 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 540 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, and ilExternalFeedBlockGUIGen\getGuiObject().

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

◆ create()

ilExternalFeedBlockGUI::create ( )

Create Form for Block.

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

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

373  {
374  $html1 = $this->createFeedBlock();
375 
376  $html2 = "";
377  if (DEVMODE == 1)
378  {
379  $this->initImportForm("feed");
380  $html2 = "<br/>".$this->form->getHTML();
381  }
382 
383  return $html1.$html2;
384  }
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 255 of file class.ilExternalFeedBlockGUI.php.

References $_SESSION, $ilCtrl, and $ilUser.

256  {
257  global $ilCtrl, $ilUser;
258 
259  $_SESSION["il_feed_js"] = "n";
260  $ilUser->writePref("il_feed_js", "n");
261  $ilCtrl->returnToParent($this);
262  }
< 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 264 of file class.ilExternalFeedBlockGUI.php.

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

265  {
266  global $ilUser;
267 
268  $_SESSION["il_feed_js"] = "y";
269  $ilUser->writePref("il_feed_js", "y");
270  echo $this->getHTML();
271  exit;
272  }
< 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 112 of file class.ilExternalFeedBlockGUI.php.

References $cmd, and $ilCtrl.

113  {
114  global $ilCtrl;
115 
116  $next_class = $ilCtrl->getNextClass();
117  $cmd = $ilCtrl->getCmd("getHTML");
118 
119  switch ($next_class)
120  {
121  default:
122  return $this->$cmd();
123  }
124  }
$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 529 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, and ilExternalFeedBlockGUIGen\getGuiObject().

Referenced by importFile().

530  {
531  global $ilCtrl;
532 
533  $this->getGuiObject()->exitSave();
534  }
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 551 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, and ilExternalFeedBlockGUIGen\getGuiObject().

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

◆ fillDataSection()

ilExternalFeedBlockGUI::fillDataSection ( )

Fill data section.

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

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

130  {
131  if ($this->getDynamic())
132  {
133  $this->setDataSection($this->getDynamicReload());
134  }
135  else if ($this->getCurrentDetailLevel() > 1 && count($this->getData()) > 0)
136  {
137  parent::fillDataSection();
138  }
139  else
140  {
141  $this->setDataSection($this->getOverview());
142  }
143  }
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 277 of file class.ilExternalFeedBlockGUI.php.

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

278  {
279  global $ilUser, $ilCtrl, $lng, $ilAccess;
280 
281  if ($this->isRepositoryObject() && !$ilAccess->checkAccess("read", "", $this->getRefId()))
282  {
283  $this->tpl->setVariable("TXT_TITLE", $item->getTitle());
284  }
285  else
286  {
287  $ilCtrl->setParameter($this, "feed_item_id", $item->getId());
288  $this->tpl->setCurrentBlock("feed_link");
289  $this->tpl->setVariable("VAL_TITLE", $item->getTitle());
290  $this->tpl->setVariable("HREF_SHOW",
291  $ilCtrl->getLinkTarget($this, "showFeedItem"));
292  $ilCtrl->setParameter($this, "feed_item_id", "");
293  $this->tpl->parseCurrentBlock();
294  }
295  }
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 46 of file class.ilExternalFeedBlockGUI.php.

Referenced by prepareSaveFeedBlock().

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

◆ getDynamic()

ilExternalFeedBlockGUI::getDynamic ( )

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

References $_SESSION, $ilCtrl, and $ilUser.

Referenced by fillDataSection(), and getHTML().

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

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

Referenced by fillDataSection().

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

149  {
150  global $ilCtrl, $lng, $ilUser, $ilAccess, $ilSetting;
151 
152  if ($this->getCurrentDetailLevel() == 0)
153  {
154  return "";
155  }
156 
157  $feed_set = new ilSetting("feed");
158 
159  if ($feed_set->get("disable_rep_feeds"))
160  {
161  return "";
162  }
163 
164  // if no dynamic reload
165  if (!$this->getDynamic())
166  {
167  $this->feed->fetch();
168  $this->setData($this->feed->getItems());
169  }
170 
171  //$this->setTitle($this->feed->getChannelTitle());
172  $this->setData($this->feed->getItems());
173 
174  if ($ilAccess->checkAccess("write", "", $this->getRefId()))
175  {
176  $ilCtrl->setParameterByClass("ilobjexternalfeedgui",
177  "ref_id", $this->getRefId());
178  $ilCtrl->setParameter($this, "external_feed_block_id", $this->getBlockId());
179  $this->addBlockCommand(
180  $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjexternalfeedgui",
181  "ilexternalfeedblockgui"),
182  "editFeedBlock"),
183  $lng->txt("settings"));
184  $ilCtrl->clearParametersByClass("ilobjexternalfeedgui");
185  }
186 
187  // JS enabler
188  $add = "";
189  if ($_SESSION["il_feed_js"] == "n" ||
190  ($ilUser->getPref("il_feed_js") == "n" && $_SESSION["il_feed_js"] != "y"))
191  {
192  $add = $this->getJSEnabler();
193  }
194 
195  return parent::getHTML().$add;
196  }
< 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.
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 239 of file class.ilExternalFeedBlockGUI.php.

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

Referenced by getHTML().

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

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

Referenced by fillDataSection().

301  {
302  global $ilUser, $lng, $ilCtrl;
303 
304  $this->setEnableNumInfo(false);
305  return '<div class="small">'.((int) count($this->getData()))." ".$lng->txt("feed_feed_items")."</div>";
306  }
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 64 of file class.ilExternalFeedBlockGUI.php.

References $ilCtrl, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

65  {
66  global $ilCtrl;
67 
68  switch($ilCtrl->getCmd())
69  {
70  case "create":
71  case "edit":
72  case "saveFeedBlock":
73  case "updateFeedBlock":
74  case "editFeedBlock":
75  case "showFeedItem":
76  case "confirmDeleteFeedBlock":
77  return IL_SCREEN_CENTER;
78  break;
79 
80  default:
81  return IL_SCREEN_SIDE;
82  break;
83  }
84  }
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, ilUtil\getImagePath(), ilBlockGUI\setImage(), ilBlockGUI\setLimit(), and ilBlockGUI\setRowTemplate().

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

◆ importFile()

ilExternalFeedBlockGUI::importFile ( )

Import.

public

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

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

422  {
423  global $rbacsystem, $objDefinition, $tpl, $lng;
424 
425  $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
426 
427  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
428  if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
429  {
430  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
431  }
432  $this->ctrl->setParameter($this, "new_type", $new_type);
433  $this->initImportForm($new_type);
434  if ($this->form->checkInput())
435  {
436  // todo: make some check on manifest file
437  include_once("./Services/Export/classes/class.ilImport.php");
438  $imp = new ilImport((int) $_GET['ref_id']);
439  $new_id = $imp->importObject($newObj, $_FILES["importfile"]["tmp_name"],
440  $_FILES["importfile"]["name"], $new_type);
441 
442  // put new object id into tree
443  if ($new_id > 0)
444  {
445  $newObj = ilObjectFactory::getInstanceByObjId($new_id);
446  $newObj->createReference();
447  $newObj->putInTree($_GET["ref_id"]);
448  $newObj->setPermissions($_GET["ref_id"]);
449  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
450  $this->exitSaveFeedBlock();
451  }
452  return;
453  }
454 
455  $this->form->setValuesByPost();
456  $tpl->setContent($this->form->getHtml());
457  }
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.
initImportForm($a_new_type="")
Init object import form.
redirection script todo: (a better solution should control the processing via a xml file) ...
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 466 of file class.ilExternalFeedBlockGUI.php.

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

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

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

Referenced by create(), and importFile().

392  {
393  global $lng, $ilCtrl;
394 
395  $lng->loadLanguageModule("feed");
396 
397  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
398  $this->form = new ilPropertyFormGUI();
399  $this->form->setTarget("_top");
400 
401  // Import file
402  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
403  $fi = new ilFileInputGUI($lng->txt("import_file"), "importfile");
404  $fi->setSuffixes(array("zip"));
405  $fi->setRequired(true);
406  $this->form->addItem($fi);
407 
408  $this->form->addCommandButton("importFile", $lng->txt("import"));
409  $this->form->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
410  $this->form->setTitle($lng->txt($a_new_type."_import"));
411 
412  $ilCtrl->setParameter($this, "new_type", $a_new_type);
413  $this->form->setFormAction($ilCtrl->getFormAction($this));
414  }
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 56 of file class.ilExternalFeedBlockGUI.php.

Referenced by fillRow().

57  {
58  return true;
59  }
+ 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 515 of file class.ilExternalFeedBlockGUI.php.

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

516  {
517  global $ilCtrl;
518 
519  $ref_id = $this->getGuiObject()->save($a_feed_block);
520  $a_feed_block->setType($this->getBlockType());
521  //$a_feed_block->setContextObjId($ilCtrl->getContextObjId());
522  //$a_feed_block->setContextObjType($ilCtrl->getContextObjType());
523  }
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 89 of file class.ilExternalFeedBlockGUI.php.

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

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

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

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

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: