3 |
## $Id$ |
## $Id$ |
4 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
5 |
## $Log$ |
## $Log$ |
6 |
|
## Revision 1.4 2003/02/13 21:55:52 joko |
7 |
|
## + logging now via the global app instance |
8 |
|
## |
9 |
|
## Revision 1.3 2003/02/09 17:51:59 joko |
10 |
|
## + minor update related to new log level constants |
11 |
|
## |
12 |
|
## Revision 1.2 2002/12/19 06:22:09 joko |
13 |
|
## + function _t |
14 |
|
## |
15 |
## Revision 1.1 2002/12/13 02:24:55 joko |
## Revision 1.1 2002/12/13 02:24:55 joko |
16 |
## + refactored code |
## + refactored code |
17 |
## |
## |
30 |
## |
## |
31 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
32 |
|
|
33 |
|
|
34 |
|
// TODO: |
35 |
|
// - try to encapsulate this code and re-export via method-linking to global scope |
36 |
|
// - is this possible with PHP? |
37 |
|
|
38 |
// wrapper-function for convenient use of "getlt"..... are there "Alias"es in php? |
// wrapper-function for convenient use of "getlt"..... are there "Alias"es in php? |
39 |
function getlt($key, $tpl=array()) { |
function getlt($key, $tpl=array()) { |
40 |
//global $lt; |
//global $lt; |
45 |
//print "<br>"; |
//print "<br>"; |
46 |
//return $lt->getlt($key, $tpl); |
//return $lt->getlt($key, $tpl); |
47 |
//print "a" . Dumper($site); |
//print "a" . Dumper($site); |
48 |
return $site->lt->getlt($key, $tpl); |
return $site->localetext->getlt($key, $tpl); |
49 |
} |
} |
50 |
|
|
51 |
// wrapper-function for convenient use of "getlink"..... are there "Alias"es in php? |
// wrapper-function for convenient use of "getlink"..... are there "Alias"es in php? |
55 |
} |
} |
56 |
|
|
57 |
// wrapper-function for getting the logger instance |
// wrapper-function for getting the logger instance |
58 |
function logp($string, $level) { |
function logp($string, $level = PEAR_LOG_DEBUG) { |
59 |
global $site; |
global $app; |
60 |
//return; |
$app->log($string, $level); |
|
$site->log($string, $level); |
|
61 |
} |
} |
62 |
|
|
63 |
function dprint($message, $level = E_USER_NOTICE) { |
function dprint($message, $level = E_USER_NOTICE) { |
64 |
//debug_append($message, $level); |
//debug_append($message, $level); |
65 |
trigger_error($message, $level); |
trigger_error($message, $level); |
66 |
} |
} |
67 |
|
|
68 |
|
function _t($identifier, $data = array()) { |
69 |
|
global $site; |
70 |
|
return $site->template->get("lt:$identifier", $data); |
71 |
|
} |
72 |
|
|
73 |
?> |
?> |