/openshift/adei

To get this branch, use:
bzr branch http://darksoft.org/webbzr/openshift/adei

« back to all changes in this revision

Viewing changes to tools.php

  • Committer: Suren A. Chilingaryan
  • Date: 2008-06-17 23:19:26 UTC
  • Revision ID: csa@dside.dyndns.org-20080617231926-w9mpfxw6lv0r0450
Administrative interface and better handling of missing group channels

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
}
108
108
 
109
109
 
 
110
function dsPrintSize($size) {
 
111
    $lvl = 0;
 
112
 
 
113
    while (($lvl<4)&&($size > 5119)) {
 
114
        $lvl++;
 
115
        $size = (int)ceil($size / 1024.);
 
116
    }
 
117
    
 
118
    switch ($lvl) {
 
119
        case 0:
 
120
            $size .= " bytes";
 
121
            break;
 
122
        case 1:
 
123
            $size .= " KB";
 
124
            break;
 
125
        case 2:
 
126
            $size .= " MB";
 
127
            break;
 
128
        case 3:
 
129
            $size .= " GB";
 
130
            break;
 
131
        case 4:
 
132
            $size .= " TB";
 
133
            break;
 
134
    }
 
135
    
 
136
    return $size;
 
137
}
 
138
 
 
139
 
110
140
function xml_escape($message) {
111
141
    return htmlspecialchars($message, ENT_COMPAT, "UTF-8");
112
142
}