Changeset 187 for trunk/global.php
- Timestamp:
- Apr 5, 2009, 3:54:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/global.php
r178 r187 32 32 global $Database; 33 33 34 //echo('Přidávám modul '.get_class($Module).'<br >');34 //echo('Přidávám modul '.get_class($Module).'<br />'); 35 35 $Module->System = &$this; 36 36 $Module->Database = &$Database; … … 202 202 return(str_replace( 203 203 array("á","č","ď","é","ě","í","ľ","ň","ó","ř","š","ť","ú","ů","ý","ž","Á","Č","Ď","É","Ě","Í","Ľ","Ň","Ó","Ř","Š","Ť","Ú","Ů","Ý","Ž"), 204 array("a","c","d","e","e","i","l","n","o","r","s","t","u","u","y","z","A","C","D","E","E","I","L","N","O","R","S","T","U","U","Y","Z"), $Text)); 205 } 204 array("a","c","d","e","e","i","l","n","o","r","s","t","u","u","y","z","A","C","D","E","E","I","L","N","O","R","S","T","U","U","Y","Z"), 205 $Text)); 206 } 207 208 function CIDRToAddressRange($Subnet, $Mask) 209 { 210 $SubnetParts = explode('.', $Subnet); 211 $SubnetBinary = ($SubnetParts[0] << 24) | ($SubnetParts[1] << 16) | ($SubnetParts[2] << 8) | $SubnetParts[3]; 212 $SubnetTopBinary = $SubnetBinary + (1 << (32 - $Mask)) - 1; 213 $SubnetTopParts = array(($SubnetTopBinary >> 24) & 255, ($SubnetTopBinary >> 16) & 255, ($SubnetTopBinary >> 8) & 255, ($SubnetTopBinary & 255)); 214 $SubnetTop = implode('.', $SubnetTopParts); 215 return(array('From' => $Subnet, 'To' => $SubnetTop)); 216 } 217 218 function RouterOSIdent($Name) 219 { 220 return(strtr(strtolower(trim($Name)), array(' ' => '-', '.' => '', '(' => '-', ')' => '-', 221 'č' => 'c', 'š' => 's', 'ě' => 'e', 'ř' => 'r', 'ž' => 'z', 'ý' => 'y', 'á' => 'a', 'í' => 'i', 'é' => 'e', 'ů' => 'u', 'ú' => 'u', 'ď' => 'd', 'ť' => 't', 'ň' => 'n', 'ó' => 'o', 222 'Č' => 'c', 'Š' => 's', 'Ě' => 'e', 'Ř' => 'r', 'Ž' => 'z', 'Ý' => 'y', 'Á' => 'a', 'Í' => 'i', 'É' => 'e', 'Ů' => 'u', 'Ú' => 'u', 'Ď' => 'd', 'Ť' => 't', 'Ň' => 'n', 'Ó' => 'o', 223 ))); 224 } 225 226 206 227 207 228 ?>
Note:
See TracChangeset
for help on using the changeset viewer.