13 |
* $Id$ |
* $Id$ |
14 |
* |
* |
15 |
* $Log$ |
* $Log$ |
16 |
|
* Revision 1.5 2003/04/11 01:31:50 joko |
17 |
|
* + function log (from flib-shortcuts) |
18 |
|
* |
19 |
|
* Revision 1.4 2003/04/09 07:55:47 joko |
20 |
|
* + function untwingle_reference |
21 |
|
* |
22 |
|
* Revision 1.3 2003/04/08 22:35:16 joko |
23 |
|
* + 'function yesno' from utils/links.php |
24 |
|
* |
25 |
* Revision 1.2 2003/04/06 01:37:31 jonen |
* Revision 1.2 2003/04/06 01:37:31 jonen |
26 |
* + added functions to generate and handle unique ID's |
* + added functions to generate and handle unique ID's |
27 |
* |
* |
667 |
return ( implode(unpack("H*",Base64_decode($ID)), '') ); |
return ( implode(unpack("H*",Base64_decode($ID)), '') ); |
668 |
} |
} |
669 |
|
|
670 |
|
// from: utils/links.php |
671 |
|
function yesno($bool) { |
672 |
|
return $bool ? 'yes' : 'no'; |
673 |
|
} |
674 |
|
|
675 |
|
function untwingle_reference($item, $options = array()) { |
676 |
|
|
677 |
|
// default |
678 |
|
if (!$options['seperator']) { $options['seperator'] = '_'; } |
679 |
|
|
680 |
|
if ( is_string($item) && (substr($item, 0, 2) == "o_") ) { |
681 |
|
//print "YAI!<br/>"; |
682 |
|
$parts = split($options['seperator'], $item); |
683 |
|
$result = array( |
684 |
|
ident => $parts[1], |
685 |
|
type => $parts[2], |
686 |
|
); |
687 |
|
return $result; |
688 |
|
} |
689 |
|
} |
690 |
|
|
691 |
|
// wrapper-function for getting the logger instance |
692 |
|
// TODO: review! what about php::append_log? |
693 |
|
function log($string, $level = PEAR_LOG_DEBUG) { |
694 |
|
global $app; |
695 |
|
$app->log($string, $level); |
696 |
|
} |
697 |
|
|
698 |
} |
} |
699 |
|
|