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

BlockGUI class for external feed block on the personal desktop. More...

+ Inheritance diagram for ilPDExternalFeedBlockGUI:
+ Collaboration diagram for ilPDExternalFeedBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getBlockType ()
 
Returns
string
More...
 
 setBlock ($a_block)
 Do most of the initialisation. More...
 
 executeCommand ()
 execute command More...
 
 fillDataSection ()
 Fill data section. More...
 
 getHTML ()
 Get block HTML code. More...
 
 getDynamic ()
 
 getDynamicReload ()
 
 getJSEnabler ()
 
 disableJS ()
 
 enableJS ()
 
 fillRow ($item)
 Fill feed item row. More...
 
 getOverview ()
 Get overview. More...
 
 showFeedItem ()
 Show Feed Item. More...
 
 create ()
 Create Form for Block. More...
 
 initFormFeedBlock ($a_mode)
 FORM FeedBlock: Init form. More...
 
 prepareSaveFeedBlock (&$a_feed_block)
 FORM FeedBlock: Prepare Saving of FeedBlock. More...
 
 confirmDeleteFeedBlock ()
 Confirmation of feed block deletion. More...
 
 exitDeleteFeedBlock ()
 Cancel deletion of feed block. More...
 
 deleteFeedBlock ()
 Delete feed block. More...
 
- Public Member Functions inherited from ilExternalFeedBlockGUIGen
 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 setFormEditMode ($a_form_edit_mode)
 Set FormEditMode. More...
 
 getFormEditMode ()
 Get FormEditMode. More...
 
 createFeedBlock ()
 FORM FeedBlock: Create ExternalFeedBlock. More...
 
 editFeedBlock ()
 FORM FeedBlock: Edit form. More...
 
 saveFeedBlock ()
 FORM FeedBlock: Save ExternalFeedBlock. More...
 
 updateFeedBlock ()
 FORM FeedBlock: Update ExternalFeedBlock. More...
 
 initFormFeedBlock ($a_mode)
 FORM FeedBlock: Init form. More...
 
 getValuesFeedBlock ()
 FORM FeedBlock: Get current values for ExternalFeedBlock form. More...
 
 cancelSaveFeedBlock ()
 FORM FeedBlock: Cancel save. More...
 
 cancelUpdateFeedBlock ()
 FORM FeedBlock: Cancel update. More...
 
 exitSaveFeedBlock ()
 FORM FeedBlock: Exit save. More...
 
 exitUpdateFeedBlock ()
 FORM FeedBlock: Exit update. More...
 
 prepareSaveFeedBlock (&$a_external_feed_block)
 FORM FeedBlock: Prepare Saving of ExternalFeedBlock. More...
 
 prepareFormFeedBlock (&$a_form_gui)
 FORM FeedBlock: Prepare form. More...
 
- Public Member Functions inherited from ilBlockGUI
 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 getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "pdfeed"
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object.
Returns
bool
More...
 
- 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
 
- 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 on the personal desktop.

Within the repository ilExternalFeedBlockGUI is used. is used.

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

@ilCtrl_IsCalledBy ilPDExternalFeedBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPDExternalFeedBlockGUI::__construct ( )

Constructor.

Reimplemented from ilExternalFeedBlockGUIGen.

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

52 {
53 global $DIC;
54
55 $this->ctrl = $DIC->ctrl();
56 $this->lng = $DIC->language();
57 $this->user = $DIC->user();
58 $this->access = $DIC->access();
59 $this->settings = $DIC->settings();
60 $lng = $DIC->language();
61
62 parent::__construct();
63
64 $lng->loadLanguageModule("feed");
65
66 $this->setLimit(5);
67 $this->setRowTemplate("tpl.block_external_feed_row.html", "Services/Feeds");
68 }
user()
Definition: user.php:4
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2

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

+ Here is the call graph for this function:

Member Function Documentation

◆ confirmDeleteFeedBlock()

ilPDExternalFeedBlockGUI::confirmDeleteFeedBlock ( )

Confirmation of feed block deletion.

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

470 {
473
474 include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
475 $c_gui = new ilConfirmationGUI();
476
477 // set confirm/cancel commands
478 $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteFeedBlock"));
479 $c_gui->setHeaderText($lng->txt("info_delete_sure"));
480 $c_gui->setCancel($lng->txt("cancel"), "exitDeleteFeedBlock");
481 $c_gui->setConfirm($lng->txt("confirm"), "deleteFeedBlock");
482
483 // add items to delete
484 $c_gui->addItem(
485 "external_feed_block_id",
486 $this->feed_block->getId(),
487 $this->feed_block->getTitle(),
488 ilUtil::getImagePath("icon_feed.svg")
489 );
490
491 return $c_gui->getHTML();
492 }
Confirmation screen class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ create()

