ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilNewsForContextBlockGUI Class Reference

BlockGUI class for block NewsForContext. More...

+ Inheritance diagram for ilNewsForContextBlockGUI:
+ Collaboration diagram for ilNewsForContextBlockGUI:

Public Member Functions

 ilNewsForContextBlockGUI ()
 Constructor.
 getNewsData ()
 Get news for context.
executeCommand ()
 execute command
 setEnableEdit ($a_enable_edit=0)
 Set EnableEdit.
 getEnableEdit ()
 Get EnableEdit.
 fillDataSection ()
 Fill data section.
 getHTML ()
 Get bloch HTML code.
 handleView ()
 Handles show/hide notification view and removes notifications if hidden.
 fillRow ($news)
 get flat bookmark list for personal desktop
 getOverview ()
 Get overview.
 showNews ()
 show news
 makeClickable ($a_str)
 Make clickable.
 unsubscribeNews ()
 Unsubscribe current user from news.
 subscribeNews ()
 Subscribe current user from news.
 fillFooter ()
 block footer
 showViewFooter ()
 Show additional footer for show/hide notifications.
 showNotifications ()
 hideNotifications ()
 editSettings ()
 Show settings screen.
 initSettingsForm ()
 Init setting form.
 cancelSettings ()
 Cancel settings.
 saveSettings ()
 Save settings.
 showFeedUrl ()
 Show feed URL.
 addCloseCommand ($a_content_block)
 getDynamic ()
 getDynamicReload ()
 getJSEnabler ()
 disableJS ()
 enableJS ()
- Public Member Functions inherited from ilBlockGUI
 ilBlockGUI ()
 Constructor.
 addHeaderLink ($a_href, $a_text, $status=true)
 getHeaderLinks ()
 setData ($a_data)
 Set Data.
 getData ()
 Get Data.
 setBigMode ($a_bigmode)
 Set Big Mode.
 getBigMode ()
 Get Big Mode.
 setBlockId ($a_block_id=0)
 Set Block Id.
 getBlockId ()
 Get Block Id.
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels.
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level.
 setGuiObject (&$a_gui_object)
 Set GuiObject.
 getGuiObject ()
 Get GuiObject.
 getCurrentDetailLevel ()
 Get Current Detail Level.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setImage ($a_image)
 Set Image.
 getImage ()
 Get Image.
 setOffset ($a_offset)
 Set Offset.
 getOffset ()
 Get Offset.
 correctOffset ()
 setLimit ($a_limit)
 Set Limit.
 getLimit ()
 Get Limit.
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode.
 getRepositoryMode ()
 Get RepositoryMode.
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info.
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info.
 setSubtitle ($a_subtitle)
 Set Subtitle.
 getSubtitle ()
 Get Subtitle.
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true).
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true).
 setAdminCommands ($a_admincommands)
 Set Administration Commmands.
 getAdminCommands ()
 Get Administration Commmands.
 setColSpan ($a_colspan)
 Set Columns Span.
 getColSpan ()
 Get Columns Span.
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow.
 getEnableDetailRow ()
 Get EnableDetailRow.
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info.
 getEnableNumInfo ()
 Get Enable Item Number Info.
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties.
 getProperty ($a_property)
 setProperty ($a_property, $a_value)
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name.
 getNavParameter ()
 getDetailParameter ()
 getConfigParameter ()
 getMoveParameter ()
 getRowTemplateName ()
 Get Row Template Name.
 getRowTemplateDir ()
 Get Row Template Directory.
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false)
 Add Block Command.
 getBlockCommands ()
 Get Block commands.
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command.
 getHeaderCommands ()
 Get Header Block commands.
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false)
 Add a footer text/link.
 getFooterLinks ()
 Get footer links.
 clearFooterLinks ()
 Clear footer links.
 handleDetailLevel ()
 Handle read/write current detail level.
 setConfigMode ($a_configmode)
 Handle config status.
 getConfigMode ()
 Get Config Mode (move blocks).
 fillHeaderCommands ()
 Fill header commands block.
 fillHeaderTitleBlock ()
 Fill header title block (title and.
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used.
 fillPreviousNext ()
 Fill previous/next row.
 setPreviousNextLinks ()
 Get previous/next linkbar.
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links.
 fillDetailRow ()
 Fill Detail Setting Row.
 fillMoveRow ()
 Fill row for Moving.
 getAllowMove ($a_direction)
 setAllowMove ($a_direction, $a_allow=true)
 fillMoveLink ($a_value, $a_img, $a_txt)

Static Public Member Functions

static getBlockType ()
 Get block type.
static isRepositoryObject ()
 Is this a repository object.
static getScreenMode ()
 Get Screen Mode for current command.

Static Public Attributes

static $block_type = "news"
static $st_data

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 $colspan = 1
 $enablenuminfo = true
 $detail_min = 0
 $detail_max = 0
 $bigmode = false
 $footer_links = array()
 $block_id = 0
 $header_commands = array()
 $allow_moving = true
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 $enabledetailrow = true
 $header_links = array()
 $footerinfo = false
 $footerinfo_icon = false
 $block_commands = array()
 $max_count = false
 $close_command = false
 $image = false
 $property = false
 $nav_value = ""
 $css_row = ""

Detailed Description

BlockGUI class for block NewsForContext.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilNewsForContextBlockGUI.php 42452 2013-05-31 16:20:08Z akill

ilNewsForContextBlockGUI: ilColumnGUI ilNewsForContextBlockGUI: ilNewsItemGUI

Definition at line 18 of file class.ilNewsForContextBlockGUI.php.

Member Function Documentation

ilNewsForContextBlockGUI::addCloseCommand (   $a_content_block)

Reimplemented in ilPDNewsBlockGUI.

Definition at line 1191 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, and $lng.

Referenced by showNews().

{
global $lng, $ilCtrl;
$a_content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
$lng->txt("close"), true);
}

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::cancelSettings ( )

Cancel settings.

Reimplemented in ilPDNewsBlockGUI.

Definition at line 1095 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->returnToParent($this);
}
ilNewsForContextBlockGUI::disableJS ( )

