/** * Constructor */ function ilNewsForContextBlockGUI() { global $ilCtrl, $lng, $ilUser, $ilHelp; parent::ilBlockGUI(); $this->setImage(ilUtil::getImagePath("icon_news_s.png")); $lng->loadLanguageModule("news"); $ilHelp->addHelpSection("news_block"); include_once "./Services/News/classes/class.ilNewsItem.php"; $this->setBlockId($ilCtrl->getContextObjId()); $this->setLimit(5); $this->setAvailableDetailLevels(3); $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)) { $data = 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(); }