ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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

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

Static Public Member Functions

static getBlockType ()
 Get block type. More...
 
static isRepositoryObject ()
 Get block type. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "pdfeed"
 

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
- Protected Attributes inherited from ilExternalFeedBlockGUIGen
 $gui_object
 
 $form_edit_mode
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 

Detailed Description

BlockGUI class for external feed block 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.

Member Function Documentation

◆ confirmDeleteFeedBlock()

ilPDExternalFeedBlockGUI::confirmDeleteFeedBlock ( )

Confirmation of feed block deletion.

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

456 {
457 global $ilCtrl, $lng;
458
459 include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
460 $c_gui = new ilConfirmationGUI();
461
462 // set confirm/cancel commands
463 $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteFeedBlock"));
464 $c_gui->setHeaderText($lng->txt("info_delete_sure"));
465 $c_gui->setCancel($lng->txt("cancel"), "exitDeleteFeedBlock");
466 $c_gui->setConfirm($lng->txt("confirm"), "deleteFeedBlock");
467
468 // add items to delete
469 $c_gui->addItem("external_feed_block_id",
470 $this->feed_block->getId(), $this->feed_block->getTitle(),
471 ilUtil::getImagePath("icon_feed.svg"));
472
473 return $c_gui->getHTML();
474 }
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
global $lng
Definition: privfeed.php:40

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

+ Here is the call graph for this function:

◆ create()

ilPDExternalFeedBlockGUI::create ( )

Create Form for Block.

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

384 {
385 return $this->createFeedBlock();
386 }
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 489 of file class.ilPDExternalFeedBlockGUI.php.

490 {
491 global $ilCtrl;
492
493 $this->feed_block->delete();
494 $ilCtrl->returnToParent($this);
495 }

References $ilCtrl.

◆ disableJS()

ilPDExternalFeedBlockGUI::disableJS ( )

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

276 {
277 global $ilCtrl, $ilUser;
278
279 $_SESSION["il_feed_js"] = "n";
280 $ilUser->writePref("il_feed_js", "n");
281 $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
282 }
$_SESSION["AccountId"]
global $ilUser
Definition: imgupload.php:15

References $_SESSION, $ilCtrl, and $ilUser.

◆ enableJS()

ilPDExternalFeedBlockGUI::enableJS ( )

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

285 {
286 global $ilUser;
287
288 $_SESSION["il_feed_js"] = "y";
289 $ilUser->writePref("il_feed_js", "y");
290 echo $this->getHTML();
291 exit;
292 }
exit
Definition: login.php:54

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

+ Here is the call graph for this function:

◆ executeCommand()

& ilPDExternalFeedBlockGUI::executeCommand ( )

execute command

Reimplemented from ilExternalFeedBlockGUIGen.

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

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

References $cmd, and $ilCtrl.

◆ exitDeleteFeedBlock()

ilPDExternalFeedBlockGUI::exitDeleteFeedBlock ( )

Cancel deletion of feed block.

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

480 {
481 global $ilCtrl;
482
483 $ilCtrl->returnToParent($this);
484 }

References $ilCtrl.

◆ fillDataSection()

ilPDExternalFeedBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

148 {
149 if ($this->getDynamic())
150 {
151 $this->setDataSection($this->getDynamicReload());
152 }
153 else if ($this->getCurrentDetailLevel() > 1 && count($this->getData()) > 0)
154 {
155 parent::fillDataSection();
156 }
157 else
158 {
159 $this->setDataSection($this->getOverview());
160 }
161 }
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 297 of file class.ilPDExternalFeedBlockGUI.php.

298 {
299 global $ilUser, $ilCtrl, $lng;
300
301 $ilCtrl->setParameter($this, "feed_item_id", $item->getId());
302 $this->tpl->setVariable("VAL_TITLE", $item->getTitle());
303 $this->tpl->setVariable("HREF_SHOW",
304 $ilCtrl->getLinkTarget($this, "showFeedItem"));
305 $ilCtrl->setParameter($this, "feed_item_id", "");
306 }

References $ilCtrl, $ilUser, and $lng.

◆ getBlockType()

static ilPDExternalFeedBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

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

References $block_type.

◆ getDynamic()

ilPDExternalFeedBlockGUI::getDynamic ( )

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

214 {
215 global $ilCtrl, $ilUser;
216
217 if ($ilCtrl->getCmdClass() != "ilcolumngui" && $ilCtrl->getCmd() != "enableJS")
218 {
219 $sess_feed_js = "";
220 if (isset($_SESSION["il_feed_js"]))
221 {
222 $sess_feed_js = $_SESSION["il_feed_js"];
223 }
224 if ($sess_feed_js != "n" &&
225 ($ilUser->getPref("il_feed_js") != "n" || $sess_feed_js == "y"))
226 {
227 // do not get feed dynamically, if cache hit is given.
228 if (!$this->feed->checkCacheHit())
229 {
230 return true;
231 }
232 }
233 }
234
235 return false;
236 }

References $_SESSION, $ilCtrl, and $ilUser.

Referenced by fillDataSection(), and getHTML().

