ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilExternalFeedBlockGUIGen Class Reference

GUI class for external news feed custom block. More...

+ Inheritance diagram for ilExternalFeedBlockGUIGen:
+ Collaboration diagram for ilExternalFeedBlockGUIGen:

Public Member Functions

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

Protected Attributes

 $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
 

Additional Inherited Members

- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Detailed Description

GUI class for external news feed custom block.

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

Definition at line 36 of file class.ilExternalFeedBlockGUIGen.php.

Constructor & Destructor Documentation

◆ __construct()

ilExternalFeedBlockGUIGen::__construct ( )

Constructor.

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

References $_GET, $ilCtrl, and array.

47  {
48  global $ilCtrl;
49 
50  parent::__construct();
51 
52  $this->ctrl = $ilCtrl;
53 
54 
55  include_once("Services/Block/classes/class.ilExternalFeedBlock.php");
56  if (isset($_GET["external_feed_block_id"]) && $_GET["external_feed_block_id"] > 0)
57  {
58  $this->external_feed_block = new ilExternalFeedBlock($_GET["external_feed_block_id"]);
59  }
60 
61  $this->ctrl->saveParameter($this, array("external_feed_block_id"));
62 
63 
64  }
$_GET["client_id"]
Custom block for external feeds.
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.

Member Function Documentation

◆ cancelSaveFeedBlock()

ilExternalFeedBlockGUIGen::cancelSaveFeedBlock ( )

FORM FeedBlock: Cancel save.

(Can be overwritten in derived classes)

Definition at line 268 of file class.ilExternalFeedBlockGUIGen.php.

References $ilCtrl.

