ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ()
 
Returns
string
More...
 
 setBlock ($a_block)
 Do most of the initialisation. 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...
 
 getValuesFeedBlock ()
 FORM FeedBlock: Get current values for ExternalFeedBlock form. More...
 
 cancelSaveFeedBlock ()
 FORM FeedBlock: Cancel save. 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 ilBlockGUI
 getBlockType ()
 
 __construct ()
 Constructor. More...
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setPresentation (int $type)
 Set presentation. More...
 
 getPresentation ()
 Get presentation type. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. 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...
 
 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 (bool $a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. 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 ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 getHTML ()
 Get HTML. 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...
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 Get HTML. More...
 

Static Public Member Functions

static getScreenMode ()
 Get Screen Mode for current command. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Data Fields

const FORM_EDIT = 0
 
const FORM_CREATE = 1
 
const FORM_RE_EDIT = 2
 
const FORM_RE_CREATE = 2
 
- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 

Static Public Attributes

static $block_type = "feed"
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object.
Returns
bool
More...
 
 getListItemForData (array $data)
 Get list item for data array.
Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item
More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 initCommands ()
 Init commands. More...
 
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getViewControls ()
 Get view controls. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 getNoItemFoundContent ()
 No item entry. More...
 

Protected Attributes

 $gui_object
 
 $form_edit_mode
 
 $settings
 
 $rbacsystem
 
 $obj_definition
 
 $new_rendering = true
 
- Protected Attributes inherited from ilBlockGUI
 $ui
 
 $data = array()
 
 $enablenuminfo = true
 
 $footer_links = array()
 
 $block_id = 0
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $title = ""
 
 $admincommands = false
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 
 $presentation
 
 $new_rendering = false
 

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$

@ilCtrl_IsCalledBy ilExternalFeedBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilExternalFeedBlockGUI::__construct ( )

Constructor.

Reimplemented from ilBlockGUI.

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

48 {
49 global $DIC;
50
51 $this->ctrl = $DIC->ctrl();
52 $this->lng = $DIC->language();
53 $this->user = $DIC->user();
54 $this->access = $DIC->access();
55 $this->settings = $DIC->settings();
56 $this->rbacsystem = $DIC->rbac()->system();
57 $this->obj_definition = $DIC["objDefinition"];
58 $lng = $DIC->language();
59
61
62 $lng->loadLanguageModule("feed");
63 $this->setLimit(5);
64 $this->setRowTemplate("tpl.block_external_feed_row.html", "Services/Feeds");
65
66 if (isset($_GET["external_feed_block_id"]) && $_GET["external_feed_block_id"] > 0) {
67 $this->external_feed_block = new ilExternalFeedBlock($_GET["external_feed_block_id"]);
68 }
69
70 $this->ctrl->saveParameter($this, array("external_feed_block_id"));
71
72 $this->setPresentation(self::PRES_SEC_LIST);
73 }
user()
Definition: user.php:4
$_GET["client_id"]
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
setPresentation(int $type)
Set presentation.
Custom block for external feeds.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2

References $_GET, $DIC, ilBlockGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), ilBlockGUI\setRowTemplate(), settings(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ cancelSaveFeedBlock()

ilExternalFeedBlockGUI::cancelSaveFeedBlock ( )

FORM FeedBlock: Cancel save.

(Can be overwritten in derived classes)

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

270 {
271 $ilCtrl = $this->ctrl;
272
273 $ilCtrl->returnToParent($this);
274 }

References ilBlockGUI\$ctrl.

◆ cancelUpdateFeedBlock()

ilExternalFeedBlockGUI::cancelUpdateFeedBlock ( )

FORM FeedBlock: Exit save.

(Can be overwritten in derived classes)

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

704 {
705 $this->getGuiObject()->cancelUpdate();
706 }

References getGuiObject().

+ Here is the call graph for this function:

◆ create()

ilExternalFeedBlockGUI::create ( )

Create Form for Block.

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

545 {
546 $html1 = $this->createFeedBlock();
547
548 $html2 = "";
549 if (DEVMODE == 1) {
550 $this->initImportForm("feed");
551 $html2 = "<br/>" . $this->form->getHTML();
552 }
553
554 return $html1 . $html2;
555 }
initImportForm($a_new_type="")
Init object import form.
createFeedBlock()
FORM FeedBlock: Create ExternalFeedBlock.

References createFeedBlock(), and initImportForm().

+ Here is the call graph for this function:

◆ createFeedBlock()

ilExternalFeedBlockGUI::createFeedBlock ( )

FORM FeedBlock: Create ExternalFeedBlock.

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

186 {
187 $this->initFormFeedBlock(self::FORM_CREATE);
188 return $this->form_gui->getHtml();
189 }
initFormFeedBlock($a_mode)
FORM FeedBlock: Init form.

References initFormFeedBlock().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ disableJS()

ilExternalFeedBlockGUI::disableJS ( )

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

435 {
436 $ilCtrl = $this->ctrl;
438
439 $_SESSION["il_feed_js"] = "n";
440 $ilUser->writePref("il_feed_js", "n");
441 $ilCtrl->returnToParent($this);
442 }
$_SESSION["AccountId"]
$ilUser
Definition: imgupload.php:18

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

◆ editFeedBlock()

ilExternalFeedBlockGUI::editFeedBlock ( )

FORM FeedBlock: Edit form.

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

196 {
197 $this->initFormFeedBlock(self::FORM_EDIT);
198 $this->getValuesFeedBlock();
199 return $this->form_gui->getHtml();
200 }
getValuesFeedBlock()
FORM FeedBlock: Get current values for ExternalFeedBlock form.

References getValuesFeedBlock(), and initFormFeedBlock().

+ Here is the call graph for this function:

◆ enableJS()

ilExternalFeedBlockGUI::enableJS ( )

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

445 {
447
448 $_SESSION["il_feed_js"] = "y";
449 $ilUser->writePref("il_feed_js", "y");
450 echo $this->getHTML();
451 exit;
452 }
exit
Definition: login.php:29

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

+ Here is the call graph for this function:

◆ executeCommand()

ilExternalFeedBlockGUI::executeCommand ( )

execute command

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

281 {
282 $ilCtrl = $this->ctrl;
283
284 $next_class = $ilCtrl->getNextClass();
285 $cmd = $ilCtrl->getCmd("getHTML");
286 switch ($next_class) {
287 default:
288 return $this->$cmd();
289 }
290 }

References ilBlockGUI\$ctrl.

◆ exitSaveFeedBlock()

ilExternalFeedBlockGUI::exitSaveFeedBlock ( )

FORM FeedBlock: Exit save.

(Can be overwritten in derived classes)

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

695 {
696 $this->getGuiObject()->exitSave();
697 }

References getGuiObject().

Referenced by importFile(), and saveFeedBlock().

+ 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 712 of file class.ilExternalFeedBlockGUI.php.

713 {
714 $this->getGuiObject()->update($this->external_feed_block);
715 }

References getGuiObject().

Referenced by updateFeedBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillDataSection()

ilExternalFeedBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

296 {
297 if ($this->getDynamic()) {
298 $this->setDataSection($this->getDynamicReload());
299 } elseif (count($this->getData()) > 0) {
300 parent::fillDataSection();
301 } else {
302 $this->setDataSection($this->getOverview());
303 }
304 }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
getData()
Get Data.

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

+ Here is the call graph for this function:

◆ fillRow()

ilExternalFeedBlockGUI::fillRow (   $item)

Fill feed item row.

Reimplemented from ilBlockGUI.

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

458 {
459 $ilCtrl = $this->ctrl;
460 $ilAccess = $this->access;
461
462 if ($this->isRepositoryObject() && !$ilAccess->checkAccess("read", "", $this->getRefId())) {
463 $this->tpl->setVariable("TXT_TITLE", $item->getTitle());
464 } else {
465 $ilCtrl->setParameter($this, "feed_item_id", $item->getId());
466 $this->tpl->setCurrentBlock("feed_link");
467 $this->tpl->setVariable("VAL_TITLE", $item->getTitle());
468 $this->tpl->setVariable(
469 "HREF_SHOW",
470 $ilCtrl->getLinkTarget($this, "showFeedItem")
471 );
472 $ilCtrl->setParameter($this, "feed_item_id", "");
473 $this->tpl->parseCurrentBlock();
474 }
475 }
isRepositoryObject()
Returns whether block has a corresponding repository object.bool

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

+ Here is the call graph for this function:

◆ getBlockType()

ilExternalFeedBlockGUI::getBlockType ( )

Returns
string

Reimplemented from ilBlockGUI.

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

78 : string
79 {
80 return self::$block_type;
81 }

References $block_type.

Referenced by prepareSaveFeedBlock().

+ Here is the caller graph for this function:

◆ getDynamic()

ilExternalFeedBlockGUI::getDynamic ( )

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

363 {
364 $ilCtrl = $this->ctrl;
366
367 // @todo
368 return false;
369
370 if ($ilCtrl->getCmdClass() != "ilcolumngui" && $ilCtrl->getCmd() != "enableJS") {
371 if ($_SESSION["il_feed_js"] != "n" &&
372 ($ilUser->getPref("il_feed_js") != "n" || $_SESSION["il_feed_js"] == "y")) {
373 // do not get feed dynamically, if cache hit is given.
374 if (!$this->feed->checkCacheHit()) {
375 return true;
376 }
377 }
378 }
379
380 return false;
381 }

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

Referenced by fillDataSection(), and getHTML().

+ Here is the caller graph for this function:

◆ getDynamicReload()

ilExternalFeedBlockGUI::getDynamicReload ( )

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

384 {
385 $ilCtrl = $this->ctrl;
387
388 $ilCtrl->setParameterByClass(
389 "ilcolumngui",
390 "block_id",
391 "block_feed_" . $this->getBlockId()
392 );
393
394 $rel_tpl = new ilTemplate("tpl.dynamic_reload.html", true, true, "Services/Feeds");
395 $rel_tpl->setVariable("TXT_LOADING", $lng->txt("feed_loading_feed"));
396 $rel_tpl->setVariable("BLOCK_ID", "block_feed_" . $this->getBlockId());
397 $rel_tpl->setVariable(
398 "TARGET",
399 $ilCtrl->getLinkTargetByClass("ilcolumngui", "updateBlock", "", true)
400 );
401
402 // no JS
403 $rel_tpl->setVariable("TXT_FEED_CLICK_HERE", $lng->txt("feed_no_js_click_here"));
404 $rel_tpl->setVariable(
405 "TARGET_NO_JS",
406 $ilCtrl->getLinkTargetByClass("ilexternalfeedblockgui", "disableJS")
407 );
408
409 return $rel_tpl->get();
410 }
getBlockId()
Get Block Id.
special template class to simplify handling of ITX/PEAR

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

Referenced by fillDataSection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFormEditMode()

ilExternalFeedBlockGUI::getFormEditMode ( )

Get FormEditMode.

Returns
int Form Edit Mode

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

References $form_edit_mode.

◆ getGuiObject()

ilExternalFeedBlockGUI::getGuiObject ( )

Get GuiObject.

Returns
object GUI object

Reimplemented from ilBlockGUI.

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

References $gui_object.

Referenced by cancelUpdateFeedBlock(), exitSaveFeedBlock(), exitUpdateFeedBlock(), and prepareSaveFeedBlock().

+ Here is the caller graph for this function:

◆ getHTML()

ilExternalFeedBlockGUI::getHTML ( )

Get block HTML code.

Reimplemented from ilBlockGUI.

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

310 {
311 $ilCtrl = $this->ctrl;
314 $ilAccess = $this->access;
315
316
317 $feed_set = new ilSetting("feed");
318
319 if ($feed_set->get("disable_rep_feeds")) {
320 return "";
321 }
322
323 // if no dynamic reload
324 if (!$this->getDynamic()) {
325 $this->feed->fetch();
326 $this->setData(array_map(function ($i) {
327 return ["item" => $i];
328 }, $this->feed->getItems()));
329 }
330
331 //$this->setTitle($this->feed->getChannelTitle());
332 //$this->setData($this->feed->getItems());
333
334 if ($ilAccess->checkAccess("write", "", $this->getRefId())) {
335 $ilCtrl->setParameterByClass(
336 "ilobjexternalfeedgui",
337 "ref_id",
338 $this->getRefId()
339 );
340 $ilCtrl->setParameter($this, "external_feed_block_id", $this->getBlockId());
341 $this->addBlockCommand(
342 $ilCtrl->getLinkTargetByClass(
343 array("ilrepositorygui", "ilobjexternalfeedgui",
344 "ilexternalfeedblockgui"),
345 "editFeedBlock"
346 ),
347 $lng->txt("settings")
348 );
349 $ilCtrl->clearParametersByClass("ilobjexternalfeedgui");
350 }
351
352 // JS enabler
353 $add = "";
354 if ($_SESSION["il_feed_js"] == "n" ||
355 ($ilUser->getPref("il_feed_js") == "n" && $_SESSION["il_feed_js"] != "y")) {
356 $add = $this->getJSEnabler();
357 }
358
359 return parent::getHTML() . $add;
360 }
setData($a_data)
Set Data.
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
getRefId()
Get Ref Id (only used if isRepositoryObject() is true).
ILIAS Setting Class.
$i
Definition: metadata.php:24
$feed_set
Definition: privfeed.php:19

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

Referenced by enableJS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getJSEnabler()

ilExternalFeedBlockGUI::getJSEnabler ( )

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

413 {
414 $ilCtrl = $this->ctrl;
416
417 $ilCtrl->setParameterByClass(
418 "ilcolumngui",
419 "block_id",
420 "block_feed_" . $this->getBlockId()
421 );
422
423 $rel_tpl = new ilTemplate("tpl.js_enabler.html", true, true, "Services/Feeds");
424 $rel_tpl->setVariable("BLOCK_ID", "block_feed_" . $this->getBlockId());
425 $rel_tpl->setVariable(
426 "TARGET",
427 $ilCtrl->getLinkTargetByClass("ilexternalfeedblockgui", "enableJS", true, "", false)
428 );
429
430 return $rel_tpl->get();
431 }

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

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getListItemForData()

ilExternalFeedBlockGUI::getListItemForData ( array  $data)
protected

Get list item for data array.

Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item

Get list item for data array.

Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item

Reimplemented from ilBlockGUI.

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

738 {
740 $f = $this->ui->factory();
741
742 $item = $data["item"];
743
744 //if ($this->isRepositoryObject() && !$ilAccess->checkAccess("read", "", $this->getRefId()))
745 $ctrl->setParameter($this, "feed_item_id", $item->getId());
746 $button = $f->button()->shy(
747 $item->getTitle(),
748 $ctrl->getLinkTarget($this, "showFeedItem", "", false, false)
749 );
750 $ctrl->setParameter($this, "feed_item_id", "");
751
752 return $f->item()->standard($button);
753 }
Common interface to all items.
Definition: Item.php:11
ui()
Definition: ui.php:5

References ilBlockGUI\$ctrl, ilBlockGUI\$data, Vendor\Package\$f, and ui().

+ Here is the call graph for this function:

◆ getOverview()

ilExternalFeedBlockGUI::getOverview ( )

Get overview.

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

481 {
484 $ilCtrl = $this->ctrl;
485
486 $this->setEnableNumInfo(false);
487 return '<div class="small">' . ((int) count($this->getData())) . " " . $lng->txt("feed_feed_items") . "</div>";
488 }
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.

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

Referenced by fillDataSection().

+ 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.

Reimplemented from ilBlockGUI.

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

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

References $DIC, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

◆ getValuesFeedBlock()

ilExternalFeedBlockGUI::getValuesFeedBlock ( )

FORM FeedBlock: Get current values for ExternalFeedBlock form.

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

256 {
257 $values = array();
258
259 $values["block_title"] = $this->external_feed_block->getTitle();
260 $values["block_feed_url"] = $this->external_feed_block->getFeedUrl();
261
262 $this->form_gui->setValuesByArray($values);
263 }

Referenced by editFeedBlock().

+ Here is the caller graph for this function:

◆ importFile()

ilExternalFeedBlockGUI::importFile ( )

Import.

@access public

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

594 {
598
599 $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
600
601 // create permission is already checked in createObject. This check here is done to prevent hacking attempts
602 if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type)) {
603 $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
604 }
605 $this->ctrl->setParameter($this, "new_type", $new_type);
606 $this->initImportForm($new_type);
607 if ($this->form->checkInput()) {
608 // todo: make some check on manifest file
609 include_once("./Services/Export/classes/class.ilImport.php");
610 $imp = new ilImport((int) $_GET['ref_id']);
611 $new_id = $imp->importObject(
612 $newObj,
613 $_FILES["importfile"]["tmp_name"],
614 $_FILES["importfile"]["name"],
615 $new_type
616 );
617
618 // put new object id into tree
619 if ($new_id > 0) {
620 $newObj = ilObjectFactory::getInstanceByObjId($new_id);
621 $newObj->createReference();
622 $newObj->putInTree($_GET["ref_id"]);
623 $newObj->setPermissions($_GET["ref_id"]);
624 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
625 $this->exitSaveFeedBlock();
626 }
627 return;
628 }
629
630 $this->form->setValuesByPost();
631 $tpl->setContent($this->form->getHtml());
632 }
$_POST["username"]
exitSaveFeedBlock()
FORM FeedBlock: Exit save.
Import class.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
redirection script todo: (a better solution should control the processing via a xml file)

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

