ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 

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 45 of file class.ilExternalFeedBlockGUIGen.php.

References $_GET, $DIC, $ilCtrl, and array.

46  {
47  global $DIC;
48 
49  $this->lng = $DIC->language();
50  $ilCtrl = $DIC->ctrl();
51 
52  parent::__construct();
53 
54  $this->ctrl = $ilCtrl;
55 
56 
57  include_once("Services/Block/classes/class.ilExternalFeedBlock.php");
58  if (isset($_GET["external_feed_block_id"]) && $_GET["external_feed_block_id"] > 0) {
59  $this->external_feed_block = new ilExternalFeedBlock($_GET["external_feed_block_id"]);
60  }
61 
62  $this->ctrl->saveParameter($this, array("external_feed_block_id"));
63  }
global $DIC
Definition: saml.php:7
$_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 260 of file class.ilExternalFeedBlockGUIGen.php.

References ilBlockGUI\$ctrl, and $ilCtrl.

261  {
263 
264  $ilCtrl->returnToParent($this);
265  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelUpdateFeedBlock()

ilExternalFeedBlockGUIGen::cancelUpdateFeedBlock ( )

FORM FeedBlock: Cancel update.

(Can be overwritten in derived classes)

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

References ilBlockGUI\$ctrl, and $ilCtrl.

272  {
274 
275  $ilCtrl->returnToParent($this);
276  }
global $ilCtrl
Definition: ilias.php:18

◆ createFeedBlock()

ilExternalFeedBlockGUIGen::createFeedBlock ( )

FORM FeedBlock: Create ExternalFeedBlock.

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

References IL_FORM_CREATE, and initFormFeedBlock().

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

131  {
133  return $this->form_gui->getHtml();
134  }
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 140 of file class.ilExternalFeedBlockGUIGen.php.

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

141  {
143  $this->getValuesFeedBlock();
144  return $this->form_gui->getHtml();
145  }
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 69 of file class.ilExternalFeedBlockGUIGen.php.

References ilBlockGUI\$ctrl, $html, and $ilCtrl.

70  {
72 
73  // get next class and command
74  $next_class = $this->ctrl->getNextClass($this);
75  $cmd = $this->ctrl->getCmd();
76 
77  switch ($next_class) {
78  default:
79  $html = $this->$cmd();
80  break;
81  }
82 
83  return $html;
84  }
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 282 of file class.ilExternalFeedBlockGUIGen.php.

References ilBlockGUI\$ctrl, and $ilCtrl.

Referenced by saveFeedBlock().

283  {
285 
286  $ilCtrl->returnToParent($this);
287  }
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 293 of file class.ilExternalFeedBlockGUIGen.php.

References ilBlockGUI\$ctrl, and $ilCtrl.

Referenced by updateFeedBlock().

294  {
296 
297  $ilCtrl->returnToParent($this);
298  }
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 121 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 246 of file class.ilExternalFeedBlockGUIGen.php.

References array.

Referenced by editFeedBlock().

247  {
248  $values = array();
249 
250  $values["block_title"] = $this->external_feed_block->getTitle();
251  $values["block_feed_url"] = $this->external_feed_block->getFeedUrl();
252 
253  $this->form_gui->setValuesByArray($values);
254  }
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 201 of file class.ilExternalFeedBlockGUIGen.php.

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

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

202  {
203  $lng = $this->lng;
204 
205  $lng->loadLanguageModule("block");
206 
207  require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
208 
209  $this->form_gui = new ilPropertyFormGUI();
210 
211 
212  // Property Title
213  $text_input = new ilTextInputGUI($lng->txt("block_feed_block_title"), "block_title");
214  $text_input->setInfo("");
215  $text_input->setRequired(true);
216  $text_input->setMaxLength(200);
217  $this->form_gui->addItem($text_input);
218 
219  // Property FeedUrl
220  $text_input = new ilTextInputGUI($lng->txt("block_feed_block_feed_url"), "block_feed_url");
221  $text_input->setInfo($lng->txt("block_feed_block_feed_url_info"));
222  $text_input->setRequired(true);
223  $text_input->setMaxLength(250);
224  $this->form_gui->addItem($text_input);
225 
226 
227  // save and cancel commands
228  if (in_array($a_mode, array(IL_FORM_CREATE,IL_FORM_RE_CREATE))) {
229  $this->form_gui->addCommandButton("saveFeedBlock", $lng->txt("save"));
230  $this->form_gui->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel"));
231  } else {
232  $this->form_gui->addCommandButton("updateFeedBlock", $lng->txt("save"));
233  $this->form_gui->addCommandButton("cancelUpdateFeedBlock", $lng->txt("cancel"));
234  }
235 
236  $this->form_gui->setTitle($lng->txt("block_feed_block_head"));
237  $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
238 
239  $this->prepareFormFeedBlock($this->form_gui);
240  }
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.
+ 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 314 of file class.ilExternalFeedBlockGUIGen.php.

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

315  {
316  }
+ 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 305 of file class.ilExternalFeedBlockGUIGen.php.

Referenced by saveFeedBlock().

306  {
307  }
+ Here is the caller graph for this function:

◆ saveFeedBlock()

ilExternalFeedBlockGUIGen::saveFeedBlock ( )

FORM FeedBlock: Save ExternalFeedBlock.

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

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

152  {
154 
155  $this->external_feed_block = new ilExternalFeedBlock();
156 
157  if ($this->form_gui->checkInput() &&
158  !$this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput("block_feed_url"))) {
159  $this->external_feed_block->setTitle($this->form_gui->getInput("block_title"));
160  $this->external_feed_block->setFeedUrl($this->form_gui->getInput("block_feed_url"));
161  $this->prepareSaveFeedBlock($this->external_feed_block);
162  $this->external_feed_block->create();
163  $this->exitSaveFeedBlock();
164  } else {
165  if ($this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput("block_feed_url"))) {
166  ilUtil::sendFailure($this->lng->txt("feed_no_local_url"), true);
167  }
168  $this->form_gui->setValuesByPost();
169  return $this->form_gui->getHtml();
170  }
171  }
prepareSaveFeedBlock(&$a_external_feed_block)
FORM FeedBlock: Prepare Saving of ExternalFeedBlock.
Custom block for external feeds.
exitSaveFeedBlock()
FORM FeedBlock: Exit save.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
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 111 of file class.ilExternalFeedBlockGUIGen.php.

