• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

lo_view.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 
00033 require_once "include/inc.header.php";
00034 require_once "classes/class.ilSQL2XML.php";
00035 require_once "classes/class.ilDOMXML.php";
00036 
00037 ob_start(); 
00038 
00039 if (!$rbacsystem->checkAccess("read",$_GET["lm_id"]))
00040 {
00041         $ilias->raiseError($lng->txt("permission_denied"),$ilias->error_obj->MESSAGE);
00042 }
00043 
00044 //$T1 = ilUtil::StopWatch();
00045 
00046 $sql2xml = new ilSQL2XML($_GET["lm_id"],$_GET["lo_id"]);
00047 $lo = $sql2xml->getLearningObject();
00048 $navbar = $sql2xml->setNavigation();
00049 
00050 //echo ilUtil::StopWatch($T1)." get_XMLdata total<br/>"; 
00051 
00052 //echo "<pre>".$lo."</pre>";
00053 //exit;
00054 
00055 //echo "<pre>".htmlentities($lo)."</pre>";
00056 
00057 
00058 //$T1 = ilUtil::StopWatch(); 
00059 // load xsl into string
00060 $path = getcwd();
00061 $xsl = file_get_contents($path."/xml/default.xsl");
00062 
00063 $args = array( '/_xml' => $lo, '/_xsl' => $xsl );
00064 $xh = xslt_create();
00065 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args);
00066 echo xslt_error($xh);
00067 xslt_free($xh);
00068 //echo ilUtil::StopWatch($T1)." XSLT_parsing total<br/>"; 
00069 
00070 //$T1 = ilUtil::StopWatch(); 
00071 $tpl->addBlockFile("CONTENT", "content", "tpl.lo_content.html");
00072 $tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
00073 $tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
00074 $tpl->touchBlock("buttons");
00075 
00076 // this view should switch between a tree view if the learningmodule's structure and full view.
00077 if (!isset($_SESSION["viewmode"]) or $_SESSION["viewmode"] == "flat")
00078 {
00079         $tpl->setCurrentBlock("btn_cell");
00080         $tpl->setVariable("BTN_LINK","lo.php?viewmode=tree");
00081         $tpl->setVariable("BTN_TXT", $lng->txt("treeview"));
00082         $tpl->parseCurrentBlock();
00083 }
00084 else
00085 {
00086         $tpl->setCurrentBlock("btn_cell");
00087         $tpl->setVariable("BTN_LINK","lo.php?viewmode=flat");
00088         $tpl->setVariable("BTN_TARGET","target=\"_parent\"");
00089         $tpl->setVariable("BTN_TXT", $lng->txt("flatview"));
00090         $tpl->parseCurrentBlock();
00091 }
00092 
00093 $tpl->setCurrentBlock("content");
00094 $tpl->setVariable("LM_NAVBAR",$navbar);
00095 $tpl->setVariable("LO_CONTENT",$output);
00096 $tpl->parseCurrentBlock();
00097 
00098 $tpl->show();
00099 //echo ilUtil::StopWatch($T1)." template_output<br/>"; 
00100 
00101 $ret_str = ob_get_contents(); 
00102 ob_end_clean(); 
00103 
00104 echo $ret_str;
00105 
00106 echo "<p><i>server processing time: ".ilUtil::StopWatch($t_pagestart)." seconds</i></p>"; 
00107 ?>

Generated on Fri Dec 13 2013 09:06:36 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1