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);
 
   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();
 
  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();
 
  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");
 
  214        $text_input->setInfo(
"");
 
  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);
 
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.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.