+ Here is the caller graph for this function:

◆ getDynamicReload()

ilPDExternalFeedBlockGUI::getDynamicReload ( )

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

239 {
240 global $ilCtrl, $lng;
241
242 $ilCtrl->setParameterByClass("ilcolumngui", "block_id",
243 "block_pdfeed_".$this->getBlockId());
244
245 $rel_tpl = new ilTemplate("tpl.dynamic_reload.html", true, true, "Services/Feeds");
246 $rel_tpl->setVariable("TXT_LOADING", $lng->txt("feed_loading_feed"));
247 $rel_tpl->setVariable("BLOCK_ID", "block_pdfeed_".$this->getBlockId());
248 $rel_tpl->setVariable("TARGET",
249 $ilCtrl->getLinkTargetByClass("ilcolumngui", "updateBlock", "", true));
250
251 // no JS
252 $rel_tpl->setVariable("TXT_FEED_CLICK_HERE", $lng->txt("feed_no_js_click_here"));
253 $rel_tpl->setVariable("TARGET_NO_JS",
254 $ilCtrl->getLinkTargetByClass("ilpdexternalfeedblockgui", "disableJS"));
255
256 return $rel_tpl->get();
257 }
getBlockId()
Get Block Id.
special template class to simplify handling of ITX/PEAR

References $ilCtrl, $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 166 of file class.ilPDExternalFeedBlockGUI.php.

167 {
168 global $ilCtrl, $lng, $ilUser, $ilAccess, $ilSetting;
169
170 $feed_set = new ilSetting("feed");
171
172 if ($ilSetting->get("block_limit_pdfeed") == 0)
173 {
174 return "";
175 }
176
177 if ($this->getCurrentDetailLevel() == 0)
178 {
179 return "";
180 }
181
182
183 // if no dynamic reload
184 if (!$this->getDynamic())
185 {
186 $this->feed->fetch();
187 $this->setData($this->feed->getItems());
188 }
189
190 $ilCtrl->setParameter($this, "external_feed_block_id",
191 $this->getBlockId());
192 $this->addBlockCommand(
193 $ilCtrl->getLinkTarget($this,
194 "editFeedBlock"),
195 $lng->txt("edit"));
196 $this->addBlockCommand(
197 $ilCtrl->getLinkTarget($this,
198 "confirmDeleteFeedBlock"),
199 $lng->txt("delete"));
200 $ilCtrl->setParameter($this, "external_feed_block_id", "");
201
202 // JS enabler
203 $add = "";
204 if ($_SESSION["il_feed_js"] == "n" ||
205 ($ilUser->getPref("il_feed_js") == "n" && $_SESSION["il_feed_js"] != "y"))
206 {
207 $add = $this->getJSEnabler();
208 }
209
210 return parent::getHTML().$add;
211 }
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.
ILIAS Setting Class.
global $ilSetting
Definition: privfeed.php:40
$feed_set
Definition: privfeed.php:42

References $_SESSION, $feed_set, $ilCtrl, $ilSetting, $ilUser, $lng, 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 259 of file class.ilPDExternalFeedBlockGUI.php.

260 {
261 global $ilCtrl, $lng;
262
263 $ilCtrl->setParameterByClass("ilcolumngui", "block_id",
264 "block_pdfeed_".$this->getBlockId());
265
266 $rel_tpl = new ilTemplate("tpl.js_enabler.html", true, true, "Services/Feeds");
267 $rel_tpl->setVariable("BLOCK_ID", "block_pdfeed_".$this->getBlockId());
268 $rel_tpl->setVariable("TARGET",
269 $ilCtrl->getLinkTargetByClass("ilpdexternalfeedblockgui", "enableJS", true));
270
271 return $rel_tpl->get();
272 }

References $ilCtrl, $lng, 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 311 of file class.ilPDExternalFeedBlockGUI.php.

312 {
313 global $ilUser, $lng, $ilCtrl;
314
315 $this->setEnableNumInfo(false);
316 return '<div class="small">'.((int) count($this->getData()))." ".$lng->txt("feed_feed_items")."</div>";
317 }
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.

References $ilCtrl, $ilUser, $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 82 of file class.ilPDExternalFeedBlockGUI.php.

