/[cvs]/nfo/php/libs/org.netfrag.glib/utils/extensions.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.glib/utils/extensions.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by joko, Tue Apr 8 22:35:16 2003 UTC revision 1.6 by joko, Wed Apr 16 16:24:23 2003 UTC
# Line 13  Line 13 
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   * Revision 1.3  2003/04/08 22:35:16  joko
26   * + 'function yesno' from utils/links.php   * + 'function yesno' from utils/links.php
27   *   *
# Line 666  Bitte versuchen Sie es später nocheinmal Line 675  Bitte versuchen Sie es später nocheinmal
675      return $bool ? 'yes' : 'no';      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    
711    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

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