Code

79e7afcaff5c82551f018271ec70607e4134922a
[gosa.git] / tests / ListTest / 1 / 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>
6 <script language="javascript" src="../ObjectListViewport.js" type="text/javascript"></script>
7 </head>
8 <body>
9 <button onclick='updateObjectListViewportSize();'>Tester</button>
10 <a href="?d=hf">No Footer &amp; Header</a> - 
11 <a href="?d=f">No Footer</a> - 
12 <a href="?d=h">No Header</a> - 
13 <a href="?d=">Normal</a> 
14 <?php
16 /* This is good for testing... */
17 error_reporting (E_ALL | E_STRICT);
19 /* Escape all preg_* relevant characters */
20 function normalizePreg($input)
21 {
22   return (addcslashes($input, '[]()|/.*+-'));
23 }
26 function get_smarty()
27 {
28         echo "Smarty fake in each ./tests/ListTest[1-9]/index.php";
29         date_default_timezone_set("europe/berlin");
30         $smarty = new smarty;
31         /* Set template compile directory */
32         $smarty->compile_dir= '/var/spool/gosa/';
33         $smarty->template_dir = '../';
34         $smarty->caching= false;
35         $smarty->php_handling= SMARTY_PHP_REMOVE;
36         return($smarty);
37 }
40 /* Initiate autoloader... */
41 require_once("../../../include/autoload.inc");
42 restore_error_handler();
43 try {
45         /* Get new test instance of the Configuration */
46         $cr= Registry::getInstance("ConfigManager");
47         $cr->load("../../../gosa.conf");
49         /* Get a new test instance of ObjectListViewports */
50         $vp= new ObjectListViewport("plugin/sample");
51         if(isset($_GET['d']) && preg_match("/f/",$_GET['d'])){
52                 $vp->enableFooter(FALSE);
53         }
54         if(isset($_GET['d']) && preg_match("/h/",$_GET['d'])){
55                 $vp->enableHeader(FALSE);
56         }
57         $content= $vp->render();
59 } catch (Exception $e) {
60         echo "\n-GOsa Exception-----------------------------------------------------------\n\n".
61                  $e->__toString().
62                  "\n\n--------------------------------------------------------------------------\n\n";
63 }
65 ?>
66     <table style='height:90%;width:90%;background-color: rgb(170, 170, 170);' cellspacing=1 cellpadding=0>
67         <tr>
68             <td>
69                <?php echo $content; ?>
70                                 
71             </td>
72         </tr>
73     </table>
74 </body>
75 </html>