ChangeSet ID: 25979 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner@winehq.org 2006/06/22 17:34:56
Modified files: include : util.php
Log message: Chris Morgan cmorgan@alum.wpi.edu Fix indenting and formatting
Patch: http://cvs.winehq.org/patch.py?id=25979
Old revision New revision Changes Path 1.56 1.57 +23 -18 appdb/include/util.php
Index: appdb/include/util.php diff -u -p appdb/include/util.php:1.56 appdb/include/util.php:1.57 --- appdb/include/util.php:1.56 22 Jun 2006 22:34:56 -0000 +++ appdb/include/util.php 22 Jun 2006 22:34:56 -0000 @@ -9,21 +9,21 @@ function makeSafe($var)
function build_urlarg($vars) { - $arr = array(); - while(list($key, $val) = each($vars)) - { - if(is_array($val)) + $arr = array(); + while(list($key, $val) = each($vars)) + { + if(is_array($val)) { - while(list($idx, $value) = each($val)) - { - //echo "Encoding $key / $value<br>"; - $arr[] = rawurlencode($key."[]")."=".rawurlencode($value); - } + while(list($idx, $value) = each($val)) + { + //echo "Encoding $key / $value<br>"; + $arr[] = rawurlencode($key."[]")."=".rawurlencode($value); + } } - else - $arr[] = $key."=".rawurlencode($val); - } - return implode("&", $arr); + else + $arr[] = $key."=".rawurlencode($val); + } + return implode("&", $arr); }
@@ -735,8 +735,9 @@ function display_page_range($currentPage echo "<a href='".$linkurl."&page=$nextPage'>></a> "; echo "<a href='".$linkurl."&page=$totalPages'>>|</a> "; } else + { echo "> >|"; - + } }
// Expand a path like /something/somedirectory/../ to /something @@ -744,13 +745,16 @@ function display_page_range($currentPage function SimplifyPath($path) { $dirs = explode('/',$path);
- for($i=0; $i<count($dirs);$i++) { - if($dirs[$i]=="." || $dirs[$i]=="") { + for($i=0; $i<count($dirs);$i++) + { + if($dirs[$i]=="." || $dirs[$i]=="") + { array_splice($dirs,$i,1); $i--; }
- if($dirs[$i]=="..") { + if($dirs[$i]=="..") + { $cnt = count($dirs); $dirs=Simplify($dirs, $i); $i-= $cnt-count($dirs); @@ -759,7 +763,8 @@ function SimplifyPath($path) { return implode('/',$dirs); }
-function Simplify($dirs, $idx) { +function Simplify($dirs, $idx) +{ if($idx==0) return $dirs;
if($dirs[$idx-1]=="..") Simplify($dirs, $idx-1);