ilPDExternalFeedBlockGUI::create ( )

Create Form for Block.

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

402 {
403 return $this->createFeedBlock();
404 }
createFeedBlock()
FORM FeedBlock: Create ExternalFeedBlock.

References ilExternalFeedBlockGUIGen\createFeedBlock().

+ Here is the call graph for this function:

◆ deleteFeedBlock()

ilPDExternalFeedBlockGUI::deleteFeedBlock ( )

Delete feed block.

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

508 {
510
511 $this->feed_block->delete();
512 $ilCtrl->returnToParent($this);
513 }

References ilBlockGUI\$ctrl, and $ilCtrl.

◆ disableJS()

ilPDExternalFeedBlockGUI::disableJS ( )

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

295 {
298
299 $_SESSION["il_feed_js"] = "n";
300 $ilUser->writePref("il_feed_js", "n");
301 $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
302 }
$_SESSION["AccountId"]
$ilUser
Definition: imgupload.php:18

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

◆ enableJS()

ilPDExternalFeedBlockGUI::enableJS ( )

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

305 {
307
308 $_SESSION["il_feed_js"] = "y";
309 $ilUser->writePref("il_feed_js", "y");
310 echo $this->getHTML();
311 exit;
312 }
exit
Definition: backend.php:16

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

+ Here is the call graph for this function:

◆ executeCommand()

ilPDExternalFeedBlockGUI::executeCommand ( )

execute command

Reimplemented from ilExternalFeedBlockGUIGen.

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

139 {
141
142 $next_class = $ilCtrl->getNextClass();
143 $cmd = $ilCtrl->getCmd("getHTML");
144
145 switch ($next_class) {
146 default:
147 return $this->$cmd();
148 }
149 }

References ilBlockGUI\$ctrl, and $ilCtrl.

◆ exitDeleteFeedBlock()

ilPDExternalFeedBlockGUI::exitDeleteFeedBlock ( )

Cancel deletion of feed block.

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

498 {
500
501 $ilCtrl->returnToParent($this);
502 }

References ilBlockGUI\$ctrl, and $ilCtrl.

◆ fillDataSection()

ilPDExternalFeedBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

155 {
156 if ($this->getDynamic()) {
157 $this->setDataSection($this->getDynamicReload());
158 } elseif ($this->getCurrentDetailLevel() > 1 && count($this->getData()) > 0) {
159 parent::fillDataSection();
160 } else {
161 $this->setDataSection($this->getOverview());
162 }
163 }
getCurrentDetailLevel()
Get Current Detail Level.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
getData()
Get Data.

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

+ Here is the call graph for this function:

◆ fillRow()

ilPDExternalFeedBlockGUI::fillRow (   $item)

Fill feed item row.

Reimplemented from ilBlockGUI.

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

318 {
320
321 $ilCtrl->setParameter($this, "feed_item_id", $item->getId());
322 $this->tpl->setVariable("VAL_TITLE", $item->getTitle());
323 $this->tpl->setVariable(
324 "HREF_SHOW",
325 $ilCtrl->getLinkTarget($this, "showFeedItem")
326 );
327 $ilCtrl->setParameter($this, "feed_item_id", "");
328 }

References ilBlockGUI\$ctrl, and $ilCtrl.

◆ getBlockType()

ilPDExternalFeedBlockGUI::getBlockType ( )

Returns
string

Reimplemented from ilBlockGUI.

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

73 : string
74 {
75 return self::$block_type;
76 }

References $block_type.

◆ getDynamic()

ilPDExternalFeedBlockGUI::getDynamic ( )

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

223 {
226
227 if ($ilCtrl->getCmdClass() != "ilcolumngui" && $ilCtrl->getCmd() != "enableJS") {
228 $sess_feed_js = "";
229 if (isset($_SESSION["il_feed_js"])) {
230 $sess_feed_js = $_SESSION["il_feed_js"];
231 }
232 if ($sess_feed_js != "n" &&
233 ($ilUser->getPref("il_feed_js") != "n" || $sess_feed_js == "y")) {
234 // do not get feed dynamically, if cache hit is given.
235 if (!$this->feed->checkCacheHit()) {
236 return true;
237 }
238 }
239 }
240
241 return false;
242 }

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

Referenced by fillDataSection(), and getHTML().

+ Here is the caller graph for this function:

◆ getDynamicReload()

ilPDExternalFeedBlockGUI::getDynamicReload ( )

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

