Code

9ffc3c3c1e79ad5de6f0c6bc07498dbe05d102a6
[gosa.git] / tests / ListTest / 3 / 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         $vp1= new ObjectListViewport("plugin/sample");
74         $vp2= new ObjectListViewport("plugin/sample");
75         if(isset($_GET['d']) && preg_match("/f/",$_GET['d'])){
76                 $vp1->enableFooter(FALSE);
77                 $vp2->enableFooter(FALSE);
78         }
79         if(isset($_GET['d']) && preg_match("/h/",$_GET['d'])){
80                 $vp1->enableHeader(FALSE);
81                 $vp2->enableHeader(FALSE);
82         }
83         $content1= $vp1->render();
84         $content2= $vp2->render();
86         $str = preg_replace("/%LIST%/",$content1,file_get_contents('tpl'));     
87         $str = preg_replace("/%LIST2%/",$content2,$str);
88         echo $str;      
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>