예제 #1
0
 protected function renderFullscreen()
 {
     global $tpl, $lng, $ilMainMenu;
     if (!ilImprint::isActive()) {
         ilUtil::redirect("ilias.php?baseClass=ilPersonalDesktopGUI");
     }
     $tpl->getStandardTemplate();
     $this->setRawPageContent(true);
     $html = $this->showPage();
     $itpl = new ilTemplate("tpl.imprint.html", true, true, "Services/Imprint");
     $itpl->setVariable("PAGE_TITLE", $lng->txt("imprint"));
     $itpl->setVariable("IMPRINT", $html);
     unset($html);
     $tpl->setContent($itpl->get());
     $ilMainMenu->showLogoOnly(true);
     echo $tpl->show("DEFAULT", true, false);
     exit;
 }
예제 #2
0
 /**
  * add ILIAS footer
  */
 function addILIASFooter()
 {
     global $ilAuth;
     if (!$this->getAddFooter()) {
         return;
     }
     global $ilias, $ilClientIniFile, $ilCtrl, $ilDB, $ilSetting, $lng;
     $ftpl = new ilTemplate("tpl.footer.html", true, true, "Services/UICore");
     $ftpl->setVariable("ILIAS_VERSION", $ilias->getSetting("ilias_version"));
     $link_items = array();
     // imprint
     include_once "Services/Imprint/classes/class.ilImprint.php";
     if ($_REQUEST["baseClass"] != "ilImprintGUI" && ilImprint::isActive()) {
         include_once "Services/Link/classes/class.ilLink.php";
         $link_items[ilLink::_getStaticLink(0, "impr")] = array($lng->txt("imprint"), true);
     }
     $link_items["mailto:" . ilUtil::prepareFormOutput($ilSetting->get("feedback_recipient"))] = array($lng->txt("contact_sysadmin"), false);
     if (DEVMODE && version_compare(PHP_VERSION, '5', '>=')) {
         $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=xhtml")] = array("Validate", true);
         $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=accessibility")] = array("Accessibility", true);
     }
     // output translation link (extended language maintenance)
     if ($ilSetting->get("lang_ext_maintenance") == "1") {
         include_once "Services/Language/classes/class.ilObjLanguageAccess.php";
         if (ilObjLanguageAccess::_checkTranslate() and !ilObjLanguageAccess::_isPageTranslation()) {
             ilObjLanguageAccess::_saveUsages();
             $link_items[ilObjLanguageAccess::_getTranslationLink()] = array($lng->txt('translation'), true);
         }
     }
     $cnt = 0;
     foreach ($link_items as $url => $caption) {
         $cnt++;
         if ($caption[1]) {
             $ftpl->touchBlock("blank");
         }
         if ($cnt < sizeof($link_items)) {
             $ftpl->touchBlock("item_separator");
         }
         $ftpl->setCurrentBlock("items");
         $ftpl->setVariable("URL_ITEM", $url);
         $ftpl->setVariable("TXT_ITEM", $caption[0]);
         $ftpl->parseCurrentBlock();
     }
     if (DEVMODE) {
         // execution time
         $t1 = explode(" ", $GLOBALS['ilGlobalStartTime']);
         $t2 = explode(" ", microtime());
         $diff = $t2[0] - $t1[0] + $t2[1] - $t1[1];
         $mem_usage = array();
         if (function_exists("memory_get_usage")) {
             $mem_usage[] = "Memory Usage: " . memory_get_usage() . " Bytes";
         }
         if (function_exists("xdebug_peak_memory_usage")) {
             $mem_usage[] = "XDebug Peak Memory Usage: " . xdebug_peak_memory_usage() . " Bytes";
         }
         $mem_usage[] = round($diff, 4) . " Seconds";
         if (sizeof($mem_usage)) {
             $ftpl->setVariable("MEMORY_USAGE", "<br>" . implode(" | ", $mem_usage));
         }
         if (is_object($ilAuth) && isset($_SESSION[$ilAuth->_sessionName]) && isset($_SESSION[$ilAuth->_sessionName]["timestamp"])) {
             $ftpl->setVariable("SESS_INFO", "<br />maxlifetime: " . ini_get("session.gc_maxlifetime") . " (" . ini_get("session.gc_maxlifetime") / 60 . "), id: " . session_id() . "<br />" . "timestamp: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["timestamp"]) . ", idle: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["idle"]) . "<br />expire: " . ($exp = $ilClientIniFile->readVariable("session", "expire")) . " (" . $exp / 60 . "), session ends at: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["idle"] + $exp));
         }
         if (!empty($_GET["do_dev_validate"]) && $ftpl->blockExists("xhtml_validation")) {
             require_once "Services/XHTMLValidator/classes/class.ilValidatorAdapter.php";
             $template2 = clone $this;
             //echo "-".ilValidatorAdapter::validate($template2->get(), $_GET["do_dev_validate"])."-";
             $ftpl->setCurrentBlock("xhtml_validation");
             $ftpl->setVariable("VALIDATION", ilValidatorAdapter::validate($template2->get("DEFAULT", false, false, false, true), $_GET["do_dev_validate"]));
             $ftpl->parseCurrentBlock();
         }
         // controller history
         if (is_object($ilCtrl) && $ftpl->blockExists("c_entry") && $ftpl->blockExists("call_history")) {
             $hist = $ilCtrl->getCallHistory();
             foreach ($hist as $entry) {
                 $ftpl->setCurrentBlock("c_entry");
                 $ftpl->setVariable("C_ENTRY", $entry["class"]);
                 if (is_object($ilDB)) {
                     $file = $ilCtrl->lookupClassPath($entry["class"]);
                     $add = $entry["mode"] . " - " . $entry["cmd"];
                     if ($file != "") {
                         $add .= " - " . $file;
                     }
                     $ftpl->setVariable("C_FILE", $add);
                 }
                 $ftpl->parseCurrentBlock();
             }
             $ftpl->setCurrentBlock("call_history");
             $ftpl->parseCurrentBlock();
             // debug hack
             $debug = $ilCtrl->getDebug();
             foreach ($debug as $d) {
                 $ftpl->setCurrentBlock("c_entry");
                 $ftpl->setVariable("C_ENTRY", $d);
                 $ftpl->parseCurrentBlock();
             }
             $ftpl->setCurrentBlock("call_history");
             $ftpl->parseCurrentBlock();
         }
         // included files
         if (is_object($ilCtrl) && $ftpl->blockExists("i_entry") && $ftpl->blockExists("included_files")) {
             $fs = get_included_files();
             $ifiles = array();
             $total = 0;
             foreach ($fs as $f) {
                 $ifiles[] = array("file" => $f, "size" => filesize($f));
                 $total += filesize($f);
             }
             $ifiles = ilUtil::sortArray($ifiles, "size", "desc", true);
             foreach ($ifiles as $f) {
                 $ftpl->setCurrentBlock("i_entry");
                 $ftpl->setVariable("I_ENTRY", $f["file"] . " (" . $f["size"] . " Bytes, " . round(100 / $total * $f["size"], 2) . "%)");
                 $ftpl->parseCurrentBlock();
             }
             $ftpl->setCurrentBlock("i_entry");
             $ftpl->setVariable("I_ENTRY", "Total (" . $total . " Bytes, 100%)");
             $ftpl->parseCurrentBlock();
             $ftpl->setCurrentBlock("included_files");
             $ftpl->parseCurrentBlock();
         }
     }
     // BEGIN Usability: Non-Delos Skins can display the elapsed time in the footer
     // The corresponding $ilBench->start invocation is in inc.header.php
     global $ilBench;
     $ilBench->stop("Core", "ElapsedTimeUntilFooter");
     $ftpl->setVariable("ELAPSED_TIME", ", " . number_format($ilBench->getMeasuredTime("Core", "ElapsedTimeUntilFooter"), 1) . ' seconds');
     // END Usability: Non-Delos Skins can display the elapsed time in the footer
     $this->setVariable("FOOTER", $ftpl->get());
 }