245 {
248
249 $ilCtrl->setParameterByClass(
250 "ilcolumngui",
251 "block_id",
252 "block_pdfeed_" . $this->getBlockId()
253 );
254
255 $rel_tpl = new ilTemplate("tpl.dynamic_reload.html", true, true, "Services/Feeds");
256 $rel_tpl->setVariable("TXT_LOADING", $lng->txt("feed_loading_feed"));
257 $rel_tpl->setVariable("BLOCK_ID", "block_pdfeed_" . $this->getBlockId());
258 $rel_tpl->setVariable(
259 "TARGET",
260 $ilCtrl->getLinkTargetByClass("ilcolumngui", "updateBlock", "", true)
261 );
262
263 // no JS
264 $rel_tpl->setVariable("TXT_FEED_CLICK_HERE", $lng->txt("feed_no_js_click_here"));
265 $rel_tpl->setVariable(
266 "TARGET_NO_JS",
267 $ilCtrl->getLinkTargetByClass("ilpdexternalfeedblockgui", "disableJS")
268 );
269
270 return $rel_tpl->get();
271 }
getBlockId()
Get Block Id.
special template class to simplify handling of ITX/PEAR

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

Referenced by fillDataSection().

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

◆ getHTML()

ilPDExternalFeedBlockGUI::getHTML ( )

Get block HTML code.

Reimplemented from ilBlockGUI.

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

