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

include/inc.client_list.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 die ("inc.client_list.php is deprecated.");
00025 
00035 //include files from PEAR
00036 require_once "PEAR.php";
00037 require_once "DB.php";
00038 
00039 // wrapper for php 4.3.2 & higher
00040 @include_once "HTML/ITX.php";
00041 
00042 if (!class_exists(IntegratedTemplateExtension))
00043 {
00044         include_once "HTML/Template/ITX.php";
00045         //include_once "classes/class.ilTemplate2.php";
00046         include_once "classes/class.ilTemplateHTMLITX.php";
00047 }
00048 else
00049 {
00050         //include_once "classes/class.ilTemplate.php";
00051         include_once "classes/class.ilTemplateITX.php";
00052 }
00053 
00054 require_once "classes/class.ilTemplate.php";
00055 
00056 require_once "./classes/class.ilIniFile.php";
00057 require_once "./classes/class.ilTableGUI.php";
00058 require_once "./classes/class.ilUtil.php";
00059 require_once "./setup/classes/class.ilClient.php";
00060 require_once "./setup/classes/class.ilClientList.php";
00061 
00062 // load setup.ini
00063 $ini_ilias = new ilIniFile("./ilias.ini.php");
00064 $ini_ilias->read();
00065 
00066 define("ILIAS_DATA_DIR",$ini_ilias->readVariable("clients","datadir"));
00067 define("ILIAS_WEB_DIR",$ini_ilias->readVariable("clients","path"));
00068 
00069 define ("ILIAS_HTTP_PATH",$ini_ilias->readVariable('server','http_path'));
00070 define ("ILIAS_ABSOLUTE_PATH",$ini_ilias->readVariable('server','absolute_path'));
00071 
00072 define ("DEBUG",false);
00073         
00074 // read path + command for third party tools from ilias.ini
00075 define ("PATH_TO_CONVERT",$ini_ilias->readVariable("tools","convert")); 
00076 define ("PATH_TO_ZIP",$ini_ilias->readVariable("tools","zip"));
00077 define ("PATH_TO_UNZIP",$ini_ilias->readVariable("tools","unzip"));
00078 define ("PATH_TO_JAVA",$ini_ilias->readVariable("tools","java"));
00079 define ("PATH_TO_HTMLDOC",$ini_ilias->readVariable("tools","htmldoc"));
00080                 
00081 //instantiate template - in the main program please use ILIAS Template class
00082 //$tpl = new $tpl_class_name ("./templates/default");
00083 //$tpl->loadTemplatefile("tpl.main.html", true, true);
00084 // instantiate main template
00085 $tpl = new ilTemplate("tpl.main.html", true, true);
00086 
00087 $tpl->setVariable("PAGETITLE","Client List");
00088 $tpl->setVariable("LOCATION_STYLESHEET","./templates/default/delos.css");
00089 $tpl->setVariable("LOCATION_JAVASCRIPT","./templates/default");
00090 
00091 // load client list template
00092 $tpl->addBlockfile("CONTENT", "content", "tpl.client_list.html");
00093 
00094 // load template for table
00095 $tpl->addBlockfile("CLIENT_LIST", "client_list", "tpl.table.html");
00096 // load template for table content data
00097 $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
00098 
00099 // load table content data
00100 $clientlist = new ilClientList();
00101 $list = $clientlist->getClients();
00102 
00103 if (count($list) == 0)
00104 {
00105     header("Location: ./setup/setup.php");
00106         exit();
00107 }
00108 
00109 foreach ($list as $key => $client)
00110 {
00111         if ($client->checkDatabaseExists() and $client->ini->readVariable("client","access") and $client->getSetting("setup_ok"))
00112         {
00113                 $data[] = array(
00114                                                 $client->getName(),
00115                                                 "<a href=\"index.php?client_id=".$key."\">Start page</a>",
00116                                                 "<a href=\"login.php?client_id=".$key."\">Login page</a>"
00117                                                 );
00118         }
00119 }
00120 
00121 // create table
00122 $tbl = new ilTableGUI();
00123 
00124 // title & header columns
00125 $tbl->setTitle("Available Clients");
00126 $tbl->setHeaderNames(array("Installation Name","Public Access","Login"));
00127 $tbl->setHeaderVars(array("name","index","login"));
00128 $tbl->setColumnWidth(array("50%","25%","25%"));
00129 
00130 // control
00131 $tbl->setOrderColumn($_GET["sort_by"],"name");
00132 $tbl->setOrderDirection($_GET["sort_order"]);
00133 $tbl->setLimit($_GET["limit"]);
00134 $tbl->setOffset($_GET["offset"]);
00135 
00136 // content
00137 $tbl->setData($data);
00138 
00139 // footer
00140 $tbl->setFooter("tblfooter");
00141 
00142 // styles
00143 $tbl->setStyle("table","std");
00144 
00145 $tbl->disable("icon");
00146 $tbl->disable("numinfo");
00147 
00148 // render table
00149 $tbl->render();
00150 
00151 $tpl->show();
00152 ?>

Generated on Fri Dec 13 2013 13:52:11 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1