KnowledgeRoot PHP Cross Reference Learning Management Systems

Source: /index.php - 197 lines - 6718 bytes - Summary - Text - Print

Description: Knowledgeroot is published under the GNU GPL! Read LICENSE

   1  <?php
   2  /**
   3   * Knowledgeroot is published under the GNU GPL! Read LICENSE
   4   *
   5   * @package Knowledgeroot
   6   * @author Frank Habermann <lordlamer@lordlamer.de>
   7   * @author Robert Scholz <scholzrobert@web.de>
   8   * @version $Id: index.php 1071 2011-05-08 20:28:39Z lordlamer $
   9   */
  10  
  11  // timer
  12  $timer = microtime();
  13  $starttime = ((double)strstr($timer, ' ') + (double)substr($timer,0,strpos($timer,' ')));
  14  
  15  if (!is_file("config/app.ini")) {
  16      echo "<html><body>No configuration file found! Please make a <a href=\"install.php\">install</a>!</body></html>";
  17      exit();
  18  }
  19  
  20  // load requiered files
  21  require_once  ('include/init.php');
  22  
  23  
  24  /********************
  25   * This is the end of initialisation
  26   * Now do header work
  27   ********************/
  28  
  29  if ($CLASS['config']->base->charset != '') {
  30    header("Content-Type: text/html; charset=".$CLASS['config']->base->charset);
  31    echo '<?xml version="1.0" encoding="'.$CLASS['config']->base->charset.'"?>';
  32  } else {
  33    echo '<?xml version="1.0" encoding="UTF-8"?>';
  34  }
  35  
  36  echo "\n";
  37  ?>
  38  <!DOCTYPE html
  39       PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  40       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  41  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  42  <head>
  43  <?php
  44    $CLASS['kr_header']->show_header();
  45  ?>
  46  </head>
  47  <body class="claro" <?php if($CLASS['config']->menu->type == "slide") { echo "onload=\"Hide('tree');\""; } ?>>
  48  
  49  <div style="display: none;" id="messagebox">
  50    <div id="msg" class="loading"><?php echo $CLASS['translate']->_('loading...'); ?></div>
  51  </div>
  52  
  53  <div id="mousemenu" style="display: none; position: absolute;">&nbsp;</div>
  54  <div id="dragbox" style="display: none; position: absolute;">&nbsp;</div>
  55  <div id="searchbox">
  56                          <form action="index.php" method="post">
  57                              <input onclick="this.value = '';" class="searchfield" type="text" name="search" value="<?php if(isset ($_GET['action']) && $_GET['action'] == "showsearch" && isset ($_GET['key']) && $_GET['key'] != "" && isset($_SESSION['search'][$_GET['key']])) { echo str_replace('&amp;quot;','&quot;',htmlspecialchars(stripslashes($_SESSION['search'][$_GET['key']]))); } else { echo $CLASS['translate']->_('Search'); } ?>" />
  58                              <input type="hidden" name="submit" value="GO" />
  59                              <input class="searchgo" type="submit" name="submit" value="<?php echo $CLASS['translate']->_('GO'); ?>" />
  60                          </form>
  61  </div>
  62  
  63  <a name="top"></a>
  64  <table border="0" cellpadding="0" cellspacing="0" width="100%">
  65      <tr class="head">
  66          <td class="head" colspan="2">
  67              <table border="0" cellpadding="0" cellspacing="0" width="100%">
  68                  <tr>
  69                      <td>
  70                          <div class="pagetitle">
  71                              <?php echo ($CLASS['config']->base->showlogo) ? "<img src=\"images/knowledgeroot_logo.png\" alt=\"".$CLASS['config']->base->title."\" title=\"".$CLASS['config']->base->title."\" />" : $CLASS['config']->base->title; ?>
  72                          </div>
  73                      </td>
  74                      <td align="right" valign="bottom">
  75                          <div class="version">
  76                              <a href="http://www.knowledgeroot.org">Knowledgeroot</a> - <?php echo $CLASS['translate']->_('version') . ":&nbsp;" . $CLASS['config']->base->version; ?>
  77                          </div>
  78                          <div class="mainnavi">
  79                          <?php
  80                            // show top menu
  81                            echo $CLASS['kr_extension']->show_menu("top");
  82                          ?>
  83                          </div>
  84                      </td>
  85                  </tr>
  86              </table>
  87          </td>
  88      </tr>
  89  
  90      <tr class="navigationpath">
  91          <td class="navigation" colspan="2">
  92              <div class="navigationleft">
  93                  <b><?php echo $CLASS['translate']->_('Path'); ?>:
  94      <?php
  95        // show path
  96        if($CLASS['knowledgeroot']->checkRecursivPerm($_SESSION['cid'], $_SESSION['userid']) != 0) {
  97          echo $CLASS['path']->getPath($_SESSION['cid']);
  98        } else {
  99          echo "/";
 100        }
 101  
 102      if (!isset ($_SESSION['user'])) { $_SESSION['user'] = ''; }
 103      ?>
 104  
 105              </b>
 106          </div>
 107          <div class="navigationright"><?php echo $CLASS['translate']->_('User')  . ":&nbsp;" . $_SESSION['user']; ?>&nbsp;</div>
 108          <div class="navigationmiddle">
 109          </div>
 110      <?php
 111      if($CLASS['config']->misc->langdropdown) {
 112      ?>
 113          <div class="navigationmiddle">
 114          <form id="change_language" action="index.php" method="post">
 115              <input type="hidden" name="action" value="change_language" />
 116      <?php
 117  
 118      if (!isset ($_SESSION['language'])) { $_SESSION['language'] = ''; }
 119  
 120      echo $CLASS['language']->lang_dropdown("language", $_SESSION['language']);
 121  
 122      if (!$CLASS['config']->tree->ajax) {
 123          echo '<input class="button" type="submit" name="submit1" value="'.$CLASS['translate']->_('change').'" />'."\n";
 124      }
 125      ?>
 126          </form>
 127          </div>
 128      <?php
 129      // end for langdropdown
 130      }
 131      ?>
 132          </td>
 133      </tr>
 134  
 135      <tr>
 136       <td id="treecontainer">
 137         <!-- <a href="#" onClick="ShowHide('tree');">#</a> -->
 138        <div id="treeopener" <?php if($CLASS['config']->menu->type == "static") { echo "style=\"display:none;\""; } else { echo "style=\"display:block;\""; } ?>>
 139          <div id="treeshow">
 140            <a href="#" onclick="ShowTree();"><img id="treeshowimg" src="images/right.gif" width="22" alt="<?php echo $CLASS['translate']->_('show menu'); ?>" title="<?php echo $CLASS['translate']->_('show menu'); ?>" /></a>
 141          </div>
 142        </div>
 143  
 144         <div id="tree" <?php if($CLASS['config']->menu->type == "static") { echo "style=\"display:block;\""; } else { echo "style=\"display:none; position:absolute;\""; } ?>>
 145      <?php
 146        // show tree
 147        if (isset ($_SESSION['open'])) {
 148          $CLASS['tree']->open = $_SESSION['open'];
 149        }
 150        $CLASS['tree']->buildTree(0);
 151      ?>
 152        </div>
 153       </td>
 154       <td id="contentcontainer">
 155      <?php
 156        // show page content
 157        $CLASS['kr_header']->show_messages();
 158        $CLASS['kr_content']->show_content();
 159      ?>
 160       </td>
 161      </tr>
 162  </table>
 163  
 164  <?php
 165    // show developer toolbar
 166    if($CLASS['config']->development->toolbar) {
 167      echo "<div id=\"footer\">\n";
 168      echo "<p>"."\n";
 169      echo "developer toolbar: <a href=\"http://forum.linuxdelta.de\" target=\"_blank\">forum</a>"."\n";
 170      echo "<a href=\"http://lists.knowledgeroot.org/cgi-bin/mailman/listinfo\" target=\"_blank\">mailinglist</a>"."\n";
 171      echo "<a href=\"http://www.knowledgeroot.org\" target=\"_blank\">project page</a>"."\n";
 172      echo "<a href=\"http://trac.knowledgeroot.org\" target=\"_blank\">bug tracker</a>"."\n";
 173      echo $CLASS['kr_extension']->show_menu("toolbar");
 174      echo "</p>"."\n";
 175      echo "</div>\n";
 176    }
 177  
 178    // do last cleanups
 179    $_SESSION['firstrun'] = 0;
 180  
 181    // show querys - only for debug
 182    if($CLASS['config']->development->sqldebug) {
 183      echo "querys: " . $CLASS['db']->querys;
 184      echo $CLASS['error']->view_array($CLASS['db']->query_cache);
 185    }
 186  
 187    // close db connection
 188    $CLASS['db']->close();
 189  
 190    if($CLASS['config']->development->runtime) {
 191      $timer = microtime();
 192      $stoptime = ((double)strstr($timer, ' ') + (double)substr($timer,0,strpos($timer,' ')));
 193      echo "<!-- runtime: ".sprintf('%2.3f', $stoptime - $starttime)." -->";
 194    }
 195  ?>
 196  </body>
 197  </html>

title

Description

title

Description

title

Description

title

title

Body