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);
49 $this->lng = $DIC->language();
52 parent::__construct();
57 include_once(
"Services/Block/classes/class.ilExternalFeedBlock.php");
58 if (isset(
$_GET[
"external_feed_block_id"]) &&
$_GET[
"external_feed_block_id"] > 0) {
62 $this->ctrl->saveParameter($this, array(
"external_feed_block_id"));
74 $next_class = $this->ctrl->getNextClass($this);
75 $cmd = $this->ctrl->getCmd();
77 switch ($next_class) {
79 $html = $this->$cmd();
93 $this->gui_object = $a_gui_object;
113 $this->form_edit_mode = $a_form_edit_mode;
133 return $this->form_gui->getHtml();
144 return $this->form_gui->getHtml();
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"));
162 $this->external_feed_block->create();
165 if ($this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput(
"block_feed_url"))) {
168 $this->form_gui->setValuesByPost();
169 return $this->form_gui->getHtml();
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();
188 if ($this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput(
"block_feed_url"))) {
191 $this->form_gui->setValuesByPost();
192 return $this->form_gui->getHtml();
205 $lng->loadLanguageModule(
"block");
207 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
215 $text_input->setRequired(
true);
216 $text_input->setMaxLength(200);
217 $this->form_gui->addItem($text_input);
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);
229 $this->form_gui->addCommandButton(
"saveFeedBlock",
$lng->txt(
"save"));
230 $this->form_gui->addCommandButton(
"cancelSaveFeedBlock",
$lng->txt(
"cancel"));
232 $this->form_gui->addCommandButton(
"updateFeedBlock",
$lng->txt(
"save"));
233 $this->form_gui->addCommandButton(
"cancelUpdateFeedBlock",
$lng->txt(
"cancel"));
236 $this->form_gui->setTitle(
$lng->txt(
"block_feed_block_head"));
237 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
250 $values[
"block_title"] = $this->external_feed_block->getTitle();
251 $values[
"block_feed_url"] = $this->external_feed_block->getFeedUrl();
253 $this->form_gui->setValuesByArray(
$values);
264 $ilCtrl->returnToParent($this);
275 $ilCtrl->returnToParent($this);
286 $ilCtrl->returnToParent($this);
297 $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.
saveFeedBlock()
FORM FeedBlock: Save ExternalFeedBlock.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
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.