83 {
84 global $ilCtrl;
85
86 switch($ilCtrl->getCmd())
87 {
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 }
const IL_SCREEN_SIDE
const IL_SCREEN_CENTER

References $ilCtrl, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

◆ ilPDExternalFeedBlockGUI()

ilPDExternalFeedBlockGUI::ilPDExternalFeedBlockGUI ( )

Constructor.

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

47 {
48 global $ilCtrl, $lng;
49
50 parent::__construct();
51 parent::ilBlockGUI();
52
53 $lng->loadLanguageModule("feed");
54
55 $this->setLimit(5);
56 $this->setRowTemplate("tpl.block_external_feed_row.html", "Services/Feeds");
57 }
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.

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

+ Here is the call graph for this function:

◆ 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 394 of file class.ilPDExternalFeedBlockGUI.php.

395 {
396 global $lng;
397
398 $lng->loadLanguageModule("block");
399
400 include("Services/Form/classes/class.ilPropertyFormGUI.php");
401
402 $this->form_gui = new ilPropertyFormGUI();
403
404 // Property Title
405 $text_input = new ilTextInputGUI($lng->txt("block_feed_block_title"), "block_title");
406 $text_input->setInfo("");
407 $text_input->setRequired(true);
408 $text_input->setMaxLength(200);
409 $this->form_gui->addItem($text_input);
410
411 // Property FeedUrl
412 $text_input = new ilFeedUrlInputGUI($lng->txt("block_feed_block_feed_url"), "block_feed_url");
413 $text_input->setInfo($lng->txt("block_feed_block_feed_url_info"));
414 $text_input->setRequired(true);
415 $text_input->setMaxLength(250);
416 $this->form_gui->addItem($text_input);
417
418
419 // save and cancel commands
420 if (in_array($a_mode, array(IL_FORM_CREATE,IL_FORM_RE_CREATE)))
421 {
422 $this->form_gui->addCommandButton("saveFeedBlock", $lng->txt("save"));
423 $this->form_gui->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
424 }
425 else
426 {
427 $this->form_gui->addCommandButton("updateFeedBlock", $lng->txt("save"));
428 $this->form_gui->addCommandButton("cancelUpdateFeedBlock", $lng->txt("cancel"));
429 }
430
431 $this->form_gui->setTitle($lng->txt("block_feed_block_head"));
432 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
433
434 $this->prepareFormFeedBlock($this->form_gui);
435
436 }
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 $lng, IL_FORM_CREATE, IL_FORM_RE_CREATE, and ilExternalFeedBlockGUIGen\prepareFormFeedBlock().

+ Here is the call graph for this function:

◆ isRepositoryObject()

static ilPDExternalFeedBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

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

75 {
76 return false;
77 }

◆ prepareSaveFeedBlock()

ilPDExternalFeedBlockGUI::prepareSaveFeedBlock ( $a_feed_block)

FORM FeedBlock: Prepare Saving of FeedBlock.

Parameters
object$a_feed_blockFeedBlock object.

Reimplemented from ilExternalFeedBlockGUIGen.

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

444 {
445 global $ilCtrl;
446
447 $a_feed_block->setContextObjId($ilCtrl->getContextObjId());
448 $a_feed_block->setContextObjType($ilCtrl->getContextObjType());
449 $a_feed_block->setType("pdfeed");
450 }

References $ilCtrl.

◆ setBlock()

ilPDExternalFeedBlockGUI::setBlock (   $a_block)

Do most of the initialisation.

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

108 {
109 global $ilCtrl;
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 }
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 libaray.

References $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 322 of file class.ilPDExternalFeedBlockGUI.php.

323 {
324 global $lng, $ilCtrl;
325
326 include_once("./Services/News/classes/class.ilNewsItem.php");
327
328 $this->feed->fetch();
329 foreach($this->feed->getItems() as $item)
330 {
331 if ($item->getId() == $_GET["feed_item_id"])
332 {
333 $c_item = $item;
334 break;
335 }
336 }
337
338 $tpl = new ilTemplate("tpl.show_feed_item.html", true, true, "Services/Feeds");
339
340 if (is_object($c_item))
341 {
342 if (trim($c_item->getSummary()) != "") // summary
343 {
344 $tpl->setCurrentBlock("content");
345 $tpl->setVariable("VAL_CONTENT", $c_item->getSummary());
346 $tpl->parseCurrentBlock();
347 }
348 if (trim($c_item->getDate()) != "" || trim($c_item->getAuthor()) != "") // date
349 {
350 $tpl->setCurrentBlock("date_author");
351 if (trim($c_item->getAuthor()) != "")
352 {
353 $tpl->setVariable("VAL_AUTHOR", $c_item->getAuthor()." - ");
354 }
355 $tpl->setVariable("VAL_DATE", $c_item->getDate());
356 $tpl->parseCurrentBlock();
357 }
358
359 if (trim($c_item->getLink()) != "") // link
360 {
361 $tpl->setCurrentBlock("plink");
362 $tpl->setVariable("HREF_LINK", $c_item->getLink());
363 $tpl->setVariable("TXT_LINK", $lng->txt("feed_open_source_page"));
364 $tpl->parseCurrentBlock();
365 }
366 $tpl->setVariable("VAL_TITLE", $c_item->getTitle()); // title
367 }
368
369 include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
370 $content_block = new ilPDContentBlockGUI();
371 $content_block->setContent($tpl->get());
372 $content_block->setTitle($this->getTitle());
373 $content_block->setImage(ilUtil::getImagePath("icon_feed.svg"));
374 $content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
375 $lng->txt("selected_items_back"));
376
377 return $content_block->getHTML();
378 }
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
getTitle()
Get Title.
BlockGUI class for (centered) Content on Personal Desktop.

References $_GET, $ilCtrl, $lng, $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 41 of file class.ilPDExternalFeedBlockGUI.php.

Referenced by getBlockType().


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