1 |
dpavlin |
1.1 |
<?php |
2 |
|
|
include("inc/Smarty.class.php"); |
3 |
|
|
class MySmarty extends Smarty { |
4 |
|
|
function MySmarty($pg = -1, $more = array()) { |
5 |
|
|
global $language, $sifra, $first, $edit, $PHP_SELF; |
6 |
|
|
$this->template_dir = "./tpl"; |
7 |
|
|
$this->compile_dir = "./tpc"; |
8 |
|
|
$this->config_dir = "./cfg"; |
9 |
|
|
$this->assign("language", $language); |
10 |
|
|
$this->assign("sifra", $sifra); |
11 |
|
|
$this->assign("first", $first); |
12 |
|
|
$this->assign("action", $PHP_SELF.Params($page, $more)); |
13 |
|
|
$new = $update = $delete = "<?>"; |
14 |
|
|
switch ($language) { |
15 |
|
|
case "HR": |
16 |
|
|
$delete = "Obri¹i"; |
17 |
|
|
$new = "Odustani"; |
18 |
|
|
if ($edit) $update = "Zapi¹i promjene"; |
19 |
|
|
else $update = "Upi¹i podatke"; |
20 |
|
|
break; |
21 |
|
|
case "EN": |
22 |
|
|
$delete = "Delete"; |
23 |
|
|
$new = "Cancel"; |
24 |
|
|
if ($edit) $update = "Update changes"; |
25 |
|
|
else $update = "Save data"; |
26 |
|
|
break; |
27 |
|
|
} |
28 |
|
|
$this->assign("delete", $delete); |
29 |
|
|
$this->assign("new", $new); |
30 |
|
|
$this->assign("update", $update); |
31 |
|
|
} |
32 |
|
|
function show() { |
33 |
|
|
global $language, $PHP_SELF; |
34 |
|
|
$pg = basename($PHP_SELF); |
35 |
|
|
$pg = eregi_replace("\.php$", "", $pg); |
36 |
|
|
$this->display("$language/$pg.tpl"); |
37 |
|
|
} |
38 |
|
|
} |
39 |
|
|
?> |