- Timestamp:
- Oct 25, 2012, 2:15:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120905/dvodist/www-util/ipp.php
r34551 r34609 1 1 <?php 2 2 3 global $realroot; 4 $realroot = "/dvodist"; 3 global $rootdir; 5 4 6 5 function head ($title) { … … 77 76 } 78 77 79 global $r ealroot;78 global $rootdir; 80 79 81 80 // hi-lite the current page (use select-style, not style) 82 81 $thisname = $_SERVER[SCRIPT_NAME]; 83 $page = $r ealroot. $base;82 $page = $rootdir . $base; 84 83 if ($page == $thisname) { 85 84 $style = trim($line[1]); … … 121 120 122 121 function dirlist ($source) { 122 if (!file_exists($source)) return; 123 123 124 $file = fopen ($source, "r"); 124 125 echo "<table class=\"dirlist\">\n"; … … 139 140 // } 140 141 141 if (count($line) != 4) continue; 142 143 $name = trim($line[0]); 144 $type = trim($line[1]); 145 $style = trim($line[2]); 146 $info = trim($line[3]); 142 if ((count($line) != 4) && (count($line) != 5)) continue; 143 144 // support both the old and new style tables: 145 // old: name | type | style | info 146 // new: name | link | type | style | info 147 148 if (count($line) == 4) { 149 echo "count = 4<br>\n"; 150 $name = trim($line[0]); 151 $type = trim($line[1]); 152 $style = trim($line[2]); 153 $info = trim($line[3]); 154 $link = $name; 155 } 156 if (count($line) == 5) { 157 echo "count = 5<br>\n"; 158 $name = trim($line[0]); 159 $link = trim($line[1]); 160 $type = trim($line[2]); 161 $style = trim($line[3]); 162 $info = trim($line[4]); 163 } 147 164 148 165 switch ($type) { … … 172 189 if (ereg ('^[:blank:]*#', $line[0])) continue; 173 190 if (count($line) < 2) continue; 174 if (count($line) != 4) continue; 175 176 $name = trim($line[0]); 177 $type = trim($line[1]); 178 $style = trim($line[2]); 179 $info = trim($line[3]); 191 192 if ((count($line) != 4) && (count($line) != 5)) continue; 193 194 // support both the old and new style tables: 195 // old: name | type | style | info 196 // new: name | link | type | style | info 197 198 if (count($line) == 4) { 199 $name = trim($line[0]); 200 $type = trim($line[1]); 201 $style = trim($line[2]); 202 $info = trim($line[3]); 203 $link = $name; 204 } 205 if (count($line) == 5) { 206 $name = trim($line[0]); 207 $link = trim($line[1]); 208 $type = trim($line[2]); 209 $style = trim($line[3]); 210 $info = trim($line[4]); 211 } 180 212 181 213 switch ($type) { … … 195 227 196 228 function verbatim ($source) { 229 if (!file_exists($source)) return; 230 197 231 $file = fopen ($source, "r"); 198 232 … … 218 252 // lines which start with @ are processed by 'dirlist', all others are processed by Markdown 219 253 function do_markdown ($source) { 254 if (!file_exists($source)) return; 255 220 256 $file = fopen ($source, "r"); 221 257
Note:
See TracChangeset
for help on using the changeset viewer.
