24 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
25 define(
"IL_FORM_EDIT", 0);
26 define(
"IL_FORM_CREATE", 1);
27 define(
"IL_FORM_RE_EDIT", 2);
28 define(
"IL_FORM_RE_CREATE", 3);
50 parent::__construct();
55 include_once(
"Services/Block/classes/class.ilExternalFeedBlock.php");
56 if (isset(
$_GET[
"external_feed_block_id"]) &&
$_GET[
"external_feed_block_id"] > 0)
61 $this->ctrl->saveParameter($this,
array(
"external_feed_block_id"));
75 $next_class = $this->ctrl->getNextClass($this);
76 $cmd = $this->ctrl->getCmd();
96 $this->gui_object = $a_gui_object;
116 $this->form_edit_mode = $a_form_edit_mode;
136 return $this->form_gui->getHtml();
148 return $this->form_gui->getHtml();
159 if ($this->form_gui->checkInput())
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"));
165 $this->external_feed_block->create();
170 $this->form_gui->setValuesByPost();
171 return $this->form_gui->getHtml();
183 if ($this->form_gui->checkInput())
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();
193 $this->form_gui->setValuesByPost();
194 return $this->form_gui->getHtml();
208 $lng->loadLanguageModule(
"block");
210 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
216 $text_input =
new ilTextInputGUI($lng->txt(
"block_feed_block_title"),
"block_title");
218 $text_input->setRequired(
true);
219 $text_input->setMaxLength(200);
220 $this->form_gui->addItem($text_input);
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);
233 $this->form_gui->addCommandButton(
"saveFeedBlock", $lng->txt(
"save"));
234 $this->form_gui->addCommandButton(
"cancelSaveFeedBlock", $lng->txt(
"cancel"));
238 $this->form_gui->addCommandButton(
"updateFeedBlock", $lng->txt(
"save"));
239 $this->form_gui->addCommandButton(
"cancelUpdateFeedBlock", $lng->txt(
"cancel"));
242 $this->form_gui->setTitle($lng->txt(
"block_feed_block_head"));
243 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
257 $values[
"block_title"] = $this->external_feed_block->getTitle();
258 $values[
"block_feed_url"] = $this->external_feed_block->getFeedUrl();
260 $this->form_gui->setValuesByArray($values);
272 $ilCtrl->returnToParent($this);
283 $ilCtrl->returnToParent($this);
294 $ilCtrl->returnToParent($this);
305 $ilCtrl->returnToParent($this);
createFeedBlock()
FORM FeedBlock: Create ExternalFeedBlock.
getGuiObject()
Get GuiObject.
__construct()
Constructor.
prepareFormFeedBlock(&$a_form_gui)
FORM FeedBlock: Prepare form.
updateFeedBlock()
FORM FeedBlock: Update ExternalFeedBlock.
prepareSaveFeedBlock(&$a_external_feed_block)
FORM FeedBlock: Prepare Saving of ExternalFeedBlock.
setGuiObject(&$a_gui_object)
Set GuiObject.
Custom block for external feeds.
GUI class for external news feed custom block.
getFormEditMode()
Get FormEditMode.
This class represents a text property in a property form.
exitUpdateFeedBlock()
FORM FeedBlock: Exit update.
exitSaveFeedBlock()
FORM FeedBlock: Exit save.
Create styles array
The data for the language used.
saveFeedBlock()
FORM FeedBlock: Save ExternalFeedBlock.
setFormEditMode($a_form_edit_mode)
Set FormEditMode.
This class represents a block method of a block.
cancelUpdateFeedBlock()
FORM FeedBlock: Cancel update.
executeCommand()
Execute command.
editFeedBlock()
FORM FeedBlock: Edit form.
getValuesFeedBlock()
FORM FeedBlock: Get current values for ExternalFeedBlock form.
cancelSaveFeedBlock()
FORM FeedBlock: Cancel save.
initFormFeedBlock($a_mode)
FORM FeedBlock: Init form.