ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 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
 __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 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.

Constructor & Destructor Documentation

◆ __construct()

ilPDExternalFeedBlockGUI::__construct ( )

Constructor.

Reimplemented from ilExternalFeedBlockGUIGen.

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ confirmDeleteFeedBlock()

ilPDExternalFeedBlockGUI::confirmDeleteFeedBlock ( )

Confirmation of feed block deletion.

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

455 {
456 global $ilCtrl, $lng;
457
458 include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
459 $c_gui = new ilConfirmationGUI();
460
461 // set confirm/cancel commands
462 $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteFeedBlock"));
463 $c_gui->setHeaderText($lng->txt("info_delete_sure"));
464 $c_gui->setCancel($lng->txt("cancel"), "exitDeleteFeedBlock");
465 $c_gui->setConfirm($lng->txt("confirm"), "deleteFeedBlock");
466
467 // add items to delete
468 $c_gui->addItem("external_feed_block_id",
469 $this->feed_block->getId(), $this->feed_block->getTitle(),
470 ilUtil::getImagePath("icon_feed.svg"));
471
472 return $c_gui->getHTML();
473 }
Confirmation screen class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

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

+ Here is the call graph for this function:

◆ create()

ilPDExternalFeedBlockGUI::create ( )

Create Form for Block.

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

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

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

References $ilCtrl.

◆ disableJS()

ilPDExternalFeedBlockGUI::disableJS ( )

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

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

References $_SESSION, $ilCtrl, and $ilUser.

◆ enableJS()

ilPDExternalFeedBlockGUI::enableJS ( )

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

284 {
285 global $ilUser;
286
287 $_SESSION["il_feed_js"] = "y";
288 $ilUser->writePref("il_feed_js", "y");
289 echo $this->getHTML();
290 exit;
291 }

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

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

References $cmd, and $ilCtrl.

◆ exitDeleteFeedBlock()

ilPDExternalFeedBlockGUI::exitDeleteFeedBlock ( )

Cancel deletion of feed block.

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

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

References $ilCtrl.

◆ fillDataSection()

ilPDExternalFeedBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

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

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

References $ilCtrl, $ilUser, and $lng.

◆ getBlockType()

static ilPDExternalFeedBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

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

References $block_type.

◆ getDynamic()

ilPDExternalFeedBlockGUI::getDynamic ( )

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

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

References $_SESSION, $ilCtrl, and $ilUser.

Referenced by fillDataSection(), and getHTML().

+ Here is the caller graph for this function:

◆ getDynamicReload()

ilPDExternalFeedBlockGUI::getDynamicReload ( )

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

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

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

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

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

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

311 {
312 global $ilUser, $lng, $ilCtrl;
313
314 $this->setEnableNumInfo(false);
315 return '<div class="small">'.((int) count($this->getData()))." ".$lng->txt("feed_feed_items")."</div>";
316 }
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 81 of file class.ilPDExternalFeedBlockGUI.php.

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

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

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

74 {
75 return false;
76 }

◆ prepareSaveFeedBlock()

ilPDExternalFeedBlockGUI::prepareSaveFeedBlock ( $a_feed_block)

FORM FeedBlock: Prepare Saving of FeedBlock.

Parameters
object$a_feed_blockFeedBlock object.

Reimplemented from ilExternalFeedBlockGUIGen.

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

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

References $ilCtrl.

◆ setBlock()

ilPDExternalFeedBlockGUI::setBlock (   $a_block)

Do most of the initialisation.

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

107 {
108 global $ilCtrl;
109
110 // init block
111 $this->feed_block = $a_block;
112 $this->setTitle($this->feed_block->getTitle());
113 $this->setBlockId($this->feed_block->getId());
114
115 // get feed object
116 include_once("./Services/Feeds/classes/class.ilExternalFeed.php");
117 $this->feed = new ilExternalFeed();
118 $this->feed->setUrl($this->feed_block->getFeedUrl());
119
120 // init details
121 $this->setAvailableDetailLevels(2);
122
123 $ilCtrl->setParameter($this, "block_id", $this->feed_block->getId());
124 }
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 321 of file class.ilPDExternalFeedBlockGUI.php.

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