Ignore:
Timestamp:
Dec 18, 2005 12:16:03 AM (18 years ago)
Author:
scdev
Message:

detabbed all files ;P

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Utilities.inc.php

    r41 r42  
    6464
    6565/**
    66  * Returns text with appropriate html translations. 
     66 * Returns text with appropriate html translations.
    6767 *
    6868 * @param  string $txt              Text to clean.
    69  * @param  bool   $preserve_html    If set to true, oTxt will not translage <, >, ", or ' 
     69 * @param  bool   $preserve_html    If set to true, oTxt will not translage <, >, ", or '
    7070 *                                  characters into HTML entities. This allows HTML to pass
    7171 *                                  through unmunged.
     
    8585        $search['retain_left_angle']       = '/&lt;/';
    8686        $replace['retain_left_angle']      = '<';
    87        
     87
    8888        $search['retain_right_angle']      = '/&gt;/';
    8989        $replace['retain_right_angle']     = '>';
    90        
     90
    9191        $search['retain_single_quote']     = '/&#039;/';
    9292        $replace['retain_single_quote']    = "'";
    93        
     93
    9494        $search['retain_double_quote']     = '/&quot;/';
    9595        $replace['retain_double_quote']    = '"';
     
    104104
    105105/**
    106  * Returns text with stylistic modifications. 
     106 * Returns text with stylistic modifications.
    107107 *
    108108 * @param  string   $txt  Text to clean.
     
    125125    $search['single_quotes']    = '/(^|[^\w=])(?:\'|&#39;|&lsquo;)([^\']+?)(?:\'|&#39;|&rsquo;)([^\w]|$)/';
    126126    $replace['single_quotes']   = '\\1&lsquo;\\2&rsquo;\\3';
    127    
     127
    128128    // em--dashes  become em&mdash;dashes
    129129    $search['em_dash']          = '/(\s*[^!<-])--([^>-]\s*)/';
     
    133133}
    134134
    135    
     135
    136136/**
    137137 * Generates a hexadecibal html color based on provided word.
     
    159159        }
    160160        break;
    161        
     161
    162162    case 1 :
    163163    default :
     
    219219    $units = array('B', 'KB', 'MB', 'GB', 'TB');
    220220    $ii = count($units) - 1;
    221  
     221
    222222    // Max unit
    223223    $unit = array_search((string) $unit, $units);
     
    225225        $unit = $ii;
    226226    }
    227  
     227
    228228    // Loop
    229229    $i = 0;
     
    232232        $i++;
    233233    }
    234  
     234
    235235    return sprintf($format, $size, $units[$i]);
    236236}
     
    264264 * @param  mixed $var       The variable that is being set.
    265265 * @param  mixed $default   What to set it to if $val is not currently set.
    266  * @return mixed            The resulting value of $var. 
     266 * @return mixed            The resulting value of $var.
    267267 */
    268268function setDefault(&$var, $default='')
     
    307307 */
    308308function urlEncodeArray($data, $prefix='', $_return=true) {
    309    
     309
    310310    // Data is stored in static variable.
    311311    static $args;
    312    
     312
    313313    if (is_array($data)) {
    314314        foreach ($data as $key => $val) {
     
    323323        $args[$prefix] = urlencode($data);
    324324    }
    325    
     325
    326326    if ($_return) {
    327327        // This is not a recursive execution. All recursion is complete.
     
    343343 */
    344344function urlEncodeArrayToString($data, $prefix='') {
    345    
     345
    346346    $array_args = urlEncodeArray($data, $prefix);
    347347    $url_args = '';
     
    378378 * Prints the word "checked" if a variable is set, and optionally matches
    379379 * the desired value, otherwise prints nothing,
    380  * used for printing the word "checked" in a checkbox form input. 
     380 * used for printing the word "checked" in a checkbox form input.
    381381 *
    382382 * @param  mixed $var     the variable to compare
     
    404404 * prints the word "selected" if a variable is set, and optionally matches
    405405 * the desired value, otherwise prints nothing,
    406  * otherwise prints nothing, used for printing the word "checked" in a 
    407  * select form input 
     406 * otherwise prints nothing, used for printing the word "checked" in a
     407 * select form input
    408408 *
    409409 * @param  mixed $var     the variable to compare
     
    450450 *
    451451 * @param  array $date     String date to convert.
    452  * @param  array $format   Date format to pass to date(). 
     452 * @param  array $format   Date format to pass to date().
    453453 *                         Default produces MySQL datetime: 0000-00-00 00:00:00.
    454454 * @return string          SQL-safe date.
     
    462462        $sql_date = date($format, strtotime($date));
    463463    }
    464    
     464
    465465    return $sql_date;
    466466}
     
    477477{
    478478    static $magic_quotes_gpc;
    479    
     479
    480480    if (!isset($magic_quotes_gpc)) {
    481481        $magic_quotes_gpc = get_magic_quotes_gpc();
    482482    }
    483    
     483
    484484    if ($magic_quotes_gpc) {
    485485        if (!is_array($var)) {
     
    562562        App::logMsg(sprintf('Adding signature to empty string.', null), LOG_NOTICE, __FILE__, __LINE__);
    563563    }
    564    
     564
    565565    if (!isset($seed_key)) {
    566566        $seed_key = App::getParam('signing_key');
     
    606606/**
    607607 * Sends empty output to the browser and flushes the php buffer so the client
    608  * will see data before the page is finished processing. 
     608 * will see data before the page is finished processing.
    609609 */
    610610function flushBuffer() {
     
    682682{
    683683    static $urls = array();
    684    
     684
    685685    if (!isset($urls[$url])) {
    686686        if (!preg_match('|\w{1,}\.\w{2,5}/|', $url)) {
     
    695695
    696696/**
    697  * Takes a URL and returns it without the query or anchor portion 
     697 * Takes a URL and returns it without the query or anchor portion
    698698 *
    699699 * @param  string $url   any kind of URI
     
    706706
    707707/**
    708  * Returns the remote IP address, taking into consideration proxy servers. 
     708 * Returns the remote IP address, taking into consideration proxy servers.
    709709 *
    710710 * @param  bool $dolookup   If true we resolve to IP to a host name,
     
    740740        $networks = array($networks);
    741741    }
    742    
     742
    743743    $ip_binary = sprintf('%032b', ip2long($ip));
    744744    foreach ($networks as $network) {
     
    758758        }
    759759    }
    760    
     760
    761761    return false;
    762762}
    763763
    764764/**
    765  * Returns a fully qualified URL to the current script, including the query. 
     765 * Returns a fully qualified URL to the current script, including the query.
    766766 *
    767767 * @return string    a full url to the current script
     
    796796    /**
    797797    * Translates text
    798     * 
     798    *
    799799    * @access public
    800800    * @param string $text the text to be translated
     
    804804        return $text;
    805805    }
    806    
     806
    807807    /**
    808808    * Translates text
    809     * 
     809    *
    810810    * @access public
    811811    * @param string $text the text to be translated
     
    815815        return $text;
    816816    }
    817    
     817
    818818    /**
    819819    * Translates text by domain
    820     * 
     820    *
    821821    * @access public
    822822    * @param string $domain the language to translate the text into
     
    827827        return $text;
    828828    }
    829    
     829
    830830    /**
    831831    * Translates text by domain and category
    832     * 
     832    *
    833833    * @access public
    834834    * @param string $domain the language to translate the text into
     
    840840        return $text;
    841841    }
    842    
     842
    843843    /**
    844844    * Binds the text domain
    845     * 
     845    *
    846846    * @access public
    847847    * @param string $domain the language to translate the text into
    848     * @param string 
     848    * @param string
    849849    * @return string translated text
    850850    */
     
    852852        return $domain;
    853853    }
    854    
     854
    855855    /**
    856856    * Sets the text domain
    857     * 
     857    *
    858858    * @access public
    859859    * @param string $domain the language to translate the text into
Note: See TracChangeset for help on using the changeset viewer.