+ 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

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

642 {
644
645 $lng->loadLanguageModule("block");
646
647 require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
648
649 $this->form_gui = new ilPropertyFormGUI();
650
651 // Property Title
652 $text_input = new ilTextInputGUI($lng->txt("block_feed_block_title"), "block_title");
653 $text_input->setInfo("");
654 $text_input->setRequired(true);
655 $text_input->setMaxLength(200);
656 $this->form_gui->addItem($text_input);
657
658 // Property FeedUrl
659 $text_input = new ilFeedUrlInputGUI($lng->txt("block_feed_block_feed_url"), "block_feed_url");
660 $text_input->setInfo($lng->txt("block_feed_block_feed_url_info"));
661 $text_input->setRequired(true);
662 $text_input->setMaxLength(250);
663 $this->form_gui->addItem($text_input);
664
665
666 // save and cancel commands
667 if (in_array($a_mode, array(self::FORM_CREATE,self::FORM_RE_CREATE))) {
668 $this->form_gui->addCommandButton("saveFeedBlock", $lng->txt("save"));
669 $this->form_gui->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
670 } else {
671 $this->form_gui->addCommandButton("updateFeedBlock", $lng->txt("save"));
672 $this->form_gui->addCommandButton("cancelUpdateFeedBlock", $lng->txt("cancel"));
673 }
674
675 $this->form_gui->setTitle($lng->txt("block_feed_block_head"));
676 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
677 }
This class represents a feed url property in a property form.
This class represents a property form user interface.
This class represents a text property in a property form.

