5include_once(
"Services/Block/classes/class.ilBlockGUI.php");
 
   52        $this->ctrl = 
$DIC->ctrl();
 
   53        $this->lng = 
$DIC->language();
 
   54        $this->
user = $DIC->user();
 
   55        $this->help = 
$DIC[
"ilHelp"];
 
   56        $this->access = 
$DIC->access();
 
   58        $this->tabs = 
$DIC->tabs();
 
   59        $this->obj_definition = 
$DIC[
"objDefinition"];
 
   60        $this->ui = 
$DIC->ui();
 
   65        $ilHelp = 
$DIC[
"ilHelp"];
 
   67        parent::__construct();
 
   69        $lng->loadLanguageModule(
"news");
 
   70        $ilHelp->addHelpSection(
"news_block");
 
   72        include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
   78        $this->dynamic = 
false;
 
   79        include_once(
"./Services/News/classes/class.ilNewsCache.php");
 
   81        $cres = unserialize($this->acache->getEntry(
$ilUser->getId() . 
":" . 
$_GET[
"ref_id"]));
 
   82        $this->cache_hit = 
false;
 
   84        if ($this->acache->getLastAccessStatus() == 
"hit" && is_array($cres)) {
 
   86            $this->cache_hit = 
true;
 
   88        if ($this->
getDynamic() && !$this->cache_hit) {
 
   89            $this->dynamic = 
true;
 
   92            if (!empty(self::$st_data)) {
 
   96                self::$st_data = 
$data;
 
  103        $this->
setRowTemplate(
"tpl.block_row_news_for_context.html", 
"Services/News");
 
  105        $this->allow_moving = 
false;
 
  117        include_once(
"./Services/News/classes/class.ilNewsCache.php");
 
  127        $news_item->setContextObjId(
$ilCtrl->getContextObjId());
 
  128        $news_item->setContextObjType(
$ilCtrl->getContextObjType());
 
  132        $prevent_aggregation = 
true;
 
  133        if (
$ilCtrl->getContextObjType() != 
"frm") {
 
  134            $forum_grouping = 
true;
 
  136            $forum_grouping = 
false;
 
  140        $news_data = $news_item->getNewsForRefId(
 
  145            $prevent_aggregation,
 
  149        $this->acache->storeEntry(
 
  151            serialize($news_data)
 
  184        if (
$ilCtrl->getCmdClass() == 
"ilnewsitemgui") {
 
  212        $next_class = 
$ilCtrl->getNextClass();
 
  213        $cmd = 
$ilCtrl->getCmd(
"getHTML");
 
  215        switch ($next_class) {
 
  216            case "ilnewsitemgui":
 
  217                include_once(
"./Services/News/classes/class.ilNewsItemGUI.php");
 
  224                return $this->$cmd();
 
  235        $this->enable_edit = $a_enable_edit;
 
  245        return $this->enable_edit;
 
  253        if ($this->dynamic) {
 
  256            parent::fillDataSection();
 
  274        $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
  297            if ($enable_internal_rss) {
 
  298                include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
 
  300                    ILIAS_HTTP_PATH . 
"/feed.php?client_id=" . rawurlencode(CLIENT_ID) . 
"&" .
 
  301                        "ref_id=" . 
$_GET[
"ref_id"],
 
  302                    $lng->txt(
"news_feed_url"),
 
  332                $ilCtrl->getLinkTargetByClass(
"ilnewsitemgui", 
"editNews"),
 
  336            $ilCtrl->setParameter($this, 
"add_mode", 
"block");
 
  338                $ilCtrl->getLinkTargetByClass(
"ilnewsitemgui", 
"createNewsItem"),
 
  341            $ilCtrl->setParameter($this, 
"add_mode", 
"");
 
  345            $ref_id = 
$_GET[
"ref_id"];
 
  349            $obj_class = strtolower(
$obj_def->getClassName($obj_type));
 
  350            $parent_gui = 
"ilobj" . $obj_class . 
"gui";
 
  352            $ilCtrl->setParameterByClass(
"ilcontainernewssettingsgui", 
"ref_id", $ref_id);
 
  356                    $ilCtrl->getLinkTargetByClass(array(
"ilrepositorygui", $parent_gui, 
"ilcontainernewssettingsgui"), 
"show"),
 
  357                    $lng->txt(
"settings")
 
  361                    $ilCtrl->getLinkTarget($this, 
"editSettings"),
 
  362                    $lng->txt(
"settings")
 
  383            && (!$news_set->get(
"enable_rss_for_internal") ||
 
  385                    $this->getBlockType(),
 
  394        if (
$ilUser->getPref(
"il_feed_js") == 
"n") {
 
  398        return parent::getHTML() . $en;
 
  408        include_once(
"Services/Block/classes/class.ilBlockSetting.php");
 
  417        $got_notices = $got_messages = 
false;
 
  419            if (
$row[
"priority"] == 0) {
 
  422            if (
$row[
"priority"] == 1) {
 
  423                $got_messages = 
true;
 
  426        $this->show_view_selection = 
false;
 
  428        if ($got_notices && $got_messages) {
 
  429            $this->show_view_selection = 
true;
 
  430        } elseif ($got_notices) {
 
  461            $this->tpl->setCurrentBlock(
"long");
 
  463            $this->tpl->setVariable(
 
  467            $this->tpl->parseCurrentBlock();
 
  471        if ($news[
"ref_id"] > 0) {
 
  472            if ($news[
"agg_ref_id"] > 0) {
 
  475                $context_ref = $news[
"agg_ref_id"];
 
  477                $obj_id = $news[
"context_obj_id"];
 
  478                $type = $news[
"context_obj_type"];
 
  479                $context_ref = $news[
"ref_id"];
 
  482            $lang_type = in_array(
$type, array(
"sahs", 
"lm", 
"htlm"))
 
  488                : 
$lng->txt($lang_type);
 
  490            $this->tpl->setCurrentBlock(
"news_context");
 
  491            $this->tpl->setVariable(
"TYPE", $type_txt);
 
  492            $this->tpl->setVariable(
 
  494                ilObject::_getIcon($obj_id, 
"tiny", 
$type)
 
  496            $this->tpl->setVariable(
 
  500            if ($news[
"user_read"] > 0) {
 
  501                $this->tpl->setVariable(
"TITLE_CLASS", 
'class="light"');
 
  504            $this->tpl->parseCurrentBlock();
 
  505            $ilCtrl->setParameter($this, 
"news_context", $context_ref);
 
  507            $ilCtrl->setParameter($this, 
"news_context", 
"");
 
  511        $this->tpl->setVariable(
 
  514                $news[
"context_obj_type"],
 
  516                $news[
"content_is_lang_var"],
 
  523        if ($news[
"user_read"] > 0) {
 
  524            $this->tpl->setVariable(
"A_CLASS", 
'class="light"');
 
  527        $ilCtrl->setParameter($this, 
"news_id", $news[
"id"]);
 
  528        $this->tpl->setVariable(
 
  530            $ilCtrl->getLinkTarget($this, 
"showNews")
 
  532        $ilCtrl->clearParameters($this);
 
  544        return '<div class="small">' . ((int) count($this->
getData())) . 
" " . 
$lng->txt(
"news_news_items") . 
"</div>";
 
  558        if (empty(self::$st_data)) {
 
  563        $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
  565        include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
  568        $tpl = 
new ilTemplate(
"tpl.show_news.html", 
true, 
true, 
"Services/News");
 
  571        $previous = $next = 
"";
 
  573        $c = current($this->
data);
 
  576        while (
$c[
"id"] > 0 &&
 
  577             $c[
"id"] != 
$_GET[
"news_id"]) {
 
  583        if (!is_array(
$c) && is_object($news) && $news->getId() > 0
 
  585            throw new ilException(
"News ID does not match object context.");
 
  590        $news_list = array();
 
  591        if (is_array(
$c[
"aggregation"])) {      
 
  592            $news_list[] = array(
"ref_id" => 
$c[
"agg_ref_id"],
 
  593                "agg_ref_id" => 
$c[
"agg_ref_id"],
 
  594                "aggregation" => 
$c[
"aggregation"],
 
  596                "content_type" => 
"text",
 
  600                "content_long" => 
"",
 
  601                "update_date" => $news->getUpdateDate(),
 
  602                "creation_date" => 
"",
 
  603                "content_is_lang_var" => 
false,
 
  604                "loc_context" => 
$_GET[
"news_context"],
 
  605                "context_obj_type" => $news->getContextObjType(),
 
  608            foreach (
$c[
"aggregation"] as $c_item) {
 
  610                $c_item[
"loc_context"] = $c_item[
"ref_id"];
 
  611                $c_item[
"loc_stop"] = 
$_GET[
"news_context"];
 
  612                $news_list[] = $c_item;
 
  615            $news_list[] = array(
 
  616                "id" => $news->getId(),
 
  617                "ref_id" => 
$_GET[
"news_context"],
 
  618                "user_id" => $news->getUserId(),
 
  619                "content_type" => $news->getContentType(),
 
  620                "mob_id" => $news->getMobId(),
 
  621                "visibility" => $news->getVisibility(),
 
  622                "priority" => $news->getPriority(),
 
  623                "content" => $news->getContent(),
 
  624                "content_long" => $news->getContentLong(),
 
  625                "update_date" => $news->getUpdateDate(),
 
  626                "creation_date" => $news->getCreationDate(),
 
  627                "context_sub_obj_type" => $news->getContextSubObjType(),
 
  628                "context_obj_type" => $news->getContextObjType(),
 
  629                "context_sub_obj_id" => $news->getContextSubObjId(),
 
  630                "content_is_lang_var" => $news->getContentIsLangVar(),
 
  631                "content_text_is_lang_var" => $news->getContentTextIsLangVar(),
 
  632                "loc_context" => 
$_GET[
"news_context"],
 
  633                "title" => $news->getTitle());
 
  638        $cache_deleted = 
false;
 
  639        foreach ($news_list as $item) {
 
  640            $row_css = ($row_css != 
"tblrow1")
 
  644            if ($item[
"ref_id"] > 0 && !$ilAccess->checkAccess(
"read", 
"", $item[
"ref_id"])) {
 
  645                $tpl->setCurrentBlock(
"content");
 
  646                $tpl->setVariable(
"VAL_CONTENT", 
$lng->txt(
"news_sorry_not_accessible_anymore"));
 
  647                $tpl->parseCurrentBlock();
 
  648                $tpl->setCurrentBlock(
"item");
 
  649                $tpl->setVariable(
"ITEM_ROW_CSS", $row_css);
 
  650                $tpl->parseCurrentBlock();
 
  651                if (!$cache_deleted) {
 
  652                    $this->acache->deleteEntry(
$ilUser->getId() . 
":" . 
$_GET[
"ref_id"]);
 
  653                    $cache_deleted = 
true;
 
  663                    $displayname = 
$user->getLogin();
 
  667                    $displayname = 
"<" . strtolower(
$lng->txt(
"deleted")) . 
">";
 
  670                $tpl->setCurrentBlock(
"user_info");
 
  671                $tpl->setVariable(
"VAL_AUTHOR", $displayname);
 
  672                $tpl->setVariable(
"TXT_AUTHOR", 
$lng->txt(
"author"));
 
  673                $tpl->parseCurrentBlock();
 
  677            $ui_renderer = $this->ui->renderer();
 
  678            $ui_factory = $this->ui->factory();
 
  679            $this->ui->factory();
 
  683                if (in_array($mime, array(
"image/jpeg", 
"image/svg+xml", 
"image/gif", 
"image/png"))) {
 
  684                    $title = basename($media_path);
 
  685                    $html = $ui_renderer->render($ui_factory->image()->responsive($media_path, 
$title));
 
  686                } elseif (in_array($mime, array(
"audio/mpeg", 
"audio/ogg", 
"video/mp4", 
"video/x-flv", 
"video/webm"))) {
 
  688                    $mp->setFile($media_path);
 
  689                    $mp->setDisplayHeight(200);
 
  690                    $html = $mp->getMediaPlayerHtml();
 
  697                $tpl->setCurrentBlock(
"player");
 
  702                $tpl->parseCurrentBlock();
 
  706            if ($enable_internal_rss && $item[
"visibility"] != 
"") {
 
  708                $tpl->setCurrentBlock(
"access");
 
  709                $tpl->setVariable(
"TXT_ACCESS", 
$lng->txt(
"news_news_item_visibility"));
 
  711                    ($item[
"priority"] == 0 &&
 
  714                        "public_notifications",
 
  718                    $tpl->setVariable(
"VAL_ACCESS", 
$lng->txt(
"news_visibility_public"));
 
  720                    $tpl->setVariable(
"VAL_ACCESS", 
$lng->txt(
"news_visibility_users"));
 
  722                $tpl->parseCurrentBlock();
 
  726            include_once(
"./Services/News/classes/class.ilNewsRendererFactory.php");
 
  728            if (trim($item[
"content"]) != 
"") {         
 
  730                $renderer->setNewsItem($it, $item[
"ref_id"]);
 
  731                $tpl->setCurrentBlock(
"content");
 
  732                $tpl->setVariable(
"VAL_CONTENT", $renderer->getDetailContent());
 
  733                $tpl->parseCurrentBlock();
 
  735            if ($item[
"update_date"] != $item[
"creation_date"]) {               
 
  736                $tpl->setCurrentBlock(
"ni_update");
 
  737                $tpl->setVariable(
"TXT_LAST_UPDATE", 
$lng->txt(
"last_update"));
 
  742                $tpl->parseCurrentBlock();
 
  746            if ($item[
"creation_date"] != 
"") {
 
  747                $tpl->setCurrentBlock(
"ni_update");
 
  752                $tpl->setVariable(
"TXT_CREATED", 
$lng->txt(
"created"));
 
  753                $tpl->parseCurrentBlock();
 
  758            if (
$_GET[
"news_context"] > 0) {
 
  765                if ($obj_type == 
"file") {
 
  766                    $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", $item[
"ref_id"]);
 
  767                    $url = 
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui", 
"sendfile");
 
  768                    $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", 
$_GET[
"ref_id"]);
 
  770                    include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
  772                    $button->setUrl(
$url);
 
  773                    $button->setCaption(
"download");
 
  775                    $tpl->setCurrentBlock(
"download");
 
  776                    $tpl->setVariable(
"BUTTON_DOWNLOAD", $button->render());
 
  777                    $tpl->parseCurrentBlock();
 
  782                if ($obj_type == 
"frm" && $item[
"context_sub_obj_type"] == 
"pos" 
  783                    && $item[
"context_sub_obj_id"] > 0) {
 
  784                    include_once(
"./Modules/Forum/classes/class.ilObjForumAccess.php");
 
  785                    $pos = $item[
"context_sub_obj_id"];
 
  788                        $add = 
"_" . $thread . 
"_" . $pos;
 
  793                if ($obj_type == 
"wiki" && $item[
"context_sub_obj_type"] == 
"wpg" 
  794                    && $item[
"context_sub_obj_id"] > 0) {
 
  795                    include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
 
  797                    if ($wptitle != 
"") {
 
  802                $url_target = 
"./goto.php?client_id=" . rawurlencode(CLIENT_ID) . 
"&target=" .
 
  803                    $obj_type . 
"_" . $item[
"ref_id"] . $add;
 
  806                if (in_array($obj_type, array(
"lm")) && $item[
"context_sub_obj_type"] == 
"pg" 
  807                    && $item[
"context_sub_obj_id"] > 0) {
 
  808                    $url_target = 
"./goto.php?client_id=" . rawurlencode(CLIENT_ID) . 
"&target=" .
 
  809                        "pg_" . $item[
"context_sub_obj_id"] . 
"_" . $item[
"ref_id"];
 
  813                if ($obj_type == 
"blog" && $item[
"context_sub_obj_type"] == 
"blp" 
  814                    && $item[
"context_sub_obj_id"] > 0) {
 
  815                    $url_target = 
"./goto.php?client_id=" . rawurlencode(CLIENT_ID) . 
"&target=" .
 
  816                        "blog_" . $item[
"ref_id"] . 
"_" . $item[
"context_sub_obj_id"];
 
  819                $context_opened = 
false;
 
  820                if ($item[
"loc_context"] != 
null && $item[
"loc_context"] != $item[
"loc_stop"]) {
 
  821                    $tpl->setCurrentBlock(
"context");
 
  822                    $context_opened = 
true;
 
  824                    $cont_loc->addContextItems($item[
"loc_context"], 
true, $item[
"loc_stop"]);
 
  825                    $tpl->setVariable(
"CONTEXT_LOCATOR", $cont_loc->getHTML());
 
  829                if ($item[
"no_context_title"] !== 
true) {
 
  830                    if (!$context_opened) {
 
  831                        $tpl->setCurrentBlock(
"context");
 
  833                    $tpl->setVariable(
"HREF_CONTEXT_TITLE", $url_target);
 
  834                    $tpl->setVariable(
"CONTEXT_TITLE", $obj_title);
 
  835                    $tpl->setVariable(
"IMG_CONTEXT_TITLE", ilObject::_getIcon($obj_id, 
"big", $obj_type));
 
  837                if ($context_opened) {
 
  838                    $tpl->parseCurrentBlock();
 
  841                $tpl->setVariable(
"HREF_TITLE", $url_target);
 
  848                    $item[
"context_obj_type"],
 
  850                    $item[
"content_is_lang_var"],
 
  857            $tpl->setCurrentBlock(
"item");
 
  858            $tpl->setVariable(
"ITEM_ROW_CSS", $row_css);
 
  859            $tpl->parseCurrentBlock();
 
  862        include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
 
  864        $content_block->setContent(
$tpl->get());
 
  866            $content_block->setTitle($this->
getProperty(
"title"));
 
  868            $content_block->setTitle(
$lng->txt(
"news_internal_news"));
 
  873        if ($previous != 
"") {
 
  874            if ($previous[
"ref_id"] > 0) {
 
  875                $ilCtrl->setParameter($this, 
"news_context", $previous[
"ref_id"]);
 
  877            $ilCtrl->setParameter($this, 
"news_id", $previous[
"id"]);
 
  878            $content_block->addFooterLink(
 
  879                $lng->txt(
"previous"),
 
  880                $ilCtrl->getLinkTarget($this, 
"showNews"),
 
  885            $ilCtrl->setParameter($this, 
"news_context", 
"");
 
  889        if (
$c = next($this->
data)) {
 
  890            if (
$c[
"ref_id"] > 0) {
 
  891                $ilCtrl->setParameter($this, 
"news_context", 
$c[
"ref_id"]);
 
  893            $ilCtrl->setParameter($this, 
"news_id", 
$c[
"id"]);
 
  894            $content_block->addFooterLink(
 
  896                $ilCtrl->getLinkTarget($this, 
"showNews"),
 
  902        $ilCtrl->setParameter($this, 
"news_context", 
"");
 
  903        $ilCtrl->setParameter($this, 
"news_id", 
"");
 
  904        $content_block->setCurrentItemNumber($curr_cnt);
 
  905        $content_block->setEnableNumInfo(
true);
 
  906        $content_block->setData($this->
getData());
 
  908        return $content_block->getHTML();
 
  920            $med = $mob->getMediaItem(
"Standard");
 
  921            if (strcasecmp(
"Reference", $med->getLocationType()) == 0) {
 
  922                $media_path = $med->getLocation();
 
  940        if (is_int(strpos($a_str, 
">")) && is_int(strpos($a_str, 
"<"))) {
 
  956        include_once(
"./Services/News/classes/class.ilNewsSubscription.php");
 
  958        $ilCtrl->returnToParent($this);
 
  969        include_once(
"./Services/News/classes/class.ilNewsSubscription.php");
 
  971        $ilCtrl->returnToParent($this);
 
  983        parent::fillFooter();
 
  985        if ($this->show_view_selection) {
 
 1002        $this->
addFooterLink(
"[" . 
$lng->txt(
"news_first_letter_of_word_notification") . 
"] " .
 
 1003            $lng->txt(
"news_notifications") . 
": ", 
"", 
"", 
"", 
false, 
true);
 
 1004        if ($this->view == 
"hide_notifications") {
 
 1013                    "showNotifications",
 
 1017                "block_" . $this->getBlockType() . 
"_" . $this->block_id
 
 1030                    "hideNotifications",
 
 1034                "block_" . $this->getBlockType() . 
"_" . $this->block_id
 
 1046        include_once(
"Services/Block/classes/class.ilBlockSetting.php");
 
 1064            $ilCtrl->returnToParent($this);
 
 1073        include_once(
"Services/Block/classes/class.ilBlockSetting.php");
 
 1077            "hide_notifications",
 
 1091            $ilCtrl->returnToParent($this);
 
 1101        return $this->settings_form->getHTML();
 
 1115        $ilTabs->clearTargets();
 
 1118        $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
 1122            "public_notifications",
 
 1140            "hide_news_per_date",
 
 1151        if ($hide_news_date != 
"") {
 
 1152            $hide_news_date = explode(
" ", $hide_news_date);
 
 1155        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1157        $this->settings_form->setTitle(
$lng->txt(
"news_settings"));
 
 1160        if ($this->
getProperty(
"hide_news_block_option")) {
 
 1162                $lng->txt(
"news_hide_news_block"),
 
 1165            $ch->setInfo(
$lng->txt(
"news_hide_news_block_info"));
 
 1166            $ch->setChecked($hide_block);
 
 1167            $this->settings_form->addItem($ch);
 
 1170                $lng->txt(
"news_hide_news_per_date"),
 
 1171                "hide_news_per_date" 
 1173            $hnpd->setInfo(
$lng->txt(
"news_hide_news_per_date_info"));
 
 1174            $hnpd->setChecked($hide_news_per_date);
 
 1177                $lng->txt(
"news_hide_news_date"),
 
 1180            $dt_prop->setRequired(
true);
 
 1181            if ($hide_news_date != 
"") {
 
 1184            #$dt_prop->setDate($hide_news_date[0]); 
 1185            #$dt_prop->setTime($hide_news_date[1]); 
 1186            $dt_prop->setShowTime(
true);
 
 1188            $hnpd->addSubItem($dt_prop);
 
 1190            $this->settings_form->addItem($hnpd);
 
 1194        if ($this->
getProperty(
"default_visibility_option") &&
 
 1195            $enable_internal_rss) {
 
 1198                "default_visibility",
 
 1202            if ($default_visibility == 
"") {
 
 1203                $default_visibility =
 
 1210            $radio_group->addOption($radio_option);
 
 1211            $radio_option = 
new ilRadioOption(
$lng->txt(
"news_visibility_public"), 
"public");
 
 1212            $radio_group->addOption($radio_option);
 
 1213            $radio_group->setInfo(
$lng->txt(
"news_news_item_visibility_info"));
 
 1214            $radio_group->setRequired(
false);
 
 1215            $radio_group->setValue($default_visibility);
 
 1216            $this->settings_form->addItem($radio_group);
 
 1220        if ($this->
getProperty(
"public_notifications_option") &&
 
 1221            $enable_internal_rss) {
 
 1223                $lng->txt(
"news_notifications_public"),
 
 1224                "notifications_public" 
 1226            $ch->setInfo(
$lng->txt(
"news_notifications_public_info"));
 
 1227            $ch->setChecked($public);
 
 1228            $this->settings_form->addItem($ch);
 
 1232        if ($enable_internal_rss) {
 
 1234                $lng->txt(
"news_public_feed"),
 
 1235                "notifications_public_feed" 
 1237            $ch->setInfo(
$lng->txt(
"news_public_feed_info"));
 
 1238            $ch->setChecked($public_feed);
 
 1239            $this->settings_form->addItem($ch);
 
 1250        $this->settings_form->addCommandButton(
"saveSettings", 
$lng->txt(
"save"));
 
 1251        $this->settings_form->addCommandButton(
"cancelSettings", 
$lng->txt(
"cancel"));
 
 1252        $this->settings_form->setFormAction(
$ilCtrl->getFormaction($this));
 
 1267        $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
 1278        if ($default_visibility == 
"") {
 
 1279            $default_visibility =
 
 1284        $radio_group->addOption($radio_option);
 
 1285        $radio_option = 
new ilRadioOption(
$lng->txt(
"news_visibility_public"), 
"public");
 
 1286        $radio_group->addOption($radio_option);
 
 1287        $radio_group->setInfo(
$lng->txt(
"news_news_item_visibility_info"));
 
 1288        $radio_group->setRequired(
false);
 
 1289        $radio_group->setValue($default_visibility);
 
 1290        $a_input->addSubItem($radio_group);
 
 1293        if ($enable_internal_rss) {
 
 1295                $lng->txt(
"news_public_feed"),
 
 1296                "notifications_public_feed" 
 1298            $radio_rss->setInfo(
$lng->txt(
"news_public_feed_info"));
 
 1299            $radio_rss->setChecked($public_feed);
 
 1300            $a_input->addSubItem($radio_rss);
 
 1309        foreach ($a_values as 
$key => $value) {
 
 1321        $ilCtrl->returnToParent($this);
 
 1333        if ($this->settings_form->checkInput()) {
 
 1335            $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
 1337            if ($enable_internal_rss) {
 
 1340                    "public_notifications",
 
 1341                    $_POST[
"notifications_public"],
 
 1348                    $_POST[
"notifications_public_feed"],
 
 1354                    "default_visibility",
 
 1355                    $_POST[
"default_visibility"],
 
 1361            if ($this->
getProperty(
"hide_news_block_option")) {
 
 1365                    $_POST[
"hide_news_block"],
 
 1371                    "hide_news_per_date",
 
 1372                    $_POST[
"hide_news_per_date"],
 
 1378                $hd = $this->settings_form->getItemByPostVar(
"hide_news_date");
 
 1379                $hide_date = $hd->getDate();
 
 1380                if (
$_POST[
"hide_news_per_date"] && $hide_date != 
null) {
 
 1399            include_once(
"./Services/News/classes/class.ilNewsCache.php");
 
 1401            $cache->deleteEntry(
$ilUser->getId() . 
":" . 
$_GET[
"ref_id"]);
 
 1403            $ilCtrl->returnToParent($this);
 
 1405            $this->settings_form->setValuesByPost();
 
 1406            return $this->settings_form->getHtml();
 
 1419        include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
 1423        $tpl = 
new ilTemplate(
"tpl.show_feed_url.html", 
true, 
true, 
"Services/News");
 
 1426            sprintf(
$lng->txt(
"news_feed_url_for"), 
$title)
 
 1428        $tpl->setVariable(
"TXT_INFO", 
$lng->txt(
"news_get_feed_info"));
 
 1429        $tpl->setVariable(
"TXT_FEED_URL", 
$lng->txt(
"news_feed_url"));
 
 1432            ILIAS_HTTP_PATH . 
"/feed.php?client_id=" . rawurlencode(CLIENT_ID) . 
"&user_id=" . 
$ilUser->getId() .
 
 1433                "&obj_id=" . $this->block_id .
 
 1438            ILIAS_HTTP_PATH . 
"/feed.php?client_id=" . rawurlencode(CLIENT_ID) . 
"&<br />user_id=" . 
$ilUser->getId() .
 
 1439                "&obj_id=" . $this->block_id .
 
 1443        include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
 
 1445        $content_block->setContent(
$tpl->get());
 
 1446        $content_block->setTitle(
$lng->txt(
"news_internal_news"));
 
 1447        $content_block->addHeaderCommand(
 
 1448            $ilCtrl->getParentReturn($this),
 
 1453        return $content_block->getHTML();
 
 1461        $a_content_block->addHeaderCommand(
 
 1462            $ilCtrl->getParentReturn($this),
 
 1473        if (
$ilCtrl->getCmd() == 
"hideNotifications" ||
 
 1474            $ilCtrl->getCmd() == 
"showNotifications") {
 
 1478        if (
$ilCtrl->getCmdClass() != 
"ilcolumngui" && 
$ilCtrl->getCmd() != 
"enableJS") {
 
 1481                $sess_feed_js = 
$_SESSION[
"il_feed_js"];
 
 1484            if ($sess_feed_js != 
"n" &&
 
 1485                (
$ilUser->getPref(
"il_feed_js") != 
"n" || $sess_feed_js == 
"y")) {
 
 1508        $rel_tpl = 
new ilTemplate(
"tpl.dynamic_reload.html", 
true, 
true, 
"Services/News");
 
 1509        $rel_tpl->setVariable(
"TXT_LOADING", 
$lng->txt(
"news_loading_news"));
 
 1511        $rel_tpl->setVariable(
 
 1513            $ilCtrl->getLinkTargetByClass(
"ilcolumngui", 
"updateBlock", 
"", 
true)
 
 1517        $rel_tpl->setVariable(
"TXT_NEWS_CLICK_HERE", 
$lng->txt(
"news_no_js_click_here"));
 
 1518        $rel_tpl->setVariable(
 
 1520            $ilCtrl->getLinkTargetByClass(strtolower(get_class($this)), 
"disableJS")
 
 1523        return $rel_tpl->get();
 
 1537        $rel_tpl = 
new ilTemplate(
"tpl.js_enabler.html", 
true, 
true, 
"Services/News");
 
 1539        $rel_tpl->setVariable(
 
 1541            $ilCtrl->getLinkTargetByClass(strtolower(get_class($this)), 
"enableJS", 
true, 
"", 
false)
 
 1544        return $rel_tpl->get();
 
 1554        $ilUser->writePref(
"il_feed_js", 
"n");
 
 1555        $ilCtrl->returnToParent($this);
 
 1564        $ilUser->writePref(
"il_feed_js", 
"y");
 
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.
setFooterInfo($a_footerinfo, $a_hide_and_icon=false)
Set Footer Info.
getCurrentDetailLevel()
Get Current Detail Level.
getBlockId()
Get Block Id.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
addFooterLink( $a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
Add a footer text/link.
setData($a_data)
Set Data.
getRepositoryMode()
Get RepositoryMode.
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
addBlockCommand( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
clearFooterLinks()
Clear footer links.
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
Base class for ILIAS Exception handling.
BlockGUI class for block NewsForContext.
showViewFooter()
Show additional footer for show/hide notifications.
cancelSettings()
Cancel settings.
saveSettings()
Save settings.
static getScreenMode()
Get Screen Mode for current command.
getMediaPath(int $mob_id)
subscribeNews()
Subscribe current user from news.
editSettings()
Show settings screen.
__construct()
Constructor.
unsubscribeNews()
Unsubscribe current user from news.
static writeSettings($a_values)
getHTML()
Get bloch HTML code.
setEnableEdit($a_enable_edit=0)
Set EnableEdit.
initSettingsForm()
Init setting form.
showFeedUrl()
Show feed URL.
handleView()
Handles show/hide notification view and removes notifications if hidden.
makeClickable($a_str)
Make clickable.
fillDataSection()
Fill data section.
executeCommand()
execute command
addCloseCommand($a_content_block)
getNewsData()
Get news for context.
const OBJECTS_WITH_NEWS_SUBTAB
object type names with settings->news settings subtab
getEnableEdit()
Get EnableEdit.
getOverview()
Get overview.
static addToSettingsForm(ilFormPropertyGUI $a_input)
Add inputs to the container news settings form to configure also the contextBlock options.
isRepositoryObject()
Returns whether block has a corresponding repository object.bool
fillRow($news)
get flat bookmark list for personal desktop
User Interface for NewsItem entities.
static _getDefaultVisibilityForRefId($a_ref_id)
Get default visibility for reference id.
static _setRead($a_user_id, $a_news_id)
Set item read.
static prepareNewsDataFromCache($a_cres)
Prepare news data from cache.
static determineNewsTitle( $a_context_obj_type, $a_title, $a_content_is_lang_var, $a_agg_ref_id=0, $a_aggregation="")
Determine title for news item entry.
static _lookupContextObjId($a_news_id)
Context Object ID.
static getRenderer($a_context_obj_type)
Get renderer.
static _subscribe($a_ref_id, $a_user_id)
Subscribe a user to an object (ref id).
static _unsubscribe($a_ref_id, $a_user_id)
Unsubscribe a user from an object (ref id).
static _getThreadForPosting($a_pos_id)
Get thread id for posting.
static _lookupFeedHash($a_user_id, $a_create=false)
Lookup news feed hash for user.
static lookupTxtById($plugin_id, $lang_var)
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static _lookupType($a_id, $a_reference=false)
lookup object type
BlockGUI class for (centered) Content on Personal Desktop.
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
static shortenWords($a_str, $a_len=30, $a_dots=true)
Ensure that the maximum word lenght within a text is not longer than $a_len.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.