1 |
<?php |
2 |
require("Smarty.class.php"); |
3 |
require("conn.inc"); |
4 |
|
5 |
$smarty = new Smarty; |
6 |
|
7 |
$smarty->assign( array ( Title=>"PLIVA Ljubljana" ) ); |
8 |
|
9 |
$section=str_replace(".php","",basename($PHP_SELF)); |
10 |
$smarty->assign("section",$section); |
11 |
|
12 |
$main_file=$section; |
13 |
|
14 |
require("inc/section.php"); |
15 |
|
16 |
include("common.inc"); |
17 |
|
18 |
include("find_html_file.inc"); |
19 |
|
20 |
if (isset($h) && file_exists(find_html_file("h/$section",$h))) { |
21 |
$main=join('',file(find_html_file("h/$section",$h))); |
22 |
if ($menu_item) { |
23 |
$title.=" : $menu_item"; |
24 |
} |
25 |
} elseif (isset($p) && file_exists("sections/$p.inc")) { |
26 |
include("sections/$p.inc"); |
27 |
} elseif (file_exists("template/$main_file.tpl")) { |
28 |
$main=$smarty->fetch("$main_file.tpl"); |
29 |
} elseif (find_html_file("h",$section)) { |
30 |
$main=join('',file(find_html_file("h",$section))); |
31 |
if (file_exists("sections/$section.inc")) { |
32 |
include("sections/$section.inc"); |
33 |
} |
34 |
} elseif (isset($static)) { |
35 |
if (strstr($static,",")) { |
36 |
$d=explode(",",$static); // dir,file |
37 |
} else { |
38 |
$d=array($static,$static); |
39 |
} |
40 |
if (find_html_file("static/$d[0]",$d[1])) { |
41 |
$main=join('',file(find_html_file("static/$d[0]",$d[1]))); |
42 |
// fix entities from MS programs |
43 |
include("fix_msshit.inc"); |
44 |
$main=fix_msshit($main); |
45 |
} else { |
46 |
$main="<b>Can't find static/$d[0]/$d[1]</b>"; |
47 |
} |
48 |
} elseif (file_exists("sections/$section.inc")) { |
49 |
include("sections/$section.inc"); |
50 |
} else { |
51 |
$main="<b>can't find template or html file for section $section</b>"; |
52 |
} |
53 |
|
54 |
$smarty->assign(array(section=>$section, |
55 |
mpic=>$mpic, |
56 |
Section_title=>$title, |
57 |
rnd=>$rnd, |
58 |
MAIN=>$main, |
59 |
)); |
60 |
|
61 |
$smarty->display("index.tpl"); |
62 |
?> |