Commit 31d3208c7d6ba5e3f62ade1cf3a836f8803da756
1 parent
b7a9ad1d
Added php doc comments to file
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@28 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
43 additions
and
31 deletions
browse.php
| 1 | <?php | 1 | <?php |
| 2 | -/* | 2 | +/** |
| 3 | * browse.php -- Browse page | 3 | * browse.php -- Browse page |
| 4 | + * | ||
| 5 | + * Browse a list of files/folders | ||
| 4 | * | 6 | * |
| 5 | * Copyright (c) 1999-2002 The Owl Project Team | 7 | * Copyright (c) 1999-2002 The Owl Project Team |
| 6 | * Licensed under the GNU GPL. For full terms see the file COPYING. | 8 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
| @@ -22,7 +24,7 @@ if(!isset($sortname)) $sortname = "ASC"; | @@ -22,7 +24,7 @@ if(!isset($sortname)) $sortname = "ASC"; | ||
| 22 | // Daphne change | 24 | // Daphne change |
| 23 | if(!isset($sortver)) $sortver = "ASC, minor_revision ASC"; | 25 | if(!isset($sortver)) $sortver = "ASC, minor_revision ASC"; |
| 24 | if(!isset($sortcheckedout)) $sortcheckedout = "ASC"; | 26 | if(!isset($sortcheckedout)) $sortcheckedout = "ASC"; |
| 25 | -// end daphne change | 27 | +// end Daphne change |
| 26 | if(!isset($sortfilename)) $sortfilename = "DESC"; | 28 | if(!isset($sortfilename)) $sortfilename = "DESC"; |
| 27 | if(!isset($sortsize)) $sortsize = "DESC"; | 29 | if(!isset($sortsize)) $sortsize = "DESC"; |
| 28 | if(!isset($sortposted)) $sortposted = "DESC"; | 30 | if(!isset($sortposted)) $sortposted = "DESC"; |
| @@ -67,6 +69,7 @@ switch ($order) { | @@ -67,6 +69,7 @@ switch ($order) { | ||
| 67 | // END 496814 Column Sorts are not persistant | 69 | // END 496814 Column Sorts are not persistant |
| 68 | 70 | ||
| 69 | 71 | ||
| 72 | +//if the user does not have permission to view the folder | ||
| 70 | if(check_auth($parent, "folder_view", $userid) != "1") { | 73 | if(check_auth($parent, "folder_view", $userid) != "1") { |
| 71 | printError($lang_nofolderaccess,""); | 74 | printError($lang_nofolderaccess,""); |
| 72 | exit; | 75 | exit; |
| @@ -123,40 +126,47 @@ if ($expand == 1) { | @@ -123,40 +126,47 @@ if ($expand == 1) { | ||
| 123 | print("\t\t<HR WIDTH=$default->table_collapse_width>\n"); | 126 | print("\t\t<HR WIDTH=$default->table_collapse_width>\n"); |
| 124 | } | 127 | } |
| 125 | 128 | ||
| 126 | -// | ||
| 127 | -// functions to create/show the links to be sorted on | ||
| 128 | -// | ||
| 129 | -function show_link($column,$sortname,$sortvalue,$order,$sess,$expand,$parent,$lang_title,$url) { | 129 | +/** |
| 130 | +* Creates links that can be sorted | ||
| 131 | +* | ||
| 132 | +* @param $column current column | ||
| 133 | +* @param $sortname | ||
| 134 | +* @param $sortvalue ASC or DESC | ||
| 135 | +* @param $order column to order by | ||
| 136 | +* @param $sess | ||
| 137 | +* @param $expand | ||
| 138 | +* @param $parent | ||
| 139 | +* @param $lang_title | ||
| 140 | +* @param $url | ||
| 141 | +*/ | ||
| 130 | 142 | ||
| 131 | - if ($sortvalue == "ASC") | ||
| 132 | - { | ||
| 133 | - print("\t\t\t\t<TD align=left><A HREF='browse.php?sess=$sess&expand=$expand&parent=$parent&order=$column&$sortname=DESC' STYLE='toplink'>$lang_title"); | ||
| 134 | - if ($order == $column) | ||
| 135 | - { | ||
| 136 | - print("<img border='0' src='$url/graphics/asc.gif' width='16' height='16'></A></TD>"); | ||
| 137 | - } | ||
| 138 | - else | ||
| 139 | - { | ||
| 140 | - print("</A></TD>"); | ||
| 141 | - } | 143 | +function show_link($column,$sortname,$sortvalue,$order,$sess,$expand,$parent,$lang_title,$url) { |
| 142 | 144 | ||
| 143 | - } | ||
| 144 | - else | ||
| 145 | - { | ||
| 146 | - print("\t\t\t\t<TD align=left><A HREF='browse.php?sess=$sess&expand=$expand&parent=$parent&order=$column&$sortname=ASC' STYLE='toplink'>$lang_title"); | ||
| 147 | - if ($order == $column) | ||
| 148 | - { | ||
| 149 | - print("<img border='0' src='$url/graphics/desc.gif' width='16' height='16'></A></TD>"); | ||
| 150 | - } | ||
| 151 | - else | ||
| 152 | - { | ||
| 153 | - print("</A></TD>"); | ||
| 154 | - } | ||
| 155 | - } | 145 | + if ($sortvalue == "ASC") { |
| 146 | + print("\t\t\t\t<TD align=left><A HREF='browse.php?sess=$sess&expand=$expand&parent=$parent&order=$column&$sortname=DESC' STYLE='toplink'>$lang_title"); | ||
| 147 | + if ($order == $column) | ||
| 148 | + { | ||
| 149 | + print("<img border='0' src='$url/graphics/asc.gif' width='16' height='16'></A></TD>"); | ||
| 150 | + } | ||
| 151 | + else | ||
| 152 | + { | ||
| 153 | + print("</A></TD>"); | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + } | ||
| 157 | + else { | ||
| 158 | + print("\t\t\t\t<TD align=left><A HREF='browse.php?sess=$sess&expand=$expand&parent=$parent&order=$column&$sortname=ASC' STYLE='toplink'>$lang_title"); | ||
| 159 | + if ($order == $column) | ||
| 160 | + { | ||
| 161 | + print("<img border='0' src='$url/graphics/desc.gif' width='16' height='16'></A></TD>"); | ||
| 162 | + } | ||
| 163 | + else { | ||
| 164 | + print("</A></TD>"); | ||
| 165 | + } | ||
| 166 | + } | ||
| 156 | } | 167 | } |
| 157 | 168 | ||
| 158 | 169 | ||
| 159 | - | ||
| 160 | if ($expand == 1) { | 170 | if ($expand == 1) { |
| 161 | print("\t\t\t<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border><TR BGCOLOR='$default->table_header_bg'>"); | 171 | print("\t\t\t<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border><TR BGCOLOR='$default->table_header_bg'>"); |
| 162 | show_link("name","sortname",$sortname,$order,$sess,$expand,$parent,$lang_title,$default->owl_root_url); | 172 | show_link("name","sortname",$sortname,$order,$sess,$expand,$parent,$lang_title,$default->owl_root_url); |
| @@ -209,7 +219,9 @@ if ($order == "creatorid") { | @@ -209,7 +219,9 @@ if ($order == "creatorid") { | ||
| 209 | //********************** | 219 | //********************** |
| 210 | 220 | ||
| 211 | while($sql->next_record()) { | 221 | while($sql->next_record()) { |
| 222 | + //if the current user has a restricted view | ||
| 212 | if($default->restrict_view == 1) { | 223 | if($default->restrict_view == 1) { |
| 224 | + //if the current user does not have permission to view the folder | ||
| 213 | if(!check_auth($sql->f("id"), "folder_view", $userid)) | 225 | if(!check_auth($sql->f("id"), "folder_view", $userid)) |
| 214 | continue; | 226 | continue; |
| 215 | } | 227 | } |