ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilExternalFeedBlockGUI Class Reference

BlockGUI class for external feed block. More...

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

Public Member Functions

 __construct ()
 Constructor. More...
 
 getBlockType ()
 
 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
 getBlockType ()
 
 __construct ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ( $a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

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

Static Public Attributes

static $block_type = "feed"
 

Protected Member Functions

 isRepositoryObject ()
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Protected Attributes

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

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.

Constructor & Destructor Documentation

◆ __construct()

ilExternalFeedBlockGUI::__construct ( )

Constructor.

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

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

43  {
44  global $DIC;
45 
46  $this->ctrl = $DIC->ctrl();
47  $this->lng = $DIC->language();
48  $this->user = $DIC->user();
49  $this->access = $DIC->access();
50  $this->settings = $DIC->settings();
51  $this->rbacsystem = $DIC->rbac()->system();
52  $this->obj_definition = $DIC["objDefinition"];
53  $lng = $DIC->language();
54 
55  parent::__construct();
56 
57  $lng->loadLanguageModule("feed");
58  $this->setLimit(5);
59  $this->setRowTemplate("tpl.block_external_feed_row.html", "Services/Feeds");
60  }
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
setLimit($a_limit)
Set Limit.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
+ Here is the call graph for this function:

Member Function Documentation

◆ cancelUpdateFeedBlock()

ilExternalFeedBlockGUI::cancelUpdateFeedBlock ( )

FORM FeedBlock: Exit save.

(Can be overwritten in derived classes)

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

References ilExternalFeedBlockGUIGen\getGuiObject().

562  {
563  $this->getGuiObject()->cancelUpdate();
564  }
+ Here is the call graph for this function:

◆ create()

ilExternalFeedBlockGUI::create ( )

Create Form for Block.

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

References $html1, $html2, ilExternalFeedBlockGUIGen\createFeedBlock(), and initImportForm().

401  {
402  $html1 = $this->createFeedBlock();
403 
404  $html2 = "";
405  if (DEVMODE == 1) {
406  $this->initImportForm("feed");
407  $html2 = "<br/>" . $this->form->getHTML();
408  }
409 
410  return $html1 . $html2;
411  }
createFeedBlock()
FORM FeedBlock: Create ExternalFeedBlock.
$html1
initImportForm($a_new_type="")
Init object import form.
$html2
+ Here is the call graph for this function:

◆ disableJS()

ilExternalFeedBlockGUI::disableJS ( )

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

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

284  {
287 
288  $_SESSION["il_feed_js"] = "n";
289  $ilUser->writePref("il_feed_js", "n");
290  $ilCtrl->returnToParent($this);
291  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18

◆ enableJS()

ilExternalFeedBlockGUI::enableJS ( )

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

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

294  {
296 
297  $_SESSION["il_feed_js"] = "y";
298  $ilUser->writePref("il_feed_js", "y");
299  echo $this->getHTML();
300  exit;
301  }
$_SESSION["AccountId"]
$ilUser
Definition: imgupload.php:18
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ executeCommand()

ilExternalFeedBlockGUI::executeCommand ( )

execute command

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

References ilBlockGUI\$ctrl, and $ilCtrl.

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

◆ exitSaveFeedBlock()

ilExternalFeedBlockGUI::exitSaveFeedBlock ( )

FORM FeedBlock: Exit save.

(Can be overwritten in derived classes)

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

References ilExternalFeedBlockGUIGen\getGuiObject().

Referenced by importFile().

553  {
554  $this->getGuiObject()->exitSave();
555  }
+ 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 570 of file class.ilExternalFeedBlockGUI.php.

References ilExternalFeedBlockGUIGen\getGuiObject().

571  {
572  $this->getGuiObject()->update($this->external_feed_block);
573  }
+ Here is the call graph for this function:

◆ fillDataSection()

ilExternalFeedBlockGUI::fillDataSection ( )

Fill data section.

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

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

146  {
147  if ($this->getDynamic()) {
148  $this->setDataSection($this->getDynamicReload());
149  } elseif ($this->getCurrentDetailLevel() > 1 && count($this->getData()) > 0) {
150  parent::fillDataSection();
151  } else {
152  $this->setDataSection($this->getOverview());
153  }
154  }
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 306 of file class.ilExternalFeedBlockGUI.php.

References ilBlockGUI\$access, ilBlockGUI\$ctrl, $ilCtrl, and isRepositoryObject().

307  {
309  $ilAccess = $this->access;
310 
311  if ($this->isRepositoryObject() && !$ilAccess->checkAccess("read", "", $this->getRefId())) {
312  $this->tpl->setVariable("TXT_TITLE", $item->getTitle());
313  } else {
314  $ilCtrl->setParameter($this, "feed_item_id", $item->getId());
315  $this->tpl->setCurrentBlock("feed_link");
316  $this->tpl->setVariable("VAL_TITLE", $item->getTitle());
317  $this->tpl->setVariable(
318  "HREF_SHOW",
319  $ilCtrl->getLinkTarget($this, "showFeedItem")
320  );
321  $ilCtrl->setParameter($this, "feed_item_id", "");
322  $this->tpl->parseCurrentBlock();
323  }
324  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ getBlockType()

ilExternalFeedBlockGUI::getBlockType ( )

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

Referenced by prepareSaveFeedBlock().

65  : string
66  {
67  return self::$block_type;
68  }
+ Here is the caller graph for this function:

◆ getDynamic()

ilExternalFeedBlockGUI::getDynamic ( )

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

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

Referenced by fillDataSection(), and getHTML().

215  {
218 
219  if ($ilCtrl->getCmdClass() != "ilcolumngui" && $ilCtrl->getCmd() != "enableJS") {
220  if ($_SESSION["il_feed_js"] != "n" &&
221  ($ilUser->getPref("il_feed_js") != "n" || $_SESSION["il_feed_js"] == "y")) {
222  // do not get feed dynamically, if cache hit is given.
223  if (!$this->feed->checkCacheHit()) {
224  return true;
225  }
226  }
227  }
228 
229  return false;
230  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the caller graph for this function:

◆ getDynamicReload()

ilExternalFeedBlockGUI::getDynamicReload ( )

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

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

Referenced by fillDataSection().

233  {
235  $lng = $this->lng;
236 
237  $ilCtrl->setParameterByClass(
238  "ilcolumngui",
239  "block_id",
240  "block_feed_" . $this->getBlockId()
241  );
242 
243  $rel_tpl = new ilTemplate("tpl.dynamic_reload.html", true, true, "Services/Feeds");
244  $rel_tpl->setVariable("TXT_LOADING", $lng->txt("feed_loading_feed"));
245  $rel_tpl->setVariable("BLOCK_ID", "block_feed_" . $this->getBlockId());
246  $rel_tpl->setVariable(
247  "TARGET",
248  $ilCtrl->getLinkTargetByClass("ilcolumngui", "updateBlock", "", true)
249  );
250 
251  // no JS
252  $rel_tpl->setVariable("TXT_FEED_CLICK_HERE", $lng->txt("feed_no_js_click_here"));
253  $rel_tpl->setVariable(
254  "TARGET_NO_JS",
255  $ilCtrl->getLinkTargetByClass("ilexternalfeedblockgui", "disableJS")
256  );
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.
+ 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 159 of file class.ilExternalFeedBlockGUI.php.

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

Referenced by enableJS().

160  {
162  $lng = $this->lng;
164  $ilAccess = $this->access;
166 
167  if ($this->getCurrentDetailLevel() == 0) {
168  return "";
169  }
170 
171  $feed_set = new ilSetting("feed");
172 
173  if ($feed_set->get("disable_rep_feeds")) {
174  return "";
175  }
176 
177  // if no dynamic reload
178  if (!$this->getDynamic()) {
179  $this->feed->fetch();
180  $this->setData($this->feed->getItems());
181  }
182 
183  //$this->setTitle($this->feed->getChannelTitle());
184  $this->setData($this->feed->getItems());
185 
186  if ($ilAccess->checkAccess("write", "", $this->getRefId())) {
187  $ilCtrl->setParameterByClass(
188  "ilobjexternalfeedgui",
189  "ref_id",
190  $this->getRefId()
191  );
192  $ilCtrl->setParameter($this, "external_feed_block_id", $this->getBlockId());
193  $this->addBlockCommand(
194  $ilCtrl->getLinkTargetByClass(
195  array("ilrepositorygui", "ilobjexternalfeedgui",
196  "ilexternalfeedblockgui"),
197  "editFeedBlock"
198  ),
199  $lng->txt("settings")
200  );
201  $ilCtrl->clearParametersByClass("ilobjexternalfeedgui");
202  }
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  $add = $this->getJSEnabler();
209  }
210 
211  return parent::getHTML() . $add;
212  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
setData($a_data)
Set Data.
$ilUser
Definition: imgupload.php:18
$feed_set
Definition: privfeed.php:19
getBlockId()
Get Block Id.
addBlockCommand( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
getRefId()
Get Ref Id (only used if isRepositoryObject() is true).
global $ilSetting
Definition: privfeed.php:17
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getJSEnabler()

ilExternalFeedBlockGUI::getJSEnabler ( )

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

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

Referenced by getHTML().

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

◆ getOverview()

ilExternalFeedBlockGUI::getOverview ( )

Get overview.

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

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

Referenced by fillDataSection().

330  {
332  $lng = $this->lng;
334 
335  $this->setEnableNumInfo(false);
336  return '<div class="small">' . ((int) count($this->getData())) . " " . $lng->txt("feed_feed_items") . "</div>";
337  }
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
getData()
Get Data.
+ 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 81 of file class.ilExternalFeedBlockGUI.php.

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

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

◆ importFile()

ilExternalFeedBlockGUI::importFile ( )

Import.

public

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

References $_GET, $_POST, ilBlockGUI\$lng, ilBlockGUI\$main_tpl, $rbacsystem, ilBlockGUI\$tpl, exitSaveFeedBlock(), ilObjectFactory\getInstanceByObjId(), and initImportForm().

450  {
453  $lng = $this->lng;
454 
455  $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
456 
457  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
458  if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type)) {
459  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
460  }
461  $this->ctrl->setParameter($this, "new_type", $new_type);
462  $this->initImportForm($new_type);
463  if ($this->form->checkInput()) {
464  // todo: make some check on manifest file
465  include_once("./Services/Export/classes/class.ilImport.php");
466  $imp = new ilImport((int) $_GET['ref_id']);
467  $new_id = $imp->importObject(
468  $newObj,
469  $_FILES["importfile"]["tmp_name"],
470  $_FILES["importfile"]["name"],
471  $new_type
472  );
473 
474  // put new object id into tree
475  if ($new_id > 0) {
476  $newObj = ilObjectFactory::getInstanceByObjId($new_id);
477  $newObj->createReference();
478  $newObj->putInTree($_GET["ref_id"]);
479  $newObj->setPermissions($_GET["ref_id"]);
480  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
481  $this->exitSaveFeedBlock();
482  }
483  return;
484  }
485 
486  $this->form->setValuesByPost();
487  $tpl->setContent($this->form->getHtml());
488  }
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) ...
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
$_POST["username"]
+ 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 497 of file class.ilExternalFeedBlockGUI.php.

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

498  {
499  $lng = $this->lng;
500 
501  $lng->loadLanguageModule("block");
502 
503  require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
504 
505  $this->form_gui = new ilPropertyFormGUI();
506 
507  // Property Title
508  $text_input = new ilTextInputGUI($lng->txt("block_feed_block_title"), "block_title");
509  $text_input->setInfo("");
510  $text_input->setRequired(true);
511  $text_input->setMaxLength(200);
512  $this->form_gui->addItem($text_input);
513 
514  // Property FeedUrl
515  $text_input = new ilFeedUrlInputGUI($lng->txt("block_feed_block_feed_url"), "block_feed_url");
516  $text_input->setInfo($lng->txt("block_feed_block_feed_url_info"));
517  $text_input->setRequired(true);
518  $text_input->setMaxLength(250);
519  $this->form_gui->addItem($text_input);
520 
521 
522  // save and cancel commands
523  if (in_array($a_mode, array(IL_FORM_CREATE,IL_FORM_RE_CREATE))) {
524  $this->form_gui->addCommandButton("saveFeedBlock", $lng->txt("save"));
525  $this->form_gui->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
526  } else {
527  $this->form_gui->addCommandButton("updateFeedBlock", $lng->txt("save"));
528  $this->form_gui->addCommandButton("cancelUpdateFeedBlock", $lng->txt("cancel"));
529  }
530 
531  $this->form_gui->setTitle($lng->txt("block_feed_block_head"));
532  $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
533 
534  $this->prepareFormFeedBlock($this->form_gui);
535  }
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.
+ Here is the call graph for this function:

◆ initImportForm()

ilExternalFeedBlockGUI::initImportForm (   $a_new_type = "")

Init object import form.

Parameters
stringnew type

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

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

Referenced by create(), and importFile().

419  {
420  $lng = $this->lng;
422 
423  $lng->loadLanguageModule("feed");
424 
425  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
426  $this->form = new ilPropertyFormGUI();
427  $this->form->setTarget("_top");
428 
429  // Import file
430  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
431  $fi = new ilFileInputGUI($lng->txt("import_file"), "importfile");
432  $fi->setSuffixes(array("zip"));
433  $fi->setRequired(true);
434  $this->form->addItem($fi);
435 
436  $this->form->addCommandButton("importFile", $lng->txt("import"));
437  $this->form->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
438  $this->form->setTitle($lng->txt($a_new_type . "_import"));
439 
440  $ilCtrl->setParameter($this, "new_type", $a_new_type);
441  $this->form->setFormAction($ilCtrl->getFormAction($this));
442  }
This class represents a property form user interface.
This class represents a file property in a property form.
global $ilCtrl
Definition: ilias.php:18
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

ilExternalFeedBlockGUI::isRepositoryObject ( )
protected

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

Referenced by fillRow().

73  : bool
74  {
75  return true;
76  }
+ 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 542 of file class.ilExternalFeedBlockGUI.php.

References getBlockType(), and ilExternalFeedBlockGUIGen\getGuiObject().

543  {
544  $this->getGuiObject()->save($a_feed_block);
545  $a_feed_block->setType($this->getBlockType());
546  }
+ Here is the call graph for this function:

◆ setBlock()

ilExternalFeedBlockGUI::setBlock (   $a_block)

Do most of the initialisation.

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

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

108  {
110 
111  // init block
112  $this->feed_block = $a_block;
113  $this->setTitle($this->feed_block->getTitle());
114  $this->setBlockId($this->feed_block->getId());
115 
116  // get feed object
117  include_once("./Services/Feeds/classes/class.ilExternalFeed.php");
118  $this->feed = new ilExternalFeed();
119  $this->feed->setUrl($this->feed_block->getFeedUrl());
120 
121  // init details
122  $this->setAvailableDetailLevels(2);
123 
124  $ilCtrl->setParameter($this, "block_id", $this->feed_block->getId());
125  }
Handles external Feeds via Magpie library.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
+ Here is the call graph for this function:

◆ showFeedItem()

ilExternalFeedBlockGUI::showFeedItem ( )

Show Feed Item.

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

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

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

Field Documentation

◆ $block_type

ilExternalFeedBlockGUI::$block_type = "feed"
static

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

◆ $obj_definition

ilExternalFeedBlockGUI::$obj_definition
protected

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

◆ $rbacsystem

ilExternalFeedBlockGUI::$rbacsystem
protected

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

Referenced by importFile().

◆ $settings

ilExternalFeedBlockGUI::$settings
protected

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

Referenced by getHTML().


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