112  {
113  $this->form_edit_mode = $a_form_edit_mode;
114  }

◆ setGuiObject()

ilExternalFeedBlockGUIGen::setGuiObject ( $a_gui_object)

Set GuiObject.

Parameters
object$a_gui_objectGUI object

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

92  {
93  $this->gui_object = $a_gui_object;
94  }

◆ updateFeedBlock()

ilExternalFeedBlockGUIGen::updateFeedBlock ( )

FORM FeedBlock: Update ExternalFeedBlock.

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

References $_POST, exitUpdateFeedBlock(), IL_FORM_EDIT, initFormFeedBlock(), and ilUtil\sendFailure().

178  {
180  $this->external_feed_block->isFeedUrlLocal($_POST["block_feed_url"]);
181  if ($this->form_gui->checkInput() &&
182  !!$this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput("block_feed_url"))) {
183  $this->external_feed_block->setTitle($this->form_gui->getInput("block_title"));
184  $this->external_feed_block->setFeedUrl($this->form_gui->getInput("block_feed_url"));
185  $this->external_feed_block->update();
186  $this->exitUpdateFeedBlock();
187  } else {
188  if ($this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput("block_feed_url"))) {
189  ilUtil::sendFailure($this->lng->txt("feed_no_local_url"), true);
190  }
191  $this->form_gui->setValuesByPost();
192  return $this->form_gui->getHtml();
193  }
194  }
exitUpdateFeedBlock()
FORM FeedBlock: Exit update.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
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 39 of file class.ilExternalFeedBlockGUIGen.php.

Referenced by getFormEditMode().

◆ $gui_object

ilExternalFeedBlockGUIGen::$gui_object
protected

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

Referenced by getGuiObject().


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