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