1 |
<? |
2 |
## ----------------------------------------------------------------------------- |
3 |
## $Id: shortcuts.php,v 1.2 2002/12/19 06:22:09 joko Exp $ |
4 |
## ----------------------------------------------------------------------------- |
5 |
## $Log: shortcuts.php,v $ |
6 |
## Revision 1.2 2002/12/19 06:22:09 joko |
7 |
## + function _t |
8 |
## |
9 |
## Revision 1.1 2002/12/13 02:24:55 joko |
10 |
## + refactored code |
11 |
## |
12 |
## Revision 1.4 2002/12/03 17:01:37 cvsjoko |
13 |
## + testing |
14 |
## |
15 |
## Revision 1.3 2002/12/01 22:05:29 cvsjoko |
16 |
## + bugfixing tests / debugging output |
17 |
## |
18 |
## Revision 1.2 2002/12/01 17:44:50 cvsjoko |
19 |
## + modification to function getlt |
20 |
## |
21 |
## Revision 1.1 2002/11/12 06:05:18 cvsjoko |
22 |
## + initial checkin |
23 |
## + shortcut functions to often used methods |
24 |
## |
25 |
## ----------------------------------------------------------------------------- |
26 |
|
27 |
|
28 |
// TODO: |
29 |
// - try to encapsulate this code and re-export via method-linking to global scope |
30 |
// - is this possible with PHP? |
31 |
|
32 |
// wrapper-function for convenient use of "getlt"..... are there "Alias"es in php? |
33 |
function getlt($key, $tpl=array()) { |
34 |
//global $lt; |
35 |
global $site; |
36 |
//print "yai - <br>"; |
37 |
//print Dumper($_SESSION); |
38 |
//print Dumper($lt); |
39 |
//print "<br>"; |
40 |
//return $lt->getlt($key, $tpl); |
41 |
//print "a" . Dumper($site); |
42 |
return $site->localetext->getlt($key, $tpl); |
43 |
} |
44 |
|
45 |
// wrapper-function for convenient use of "getlink"..... are there "Alias"es in php? |
46 |
function getlink( $key, $attribs = array() ) { |
47 |
global $site; |
48 |
return $site->getLink( $key, $attribs ); |
49 |
} |
50 |
|
51 |
// wrapper-function for getting the logger instance |
52 |
function logp($string, $level = PEAR_LOG_DEBUG) { |
53 |
global $site; |
54 |
//return; |
55 |
$site->log($string, $level); |
56 |
} |
57 |
|
58 |
function dprint($message, $level = E_USER_NOTICE) { |
59 |
//debug_append($message, $level); |
60 |
trigger_error($message, $level); |
61 |
} |
62 |
|
63 |
function _t($identifier, $data = array()) { |
64 |
global $site; |
65 |
return $site->template->get("lt:$identifier", $data); |
66 |
} |
67 |
|
68 |
?> |