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