Definition at line 1268 of file class.ilNewsForContextBlockGUI.php.

References $_SESSION, and $ilCtrl.

{
global $ilCtrl, $ilUser;
$_SESSION["il_feed_js"] = "n";
$ilUser->writePref("il_feed_js", "n");
$ilCtrl->returnToParent($this);
//$ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
}
ilNewsForContextBlockGUI::editSettings ( )

Show settings screen.

Reimplemented in ilPDNewsBlockGUI.

Definition at line 965 of file class.ilNewsForContextBlockGUI.php.

References initSettingsForm().

{
$this->initSettingsForm();
return $this->settings_form->getHTML();
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::enableJS ( )

Definition at line 1278 of file class.ilNewsForContextBlockGUI.php.

References $_SESSION, exit, and getHTML().

{
global $ilUser;
//echo "enableJS";
$_SESSION["il_feed_js"] = "y";
$ilUser->writePref("il_feed_js", "y");
echo $this->getHTML();
}

+ Here is the call graph for this function:

& ilNewsForContextBlockGUI::executeCommand ( )

execute command

Reimplemented in ilPDNewsBlockGUI.

Definition at line 178 of file class.ilNewsForContextBlockGUI.php.

References $cmd, $ilCtrl, and getEnableEdit().

{
global $ilCtrl;
$next_class = $ilCtrl->getNextClass();
$cmd = $ilCtrl->getCmd("getHTML");
switch ($next_class)
{
case "ilnewsitemgui":
include_once("./Services/News/classes/class.ilNewsItemGUI.php");
$news_item_gui = new ilNewsItemGUI();
$news_item_gui->setEnableEdit($this->getEnableEdit());
$html = $ilCtrl->forwardCommand($news_item_gui);
return $html;
default:
return $this->$cmd();
}
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDNewsBlockGUI.

Definition at line 222 of file class.ilNewsForContextBlockGUI.php.

References ilBlockGUI\getCurrentDetailLevel(), ilBlockGUI\getData(), getDynamicReload(), getOverview(), and ilBlockGUI\setDataSection().

{
if ($this->dynamic)
{
$this->setDataSection($this->getDynamicReload());
}
else if ($this->getCurrentDetailLevel() > 1 && count($this->getData()) > 0)
{
}
else
{
$this->setDataSection($this->getOverview());
}
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::fillFooter ( )

block footer

Reimplemented from ilBlockGUI.

Definition at line 864 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $lng, and showViewFooter().

{
global $ilCtrl, $lng, $ilUser;
if ($this->show_view_selection)
{
$this->showViewFooter();
}
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::fillRow (   $news)

get flat bookmark list for personal desktop

Reimplemented from ilBlockGUI.

Definition at line 390 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $lng, ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilNewsItem\determineNewsTitle(), ilDatePresentation\formatDate(), ilBlockGUI\getCurrentDetailLevel(), IL_CAL_DATETIME, and ilUtil\shortenWords().

{
global $ilUser, $ilCtrl, $lng;
if ($this->getCurrentDetailLevel() > 2)
{
$this->tpl->setCurrentBlock("long");
//$this->tpl->setVariable("VAL_CONTENT", $news["content"]);
$this->tpl->setVariable("VAL_CREATION_DATE",
$this->tpl->parseCurrentBlock();
}
// notification
if ($news["priority"] == 0)
{
/*
$this->tpl->setCurrentBlock("notification");
$this->tpl->setVariable("CHAR_NOT", $lng->txt("news_first_letter_of_word_notification"));
$this->tpl->parseCurrentBlock();
*/
}
// title image type
if ($news["ref_id"] > 0)
{
if ($news["agg_ref_id"] > 0)
{
$obj_id = ilObject::_lookupObjId($news["agg_ref_id"]);
$type = ilObject::_lookupType($obj_id);
$context_ref = $news["agg_ref_id"];
}
else
{
$obj_id = $news["context_obj_id"];
$type = $news["context_obj_type"];
$context_ref = $news["ref_id"];
}
$lang_type = in_array($type, array("sahs", "lm", "dbk", "htlm"))
? "lres"
: "obj_".$type;
$this->tpl->setCurrentBlock("news_context");
$this->tpl->setVariable("TYPE", $lng->txt($lang_type));
$this->tpl->setVariable("IMG_TYPE",
ilObject::_getIcon($obj_id, "tiny", $type));
$this->tpl->setVariable("TITLE",
if ($news["user_read"] > 0)
{
$this->tpl->setVariable("TITLE_CLASS", 'class="light"');
}
$this->tpl->parseCurrentBlock();
$ilCtrl->setParameter($this, "news_context", $context_ref);
}
else
{
$ilCtrl->setParameter($this, "news_context", "");
}
// title
$this->tpl->setVariable("VAL_TITLE",
($news["context_obj_type"], $news["title"], $news["content_is_lang_var"],
$news["agg_ref_id"], $news["aggregation"])));
if ($news["user_read"] > 0)
{
$this->tpl->setVariable("A_CLASS", 'class="light"');
}
$ilCtrl->setParameter($this, "news_id", $news["id"]);
$this->tpl->setVariable("HREF_SHOW",
$ilCtrl->getLinkTarget($this, "showNews"));
$ilCtrl->clearParameters($this);
}

+ Here is the call graph for this function:

static ilNewsForContextBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDNewsBlockGUI.

Definition at line 130 of file class.ilNewsForContextBlockGUI.php.

References $block_type.

Referenced by getDynamicReload(), getHTML(), getJSEnabler(), handleView(), hideNotifications(), initSettingsForm(), saveSettings(), and showNotifications().

{
}

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::getDynamic ( )

Definition at line 1199 of file class.ilNewsForContextBlockGUI.php.

References $_SESSION, and $ilCtrl.

Referenced by ilNewsForContextBlockGUI(), and ilPDNewsBlockGUI\ilPDNewsBlockGUI().

{
global $ilCtrl, $ilUser;
if ($ilCtrl->getCmd() == "hideNotifications" ||
$ilCtrl->getCmd() == "showNotifications")
{
return false;
}
if ($ilCtrl->getCmdClass() != "ilcolumngui" && $ilCtrl->getCmd() != "enableJS")
{
$sess_feed_js = "";
if (isset($_SESSION["il_feed_js"]))
{
$sess_feed_js = $_SESSION["il_feed_js"];
}
if ($sess_feed_js != "n" &&
($ilUser->getPref("il_feed_js") != "n" || $sess_feed_js == "y"))
{
// do not get feed dynamically, if cache hit is given.
// if (!$this->feed->checkCacheHit())
// {
return true;
// }
}
}
return false;
}

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::getDynamicReload ( )

Definition at line 1231 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $lng, ilBlockGUI\getBlockId(), and getBlockType().

Referenced by ilPDNewsBlockGUI\fillDataSection(), and fillDataSection().

{
global $ilCtrl, $lng;
$ilCtrl->setParameterByClass("ilcolumngui", "block_id",
"block_".$this->getBlockType()."_".$this->getBlockId());
$rel_tpl = new ilTemplate("tpl.dynamic_reload.html", true, true, "Services/News");
$rel_tpl->setVariable("TXT_LOADING", $lng->txt("news_loading_news"));
$rel_tpl->setVariable("BLOCK_ID", "block_".$this->getBlockType()."_".$this->getBlockId());
$rel_tpl->setVariable("TARGET",
$ilCtrl->getLinkTargetByClass("ilcolumngui", "updateBlock", "", true));
// no JS
$rel_tpl->setVariable("TXT_NEWS_CLICK_HERE", $lng->txt("news_no_js_click_here"));
$rel_tpl->setVariable("TARGET_NO_JS",
$ilCtrl->getLinkTargetByClass(strtolower(get_class($this)), "disableJS"));
return $rel_tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean Edit mode on/off

Reimplemented from ilBlockGUI.

Definition at line 214 of file class.ilNewsForContextBlockGUI.php.

Referenced by executeCommand(), and getHTML().

{
return $this->enable_edit;
}

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::getHTML ( )

Get bloch HTML code.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDNewsBlockGUI.

Definition at line 241 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, $lng, ilBlockSetting\_lookup(), ilBlockGUI\addBlockCommand(), getBlockType(), ilBlockGUI\getData(), getEnableEdit(), ilUtil\getImagePath(), ilBlockGUI\getProperty(), ilBlockGUI\getRepositoryMode(), ilBlockGUI\setFooterInfo(), and ilBlockGUI\setTitle().

Referenced by enableJS(), hideNotifications(), and showNotifications().

{
global $ilCtrl, $lng, $ilUser;
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
$hide_block = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_block",
0, $this->block_id);
if ($hide_block)
{
$this->setFooterInfo($lng->txt("news_hidden_news_block"));
}
if ($this->getProperty("title") != "")
{
$this->setTitle($this->getProperty("title"));
}
$public_feed = ilBlockSetting::_lookup($this->getBlockType(), "public_feed",
0, $this->block_id);
if ($public_feed)
{
if ($enable_internal_rss)
{
ILIAS_HTTP_PATH."/feed.php?client_id=".rawurlencode(CLIENT_ID)."&".
"ref_id=".$_GET["ref_id"],
$lng->txt("news_feed_url"), "_blank",
ilUtil::getImagePath("rss.gif"));
}
}
/* Subscription Concept is abandonded for now (Alex)
// subscribe/unsibscribe link
include_once("./Services/News/classes/class.ilNewsSubscription.php");
if (ilNewsSubscription::_hasSubscribed($_GET["ref_id"], $ilUser->getId()))
{
$this->addBlockCommand(
$ilCtrl->getLinkTarget($this, "unsubscribeNews"),
$lng->txt("news_unsubscribe"));
}
else
{
$this->addBlockCommand(
$ilCtrl->getLinkTarget($this, "subscribeNews"),
$lng->txt("news_subscribe"));
}
*/
// add edit commands
if ($this->getEnableEdit())
{
$ilCtrl->getLinkTargetByClass("ilnewsitemgui", "editNews"),
$lng->txt("edit"));
$ilCtrl->setParameter($this, "add_mode", "block");
$ilCtrl->getLinkTargetByClass("ilnewsitemgui", "createNewsItem"),
$lng->txt("add"));
$ilCtrl->setParameter($this, "add_mode", "");
}
if ($this->getProperty("settings") == true)
{
$ilCtrl->getLinkTarget($this, "editSettings"),
$lng->txt("settings"));
}
// do not display hidden repository news blocks for users
// who do not have write permission
if (!$this->getEnableEdit() && $this->getRepositoryMode() &&
ilBlockSetting::_lookup($this->getBlockType(), "hide_news_block",
0, $this->block_id))
{
return "";
}
// do not display empty news blocks for users
// who do not have write permission
if (count($this->getData()) == 0 && !$this->getEnableEdit() &&
$this->getRepositoryMode() && !$this->dynamic
&& (!$news_set->get("enable_rss_for_internal") ||
!ilBlockSetting::_lookup($this->getBlockType(), "public_feed",
0, $this->block_id)))
{
return "";
}
$en = "";
if ($ilUser->getPref("il_feed_js") == "n")
{
// $en = getJSEnabler();
}
return parent::getHTML().$en;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::getJSEnabler ( )

Definition at line 1252 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $lng, ilBlockGUI\getBlockId(), and getBlockType().

Referenced by ilPDNewsBlockGUI\getHTML().

{
global $ilCtrl, $lng;
$ilCtrl->setParameterByClass("ilcolumngui", "block_id",
"block_".$this->getBlockType()."_".$this->getBlockId());
//echo "hh";
$rel_tpl = new ilTemplate("tpl.js_enabler.html", true, true, "Services/News");
$rel_tpl->setVariable("BLOCK_ID", "block_".$this->getBlockType()."_".$this->getBlockId());
$rel_tpl->setVariable("TARGET",
$ilCtrl->getLinkTargetByClass(strtolower(get_class($this)), "enableJS", true, "", false));
return $rel_tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::getNewsData ( )

Get news for context.

Reimplemented in ilPDNewsBlockGUI.

Definition at line 84 of file class.ilNewsForContextBlockGUI.php.

References $_GET, and $ilCtrl.

Referenced by hideNotifications(), ilNewsForContextBlockGUI(), showNews(), and showNotifications().

{
global $ilCtrl, $ilUser;
include_once("./Services/News/classes/class.ilNewsCache.php");
$this->acache = new ilNewsCache();
/* $cres = $this->acache->getEntry($ilUser->getId().":".$_GET["ref_id"]);
if ($this->acache->getLastAccessStatus() == "hit" && false)
{
$news_data = unserialize($cres);
}
else
{*/
$news_item = new ilNewsItem();
$news_item->setContextObjId($ilCtrl->getContextObjId());
$news_item->setContextObjType($ilCtrl->getContextObjType());
// workaround, better: reduce constructor and introduce
//$prevent_aggregation = $this->getProperty("prevent_aggregation");
$prevent_aggregation = true;
if ($ilCtrl->getContextObjType() != "frm")
{
$forum_grouping = true;
}
else
{
$forum_grouping = false;
}
$news_data = $news_item->getNewsForRefId($_GET["ref_id"], false, false, 0,
$prevent_aggregation, $forum_grouping);
$this->acache->storeEntry($ilUser->getId().":".$_GET["ref_id"],
serialize($news_data));
// }
//var_dump($news_data);
return $news_data;
}

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::getOverview ( )

Get overview.

Definition at line 474 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $lng, and ilBlockGUI\getData().

Referenced by ilPDNewsBlockGUI\fillDataSection(), and fillDataSection().

{
global $ilUser, $lng, $ilCtrl;
return '<div class="small">'.((int) count($this->getData()))." ".$lng->txt("news_news_items")."</div>";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilNewsForContextBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDNewsBlockGUI.

Definition at line 148 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, IL_SCREEN_CENTER, IL_SCREEN_FULL, and IL_SCREEN_SIDE.

{
global $ilCtrl;
if ($ilCtrl->getCmdClass() == "ilnewsitemgui")
{
}
switch($ilCtrl->getCmd())
{
case "showNews":
case "showFeedUrl":
break;
case "editSettings":
case "saveSettings":
break;
default:
break;
}
}
ilNewsForContextBlockGUI::handleView ( )

Handles show/hide notification view and removes notifications if hidden.

Definition at line 344 of file class.ilNewsForContextBlockGUI.php.

References ilBlockGUI\$block_id, $row, ilBlockSetting\_lookup(), and getBlockType().

Referenced by hideNotifications(), ilNewsForContextBlockGUI(), ilPDNewsBlockGUI\ilPDNewsBlockGUI(), and showNotifications().

{
global $ilUser;
include_once("Services/Block/classes/class.ilBlockSetting.php");
$this->view = ilBlockSetting::_lookup($this->getBlockType(), "view",
$ilUser->getId(), $this->block_id);
// check whether notices and messages exist
$got_notices = $got_messages = false;
foreach($this->data as $row)
{
if ($row["priority"] == 0) $got_notices = true;
if ($row["priority"] == 1) $got_messages = true;
}
$this->show_view_selection = false;
if ($got_notices && $got_messages)
{
$this->show_view_selection = true;
}
else if ($got_notices)
{
$this->view = "";
}
// remove notifications if hidden
/*
if (($this->view == "hide_notifications") && $this->show_view_selection)
{
$rset = array();
foreach($this->data as $k => $row)
{
if ($row["priority"] == 1)
{
$rset[$k] = $row;
}
}
$this->data = $rset;
}
*/
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::hideNotifications ( )

Definition at line 938 of file class.ilNewsForContextBlockGUI.php.

References ilBlockGUI\$block_id, ilBlockGUI\$data, $ilCtrl, ilBlockSetting\_write(), exit, getBlockType(), getHTML(), getNewsData(), handleView(), and ilBlockGUI\setData().

{
global $ilCtrl, $ilUser;
include_once("Services/Block/classes/class.ilBlockSetting.php");
$view = ilBlockSetting::_write($this->getBlockType(), "view", "hide_notifications",
$ilUser->getId(), $this->block_id);
// reload data
$data = $this->getNewsData();
$this->setData($data);
$this->handleView();
if ($ilCtrl->isAsynch())
{
echo $this->getHTML();
}
else
{
$ilCtrl->returnToParent($this);
}
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::ilNewsForContextBlockGUI ( )

Constructor.

Definition at line 26 of file class.ilNewsForContextBlockGUI.php.

References $_GET, ilBlockGUI\$data, $ilCtrl, $lng, $st_data, ilBlockGUI\getCurrentDetailLevel(), getDynamic(), ilUtil\getImagePath(), getNewsData(), handleView(), ilBlockGUI\ilBlockGUI(), ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setBlockId(), ilBlockGUI\setData(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setImage(), ilBlockGUI\setLimit(), ilBlockGUI\setRowTemplate(), and ilBlockGUI\setTitle().

{
global $ilCtrl, $lng, $ilUser;
$this->setImage(ilUtil::getImagePath("icon_news_s.gif"));
$lng->loadLanguageModule("news");
include_once("./Services/News/classes/class.ilNewsItem.php");
$this->setBlockId($ilCtrl->getContextObjId());
$this->setLimit(5);
$this->setEnableNumInfo(true);
$this->dynamic = false;
include_once("./Services/News/classes/class.ilNewsCache.php");
$this->acache = new ilNewsCache();
$cres = $this->acache->getEntry($ilUser->getId().":".$_GET["ref_id"]);
$this->cache_hit = false;
if ($this->acache->getLastAccessStatus() == "hit")
{
self::$st_data = unserialize($cres);
$this->cache_hit = true;
}
if ($this->getDynamic() && !$this->cache_hit)
{
$this->dynamic = true;
$data = array();
}
else if ($this->getCurrentDetailLevel() > 0)
{
if (!empty(self::$st_data))
{
}
else
{
$data = $this->getNewsData();
self::$st_data = $data;
}
}
else
{
$data = array();
}
$this->setTitle($lng->txt("news_internal_news"));
$this->setRowTemplate("tpl.block_row_news_for_context.html", "Services/News");
$this->setData($data);
$this->allow_moving = false;
$this->handleView();
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::initSettingsForm ( )

Init setting form.

Definition at line 974 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, $ilSetting, $lng, ilNewsItem\_getDefaultVisibilityForRefId(), ilBlockSetting\_lookup(), getBlockType(), ilUtil\getImagePath(), ilBlockGUI\getProperty(), IL_CAL_DATETIME, ilDateTimeInputGUI\setDate(), ilRadioOption\setInfo(), and ilFormPropertyGUI\setInfo().

Referenced by editSettings(), and saveSettings().

{
global $ilUser, $lng, $ilCtrl, $ilSetting, $ilTabs;
$ilTabs->clearTargets();
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
$public = ilBlockSetting::_lookup($this->getBlockType(), "public_notifications",
0, $this->block_id);
$public_feed = ilBlockSetting::_lookup($this->getBlockType(), "public_feed",
0, $this->block_id);
$hide_block = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_block",
0, $this->block_id);
$hide_news_per_date = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_per_date",
0, $this->block_id);
$hide_news_date = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_date",
0, $this->block_id);
if ($hide_news_date != "")
{
$hide_news_date = explode(" ", $hide_news_date);
}
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$this->settings_form = new ilPropertyFormGUI();
$this->settings_form->setTitle($lng->txt("news_settings"));
$this->settings_form->setTitleIcon(ilUtil::getImagePath("icon_news.gif"));
// hide news block for learners
if ($this->getProperty("hide_news_block_option"))
{
$ch = new ilCheckboxInputGUI($lng->txt("news_hide_news_block"),
"hide_news_block");
$ch->setInfo($lng->txt("news_hide_news_block_info"));
$ch->setChecked($hide_block);
$this->settings_form->addItem($ch);
$hnpd = new ilCheckboxInputGUI($lng->txt("news_hide_news_per_date"),
"hide_news_per_date");
$hnpd->setInfo($lng->txt("news_hide_news_per_date_info"));
$hnpd->setChecked($hide_news_per_date);
$dt_prop = new ilDateTimeInputGUI($lng->txt("news_hide_news_date"),
"hide_news_date");
if ($hide_news_date != "")
{
$dt_prop->setDate(new ilDateTime($hide_news_date[0].' '.$hide_news_date[1],IL_CAL_DATETIME));
}
#$dt_prop->setDate($hide_news_date[0]);
#$dt_prop->setTime($hide_news_date[1]);
$dt_prop->setShowTime(true);
//$dt_prop->setInfo($lng->txt("news_hide_news_date_info"));
$hnpd->addSubItem($dt_prop);
$this->settings_form->addItem($hnpd);
}
// default visibility
if ($this->getProperty("default_visibility_option") &&
$enable_internal_rss)
{
$default_visibility = ilBlockSetting::_lookup($this->getBlockType(), "default_visibility",
0, $this->block_id);
if ($default_visibility == "")
{
$default_visibility =
}
// Default Visibility
$radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "default_visibility");
$radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users");
$radio_group->addOption($radio_option);
$radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public");
$radio_group->addOption($radio_option);
$radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
$radio_group->setRequired(false);
$radio_group->setValue($default_visibility);
$this->settings_form->addItem($radio_group);
}
// public notifications
if ($this->getProperty("public_notifications_option") &&
$enable_internal_rss)
{
$ch = new ilCheckboxInputGUI($lng->txt("news_notifications_public"),
"notifications_public");
$ch->setInfo($lng->txt("news_notifications_public_info"));
$ch->setChecked($public);
$this->settings_form->addItem($ch);
}
// extra rss feed
if ($enable_internal_rss)
{
$ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"),
"notifications_public_feed");
$ch->setInfo($lng->txt("news_public_feed_info"));
$ch->setChecked($public_feed);
$this->settings_form->addItem($ch);
}
//$this->settings_form->addCheckboxProperty($lng->txt("news_public_feed"), "notifications_public_feed",
// "1", $public_feed, $lng->txt("news_public_feed_info"));
//if ($this->getProperty("public_notifications_option"))
//{
// $this->settings_form->addCheckboxProperty($lng->txt("news_notifications_public"), "notifications_public",
// "1", $public, $lng->txt("news_notifications_public_info"));
//}
$this->settings_form->addCommandButton("saveSettings", $lng->txt("save"));
$this->settings_form->addCommandButton("cancelSettings", $lng->txt("cancel"));
$this->settings_form->setFormAction($ilCtrl->getFormaction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilNewsForContextBlockGUI::isRepositoryObject ( )
static

Is this a repository object.

Returns
string Block type.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDNewsBlockGUI.

Definition at line 140 of file class.ilNewsForContextBlockGUI.php.

{
return false;
}
ilNewsForContextBlockGUI::makeClickable (   $a_str)

Make clickable.

Parameters
@return

Definition at line 824 of file class.ilNewsForContextBlockGUI.php.

Referenced by showNews().

{
// this fixes bug 8744. We assume that strings that contain < and >
// already contain html, we do not handle these
if (is_int(strpos($a_str, ">")) && is_int(strpos($a_str, "<")))
{
return $a_str;
}
return ilUtil::makeClickable($a_str);
}

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::saveSettings ( )

Save settings.

Reimplemented in ilPDNewsBlockGUI.

Definition at line 1105 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $_POST, ilBlockGUI\$block_id, $ilCtrl, ilBlockSetting\_write(), getBlockType(), ilBlockGUI\getProperty(), IL_CAL_DATETIME, and initSettingsForm().

{
global $ilCtrl, $ilUser;
$this->initSettingsForm();
if ($this->settings_form->checkInput())
{
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
if ($enable_internal_rss)
{
ilBlockSetting::_write($this->getBlockType(), "public_notifications", $_POST["notifications_public"],
0, $this->block_id);
ilBlockSetting::_write($this->getBlockType(), "public_feed", $_POST["notifications_public_feed"],
0, $this->block_id);
ilBlockSetting::_write($this->getBlockType(), "default_visibility", $_POST["default_visibility"],
0, $this->block_id);
}
if ($this->getProperty("hide_news_block_option"))
{
ilBlockSetting::_write($this->getBlockType(), "hide_news_block", $_POST["hide_news_block"],
0, $this->block_id);
ilBlockSetting::_write($this->getBlockType(), "hide_news_per_date", $_POST["hide_news_per_date"],
0, $this->block_id);
// hide date
$hd = $this->settings_form->getInput("hide_news_date");
$hide_date = new ilDateTime($hd["date"]." ".
$hd["time"],IL_CAL_DATETIME,$ilUser->getTimeZone());
ilBlockSetting::_write($this->getBlockType(), "hide_news_date",
$hide_date->get(IL_CAL_DATETIME),
}
include_once("./Services/News/classes/class.ilNewsCache.php");
$cache = new ilNewsCache();
$cache->deleteEntry($ilUser->getId().":".$_GET["ref_id"]);
$ilCtrl->returnToParent($this);
}
else
{
$this->settings_form->setValuesByPost();
return $this->settings_form->getHtml();
}
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::setEnableEdit (   $a_enable_edit = 0)

Set EnableEdit.

Parameters
boolean$a_enable_editEdit mode on/off

Reimplemented from ilBlockGUI.

Definition at line 204 of file class.ilNewsForContextBlockGUI.php.

{
$this->enable_edit = $a_enable_edit;
}
ilNewsForContextBlockGUI::showFeedUrl ( )

Show feed URL.

Reimplemented in ilPDNewsBlockGUI.

Definition at line 1158 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $lng, $title, $tpl, ilObject\_lookupTitle(), and ilUtil\getImagePath().

{
global $lng, $ilCtrl, $ilUser;
include_once("./Services/News/classes/class.ilNewsItem.php");
$title = ilObject::_lookupTitle($this->block_id);
$tpl = new ilTemplate("tpl.show_feed_url.html", true, true, "Services/News");
$tpl->setVariable("TXT_TITLE",
sprintf($lng->txt("news_feed_url_for"), $title));
$tpl->setVariable("TXT_INFO", $lng->txt("news_get_feed_info"));
$tpl->setVariable("TXT_FEED_URL", $lng->txt("news_feed_url"));
$tpl->setVariable("VAL_FEED_URL",
ILIAS_HTTP_PATH."/feed.php?client_id=".rawurlencode(CLIENT_ID)."&user_id=".$ilUser->getId().
"&obj_id=".$this->block_id.
"&hash=".ilObjUser::_lookupFeedHash($ilUser->getId(), true));
$tpl->setVariable("VAL_FEED_URL_TXT",
ILIAS_HTTP_PATH."/feed.php?client_id=".rawurlencode(CLIENT_ID)."&<br />user_id=".$ilUser->getId().
"&obj_id=".$this->block_id.
"&hash=".ilObjUser::_lookupFeedHash($ilUser->getId(), true));
include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
$content_block = new ilPDContentBlockGUI();
$content_block->setContent($tpl->get());
$content_block->setTitle($lng->txt("news_internal_news"));
$content_block->setImage(ilUtil::getImagePath("icon_news.gif"));
$content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
$lng->txt("close"), true);
return $content_block->getHTML();
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::showNews ( )

show news

Reimplemented in ilPDNewsBlockGUI.

Definition at line 484 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, ilObject\_exists(), ilObject\_getIcon(), ilObjForumAccess\_getThreadForPosting(), ilObjMediaObject\_getURL(), ilBlockSetting\_lookup(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilNewsItem\_setRead(), addCloseCommand(), ilNewsItem\determineNewsContent(), ilNewsItem\determineNewsTitle(), ilDatePresentation\formatDate(), ilBlockGUI\getData(), ilUtil\getImagePath(), getNewsData(), ilBlockGUI\getProperty(), IL_CAL_DATETIME, ilWikiPage\lookupTitle(), makeClickable(), NEWS_AUDIO, NEWS_PUBLIC, and ilBlockGUI\setData().

{
global $lng, $ilCtrl, $ilUser;
// workaround for dynamic mode (if cache is disabled, showNews has no data)
if (empty(self::$st_data))
{
$this->setData($this->getNewsData());
}
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
include_once("./Services/News/classes/class.ilNewsItem.php");
$news = new ilNewsItem($_GET["news_id"]);
$tpl = new ilTemplate("tpl.show_news.html", true, true, "Services/News");
// get current item in data set
$previous = $next = "";
reset($this->data);
$c = current($this->data);
$curr_cnt = 1;
while($c["id"] > 0 &&
$c["id"] != $_GET["news_id"])
{
$previous = $c;
$c = next($this->data);
$curr_cnt++;
}
// collect news items to show
$news_list = array();
if (is_array($c["aggregation"])) // we have an aggregation
{
//$agg_obj_id = ilObject::_lookupObjId($c["agg_ref_id"]);
//$agg_obj_type = ilObject::_lookupType($agg_obj_id);
//$agg_obj_title = ilObject::_lookupObjId($agg_obj_id);
$news_list[] = array("ref_id" => $c["agg_ref_id"],
"agg_ref_id" => $c["agg_ref_id"],
"aggregation" => $c["aggregation"],
"user_id" => "",
"content_type" => "text",
"mob_id" => 0,
"visibility" => "",
"content" => "",
"content_long" => "",
"update_date" => $news->getUpdateDate(),
"creation_date" => "",
"content_is_lang_var" => false,
"loc_context" => $_GET["news_context"],
"context_obj_type" => $news->getContextObjType(),
"title" => "");
foreach($c["aggregation"] as $c_item)
{
ilNewsItem::_setRead($ilUser->getId(), $c_item["id"]);
$c_item["loc_context"] = $c_item["ref_id"];
$c_item["loc_stop"] = $_GET["news_context"];
$news_list[] = $c_item;
}
}
else // no aggregation, simple news item
{
$news_list[] = array("ref_id" => $_GET["news_context"],
"user_id" => $news->getUserId(),
"content_type" => $news->getContentType(),
"mob_id" => $news->getMobId(),
"visibility" => $news->getVisibility(),
"priority" => $news->getPriority(),
"content" => $news->getContent(),
"content_long" => $news->getContentLong(),
"update_date" => $news->getUpdateDate(),
"creation_date" => $news->getCreationDate(),
"context_sub_obj_type" => $news->getContextSubObjType(),
"context_obj_type" => $news->getContextObjType(),
"context_sub_obj_id" => $news->getContextSubObjId(),
"content_is_lang_var" => $news->getContentIsLangVar(),
"content_text_is_lang_var" => $news->getContentTextIsLangVar(),
"loc_context" => $_GET["news_context"],
"title" => $news->getTitle());
ilNewsItem::_setRead($ilUser->getId(), $_GET["news_id"]);
}
foreach ($news_list as $item)
{
// user
if ($item["user_id"] > 0 && ilObject::_exists($item["user_id"]))
{
// get login
if (ilObjUser::_exists($item["user_id"]))
{
$user = new ilObjUser($item["user_id"]);
$displayname = $user->getLogin();
} else
{
// this should actually not happen, since news entries
// should be deleted when the user is going to be removed
$displayname = "&lt;". strtolower($lng->txt("deleted")) ."&gt;";
}
$tpl->setCurrentBlock("user_info");
$tpl->setVariable("VAL_AUTHOR", $displayname);
$tpl->setVariable("TXT_AUTHOR", $lng->txt("author"));
$tpl->parseCurrentBlock();
}
// media player
if ($item["content_type"] == NEWS_AUDIO &&
$item["mob_id"] > 0 && ilObject::_exists($item["mob_id"]))
{
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
include_once("./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
$mob = new ilObjMediaObject($item["mob_id"]);
$med = $mob->getMediaItem("Standard");
$mpl = new ilMediaPlayerGUI();
if (strcasecmp("Reference", $med->getLocationType()) == 0)
$mpl->setFile($med->getLocation());
else
$mpl->setFile(ilObjMediaObject::_getURL($mob->getId())."/".$med->getLocation());
$mpl->setDisplayHeight($med->getHeight());
$tpl->setCurrentBlock("player");
$tpl->setVariable("PLAYER",
$mpl->getMp3PlayerHtml());
$tpl->parseCurrentBlock();
}
// access
if ($enable_internal_rss && $item["visibility"] != "")
{
$obj_id = ilObject::_lookupObjId($item["ref_id"]);
$tpl->setCurrentBlock("access");
$tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility"));
if ($item["visibility"] == NEWS_PUBLIC ||
($item["priority"] == 0 &&
ilBlockSetting::_lookup("news", "public_notifications",
0, $obj_id)))
{
$tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public"));
}
else
{
$tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users"));
}
$tpl->parseCurrentBlock();
}
// content
if (trim($item["content"]) != "") // content
{
$tpl->setCurrentBlock("content");
$tpl->setVariable("VAL_CONTENT",
nl2br($this->makeClickable(
ilNewsItem::determineNewsContent($item["context_obj_type"], $item["content"], $item["content_text_is_lang_var"])
)));
//$tpl->setVariable("VAL_CONTENT", nl2br($item["content"]));
$tpl->parseCurrentBlock();
}
if (trim($item["content_long"]) != "") // long content
{
$tpl->setCurrentBlock("long");
$tpl->setVariable("VAL_LONG_CONTENT", $this->makeClickable($item["content_long"]));
$tpl->parseCurrentBlock();
}
if ($item["update_date"] != $item["creation_date"]) // update date
{
$tpl->setCurrentBlock("ni_update");
$tpl->setVariable("TXT_LAST_UPDATE", $lng->txt("last_update"));
$tpl->setVariable("VAL_LAST_UPDATE",
$tpl->parseCurrentBlock();
}
// creation date
if ($item["creation_date"] != "")
{
$tpl->setCurrentBlock("ni_update");
$tpl->setVariable("VAL_CREATION_DATE",
$tpl->setVariable("TXT_CREATED", $lng->txt("created"));
$tpl->parseCurrentBlock();
}
// context / title
if ($_GET["news_context"] > 0)
{
//$obj_id = ilObject::_lookupObjId($_GET["news_context"]);
$obj_id = ilObject::_lookupObjId($item["ref_id"]);
$obj_type = ilObject::_lookupType($obj_id);
$obj_title = ilObject::_lookupTitle($obj_id);
// file hack, not nice
if ($obj_type == "file")
{
$tpl->setCurrentBlock("download");
$tpl->setVariable("TXT_DOWNLOAD", $lng->txt("download"));
$tpl->setVariable("HREF_DOWNLOAD",
"./repository.php?ref_id=".$item["ref_id"]."&amp;cmd=sendfile");
$tpl->parseCurrentBlock();
}
// forum hack, not nice
$add = "";
if ($obj_type == "frm" && $item["context_sub_obj_type"] == "pos"
&& $item["context_sub_obj_id"] > 0)
{
include_once("./Modules/Forum/classes/class.ilObjForumAccess.php");
$pos = $item["context_sub_obj_id"];
if ($thread > 0)
{
$add = "_".$thread."_".$pos;
}
}
// wiki hack, not nice
if ($obj_type == "wiki" && $item["context_sub_obj_type"] == "wpg"
&& $item["context_sub_obj_id"] > 0)
{
include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
$wptitle = ilWikiPage::lookupTitle($item["context_sub_obj_id"]);
if ($wptitle != "")
{
$add = "_".ilWikiUtil::makeUrlTitle($wptitle);
}
}
$url_target = "./goto.php?client_id=".rawurlencode(CLIENT_ID)."&target=".
$obj_type."_".$item["ref_id"].$add;
// lm page hack, not nice
if (in_array($obj_type, array("dbk", "lm")) && $item["context_sub_obj_type"] == "pg"
&& $item["context_sub_obj_id"] > 0)
{
$url_target = "./goto.php?client_id=".rawurlencode(CLIENT_ID)."&target=".
"pg_".$item["context_sub_obj_id"]."_".$item["ref_id"];
}
$context_opened = false;
if ($item["loc_context"] != null && $item["loc_context"] != $item["loc_stop"])
{
$tpl->setCurrentBlock("context");
$context_opened = true;
$cont_loc = new ilLocatorGUI();
$cont_loc->addContextItems($item["loc_context"], true, $item["loc_stop"]);
$tpl->setVariable("CONTEXT_LOCATOR", $cont_loc->getHTML());
}
//var_dump($item);
if ($item["no_context_title"] !== true)
{
if (!$context_opened)
{
$tpl->setCurrentBlock("context");
}
$tpl->setVariable("HREF_CONTEXT_TITLE", $url_target);
$tpl->setVariable("CONTEXT_TITLE", $obj_title);
$tpl->setVariable("IMG_CONTEXT_TITLE", ilObject::_getIcon($obj_id, "big", $obj_type));
}
if ($context_opened)
{
$tpl->parseCurrentBlock();
}
$tpl->setVariable("HREF_TITLE", $url_target);
}
// title
$tpl->setVariable("VAL_TITLE",
ilNewsItem::determineNewsTitle($item["context_obj_type"],
$item["title"], $item["content_is_lang_var"], $item["agg_ref_id"],
$item["aggregation"]));
$row_css = ($row_css != "tblrow1")
? "tblrow1"
: "tblrow2";
$tpl->setCurrentBlock("item");
$tpl->setVariable("ITEM_ROW_CSS", $row_css);
$tpl->parseCurrentBlock();
}
include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
$content_block = new ilPDContentBlockGUI();
$content_block->setContent($tpl->get());
if ($this->getProperty("title") != "")
{
$content_block->setTitle($this->getProperty("title"));
}
else
{
$content_block->setTitle($lng->txt("news_internal_news"));
}
//$content_block->setColSpan(2);
$content_block->setImage(ilUtil::getImagePath("icon_news.gif"));
$this->addCloseCommand($content_block);
// previous
if ($previous != "")
{
if ($previous["ref_id"] > 0)
{
$ilCtrl->setParameter($this, "news_context", $previous["ref_id"]);
}
$ilCtrl->setParameter($this, "news_id", $previous["id"]);
$content_block->addFooterLink($lng->txt("previous"),
$ilCtrl->getLinkTarget($this, "showNews"), "", "", true);
$ilCtrl->setParameter($this, "news_context", "");
}
// next
if ($c = next($this->data))
{
if ($c["ref_id"] > 0)
{
$ilCtrl->setParameter($this, "news_context", $c["ref_id"]);
}
$ilCtrl->setParameter($this, "news_id", $c["id"]);
$content_block->addFooterLink($lng->txt("next"),
$ilCtrl->getLinkTarget($this, "showNews"), "", "", true);
}
$ilCtrl->setParameter($this, "news_context", "");
$ilCtrl->setParameter($this, "news_id", "");
$content_block->setCurrentItemNumber($curr_cnt);
$content_block->setEnableNumInfo(true);
$content_block->setData($this->getData());
return $content_block->getHTML();
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::showNotifications ( )

Definition at line 914 of file class.ilNewsForContextBlockGUI.php.

References ilBlockGUI\$block_id, ilBlockGUI\$data, $ilCtrl, ilBlockSetting\_write(), exit, getBlockType(), getHTML(), getNewsData(), handleView(), and ilBlockGUI\setData().

{
global $ilCtrl, $ilUser;
include_once("Services/Block/classes/class.ilBlockSetting.php");
$view = ilBlockSetting::_write($this->getBlockType(), "view", "",
$ilUser->getId(), $this->block_id);
// reload data
$data = $this->getNewsData();
$this->setData($data);
$this->handleView();
if ($ilCtrl->isAsynch())
{
echo $this->getHTML();
}
else
{
$ilCtrl->returnToParent($this);
}
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::showViewFooter ( )

Show additional footer for show/hide notifications.

Definition at line 879 of file class.ilNewsForContextBlockGUI.php.

References ilBlockGUI\$block_id, $ilCtrl, $lng, ilBlockGUI\addFooterLink(), ilBlockGUI\clearFooterLinks(), and ilBlockGUI\fillFooterLinks().

Referenced by fillFooter().

{
global $ilUser, $lng, $ilCtrl;
return; // notifications always shown
$this->clearFooterLinks();
$this->addFooterLink("[".$lng->txt("news_first_letter_of_word_notification")."] ".
$lng->txt("news_notifications").": ", "", "", "", false, true);
if ($this->view == "hide_notifications")
{
$this->addFooterLink($lng->txt("show"),
$ilCtrl->getLinkTarget($this,
"showNotifications"),
$ilCtrl->getLinkTarget($this,
"showNotifications", "", true),
"block_".$this->getBlockType()."_".$this->block_id
);
$this->addFooterLink($lng->txt("hide"));
}
else
{
$this->addFooterLink($lng->txt("show"));
$this->addFooterLink($lng->txt("hide"),
$ilCtrl->getLinkTarget($this,
"hideNotifications"),
$ilCtrl->getLinkTarget($this,
"hideNotifications", "", true),
"block_".$this->getBlockType()."_".$this->block_id
);
}
$this->fillFooterLinks();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNewsForContextBlockGUI::subscribeNews ( )

Subscribe current user from news.

Definition at line 852 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, and ilNewsSubscription\_subscribe().

{
global $ilUser, $ilCtrl;
include_once("./Services/News/classes/class.ilNewsSubscription.php");
ilNewsSubscription::_subscribe($_GET["ref_id"], $ilUser->getId());
$ilCtrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilNewsForContextBlockGUI::unsubscribeNews ( )

Unsubscribe current user from news.

Definition at line 840 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, and ilNewsSubscription\_unsubscribe().

{
global $ilUser, $ilCtrl;
include_once("./Services/News/classes/class.ilNewsSubscription.php");
ilNewsSubscription::_unsubscribe($_GET["ref_id"], $ilUser->getId());
$ilCtrl->returnToParent($this);
}

+ Here is the call graph for this function:

Field Documentation

ilNewsForContextBlockGUI::$block_type = "news"
static

Definition at line 20 of file class.ilNewsForContextBlockGUI.php.

Referenced by getBlockType().

ilNewsForContextBlockGUI::$st_data
static

Definition at line 21 of file class.ilNewsForContextBlockGUI.php.

Referenced by ilNewsForContextBlockGUI().


The documentation for this class was generated from the following file: