Code

Updated lists tests
[gosa.git] / tests / ListTest / 3 / index.php
1 <?php
2 require_once("../../../include/autoload.inc");
3 restore_error_handler();
4 session_start();
5 ?>
6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
7 <html>
8 <head>
9 <title>Blubb</title>
10 <style type="text/css">@import url('../ObjectListViewport.css');</style>
13   <meta name="generator" content="my hands">
14   <meta name="description" content="GOsa - Login">
15   <meta name="author" lang="de" content="Cajus Pollmeier">
17   <meta http-equiv="Expires" content="Mon, 26 Jul 1997 05:00:00 GMT">
19   <meta http-equiv="Last-Modified" content="Friday, 09th November 2007 09:14:31 +0000 GMT">
20   <meta http-equiv="Cache-Control" content="no-cache">
21   <meta http-equiv="Pragma" content="no-cache">
22   <meta http-equiv="Cache-Control" content="post-check=0, pre-check=0">
23   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
25   <style type="text/css">@import url('themes/default/style.css');</style>
26   <link rel="shortcut icon" href="favicon.ico">
28 <script language="javascript" src="../ObjectListViewport.js" type="text/javascript"></script>
29   <script language="javascript" src="include/png.js" type="text/javascript"></script>
30   <script language="javascript" src="include/calendar.js" type="text/javascript"></script>
31   <script language="javascript" src="include/focus.js" type="text/javascript"></script>
32   <script language="javascript" src="include/warning.js" type="text/javascript"></script>
33 </head>
34 <body>
35 <button onclick='updateObjectListViewportSize();'>Tester</button>
36 <?php
38 /* This is good for testing... */
39 error_reporting (E_ALL | E_STRICT);
41 function get_smarty()
42 {
43     echo "Smarty fake in each ./tests/ListTest[1-9]/index.php";
44     date_default_timezone_set("europe/berlin");
45     $smarty = new smarty;
46     /* Set template compile directory */
47     $smarty->compile_dir= '/var/spool/gosa/';
48     $smarty->template_dir = '../';
49     $smarty->caching= false;
50     $smarty->php_handling= SMARTY_PHP_REMOVE;
51     return($smarty);
52 }
56 /* Escape all preg_* relevant characters */
57 function normalizePreg($input)
58 {
59   return (addcslashes($input, '[]()|/.*+-'));
60 }
63 /* Initiate autoloader... */
64 try {
66         /* Get new test instance of the Configuration */
67         $cr= Registry::getInstance("ConfigManager");
68         $cr->load("../../../gosa.conf");
70         /* Get a new test instance of ObjectListViewports */
72         if(!isset($_SESSION['vp1'])){
73                 $_SESSION['vp1'] = new ObjectListViewport("plugin/sample");
74                 $_SESSION['vp2'] = new ObjectListViewport("plugin/sample");
75         }
76         $vp1 = $_SESSION['vp1'];
77         $vp2 = $_SESSION['vp2'];
78         $content1= $vp1->render();
79         $content2= $vp2->render();
81         $str = preg_replace("/%LIST%/",$content1,file_get_contents('tpl'));     
82         $str = preg_replace("/%LIST2%/",$content2,$str);
83         echo $str;      
85 } catch (Exception $e) {
86         echo "\n-GOsa Exception-----------------------------------------------------------\n\n".
87                  $e->__toString().
88                  "\n\n--------------------------------------------------------------------------\n\n";
89 }
91 ?>
92 </body>
93 </html>