References ilBlockGUI\$lng.

Referenced by createFeedBlock(), editFeedBlock(), saveFeedBlock(), and updateFeedBlock().

+ Here is the caller graph for this function:

◆ initImportForm()

ilExternalFeedBlockGUI::initImportForm (   $a_new_type = "")

Init object import form.

Parameters
stringnew type

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

563 {
565 $ilCtrl = $this->ctrl;
566
567 $lng->loadLanguageModule("feed");
568
569 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
570 $this->form = new ilPropertyFormGUI();
571 $this->form->setTarget("_top");
572
573 // Import file
574 include_once("./Services/Form/classes/class.ilFileInputGUI.php");
575 $fi = new ilFileInputGUI($lng->txt("import_file"), "importfile");
576 $fi->setSuffixes(array("zip"));
577 $fi->setRequired(true);
578 $this->form->addItem($fi);
579
580 $this->form->addCommandButton("importFile", $lng->txt("import"));
581 $this->form->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
582 $this->form->setTitle($lng->txt($a_new_type . "_import"));
583
584 $ilCtrl->setParameter($this, "new_type", $a_new_type);
585 $this->form->setFormAction($ilCtrl->getFormAction($this));
586 }
This class represents a file property in a property form.

References ilBlockGUI\$ctrl, and ilBlockGUI\$lng.