269  {
270  global $ilCtrl;
271 
272  $ilCtrl->returnToParent($this);
273  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelUpdateFeedBlock()

ilExternalFeedBlockGUIGen::cancelUpdateFeedBlock ( )

FORM FeedBlock: Cancel update.

(Can be overwritten in derived classes)

Definition at line 279 of file class.ilExternalFeedBlockGUIGen.php.

References $ilCtrl.

280  {
281  global $ilCtrl;
282 
283  $ilCtrl->returnToParent($this);
284  }
global $ilCtrl
Definition: ilias.php:18

◆ createFeedBlock()

ilExternalFeedBlockGUIGen::createFeedBlock ( )

FORM FeedBlock: Create ExternalFeedBlock.

Definition at line 133 of file class.ilExternalFeedBlockGUIGen.php.

References IL_FORM_CREATE, and initFormFeedBlock().

Referenced by ilExternalFeedBlockGUI\create(), and ilPDExternalFeedBlockGUI\create().

134  {
136  return $this->form_gui->getHtml();
137 
138  }
initFormFeedBlock($a_mode)
FORM FeedBlock: Init form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editFeedBlock()

ilExternalFeedBlockGUIGen::editFeedBlock ( )

FORM FeedBlock: Edit form.

Definition at line 144 of file class.ilExternalFeedBlockGUIGen.php.

References getValuesFeedBlock(), IL_FORM_EDIT, and initFormFeedBlock().

145  {
147  $this->getValuesFeedBlock();
148  return $this->form_gui->getHtml();
149 
150  }
getValuesFeedBlock()
FORM FeedBlock: Get current values for ExternalFeedBlock form.
initFormFeedBlock($a_mode)
FORM FeedBlock: Init form.
+ Here is the call graph for this function:

◆ executeCommand()

ilExternalFeedBlockGUIGen::executeCommand ( )

Execute command.

Definition at line 70 of file class.ilExternalFeedBlockGUIGen.php.

References $cmd, $html, and $ilCtrl.

71  {
72  global $ilCtrl;
73 
74  // get next class and command
75  $next_class = $this->ctrl->getNextClass($this);
76  $cmd = $this->ctrl->getCmd();
77 
78  switch ($next_class)
79  {
80  default:
81  $html = $this->$cmd();
82  break;
83  }
84 
85  return $html;
86 
87  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
$html
Definition: example_001.php:87

◆ exitSaveFeedBlock()

ilExternalFeedBlockGUIGen::exitSaveFeedBlock ( )

FORM FeedBlock: Exit save.

(Can be overwritten in derived classes)

Definition at line 290 of file class.ilExternalFeedBlockGUIGen.php.

References $ilCtrl.

Referenced by saveFeedBlock().

291  {
292  global $ilCtrl;
293 
294  $ilCtrl->returnToParent($this);
295  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ exitUpdateFeedBlock()

ilExternalFeedBlockGUIGen::exitUpdateFeedBlock ( )

FORM FeedBlock: Exit update.

(Can be overwritten in derived classes)

Definition at line 301 of file class.ilExternalFeedBlockGUIGen.php.

References $ilCtrl.

Referenced by updateFeedBlock().

302  {
303  global $ilCtrl;
304 
305  $ilCtrl->returnToParent($this);
306  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ getFormEditMode()

ilExternalFeedBlockGUIGen::getFormEditMode ( )

Get FormEditMode.

Returns
int Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE | IL_FORM_RE_EDIT | IL_FORM_RE_CREATE)

Definition at line 124 of file class.ilExternalFeedBlockGUIGen.php.

References $form_edit_mode.

◆ getGuiObject()

ilExternalFeedBlockGUIGen::getGuiObject ( )

◆ getValuesFeedBlock()

ilExternalFeedBlockGUIGen::getValuesFeedBlock ( )

FORM FeedBlock: Get current values for ExternalFeedBlock form.

Definition at line 253 of file class.ilExternalFeedBlockGUIGen.php.

References array.

Referenced by editFeedBlock().

254  {
255  $values = array();
256 
257  $values["block_title"] = $this->external_feed_block->getTitle();
258  $values["block_feed_url"] = $this->external_feed_block->getFeedUrl();
259 
260  $this->form_gui->setValuesByArray($values);
261 
262  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ initFormFeedBlock()

ilExternalFeedBlockGUIGen::initFormFeedBlock (   $a_mode)

FORM FeedBlock: Init form.

Parameters
int$a_modeForm Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)

Definition at line 204 of file class.ilExternalFeedBlockGUIGen.php.

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

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

205  {
206  global $lng;
207 
208  $lng->loadLanguageModule("block");
209 
210  require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
211 
212  $this->form_gui = new ilPropertyFormGUI();
213 
214 
215  // Property Title
216  $text_input = new ilTextInputGUI($lng->txt("block_feed_block_title"), "block_title");
217  $text_input->setInfo("");
218  $text_input->setRequired(true);
219  $text_input->setMaxLength(200);
220  $this->form_gui->addItem($text_input);
221 
222  // Property FeedUrl
223  $text_input = new ilTextInputGUI($lng->txt("block_feed_block_feed_url"), "block_feed_url");
224  $text_input->setInfo($lng->txt("block_feed_block_feed_url_info"));
225  $text_input->setRequired(true);
226  $text_input->setMaxLength(250);
227  $this->form_gui->addItem($text_input);
228 
229 
230  // save and cancel commands
231  if (in_array($a_mode, array(IL_FORM_CREATE,IL_FORM_RE_CREATE)))
232  {
233  $this->form_gui->addCommandButton("saveFeedBlock", $lng->txt("save"));
234  $this->form_gui->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
235  }
236  else
237  {
238  $this->form_gui->addCommandButton("updateFeedBlock", $lng->txt("save"));
239  $this->form_gui->addCommandButton("cancelUpdateFeedBlock", $lng->txt("cancel"));
240  }
241 
242  $this->form_gui->setTitle($lng->txt("block_feed_block_head"));
243  $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
244 
245  $this->prepareFormFeedBlock($this->form_gui);
246 
247  }
prepareFormFeedBlock(&$a_form_gui)
FORM FeedBlock: Prepare form.
This class represents a property form user interface.
setInfo($a_info)
Set Information Text.
This class represents a text property in a property form.
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareFormFeedBlock()

ilExternalFeedBlockGUIGen::prepareFormFeedBlock ( $a_form_gui)

FORM FeedBlock: Prepare form.

(Can be overwritten in derived classes)

Parameters
object$a_form_guiilPropertyFormGUI instance.

Definition at line 323 of file class.ilExternalFeedBlockGUIGen.php.

Referenced by initFormFeedBlock(), ilPDExternalFeedBlockGUI\initFormFeedBlock(), and ilExternalFeedBlockGUI\initFormFeedBlock().

324  {
325 
326  }
+ Here is the caller graph for this function:

◆ prepareSaveFeedBlock()

ilExternalFeedBlockGUIGen::prepareSaveFeedBlock ( $a_external_feed_block)

FORM FeedBlock: Prepare Saving of ExternalFeedBlock.

Parameters
object$a_external_feed_blockExternalFeedBlock object.

Definition at line 313 of file class.ilExternalFeedBlockGUIGen.php.

Referenced by saveFeedBlock().

314  {
315 
316  }
+ Here is the caller graph for this function:

◆ saveFeedBlock()

ilExternalFeedBlockGUIGen::saveFeedBlock ( )

FORM FeedBlock: Save ExternalFeedBlock.

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

References exitSaveFeedBlock(), IL_FORM_CREATE, initFormFeedBlock(), and prepareSaveFeedBlock().

157  {
159  if ($this->form_gui->checkInput())
160  {
161  $this->external_feed_block = new ilExternalFeedBlock();
162  $this->external_feed_block->setTitle($this->form_gui->getInput("block_title"));
163  $this->external_feed_block->setFeedUrl($this->form_gui->getInput("block_feed_url"));
164  $this->prepareSaveFeedBlock($this->external_feed_block);
165  $this->external_feed_block->create();
166  $this->exitSaveFeedBlock();
167  }
168  else
169  {
170  $this->form_gui->setValuesByPost();
171  return $this->form_gui->getHtml();
172  }
173 
174  }
prepareSaveFeedBlock(&$a_external_feed_block)
FORM FeedBlock: Prepare Saving of ExternalFeedBlock.
Custom block for external feeds.
exitSaveFeedBlock()
FORM FeedBlock: Exit save.
initFormFeedBlock($a_mode)
FORM FeedBlock: Init form.
+ Here is the call graph for this function:

◆ setFormEditMode()

ilExternalFeedBlockGUIGen::setFormEditMode (   $a_form_edit_mode)

Set FormEditMode.

Parameters
int$a_form_edit_modeForm Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE | IL_FORM_RE_EDIT | IL_FORM_RE_CREATE)

Definition at line 114 of file class.ilExternalFeedBlockGUIGen.php.

115  {
116  $this->form_edit_mode = $a_form_edit_mode;
117  }

◆ setGuiObject()

ilExternalFeedBlockGUIGen::setGuiObject ( $a_gui_object)

Set GuiObject.

Parameters
object$a_gui_objectGUI object

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

95  {
96  $this->gui_object = $a_gui_object;
97  }

◆ updateFeedBlock()

ilExternalFeedBlockGUIGen::updateFeedBlock ( )

FORM FeedBlock: Update ExternalFeedBlock.

Definition at line 180 of file class.ilExternalFeedBlockGUIGen.php.

References exitUpdateFeedBlock(), IL_FORM_EDIT, and initFormFeedBlock().

181  {
183  if ($this->form_gui->checkInput())
184  {
185 
186  $this->external_feed_block->setTitle($this->form_gui->getInput("block_title"));
187  $this->external_feed_block->setFeedUrl($this->form_gui->getInput("block_feed_url"));
188  $this->external_feed_block->update();
189  $this->exitUpdateFeedBlock();
190  }
191  else
192  {
193  $this->form_gui->setValuesByPost();
194  return $this->form_gui->getHtml();
195  }
196 
197  }
exitUpdateFeedBlock()
FORM FeedBlock: Exit update.
initFormFeedBlock($a_mode)
FORM FeedBlock: Init form.
+ Here is the call graph for this function:

Field Documentation

◆ $form_edit_mode

ilExternalFeedBlockGUIGen::$form_edit_mode
protected

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

Referenced by getFormEditMode().

◆ $gui_object

ilExternalFeedBlockGUIGen::$gui_object
protected

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

Referenced by getGuiObject().


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