Code

d7043ab94e8dd35a386aea36ee36d83aa135bb05
[gosa.git] / tests / ListTest / 2 / index.php
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <title>Blubb</title>
5 <style type="text/css">@import url('../ObjectListViewport.css');</style>
8   <meta name="generator" content="my hands">
9   <meta name="description" content="GOsa - Login">
10   <meta name="author" lang="de" content="Cajus Pollmeier">
12   <meta http-equiv="Expires" content="Mon, 26 Jul 1997 05:00:00 GMT">
14   <meta http-equiv="Last-Modified" content="Friday, 09th November 2007 09:14:31 +0000 GMT">
15   <meta http-equiv="Cache-Control" content="no-cache">
16   <meta http-equiv="Pragma" content="no-cache">
17   <meta http-equiv="Cache-Control" content="post-check=0, pre-check=0">
18   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
20   <style type="text/css">@import url('themes/default/style.css');</style>
21   <link rel="shortcut icon" href="favicon.ico">
23 <script language="javascript" src="../ObjectListViewport.js" type="text/javascript"></script>
24   <script language="javascript" src="include/png.js" type="text/javascript"></script>
25   <script language="javascript" src="include/calendar.js" type="text/javascript"></script>
26   <script language="javascript" src="include/focus.js" type="text/javascript"></script>
27   <script language="javascript" src="include/warning.js" type="text/javascript"></script>
28 </head>
29 <body>
30 <button onclick='updateObjectListViewportSize();'>Tester</button>
31 <a href="?d=hf">No Footer &amp; Header</a> - 
32 <a href="?d=f">No Footer</a> - 
33 <a href="?d=h">No Header</a> - 
34 <a href="?d=">Normal</a> 
35 <?php
37 /* This is good for testing... */
38 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 require_once("../../../include/autoload.inc");
65 restore_error_handler();
66 try {
68         /* Get new test instance of the Configuration */
69         $cr= Registry::getInstance("ConfigManager");
70         $cr->load("../../../gosa.conf");
72         /* Get a new test instance of ObjectListViewports */
73         $vp= new ObjectListViewport("plugin/sample");
74         if(isset($_GET['d']) && preg_match("/f/",$_GET['d'])){
75                 $vp->enableFooter(FALSE);
76         }
77         if(isset($_GET['d']) && preg_match("/h/",$_GET['d'])){
78                 $vp->enableHeader(FALSE);
79         }
80         $content= $vp->render();
82         echo preg_replace("/%LIST%/",$content,file_get_contents('tpl'));        
84 } catch (Exception $e) {
85         echo "\n-GOsa Exception-----------------------------------------------------------\n\n".
86                  $e->__toString().
87                  "\n\n--------------------------------------------------------------------------\n\n";
88 }
90 ?>
91 </body>
92 </html>