예제 #3
0
 /**
  * 
  *
  * @param
  * @return
  */
 function checkAccessMobUsage($usage, $oid)
 {
     /**
      * @var $ilObjDataCache ilObjectDataCache
      */
     global $ilObjDataCache;
     switch ($usage['type']) {
         case 'lm:pg':
             if ($this->checkAccessObject($oid, 'lm')) {
                 return true;
             }
             /* as $usage['id'] (== page) is not processed anymore, we can use standard
             			if ($oid > 0)
             			{
             				if ($this->checkAccessLM($oid, 'lm', $usage['id']))
             				{
             					return true;
             				}
             			}				 
             			*/
             break;
         case 'news':
             // media objects in news (media casts)
             include_once "./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php";
             include_once "./Services/News/classes/class.ilNewsItem.php";
             if ($this->checkAccessObject($oid, 'mcst')) {
                 return true;
             } elseif (ilObjMediaCastAccess::_lookupPublicFiles($oid) && ilNewsItem::_lookupVisibility($usage["id"]) == NEWS_PUBLIC) {
                 return true;
             }
             break;
             /* see default
                         case 'dcl:html':
                             include_once("./Modules/DataCollection/classes/class.ilObjDataCollectionAccess.php");
                             include_once("./Services/Object/classes/class.ilObject2.php");
                             $ref_ids = ilObject2::_getAllReferences($oid);
                             foreach($ref_ids as $ref_id)
                                 if(ilObjDataCollectionAccess::_checkAccess("view", "read", $ref_id, $oid))
                                     return true;
                             break;
             			*/
         /* see default
                     case 'dcl:html':
                         include_once("./Modules/DataCollection/classes/class.ilObjDataCollectionAccess.php");
                         include_once("./Services/Object/classes/class.ilObject2.php");
                         $ref_ids = ilObject2::_getAllReferences($oid);
                         foreach($ref_ids as $ref_id)
                             if(ilObjDataCollectionAccess::_checkAccess("view", "read", $ref_id, $oid))
                                 return true;
                         break;
         			*/
         case 'frm~:html':
         case 'exca~:html':
             // $oid = userid
             foreach ($this->check_users as $user_id) {
                 if ($ilObjDataCache->lookupType($oid) == 'usr' && $oid == $user_id) {
                     return true;
                 }
             }
             break;
         case 'qpl:pg':
         case 'qpl:html':
             // test questions
             if ($this->checkAccessTestQuestion($oid, $usage['id'])) {
                 return true;
             }
             break;
         case 'gdf:pg':
             // special check for glossary terms
             if ($this->checkAccessGlossaryTerm($oid, $usage['id'])) {
                 return true;
             }
             break;
         case 'sahs:pg':
             // check for scorm pages
             if ($this->checkAccessObject($oid, 'sahs')) {
                 return true;
             }
             break;
         case 'prtf:pg':
             // special check for portfolio pages
             if ($this->checkAccessPortfolioPage($oid, $usage['id'])) {
                 return true;
             }
             break;
         case 'blp:pg':
             // special check for blog pages
             if ($this->checkAccessBlogPage($oid, $usage['id'])) {
                 return true;
             }
             break;
         case 'lobj:pg':
             // special check for learning objective pages
             if ($this->checkAccessLearningObjectivePage($oid, $usage['id'])) {
                 return true;
             }
             break;
         case 'impr:pg':
             include_once 'Services/Imprint/classes/class.ilImprint.php';
             return ilImprint::isActive() || $this->checkAccessObject(SYSTEM_FOLDER_ID, 'adm');
         case 'cstr:pg':
         default:
             // standard object check
             if ($this->checkAccessObject($oid)) {
                 return true;
             }
             break;
     }
     return false;
 }