24include_once(
"Services/Block/classes/class.ilBlockGUI.php");
25define(
"IL_FORM_EDIT", 0);
26define(
"IL_FORM_CREATE", 1);
27define(
"IL_FORM_RE_EDIT", 2);
28define(
"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");
217 $text_input->setInfo(
"");
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);
An exception for terminatinating execution or to throw for unit testing.
This class represents a block method of a block.
GUI class for external news feed custom block.
getFormEditMode()
Get FormEditMode.
exitSaveFeedBlock()
FORM FeedBlock: Exit save.
createFeedBlock()
FORM FeedBlock: Create ExternalFeedBlock.
setFormEditMode($a_form_edit_mode)
Set FormEditMode.
exitUpdateFeedBlock()
FORM FeedBlock: Exit update.
updateFeedBlock()
FORM FeedBlock: Update ExternalFeedBlock.
executeCommand()
Execute command.
getGuiObject()
Get GuiObject.
prepareSaveFeedBlock(&$a_external_feed_block)
FORM FeedBlock: Prepare Saving of ExternalFeedBlock.
initFormFeedBlock($a_mode)
FORM FeedBlock: Init form.
saveFeedBlock()
FORM FeedBlock: Save ExternalFeedBlock.
__construct()
Constructor.
cancelUpdateFeedBlock()
FORM FeedBlock: Cancel update.
cancelSaveFeedBlock()
FORM FeedBlock: Cancel save.
prepareFormFeedBlock(&$a_form_gui)
FORM FeedBlock: Prepare form.
setGuiObject(&$a_gui_object)
Set GuiObject.
editFeedBlock()
FORM FeedBlock: Edit form.
getValuesFeedBlock()
FORM FeedBlock: Get current values for ExternalFeedBlock form.
Custom block for external feeds.
This class represents a text property in a property form.