/[cvs]/nfo/php/libs/org.netfrag.flib/utils/shortcuts.php
ViewVC logotype

Annotation of /nfo/php/libs/org.netfrag.flib/utils/shortcuts.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Thu Feb 13 21:55:52 2003 UTC (21 years, 6 months ago) by joko
Branch: MAIN
Changes since 1.3: +6 -4 lines
+ logging now via the global app instance

1 joko 1.1 <?
2     ## -----------------------------------------------------------------------------
3 joko 1.4 ## $Id: shortcuts.php,v 1.3 2003/02/09 17:51:59 joko Exp $
4 joko 1.1 ## -----------------------------------------------------------------------------
5     ## $Log: shortcuts.php,v $
6 joko 1.4 ## Revision 1.3 2003/02/09 17:51:59 joko
7     ## + minor update related to new log level constants
8     ##
9 joko 1.3 ## Revision 1.2 2002/12/19 06:22:09 joko
10     ## + function _t
11     ##
12 joko 1.2 ## Revision 1.1 2002/12/13 02:24:55 joko
13     ## + refactored code
14     ##
15 joko 1.1 ## 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 joko 1.2
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 joko 1.1 // 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 joko 1.2 return $site->localetext->getlt($key, $tpl);
46 joko 1.1 }
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 joko 1.3 function logp($string, $level = PEAR_LOG_DEBUG) {
56 joko 1.4 global $app;
57     $app->log($string, $level);
58 joko 1.1 }
59    
60 joko 1.2 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 joko 1.1
70     ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed