51        $this->ctrl = 
$DIC->ctrl();
 
   52        $this->lng = 
$DIC->language();
 
   53        $this->
user = $DIC->user();
 
   54        $this->access = 
$DIC->access();
 
   56        $this->rbacsystem = 
$DIC->rbac()->system();
 
   57        $this->obj_definition = 
$DIC[
"objDefinition"];
 
   62        $lng->loadLanguageModule(
"feed");
 
   64        $this->
setRowTemplate(
"tpl.block_external_feed_row.html", 
"Services/Feeds");
 
   66        if (isset(
$_GET[
"external_feed_block_id"]) && 
$_GET[
"external_feed_block_id"] > 0) {
 
   70        $this->ctrl->saveParameter($this, array(
"external_feed_block_id"));
 
   98        $ilCtrl = 
$DIC->ctrl();
 
  100        switch ($ilCtrl->getCmd()) {
 
  103            case "saveFeedBlock":
 
  104            case "updateFeedBlock":
 
  105            case "editFeedBlock":
 
  107            case "confirmDeleteFeedBlock":
 
  125        $this->feed_block = $a_block;
 
  126        $this->
setTitle($this->feed_block->getTitle());
 
  127        $this->
setBlockId($this->feed_block->getId());
 
  130        include_once(
"./Services/Feeds/classes/class.ilExternalFeed.php");
 
  132        $this->feed->setUrl($this->feed_block->getFeedUrl());
 
  136        $ilCtrl->setParameter($this, 
"block_id", $this->feed_block->getId());
 
  148        $this->gui_object = $a_gui_object;
 
  168        $this->form_edit_mode = $a_form_edit_mode;
 
  188        return $this->form_gui->getHtml();
 
  199        return $this->form_gui->getHtml();
 
  212        if ($this->form_gui->checkInput() &&
 
  213            !$this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput(
"block_feed_url"))) {
 
  214            $this->external_feed_block->setTitle($this->form_gui->getInput(
"block_title"));
 
  215            $this->external_feed_block->setFeedUrl($this->form_gui->getInput(
"block_feed_url"));
 
  217            $this->external_feed_block->create();
 
  220            if ($this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput(
"block_feed_url"))) {
 
  223            $this->form_gui->setValuesByPost();
 
  224            return $this->form_gui->getHtml();
 
  235        if ($this->form_gui->checkInput() &&
 
  236            !$this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput(
"block_feed_url"))) {
 
  237            $this->external_feed_block->setTitle($this->form_gui->getInput(
"block_title"));
 
  238            $this->external_feed_block->setFeedUrl($this->form_gui->getInput(
"block_feed_url"));
 
  239            $this->external_feed_block->update();
 
  242            if ($this->external_feed_block->isFeedUrlLocal($this->form_gui->getInput(
"block_feed_url"))) {
 
  245            $this->form_gui->setValuesByPost();
 
  246            return $this->form_gui->getHtml();
 
  259        $values[
"block_title"] = $this->external_feed_block->getTitle();
 
  260        $values[
"block_feed_url"] = $this->external_feed_block->getFeedUrl();
 
  262        $this->form_gui->setValuesByArray($values);
 
  273        $ilCtrl->returnToParent($this);
 
  284        $next_class = $ilCtrl->getNextClass();
 
  285        $cmd = $ilCtrl->getCmd(
"getHTML");
 
  286        switch ($next_class) {
 
  288                return $this->$cmd();
 
  299        } elseif (count($this->
getData()) > 0) {
 
  300            parent::fillDataSection();
 
  319        if (
$feed_set->get(
"disable_rep_feeds")) {
 
  325            $this->feed->fetch();
 
  327                return [
"item" => 
$i];
 
  328            }, $this->feed->getItems()));
 
  334        if ($ilAccess->checkAccess(
"write", 
"", $this->getRefId())) {
 
  335            $ilCtrl->setParameterByClass(
 
  336                "ilobjexternalfeedgui",
 
  340            $ilCtrl->setParameter($this, 
"external_feed_block_id", $this->
getBlockId());
 
  342                $ilCtrl->getLinkTargetByClass(
 
  343                    array(
"ilrepositorygui", 
"ilobjexternalfeedgui",
 
  344                    "ilexternalfeedblockgui"),
 
  347                $lng->txt(
"settings")
 
  349            $ilCtrl->clearParametersByClass(
"ilobjexternalfeedgui");
 
  355            (
$ilUser->getPref(
"il_feed_js") == 
"n" && 
$_SESSION[
"il_feed_js"] != 
"y")) {
 
  359        return parent::getHTML() . $add;
 
  370        if ($ilCtrl->getCmdClass() != 
"ilcolumngui" && $ilCtrl->getCmd() != 
"enableJS") {
 
  372                (
$ilUser->getPref(
"il_feed_js") != 
"n" || 
$_SESSION[
"il_feed_js"] == 
"y")) {
 
  374                if (!$this->feed->checkCacheHit()) {
 
  388        $ilCtrl->setParameterByClass(
 
  394        $rel_tpl = 
new ilTemplate(
"tpl.dynamic_reload.html", 
true, 
true, 
"Services/Feeds");
 
  395        $rel_tpl->setVariable(
"TXT_LOADING", 
$lng->txt(
"feed_loading_feed"));
 
  396        $rel_tpl->setVariable(
"BLOCK_ID", 
"block_feed_" . $this->
getBlockId());
 
  397        $rel_tpl->setVariable(
 
  399            $ilCtrl->getLinkTargetByClass(
"ilcolumngui", 
"updateBlock", 
"", 
true)
 
  403        $rel_tpl->setVariable(
"TXT_FEED_CLICK_HERE", 
$lng->txt(
"feed_no_js_click_here"));
 
  404        $rel_tpl->setVariable(
 
  406            $ilCtrl->getLinkTargetByClass(
"ilexternalfeedblockgui", 
"disableJS")
 
  409        return $rel_tpl->get();
 
  417        $ilCtrl->setParameterByClass(
 
  423        $rel_tpl = 
new ilTemplate(
"tpl.js_enabler.html", 
true, 
true, 
"Services/Feeds");
 
  424        $rel_tpl->setVariable(
"BLOCK_ID", 
"block_feed_" . $this->
getBlockId());
 
  425        $rel_tpl->setVariable(
 
  427            $ilCtrl->getLinkTargetByClass(
"ilexternalfeedblockgui", 
"enableJS", 
true, 
"", 
false)
 
  430        return $rel_tpl->get();
 
  440        $ilUser->writePref(
"il_feed_js", 
"n");
 
  441        $ilCtrl->returnToParent($this);
 
  449        $ilUser->writePref(
"il_feed_js", 
"y");
 
  462        if ($this->
isRepositoryObject() && !$ilAccess->checkAccess(
"read", 
"", $this->getRefId())) {
 
  463            $this->tpl->setVariable(
"TXT_TITLE", $item->getTitle());
 
  465            $ilCtrl->setParameter($this, 
"feed_item_id", $item->getId());
 
  466            $this->tpl->setCurrentBlock(
"feed_link");
 
  467            $this->tpl->setVariable(
"VAL_TITLE", $item->getTitle());
 
  468            $this->tpl->setVariable(
 
  470                $ilCtrl->getLinkTarget($this, 
"showFeedItem")
 
  472            $ilCtrl->setParameter($this, 
"feed_item_id", 
"");
 
  473            $this->tpl->parseCurrentBlock();
 
  487        return '<div class="small">' . ((int) count($this->
getData())) . 
" " . 
$lng->txt(
"feed_feed_items") . 
"</div>";
 
  498        include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
  500        $this->feed->fetch();
 
  501        foreach ($this->feed->getItems() as $item) {
 
  502            if ($item->getId() == 
$_GET[
"feed_item_id"]) {
 
  508        $tpl = 
new ilTemplate(
"tpl.show_feed_item.html", 
true, 
true, 
"Services/Feeds");
 
  510        if (is_object($c_item)) {
 
  511            if (trim($c_item->getSummary()) != 
"") {            
 
  512                $tpl->setCurrentBlock(
"content");
 
  513                $tpl->setVariable(
"VAL_CONTENT", $c_item->getSummary());
 
  514                $tpl->parseCurrentBlock();
 
  516            if (trim($c_item->getDate()) != 
"" || trim($c_item->getAuthor()) != 
"") {           
 
  517                $tpl->setCurrentBlock(
"date_author");
 
  518                if (trim($c_item->getAuthor()) != 
"") {
 
  519                    $tpl->setVariable(
"VAL_AUTHOR", $c_item->getAuthor() . 
" - ");
 
  521                $tpl->setVariable(
"VAL_DATE", $c_item->getDate());
 
  522                $tpl->parseCurrentBlock();
 
  525            if (trim($c_item->getLink()) != 
"") {               
 
  526                $tpl->setCurrentBlock(
"plink");
 
  527                $tpl->setVariable(
"HREF_LINK", $c_item->getLink());
 
  528                $tpl->setVariable(
"TXT_LINK", 
$lng->txt(
"feed_open_source_page"));
 
  529                $tpl->parseCurrentBlock();
 
  531            $tpl->setVariable(
"VAL_TITLE", $c_item->getTitle());                        
 
  535        $content_block->setContent(
$tpl->get());
 
  536        $content_block->setTitle($this->
getTitle());
 
  538        return $content_block->getHTML();
 
  551            $html2 = 
"<br/>" . $this->form->getHTML();
 
  554        return $html1 . $html2;
 
  567        $lng->loadLanguageModule(
"feed");
 
  569        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  571        $this->form->setTarget(
"_top");
 
  574        include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
 
  576        $fi->setSuffixes(array(
"zip"));
 
  577        $fi->setRequired(
true);
 
  578        $this->form->addItem($fi);
 
  580        $this->form->addCommandButton(
"importFile", 
$lng->txt(
"import"));
 
  581        $this->form->addCommandButton(
"cancelSaveFeedBlock", 
$lng->txt(
"cancel"));
 
  582        $this->form->setTitle(
$lng->txt($a_new_type . 
"_import"));
 
  584        $ilCtrl->setParameter($this, 
"new_type", $a_new_type);
 
  585        $this->form->setFormAction($ilCtrl->getFormAction($this));
 
  603            $this->
ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
 
  605        $this->ctrl->setParameter($this, 
"new_type", $new_type);
 
  607        if ($this->form->checkInput()) {
 
  609            include_once(
"./Services/Export/classes/class.ilImport.php");
 
  611            $new_id = $imp->importObject(
 
  613                $_FILES[
"importfile"][
"tmp_name"],
 
  614                $_FILES[
"importfile"][
"name"],
 
  621                $newObj->createReference();
 
  622                $newObj->putInTree(
$_GET[
"ref_id"]);
 
  623                $newObj->setPermissions(
$_GET[
"ref_id"]);
 
  624                ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
  630        $this->form->setValuesByPost();
 
  631        $tpl->setContent($this->form->getHtml());
 
  645        $lng->loadLanguageModule(
"block");
 
  647        require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  653        $text_input->setInfo(
"");
 
  654        $text_input->setRequired(
true);
 
  655        $text_input->setMaxLength(200);
 
  656        $this->form_gui->addItem($text_input);
 
  660        $text_input->setInfo(
$lng->txt(
"block_feed_block_feed_url_info"));
 
  661        $text_input->setRequired(
true);
 
  662        $text_input->setMaxLength(250);
 
  663        $this->form_gui->addItem($text_input);
 
  667        if (in_array($a_mode, array(self::FORM_CREATE,self::FORM_RE_CREATE))) {
 
  668            $this->form_gui->addCommandButton(
"saveFeedBlock", 
$lng->txt(
"save"));
 
  669            $this->form_gui->addCommandButton(
"cancelSaveFeedBlock", 
$lng->txt(
"cancel"));
 
  671            $this->form_gui->addCommandButton(
"updateFeedBlock", 
$lng->txt(
"save"));
 
  672            $this->form_gui->addCommandButton(
"cancelUpdateFeedBlock", 
$lng->txt(
"cancel"));
 
  675        $this->form_gui->setTitle(
$lng->txt(
"block_feed_block_head"));
 
  676        $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
 
  714        $this->
getGuiObject()->update($this->external_feed_block);
 
  740        $f = $this->
ui->factory();
 
  742        $item = 
$data[
"item"];
 
  745        $ctrl->setParameter($this, 
"feed_item_id", $item->getId());
 
  746        $button = 
$f->button()->shy(
 
  748            $ctrl->getLinkTarget($this, 
"showFeedItem", 
"", 
false, 
false)
 
  750        $ctrl->setParameter($this, 
"feed_item_id", 
"");
 
  752        return $f->item()->standard($button);
 
An exception for terminatinating execution or to throw for unit testing.
This class represents a block method of a block.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
getBlockId()
Get Block Id.
setData($a_data)
Set Data.
setPresentation(int $type)
Set presentation.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
getRefId()
Get Ref Id (only used if isRepositoryObject() is true).
BlockGUI class for (centered) Content on Personal Desktop.
BlockGUI class for external feed block.
getOverview()
Get overview.
getFormEditMode()
Get FormEditMode.
getHTML()
Get block HTML code.
initImportForm($a_new_type="")
Init object import form.
cancelUpdateFeedBlock()
FORM FeedBlock: Exit save.
setGuiObject(&$a_gui_object)
Set GuiObject.
getGuiObject()
Get GuiObject.
static getScreenMode()
Get Screen Mode for current command.
create()
Create Form for Block.
fillRow($item)
Fill feed item row.
setBlock($a_block)
Do most of the initialisation.
exitUpdateFeedBlock()
FORM FeedBlock: Exit save.
initFormFeedBlock($a_mode)
FORM FeedBlock: Init form.
getListItemForData(array $data)
Get list item for data array.null|\ILIAS\UI\Component\Item\Item
showFeedItem()
Show Feed Item.
setFormEditMode($a_form_edit_mode)
Set FormEditMode.
__construct()
Constructor.
isRepositoryObject()
Returns whether block has a corresponding repository object.bool
updateFeedBlock()
FORM FeedBlock: Update ExternalFeedBlock.
executeCommand()
execute command
editFeedBlock()
FORM FeedBlock: Edit form.
cancelSaveFeedBlock()
FORM FeedBlock: Cancel save.
createFeedBlock()
FORM FeedBlock: Create ExternalFeedBlock.
fillDataSection()
Fill data section.
exitSaveFeedBlock()
FORM FeedBlock: Exit save.
getValuesFeedBlock()
FORM FeedBlock: Get current values for ExternalFeedBlock form.
prepareSaveFeedBlock(&$a_feed_block)
FORM FeedBlock: Prepare Saving of FeedBlock.
saveFeedBlock()
FORM FeedBlock: Save ExternalFeedBlock.
Custom block for external feeds.
Handles external Feeds via Magpie library.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.
redirection script todo: (a better solution should control the processing via a xml file)