Mercurial > hg > mlmmj
annotate contrib/web/php-admin/htdocs/index.php @ 759:73c8715367fb
Better techniques for locating support files in php-admin
- existing installations will need to have their conf/config.php altered to set
the variable $confdir
author | Ben Schmidt |
---|---|
date | Wed, 06 Oct 2010 10:35:04 +1100 |
parents | 6d354f3a8d90 |
children | 331115b58da4 |
rev | line source |
---|---|
309 | 1 <?php |
2 | |
3 /* mlmmj/php-admin: | |
4 * Copyright (C) 2004 Christoph Thiel <ct at kki dot org> | |
5 * | |
6 * mlmmj/php-perl: | |
7 * Copyright (C) 2004 Morten K. Poulsen <morten at afdelingp.dk> | |
8 * Copyright (C) 2004 Christian Laursen <christian@pil.dk> | |
9 * | |
10 * Permission is hereby granted, free of charge, to any person obtaining a copy | |
11 * of this software and associated documentation files (the "Software"), to | |
12 * deal in the Software without restriction, including without limitation the | |
13 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
14 * sell copies of the Software, and to permit persons to whom the Software is | |
15 * furnished to do so, subject to the following conditions: | |
16 * | |
17 * The above copyright notice and this permission notice shall be included in | |
18 * all copies or substantial portions of the Software. | |
19 * | |
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
26 * IN THE SOFTWARE. | |
27 */ | |
28 | |
759
73c8715367fb
Better techniques for locating support files in php-admin
Ben Schmidt
parents:
710
diff
changeset
|
29 require(dirname(dirname(__FILE__))."/conf/config.php"); |
73c8715367fb
Better techniques for locating support files in php-admin
Ben Schmidt
parents:
710
diff
changeset
|
30 require(dirname(__FILE__)."/class.rFastTemplate.php"); |
309 | 31 |
710
6d354f3a8d90
Replaced class.FastTemplate.php with class.rFastTemplate.php in contrib/web/php-admin (Christoph Thiel)
mortenp
parents:
384
diff
changeset
|
32 $tpl = new rFastTemplate($templatedir); |
309 | 33 |
34 $tpl->define(array("main" => "index.html")); | |
35 | |
36 $lists = ""; | |
37 | |
38 $dir = opendir($topdir); | |
39 while ($file = readdir($dir)) { | |
40 if (!ereg("^\.",$file)) | |
41 { | |
384 | 42 $lists .= "<a href=\"edit.php?list=".urlencode($file)."\">". |
43 htmlentities($file)."</a><br />\n"; | |
309 | 44 } |
45 } | |
46 closedir($dir); | |
47 | |
48 $tpl->assign(array("LISTS" => $lists)); | |
49 | |
50 | |
51 $tpl->parse("MAIN","main"); | |
52 $tpl->FastPrint("MAIN"); | |
53 | |
54 ?> |