Code

Added POST variables
[gosa.git] / tests / ListTest / 2 / index.php
1 <?php
3 require_once("../../../include/autoload.inc");
4 restore_error_handler();
5 session_start();
6 ?>
7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
8 <html>
9 <head>
10 <title>Blubb</title>
11 <style type="text/css">@import url('../ObjectListViewport.css');</style>
14   <meta name="generator" content="my hands">
15   <meta name="description" content="GOsa - Login">
16   <meta name="author" lang="de" content="Cajus Pollmeier">
18   <meta http-equiv="Expires" content="Mon, 26 Jul 1997 05:00:00 GMT">
20   <meta http-equiv="Last-Modified" content="Friday, 09th November 2007 09:14:31 +0000 GMT">
21   <meta http-equiv="Cache-Control" content="no-cache">
22   <meta http-equiv="Pragma" content="no-cache">
23   <meta http-equiv="Cache-Control" content="post-check=0, pre-check=0">
24   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
26   <style type="text/css">@import url('themes/default/style.css');</style>
27   <link rel="shortcut icon" href="favicon.ico">
29 <script language="javascript" src="../ObjectListViewport.js" type="text/javascript"></script>
30   <script language="javascript" src="include/png.js" type="text/javascript"></script>
31   <script language="javascript" src="include/calendar.js" type="text/javascript"></script>
32   <script language="javascript" src="include/focus.js" type="text/javascript"></script>
33   <script language="javascript" src="include/warning.js" type="text/javascript"></script>
34 </head>
35 <body>
36 <button onclick='updateObjectListViewportSize();'>Tester</button>
37 <a href="?d=hf">No Footer &amp; Header</a> - 
38 <a href="?d=f">No Footer</a> - 
39 <a href="?d=h">No Header</a> - 
40 <a href="?d=">Normal</a> 
41 <?php
43 /* This is good for testing... */
44 error_reporting (E_ALL | E_STRICT);
46 function get_smarty()
47 {
48     echo "Smarty fake in each ./tests/ListTest[1-9]/index.php";
49     date_default_timezone_set("europe/berlin");
50     $smarty = new smarty;
51     /* Set template compile directory */
52     $smarty->compile_dir= '/var/spool/gosa/';
53     $smarty->template_dir = '../';
54     $smarty->caching= false;
55     $smarty->php_handling= SMARTY_PHP_REMOVE;
56     return($smarty);
57 }
61 /* Escape all preg_* relevant characters */
62 function normalizePreg($input)
63 {
64   return (addcslashes($input, '[]()|/.*+-'));
65 }
68 /* Initiate autoloader... */
69 try {
71         /* Get new test instance of the Configuration */
72         $cr= Registry::getInstance("ConfigManager");
73         $cr->load("../../../gosa.conf");
75         /* Get a new test instance of ObjectListViewports */
76         if(!isset($_SESSION['vp'])){
77                 $_SESSION['vp'] = new ObjectListViewport("plugin/sample");
78         }
79         $vp = $_SESSION['vp'];
80         if(isset($_GET['d']) && preg_match("/f/",$_GET['d'])){
81                 $vp->enableFooter(FALSE);
82         }
83         if(isset($_GET['d']) && preg_match("/h/",$_GET['d'])){
84                 $vp->enableHeader(FALSE);
85         }
86         $content= $vp->render();
88         echo preg_replace("/%LIST%/",$content,file_get_contents('tpl'));        
90 } catch (Exception $e) {
91         echo "\n-GOsa Exception-----------------------------------------------------------\n\n".
92                  $e->__toString().
93                  "\n\n--------------------------------------------------------------------------\n\n";
94 }
96 ?>
97 </body>
98 </html>