169 {
174
175
176 if ($ilSetting->get("block_limit_pdfeed") == 0) {
177 return "";
178 }
179
180 if ($this->getCurrentDetailLevel() == 0) {
181 return "";
182 }
183
184
185 // if no dynamic reload
186 if (!$this->getDynamic()) {
187 $this->feed->fetch();
188 $this->setData($this->feed->getItems());
189 }
190
191 $ilCtrl->setParameter(
192 $this,
193 "external_feed_block_id",
194 $this->getBlockId()
195 );
196 $this->addBlockCommand(
197 $ilCtrl->getLinkTarget(
198 $this,
199 "editFeedBlock"
200 ),
201 $lng->txt("edit")
202 );
203 $this->addBlockCommand(
204 $ilCtrl->getLinkTarget(
205 $this,
206 "confirmDeleteFeedBlock"
207 ),
208 $lng->txt("delete")
209 );
210 $ilCtrl->setParameter($this, "external_feed_block_id", "");
211
212 // JS enabler
213 $add = "";
214 if ($_SESSION["il_feed_js"] == "n" ||
215 ($ilUser->getPref("il_feed_js") == "n" && $_SESSION["il_feed_js"] != "y")) {
216 $add = $this->getJSEnabler();
217 }
218
219 return parent::getHTML() . $add;
220 }
setData($a_data)
Set Data.
addBlockCommand( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
global $ilSetting
Definition: privfeed.php:17

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

Referenced by enableJS().

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

◆ getJSEnabler()

ilPDExternalFeedBlockGUI::getJSEnabler ( )

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

274 {
276
277 $ilCtrl->setParameterByClass(
278 "ilcolumngui",
279 "block_id",
280 "block_pdfeed_" . $this->getBlockId()
281 );
282
283 $rel_tpl = new ilTemplate("tpl.js_enabler.html", true, true, "Services/Feeds");
284 $rel_tpl->setVariable("BLOCK_ID", "block_pdfeed_" . $this->getBlockId());
285 $rel_tpl->setVariable(
286 "TARGET",
287 $ilCtrl->getLinkTargetByClass("ilpdexternalfeedblockgui", "enableJS", true)
288 );
289
290 return $rel_tpl->get();
291 }

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

Referenced by getHTML().

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

◆ getOverview()

ilPDExternalFeedBlockGUI::getOverview ( )

Get overview.

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

334 {
336
337 $this->setEnableNumInfo(false);
338 return '<div class="small">' . ((int) count($this->getData())) . " " . $lng->txt("feed_feed_items") . "</div>";
339 }
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.

References ilBlockGUI\$lng, 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 ilPDExternalFeedBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

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

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

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

◆ initFormFeedBlock()

ilPDExternalFeedBlockGUI::initFormFeedBlock (   $a_mode)

FORM FeedBlock: Init form.

(We need to overwrite, because Generator does not know FeedUrl Inputs yet.

Parameters
int$a_modeForm Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)

Reimplemented from ilExternalFeedBlockGUIGen.

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

413 {
415
416 $lng->loadLanguageModule("block");
417
418 require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
419
420 $this->form_gui = new ilPropertyFormGUI();
421
422 // Property Title
423 $text_input = new ilTextInputGUI($lng->txt("block_feed_block_title"), "block_title");
424 $text_input->setInfo("");
425 $text_input->setRequired(true);
426 $text_input->setMaxLength(200);
427 $this->form_gui->addItem($text_input);
428
429 // Property FeedUrl
430 $text_input = new ilFeedUrlInputGUI($lng->txt("block_feed_block_feed_url"), "block_feed_url");
431 $text_input->setInfo($lng->txt("block_feed_block_feed_url_info"));
432 $text_input->setRequired(true);
433 $text_input->setMaxLength(250);
434 $this->form_gui->addItem($text_input);
435
436
437 // save and cancel commands
438 if (in_array($a_mode, array(IL_FORM_CREATE,IL_FORM_RE_CREATE))) {
439 $this->form_gui->addCommandButton("saveFeedBlock", $lng->txt("save"));
440 $this->form_gui->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
441 } else {
442 $this->form_gui->addCommandButton("updateFeedBlock", $lng->txt("save"));
443 $this->form_gui->addCommandButton("cancelUpdateFeedBlock", $lng->txt("cancel"));
444 }
445
446 $this->form_gui->setTitle($lng->txt("block_feed_block_head"));
447 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
448
449 $this->prepareFormFeedBlock($this->form_gui);
450 }
prepareFormFeedBlock(&$a_form_gui)
FORM FeedBlock: Prepare form.
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, IL_FORM_CREATE, IL_FORM_RE_CREATE, and ilExternalFeedBlockGUIGen\prepareFormFeedBlock().

+ Here is the call graph for this function:

◆ isRepositoryObject()

ilPDExternalFeedBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Returns
bool

Reimplemented from ilBlockGUI.

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

81 : bool
82 {
83 return false;
84 }

◆ prepareSaveFeedBlock()

ilPDExternalFeedBlockGUI::prepareSaveFeedBlock ( $a_feed_block)

FORM FeedBlock: Prepare Saving of FeedBlock.

Parameters
object$a_feed_blockFeedBlock object.

Reimplemented from ilExternalFeedBlockGUIGen.

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

458 {
460
461 $a_feed_block->setContextObjId($ilCtrl->getContextObjId());
462 $a_feed_block->setContextObjType($ilCtrl->getContextObjType());
463 $a_feed_block->setType("pdfeed");
464 }

References ilBlockGUI\$ctrl, and $ilCtrl.

◆ setBlock()

ilPDExternalFeedBlockGUI::setBlock (   $a_block)

Do most of the initialisation.

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

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

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

+ Here is the call graph for this function:

◆ showFeedItem()

ilPDExternalFeedBlockGUI::showFeedItem ( )

Show Feed Item.

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

345 {
348
349 include_once("./Services/News/classes/class.ilNewsItem.php");
350
351 $this->feed->fetch();
352 foreach ($this->feed->getItems() as $item) {
353 if ($item->getId() == $_GET["feed_item_id"]) {
354 $c_item = $item;
355 break;
356 }
357 }
358
359 $tpl = new ilTemplate("tpl.show_feed_item.html", true, true, "Services/Feeds");
360
361 if (is_object($c_item)) {
362 if (trim($c_item->getSummary()) != "") { // summary
363 $tpl->setCurrentBlock("content");
364 $tpl->setVariable("VAL_CONTENT", $c_item->getSummary());
365 $tpl->parseCurrentBlock();
366 }
367 if (trim($c_item->getDate()) != "" || trim($c_item->getAuthor()) != "") { // date
368 $tpl->setCurrentBlock("date_author");
369 if (trim($c_item->getAuthor()) != "") {
370 $tpl->setVariable("VAL_AUTHOR", $c_item->getAuthor() . " - ");
371 }
372 $tpl->setVariable("VAL_DATE", $c_item->getDate());
373 $tpl->parseCurrentBlock();
374 }
375
376 if (trim($c_item->getLink()) != "") { // link
377 $tpl->setCurrentBlock("plink");
378 $tpl->setVariable("HREF_LINK", $c_item->getLink());
379 $tpl->setVariable("TXT_LINK", $lng->txt("feed_open_source_page"));
380 $tpl->parseCurrentBlock();
381 }
382 $tpl->setVariable("VAL_TITLE", $c_item->getTitle()); // title
383 }
384
385 include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
386 $content_block = new ilPDContentBlockGUI();
387 $content_block->setContent($tpl->get());
388 $content_block->setTitle($this->getTitle());
389 $content_block->setImage(ilUtil::getImagePath("icon_feed.svg"));
390 $content_block->addHeaderCommand(
391 $ilCtrl->getParentReturn($this),
392 $lng->txt("selected_items_back")
393 );
394
395 return $content_block->getHTML();
396 }
$_GET["client_id"]
getTitle()
Get Title.
BlockGUI class for (centered) Content on Personal Desktop.

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

+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilPDExternalFeedBlockGUI::$block_type = "pdfeed"
static

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

Referenced by getBlockType().

◆ $settings

ilPDExternalFeedBlockGUI::$settings
protected

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

Referenced by getHTML().


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