Referenced by create(), and importFile().

+ Here is the caller graph for this function:

◆ isRepositoryObject()

ilExternalFeedBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Returns
bool

Reimplemented from ilBlockGUI.

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

86 : bool
87 {
88 return true;
89 }

Referenced by fillRow().

+ 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 684 of file class.ilExternalFeedBlockGUI.php.

685 {
686 $this->getGuiObject()->save($a_feed_block);
687 $a_feed_block->setType($this->getBlockType());
688 }

References getBlockType(), and getGuiObject().

Referenced by saveFeedBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFeedBlock()

ilExternalFeedBlockGUI::saveFeedBlock ( )

FORM FeedBlock: Save ExternalFeedBlock.

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

207 {
208 $this->initFormFeedBlock(self::FORM_CREATE);
209
210 $this->external_feed_block = new ilExternalFeedBlock();
211
212 if ($this->form_gui->checkInput() &&
213 !$this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput("block_feed_url"))) {
214 $this->external_feed_block->setTitle($this->form_gui->getInput("block_title"));
215 $this->external_feed_block->setFeedUrl($this->form_gui->getInput("block_feed_url"));
216 $this->prepareSaveFeedBlock($this->external_feed_block);
217 $this->external_feed_block->create();
218 $this->exitSaveFeedBlock();
219 } else {
220 if ($this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput("block_feed_url"))) {
221 ilUtil::sendFailure($this->lng->txt("feed_no_local_url"), true);
222 }
223 $this->form_gui->setValuesByPost();
224 return $this->form_gui->getHtml();
225 }
226 }
prepareSaveFeedBlock(&$a_feed_block)
FORM FeedBlock: Prepare Saving of FeedBlock.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References exitSaveFeedBlock(), initFormFeedBlock(), prepareSaveFeedBlock(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ setBlock()

ilExternalFeedBlockGUI::setBlock (   $a_block)

Do most of the initialisation.

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

121 {
122 $ilCtrl = $this->ctrl;
123
124 // init block
125 $this->feed_block = $a_block;
126 $this->setTitle($this->feed_block->getTitle());
127 $this->setBlockId($this->feed_block->getId());
128
129 // get feed object
130 include_once("./Services/Feeds/classes/class.ilExternalFeed.php");
131 $this->feed = new ilExternalFeed();
132 $this->feed->setUrl($this->feed_block->getFeedUrl());
133
134 // init details
135
136 $ilCtrl->setParameter($this, "block_id", $this->feed_block->getId());
137 }
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
Handles external Feeds via Magpie library.

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

+ Here is the call graph for this function:

◆ setFormEditMode()

ilExternalFeedBlockGUI::setFormEditMode (   $a_form_edit_mode)

Set FormEditMode.

Parameters
int$a_form_edit_modeForm Edit Mode

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

167 {
168 $this->form_edit_mode = $a_form_edit_mode;
169 }

◆ setGuiObject()

ilExternalFeedBlockGUI::setGuiObject ( $a_gui_object)

Set GuiObject.

Parameters
object$a_gui_objectGUI object

Reimplemented from ilBlockGUI.

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

147 {
148 $this->gui_object = $a_gui_object;
149 }

◆ showFeedItem()

ilExternalFeedBlockGUI::showFeedItem ( )

Show Feed Item.

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

494 {
496 $ilCtrl = $this->ctrl;
497
498 include_once("./Services/News/classes/class.ilNewsItem.php");
499
500 $this->feed->fetch();
501 foreach ($this->feed->getItems() as $item) {
502 if ($item->getId() == $_GET["feed_item_id"]) {
503 $c_item = $item;
504 break;
505 }
506 }
507
508 $tpl = new ilTemplate("tpl.show_feed_item.html", true, true, "Services/Feeds");
509
510 if (is_object($c_item)) {
511 if (trim($c_item->getSummary()) != "") { // summary
512 $tpl->setCurrentBlock("content");
513 $tpl->setVariable("VAL_CONTENT", $c_item->getSummary());
514 $tpl->parseCurrentBlock();
515 }
516 if (trim($c_item->getDate()) != "" || trim($c_item->getAuthor()) != "") { // date
517 $tpl->setCurrentBlock("date_author");
518 if (trim($c_item->getAuthor()) != "") {
519 $tpl->setVariable("VAL_AUTHOR", $c_item->getAuthor() . " - ");
520 }
521 $tpl->setVariable("VAL_DATE", $c_item->getDate());
522 $tpl->parseCurrentBlock();
523 }
524
525 if (trim($c_item->getLink()) != "") { // link
526 $tpl->setCurrentBlock("plink");
527 $tpl->setVariable("HREF_LINK", $c_item->getLink());
528 $tpl->setVariable("TXT_LINK", $lng->txt("feed_open_source_page"));
529 $tpl->parseCurrentBlock();
530 }
531 $tpl->setVariable("VAL_TITLE", $c_item->getTitle()); // title
532 }
533
534 $content_block = new ilDashboardContentBlockGUI();
535 $content_block->setContent($tpl->get());
536 $content_block->setTitle($this->getTitle());
537
538 return $content_block->getHTML();
539 }
getTitle()
Get Title.
BlockGUI class for (centered) Content on Personal Desktop.

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

+ Here is the call graph for this function:

◆ updateFeedBlock()

ilExternalFeedBlockGUI::updateFeedBlock ( )

FORM FeedBlock: Update ExternalFeedBlock.

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

233 {
234 $this->initFormFeedBlock(self::FORM_EDIT);
235 if ($this->form_gui->checkInput() &&
236 !$this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput("block_feed_url"))) {
237 $this->external_feed_block->setTitle($this->form_gui->getInput("block_title"));
238 $this->external_feed_block->setFeedUrl($this->form_gui->getInput("block_feed_url"));
239 $this->external_feed_block->update();
240 $this->exitUpdateFeedBlock();
241 } else {
242 if ($this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput("block_feed_url"))) {
243 ilUtil::sendFailure($this->lng->txt("feed_no_local_url"));
244 }
245 $this->form_gui->setValuesByPost();
246 return $this->form_gui->getHtml();
247 }
248 }
exitUpdateFeedBlock()
FORM FeedBlock: Exit save.

References exitUpdateFeedBlock(), initFormFeedBlock(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilExternalFeedBlockGUI::$block_type = "feed"
static

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

Referenced by getBlockType().

◆ $form_edit_mode

ilExternalFeedBlockGUI::$form_edit_mode
protected

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

Referenced by getFormEditMode().

◆ $gui_object

ilExternalFeedBlockGUI::$gui_object
protected

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

Referenced by getGuiObject().

◆ $new_rendering

ilExternalFeedBlockGUI::$new_rendering = true
protected

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

◆ $obj_definition

ilExternalFeedBlockGUI::$obj_definition
protected

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

◆ $rbacsystem

ilExternalFeedBlockGUI::$rbacsystem
protected

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

Referenced by importFile().

◆ $settings

ilExternalFeedBlockGUI::$settings
protected

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

◆ FORM_CREATE

const ilExternalFeedBlockGUI::FORM_CREATE = 1

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

◆ FORM_EDIT

const ilExternalFeedBlockGUI::FORM_EDIT = 0

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

◆ FORM_RE_CREATE

const ilExternalFeedBlockGUI::FORM_RE_CREATE = 2

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

◆ FORM_RE_EDIT

const ilExternalFeedBlockGUI::FORM_RE_EDIT = 2

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


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