Ejemplo n.º 1
0
/**
 * @version $Id: footer.php 107 2008-07-22 17:27:12Z soeren $
 * @package eXtplorer
 * @copyright soeren 2007
 * @author The eXtplorer project (http://sourceforge.net/projects/extplorer)
 * @author The  The QuiX project (http://quixplorer.sourceforge.net)
 * 
 * @license
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 * 
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 * 
 * Alternatively, the contents of this file may be used under the terms
 * of the GNU General Public License Version 2 or later (the "GPL"), in
 * which case the provisions of the GPL are applicable instead of
 * those above. If you wish to allow use of your version of this file only
 * under the terms of the GPL and not to allow others to use
 * your version of this file under the MPL, indicate your decision by
 * deleting  the provisions above and replace  them with the notice and
 * other provisions required by the GPL.  If you do not delete
 * the provisions above, a recipient may use your version of this file
 * under either the MPL or the GPL."
 * 
 * Shows the About Box!
 */
function show_about()
{
    // footer for html-page
    echo "\n<div id=\"ext_footer\" style=\"text-align:center;\">\r\n\t<img src=\"" . _EXT_URL . "/images/MangosWeb_small.png\" align=\"middle\" alt=\"Mangosweb Enhanced Logo\" />\r\n\t<br />\r\n\t" . ext_Lang::msg('your_version') . ": <a href=\"" . $GLOBALS['ext_home'] . "\" target=\"_blank\">eXtplorer {$GLOBALS['ext_version']}</a>\r\n\t<br />\r\n (<a href=\"http://virtuemart.net/index2.php?option=com_versions&amp;catid=5&amp;myVersion=" . $GLOBALS['ext_version'] . "\" onclick=\"javascript:void window.open('http://virtuemart.net/index2.php?option=com_versions&catid=5&myVersion=" . $GLOBALS['ext_version'] . "', 'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=580,directories=no,location=no'); return false;\" title=\"" . $GLOBALS["messages"]["check_version"] . "\">" . $GLOBALS["messages"]["check_version"] . "</a>)\r\n\t\r\n\t";
    if (function_exists("disk_free_space")) {
        $size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } elseif (function_exists("diskfreespace")) {
        $size = diskfreespace($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } else {
        $free = "?";
    }
    echo '<br />' . $GLOBALS["messages"]["miscfree"] . ": " . $free . " \n";
    if (extension_loaded("posix")) {
        $owner_info = '<br /><br />' . ext_Lang::msg('current_user') . ' ';
        if (ext_isFTPMode()) {
            $my_user_info = posix_getpwnam($_SESSION['ftp_login']);
            $my_group_info = posix_getgrgid($my_user_info['gid']);
        } else {
            $my_user_info = posix_getpwuid(posix_geteuid());
            $my_group_info = posix_getgrgid(posix_getegid());
        }
        $owner_info .= $my_user_info['name'] . ' (' . $my_user_info['uid'] . '), ' . $my_group_info['name'] . ' (' . $my_group_info['gid'] . ')';
        echo $owner_info;
    }
    echo "\r\n\t</div>";
}
Ejemplo n.º 2
0
function list_dir($dir)
{
    // list directory contents
    global $dir_up, $mosConfig_live_site, $_VERSION;
    $allow = ($GLOBALS["permissions"] & 01) == 01;
    $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02;
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        ext_Result::sendResult('', false, $dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $dirs = explode("/", $dir);
    $implode = "";
    $dir_links = "<a href=\"" . make_link("list", "", null) . "\">..</a>&nbsp;/&nbsp;";
    foreach ($dirs as $directory) {
        if ($directory != "") {
            $implode .= $directory . "/";
            $dir_links .= "<a href=\"" . make_link("list", $implode, null) . "\">{$directory}</a>&nbsp;/&nbsp;";
        }
    }
    echo '<div class="componentheading">' . $GLOBALS["messages"]["actdir"] . ": " . $dir_links . '</div>';
    // Sorting of items
    $images = "&nbsp;<img width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" src=\"" . _EXT_URL . "/images/";
    if ($GLOBALS["direction"] == "ASC") {
        $_srt = "DESC";
        $images .= "_arrowup.gif\" alt=\"^\">";
    } else {
        $_srt = "ASC";
        $images .= "_arrowdown.gif\" alt=\"v\">";
    }
    // Toolbar
    /*echo "<br><table width=\"95%\"><tr><td><table><tr>\n";
    	
    	// PARENT DIR
    	echo "<td>";
    	if( $dir != "" ) {
    	  echo "<a href=\"".make_link("list",$dir_up,NULL)."\">";
    	  echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/_up.png\" ";
    	  echo "alt=\"".$GLOBALS["messages"]["uplink"]."\" title=\"".$GLOBALS["messages"]["uplink"]."\"></a>";
    	}
    	echo "</td>\n";
    	// HOME DIR
    	echo "<td><a href=\"".make_link("list",NULL,NULL)."\">";
    	echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/_home.gif\" ";
    	echo "alt=\"".$GLOBALS["messages"]["homelink"]."\" title=\"".$GLOBALS["messages"]["homelink"]."\"></a></td>\n";
    	// RELOAD
    	echo "<td><a href=\"javascript:location.reload();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    	echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_refresh.gif\" alt=\"".$GLOBALS["messages"]["reloadlink"];
    	echo "\" title=\"".$GLOBALS["messages"]["reloadlink"]."\"></A></td>\n";
    	// SEARCH
    	echo "<td><a href=\"".make_link("search",$dir,NULL)."\">";
    	echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/_search.gif\" ";
    	echo "alt=\"".$GLOBALS["messages"]["searchlink"]."\" title=\"".$GLOBALS["messages"]["searchlink"];
    	echo "\"></a></td>\n";
    	
    	echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    	
    	// Joomla Sysinfo
    	echo "<td><a href=\"".make_link("sysinfo",$dir,NULL)."\">";
    	echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/systeminfo.gif\" ";
    	echo "alt=\"" . $GLOBALS['messages']['mossysinfolink'] . "\" title=\"" .$GLOBALS['messages']['mossysinfolink'] . "\"></a></td>\n";
    	
    	echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    	
    	if($allow) {
    		// COPY
    		echo "<td><a href=\"javascript:Copy();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_copy.gif\" alt=\"".$GLOBALS["messages"]["copylink"];
    		echo "\" title=\"".$GLOBALS["messages"]["copylink"]."\"></a></td>\n";
    		// MOVE
    		echo "<td><a href=\"javascript:Move();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_move.gif\" alt=\"".$GLOBALS["messages"]["movelink"];
    		echo "\" title=\"".$GLOBALS["messages"]["movelink"]."\"></A></td>\n";
    		// DELETE
    		echo "<td><a href=\"javascript:Delete();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_delete.gif\" alt=\"".$GLOBALS["messages"]["dellink"];
    		echo "\" title=\"".$GLOBALS["messages"]["dellink"]."\"></A></td>\n";
    		// CHMOD
    		echo "<td><a href=\"javascript:Chmod();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_chmod.gif\" alt=\"chmod\" title=\"" . $GLOBALS['messages']['chmodlink'] . "\"></a></td>\n";
    		// UPLOAD
    		if(ini_get("file_uploads")) {
    			echo "<td><a href=\"".make_link("upload",$dir,NULL)."\">";
    			echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    			echo "src=\""._EXT_URL."/images/_upload.gif\" alt=\"".$GLOBALS["messages"]["uploadlink"];
    			echo "\" title=\"".$GLOBALS["messages"]["uploadlink"]."\"></A></td>\n";
    		} else {
    			echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    			echo "src=\""._EXT_URL."/images/_upload_.gif\" alt=\"".$GLOBALS["messages"]["uploadlink"];
    			echo "\" title=\"".$GLOBALS["messages"]["uploadlink"]."\"></td>\n";
    		}
    		// ARCHIVE
    		if($GLOBALS["zip"] || $GLOBALS["tar"] || $GLOBALS["tgz"]) {
    			echo "<td><a href=\"javascript:Archive();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    			echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_archive.gif\" alt=\"".$GLOBALS["messages"]["comprlink"];
    			echo "\" title=\"".$GLOBALS["messages"]["comprlink"]."\"></A></td>\n";
    		}
    	} else {
    		// COPY
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_copy_.gif\" alt=\"".$GLOBALS["messages"]["copylink"]."\" title=\"";
    		echo $GLOBALS["messages"]["copylink"]."\"></td>\n";
    		// MOVE
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_move_.gif\" alt=\"".$GLOBALS["messages"]["movelink"]."\" title=\"";
    		echo $GLOBALS["messages"]["movelink"]."\"></td>\n";
    		// DELETE
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_delete_.gif\" alt=\"".$GLOBALS["messages"]["dellink"]."\" title=\"";
    		echo $GLOBALS["messages"]["dellink"]."\"></td>\n";
    		// UPLOAD
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_upload_.gif\" alt=\"".$GLOBALS["messages"]["uplink"];
    		echo "\" title=\"".$GLOBALS["messages"]["uplink"]."\"></td>\n";
    	}
    
    	// ADMIN & LOGOUT
    	if($GLOBALS["require_login"]) {
    		echo "<td>::</td>";
    		// ADMIN
    		if($admin) {
    			echo "<td><a href=\"".make_link("admin",$dir,NULL)."\">";
    			echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    			echo "src=\""._EXT_URL."/images/_admin.gif\" alt=\"".$GLOBALS["messages"]["adminlink"]."\" title=\"";
    			echo $GLOBALS["messages"]["adminlink"]."\"></A></td>\n";
    		}
    		// LOGOUT
    		echo "<td><a href=\"".make_link("logout",NULL,NULL)."\">";
    		echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_logout.gif\" alt=\"".$GLOBALS["messages"]["logoutlink"]."\" title=\"";
    		echo $GLOBALS["messages"]["logoutlink"]."\"></a></td>\n";
    	}
    	// Logo
    	echo "<td style=\"padding-left:10px;\">";
    	//echo "<div style=\"margin-left:10px;float:right;\" width=\"305\" >";
    	echo "<a href=\"".$GLOBALS['ext_home']."\" target=\"_blank\" title=\"joomlaXplorer Project\"><img border=\"0\" align=\"absmiddle\" id=\"ext_logo\" style=\"filter:alpha(opacity=10);-moz-opacity:.10;opacity:.10;\" onmouseover=\"opacity('ext_logo', 60, 99, 500);\" onmouseout=\"opacity('ext_logo', 100, 60, 500);\" ";
    	echo "src=\""._EXT_URL."/images/logo.gif\" align=\"right\" alt=\"" . $GLOBALS['messages']['logolink'] . "\"></a>";
    	//echo "</div>";
    	echo "</td>\n";
    	
    	echo "</tr></table></td>\n";
    	
    	// Create File / Dir
    	
    	if($allow && is_writable($GLOBALS['home_dir'].'/'.$dir)) {
    		echo "<td align=\"right\"><table><form action=\"".make_link("mkitem",$dir,NULL)."\" method=\"post\">\n<tr><td>";
    		echo "<select name=\"mktype\"><option value=\"file\">".$GLOBALS["mimes"]["file"]."</option>";
    		echo "<option value=\"dir\">".$GLOBALS["mimes"]["dir"]."</option></select>\n";
    		echo "<input name=\"mkname\" type=\"text\" size=\"15\">";
    		echo "<input type=\"submit\" value=\"".$GLOBALS["messages"]["btncreate"];
    		echo "\"></td></tr></form></table></td>\n";
    	}
    	
    	echo "</tr></table>\n";
    	*/
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<table width=\"95%\" cellpadding=\"5\" cellspacing=\"2\"><tr class=\"sectiontableheader\">\n";
    echo "<th width=\"44%\"><b>\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $images;
    }
    echo "</a></b></td>\n<th width=\"10%\"><b>";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $images;
    }
    echo "</a></b></th>\n<th width=\"12%\" ><b>";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $images;
    }
    echo "</a></b></th>\n<th width=\"12%\"><b>";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $images;
    }
    echo "</a></b></th></tr>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list), $allow);
    // print number of items & total filesize
    echo "<tr><td colspan=\"4\"><hr/></td></tr><tr>\n<td>&nbsp;</td>";
    echo "<td>" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " " . parse_file_size($tot_file_size) . "</td>\n";
    echo "<td>&nbsp;</td><td>&nbsp;</td>";
    echo "</tr>\n<tr><td colspan=\"4\"><hr/></td></tr></table>\n";
}
Ejemplo n.º 3
0
function list_dir($dir)
{
    // list directory contents
    global $dir_up, $mosConfig_live_site, $_VERSION;
    ?>
	<script type="text/javascript" src="<?php 
    echo $mosConfig_live_site;
    ?>
/includes/js/overlib_mini.js"></script>
	<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
	<?php 
    $allow = ($GLOBALS["permissions"] & 01) == 01;
    $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02;
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        show_error($dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $dirs = explode("/", $dir);
    $implode = "";
    $dir_links = "<a href=\"" . make_link("list", "", null) . "\">..</a>/";
    foreach ($dirs as $directory) {
        if ($directory != "") {
            $implode .= $directory . "/";
            $dir_links .= "<a href=\"" . make_link("list", $implode, null) . "\">{$directory}</a>/";
        }
    }
    show_header($GLOBALS["messages"]["actdir"] . ": " . $dir_links);
    // Javascript functions:
    include _QUIXPLORER_PATH . "/include/javascript.php";
    // Sorting of items
    $images = "&nbsp;<img width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/";
    if ($GLOBALS["srt"] == "yes") {
        $_srt = "no";
        $images .= "_arrowup.gif\" alt=\"^\">";
    } else {
        $_srt = "yes";
        $images .= "_arrowdown.gif\" alt=\"v\">";
    }
    // Toolbar
    echo "<br><table width=\"95%\"><tr><td><table><tr>\n";
    // PARENT DIR
    echo "<td>";
    if ($dir != "") {
        echo "<a href=\"" . make_link("list", $dir_up, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_up.png\" ";
        echo "alt=\"" . $GLOBALS["messages"]["uplink"] . "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"></a>";
    }
    echo "</td>\n";
    // HOME DIR
    echo "<td><a href=\"" . make_link("list", NULL, NULL) . "\">";
    echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_home.gif\" ";
    echo "alt=\"" . $GLOBALS["messages"]["homelink"] . "\" title=\"" . $GLOBALS["messages"]["homelink"] . "\"></a></td>\n";
    // RELOAD
    echo "<td><a href=\"javascript:location.reload();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_refresh.gif\" alt=\"" . $GLOBALS["messages"]["reloadlink"];
    echo "\" title=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></td>\n";
    // SEARCH
    if (!jx_isFTPMode()) {
        echo "<td><a href=\"" . make_link("search", $dir, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_search.gif\" ";
        echo "alt=\"" . $GLOBALS["messages"]["searchlink"] . "\" title=\"" . $GLOBALS["messages"]["searchlink"];
        echo "\"></a></td>\n";
    }
    echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    // Joomla Sysinfo
    echo "<td><a href=\"" . make_link("sysinfo", $dir, NULL) . "\">";
    echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/systeminfo.gif\" ";
    echo "alt=\"" . $GLOBALS['messages']['mossysinfolink'] . "\" title=\"" . $GLOBALS['messages']['mossysinfolink'] . "\"></a></td>\n";
    echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    if ($allow) {
        // COPY
        echo "<td><a href=\"javascript:Copy();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_copy.gif\" alt=\"" . $GLOBALS["messages"]["copylink"];
        echo "\" title=\"" . $GLOBALS["messages"]["copylink"] . "\"></a></td>\n";
        // MOVE
        echo "<td><a href=\"javascript:Move();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_move.gif\" alt=\"" . $GLOBALS["messages"]["movelink"];
        echo "\" title=\"" . $GLOBALS["messages"]["movelink"] . "\"></A></td>\n";
        // DELETE
        echo "<td><a href=\"javascript:Delete();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_delete.gif\" alt=\"" . $GLOBALS["messages"]["dellink"];
        echo "\" title=\"" . $GLOBALS["messages"]["dellink"] . "\"></A></td>\n";
        // CHMOD
        echo "<td><a href=\"javascript:Chmod();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_chmod.gif\" alt=\"chmod\" title=\"" . $GLOBALS['messages']['chmodlink'] . "\"></a></td>\n";
        // UPLOAD
        if (ini_get("file_uploads")) {
            echo "<td><a href=\"" . make_link("upload", $dir, NULL) . "\">";
            echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_upload.gif\" alt=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></A></td>\n";
        } else {
            echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_upload_.gif\" alt=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></td>\n";
        }
        // ARCHIVE
        if (($GLOBALS["zip"] || $GLOBALS["tar"] || $GLOBALS["tgz"]) && !jx_isFTPMode()) {
            echo "<td><a href=\"javascript:Archive();\"><img border=\"0\" width=\"22\" height=\"22\" ";
            echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_archive.gif\" alt=\"" . $GLOBALS["messages"]["comprlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["comprlink"] . "\"></a></td>\n";
        }
    } else {
        // COPY
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_copy_.gif\" alt=\"" . $GLOBALS["messages"]["copylink"] . "\" title=\"";
        echo $GLOBALS["messages"]["copylink"] . "\"></td>\n";
        // MOVE
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_move_.gif\" alt=\"" . $GLOBALS["messages"]["movelink"] . "\" title=\"";
        echo $GLOBALS["messages"]["movelink"] . "\"></td>\n";
        // DELETE
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_delete_.gif\" alt=\"" . $GLOBALS["messages"]["dellink"] . "\" title=\"";
        echo $GLOBALS["messages"]["dellink"] . "\"></td>\n";
        // UPLOAD
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_upload_.gif\" alt=\"" . $GLOBALS["messages"]["uplink"];
        echo "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"></td>\n";
    }
    // ADMIN & LOGOUT
    if ($GLOBALS["require_login"]) {
        echo "<td>::</td>";
        // ADMIN
        if ($admin) {
            echo "<td><a href=\"" . make_link("admin", $dir, NULL) . "\">";
            echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_admin.gif\" alt=\"" . $GLOBALS["messages"]["adminlink"] . "\" title=\"";
            echo $GLOBALS["messages"]["adminlink"] . "\"></A></td>\n";
        }
        // LOGOUT
        echo "<td><a href=\"" . make_link("logout", NULL, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_logout.gif\" alt=\"" . $GLOBALS["messages"]["logoutlink"] . "\" title=\"";
        echo $GLOBALS["messages"]["logoutlink"] . "\"></a></td>\n";
    }
    // Logo
    echo "<td style=\"padding-left:10px;\">";
    //echo "<div style=\"margin-left:10px;float:right;\" width=\"305\" >";
    echo "<a href=\"" . $GLOBALS['jx_home'] . "\" target=\"_blank\" title=\"joomlaXplorer Project\"><img border=\"0\" align=\"absmiddle\" id=\"jx_logo\" style=\"filter:alpha(opacity=10);-moz-opacity:.10;opacity:.10;\" onmouseover=\"opacity('jx_logo', 60, 99, 500);\" onmouseout=\"opacity('jx_logo', 100, 60, 500);\" ";
    echo "src=\"" . _QUIXPLORER_URL . "/images/logo.gif\" align=\"right\" alt=\"" . $GLOBALS['messages']['logolink'] . "\"></a>";
    //echo "</div>";
    echo "</td>\n";
    echo "</tr></table></td>\n";
    // Create File / Dir
    if ($allow && @$GLOBALS['jx_File']->is_writable(get_abs_dir($dir))) {
        echo "<td align=\"right\">\n\t\t\t\t<form action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\" name=\"mkitemform\">\n\n\t\t\t\t<table><tr><td>\n\t\t\t\t\t<select name=\"mktype\" onchange=\"checkMkitemForm(this.options[this.selectedIndex])\">\n\t\t\t\t\t\t<option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>\n\t\t\t\t\t\t<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option>";
        if (!jx_isFTPMode() && !$GLOBALS['isWindows']) {
            echo "\t\t\t<option value=\"symlink\">" . $GLOBALS["mimes"]["symlink"] . "</option>\n";
        }
        echo "\t\t</select>\n\t\t\t\t\t<input name=\"symlink_target\" type=\"hidden\" size=\"25\" title=\"{$GLOBALS['messages']['symlink_target']}\" value=\"{$GLOBALS['mosConfig_absolute_path']}\" />\n\t\t\t\t\t<input name=\"mkname\" type=\"text\" size=\"15\" title=\"{$GLOBALS['messages']['nameheader']}\" />\n\t\t\t\t\t<input type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"] . "\" />\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td id=\"quick_jumpto\">" . list_bookmarks($dir) . "</td></tr>\n\t\t\t\t</table>\n\t\t\t\t<script type=\"text/javascript\">function checkMkitemForm( el ) { if( el.value =='symlink' ) document.mkitemform.symlink_target.type='text'; else document.mkitemform.symlink_target.type='hidden';} </script>\n\t\t\t\t</form>\n\t\t\t  </td>\n";
    } else {
        echo "<td align=\"right\">\n\t\t\t\t<table><tr><td id=\"quick_jumpto\">" . list_bookmarks($dir) . "</td></tr></table>\n\t\t\t </td>";
    }
    echo "</tr></table>\n";
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<form name=\"selform\" method=\"post\" action=\"" . make_link("post", $dir, null) . "\">\n\t<input type=\"hidden\" name=\"do_action\" /><input type=\"hidden\" name=\"first\" value=\"y\" />\n\t<table class=\"adminlist\" width=\"95%\">\n";
    if (extension_loaded("posix")) {
        $owner_info = '<th width="15%" class="title">' . $GLOBALS['messages']['miscowner'] . '&nbsp;';
        if (jx_isFTPMode()) {
            $my_user_info = posix_getpwnam($_SESSION['ftp_login']);
            $my_group_info = posix_getgrgid($my_user_info['gid']);
        } else {
            $my_user_info = posix_getpwuid(posix_geteuid());
            $my_group_info = posix_getgrgid(posix_getegid());
        }
        $owner_info .= mosTooltip(mysql_escape_string(sprintf($GLOBALS['messages']['miscownerdesc'], $my_user_info['name'], $my_user_info['uid'], $my_group_info['name'], $my_group_info['gid'])));
        // new [mic]
        $owner_info .= "</th>\n";
        $colspan = 8;
    } else {
        $owner_info = "";
        $colspan = 7;
    }
    // Table Header
    echo "<tr>\n\t<th width=\"2%\" class=\"title\">\n\t\t<input type=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\" />\n\t</th>\n\t<th width=\"34%\" class=\"title\">\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $images;
    }
    echo '</a>';
    echo "</th>\n\t<th width=\"10%\" class=\"title\">";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"14%\" class=\"title\">";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"14%\" class=\"title\">";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"2%\" class=\"title\">" . $GLOBALS["messages"]["permheader"] . "\n";
    echo "</th>";
    echo $owner_info;
    echo "<th width=\"10%\" class=\"title\">" . $GLOBALS["messages"]["actionheader"] . "</th>\n\t\n\t</tr>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list), $allow);
    // print number of items & total filesize
    echo "<tr><td colspan=\"{$colspan}\"><hr/></td></tr><tr>\n<td class=\"title\"></td>";
    echo "<td class=\"title\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
    if (function_exists("disk_free_space")) {
        $size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } elseif (function_exists("diskfreespace")) {
        $size = diskfreespace($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } else {
        $free = "?";
    }
    echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</td>\n";
    echo "<td class=\"title\">" . parse_file_size($tot_file_size) . "</td>\n";
    for ($i = 0; $i < $colspan - 3; ++$i) {
        echo "<td class=\"title\"></td>";
    }
    echo "</tr>\n<tr><td colspan=\"{$colspan}\"><hr/></td></tr></table>\n\t\t</form>";
    ?>
<script type="text/javascript"><!--
	// Uncheck all items (to avoid problems with new items)
	var ml = document.selform;
	var len = ml.elements.length;
	for(var i=0; i<len; ++i) {
		var e = ml.elements[i];
		if(e.name == "selitems[]" && e.checked == true) {
			e.checked=false;
		}
	}
	opacity('jx_logo', 10, 60, 2000);
// --></script>

<?php 
}
Ejemplo n.º 4
0
/**
 * This function assembles an array (list) of files or directories in the directory specified by $dir
 * The result array is send using JSON
 *
 * @param string $dir
 * @param string $sendWhat Can be "files" or "dirs"
 */
function send_dircontents($dir, $sendWhat = 'files')
{
    // print table of files
    global $dir_up, $mainframe;
    // make file & dir tables, & get total filesize & number of items
    get_dircontents($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    if ($sendWhat == 'files') {
        $list = $file_list;
    } elseif ($sendWhat == 'dirs') {
        $list = $dir_list;
    } else {
        $list = make_list($dir_list, $file_list);
    }
    $i = 0;
    $items['totalCount'] = count($list);
    $items['items'] = array();
    $dirlist = array();
    if ($sendWhat != 'dirs') {
        // Replaced array_splice, because it resets numeric indexes (like files or dirs with a numeric name)
        // Here we reduce the list to the range of $limit beginning at $start
        $a = 0;
        $output_array = array();
        foreach ($list as $key => $value) {
            if ($a >= $GLOBALS['start'] && $a - $GLOBALS['start'] < $GLOBALS['limit']) {
                $output_array[$key] = $value;
            }
            $a++;
        }
        $list = $output_array;
    }
    while (list($item, $info) = each($list)) {
        // link to dir / file
        if (is_array($info)) {
            $abs_item = $info;
            if (extension_loaded('posix')) {
                $user_info = posix_getpwnam($info['user']);
                $file_info['uid'] = $user_info['uid'];
                $file_info['gid'] = $user_info['gid'];
            }
        } else {
            $abs_item = get_abs_item(ext_TextEncoding::fromUTF8($dir), $item);
            $file_info = @stat($abs_item);
        }
        $is_dir = get_is_dir($abs_item);
        if ($GLOBALS['use_mb']) {
            if (ext_isFTPMode()) {
                $items['items'][$i]['name'] = $item;
            } else {
                if (mb_detect_encoding($item) == 'ASCII') {
                    $items['items'][$i]['name'] = ext_TextEncoding::toUTF8($item);
                } else {
                    $items['items'][$i]['name'] = ext_TextEncoding::toUTF8($item);
                }
            }
        } else {
            $items['items'][$i]['name'] = ext_isFTPMode() ? $item : ext_TextEncoding::toUTF8($item);
        }
        $items['items'][$i]['is_file'] = get_is_file($abs_item);
        $items['items'][$i]['is_archive'] = ext_isArchive($item) && !ext_isFTPMode();
        $items['items'][$i]['is_writable'] = $is_writable = @$GLOBALS['ext_File']->is_writable($abs_item);
        $items['items'][$i]['is_chmodable'] = $is_chmodable = @$GLOBALS['ext_File']->is_chmodable($abs_item);
        $items['items'][$i]['is_readable'] = $is_readable = @$GLOBALS['ext_File']->is_readable($abs_item);
        $items['items'][$i]['is_deletable'] = $is_deletable = @$GLOBALS['ext_File']->is_deletable($abs_item);
        $items['items'][$i]['is_editable'] = get_is_editable($abs_item);
        $items['items'][$i]['icon'] = _EXT_URL . "/images/" . get_mime_type($abs_item, "img");
        $items['items'][$i]['size'] = parse_file_size(get_file_size($abs_item));
        // type
        $items['items'][$i]['type'] = get_mime_type($abs_item, "type");
        // modified
        $items['items'][$i]['modified'] = parse_file_date(get_file_date($abs_item));
        // permissions
        $perms = get_file_perms($abs_item);
        if ($perms) {
            if (strlen($perms) > 3) {
                $perms = substr($perms, 2);
            }
            $items['items'][$i]['perms'] = $perms . ' (' . parse_file_perms($perms) . ')';
        } else {
            $items['items'][$i]['perms'] = ' (unknown) ';
        }
        $items['items'][$i]['perms'] = $perms . ' (' . parse_file_perms($perms) . ')';
        if (extension_loaded("posix")) {
            if ($file_info["uid"]) {
                $user_info = posix_getpwuid($file_info["uid"]);
                //$group_info = posix_getgrgid($file_info["gid"]);
                $items['items'][$i]['owner'] = $user_info["name"] . " (" . $file_info["uid"] . ")";
            } else {
                $items['items'][$i]['owner'] = " (unknown) ";
            }
        } else {
            $items['items'][$i]['owner'] = 'n/a';
        }
        if ($is_dir && $sendWhat != 'files') {
            $id = str_replace('/', $GLOBALS['separator'], $dir) . $GLOBALS['separator'] . $item;
            $id = str_replace($GLOBALS['separator'], '_RRR_', $id);
            $qtip = "<strong>" . ext_Lang::mime('dir', true) . "</strong><br /><strong>" . ext_Lang::msg('miscperms', true) . ":</strong> " . $perms . "<br />";
            $qtip .= '<strong>' . ext_Lang::msg('miscowner', true) . ':</strong> ' . $items['items'][$i]['owner'];
            if ($GLOBALS['use_mb']) {
                if (ext_isFTPMode()) {
                    $dirlist[] = array('text' => htmlspecialchars($item), 'id' => $id, 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
                } else {
                    if (mb_detect_encoding($item) == 'ASCII') {
                        $dirlist[] = array('text' => htmlspecialchars(ext_TextEncoding::toUTF8($item)), 'id' => utf8_encode($id), 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
                    } else {
                        $dirlist[] = array('text' => htmlspecialchars($item), 'id' => $id, 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
                    }
                }
            } else {
                $dirlist[] = array('text' => htmlspecialchars(ext_isFTPMode() ? $item : ext_TextEncoding::toUTF8($item)), 'id' => ext_isFTPMode() ? $id : ext_TextEncoding::toUTF8($id), 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
            }
        }
        if (!$is_dir && $sendWhat == 'files' || $sendWhat == 'both') {
            $i++;
        }
    }
    while (@ob_end_clean()) {
    }
    if ($sendWhat == 'dirs') {
        $result = $dirlist;
    } else {
        $result = $items;
    }
    $classname = class_exists('ext_Json') ? 'ext_Json' : 'Services_JSON';
    $json = new $classname();
    echo $json->encode($result);
    ext_exit();
}
Ejemplo n.º 5
0
function list_dir($dir)
{
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        show_error($dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $s_dir = $dir;
    if (strlen($s_dir) > 50) {
        $s_dir = "..." . substr($s_dir, -47);
    }
    show_header("<a href='javascript:history.go(-1);'><font color=#0a0a0a>Go Back to Problem List</font></a><br>" . $GLOBALS["messages"]["actdir"] . ": /" . get_rel_item("", $s_dir));
    // Javascript functions:
    include "./.include/javascript.php";
    // Sorting of items
    $_img = "&nbsp;<IMG width=\"10\" height=\"10\" border=\"0\" align=\"ABSMIDDLE\" src=\"_img/";
    if ($GLOBALS["srt"] == "yes") {
        $_srt = "no";
        $_img .= "_arrowup.gif\" ALT=\"^\">";
    } else {
        $_srt = "yes";
        $_img .= "_arrowdown.gif\" ALT=\"v\">";
    }
    // Toolbar
    echo "<BR><TABLE width=\"95%\"><TR><TD><TABLE><TR>\n";
    // PARENT DIR
    echo "<TD><A HREF=\"" . make_link("list", $dir_up, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"_img/_up.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["uplink"] . "\" TITLE=\"" . $GLOBALS["messages"]["uplink"] . "\"></A></TD>\n";
    // HOME DIR
    echo "<TD><A HREF=\"" . make_link("list", NULL, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"_img/_home.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["homelink"] . "\" TITLE=\"" . $GLOBALS["messages"]["homelink"] . "\"></A></TD>\n";
    // RELOAD
    echo "<TD><A HREF=\"javascript:location.reload();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
    echo "align=\"ABSMIDDLE\" src=\"_img/_refresh.gif\" ALT=\"" . $GLOBALS["messages"]["reloadlink"];
    echo "\" TITLE=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></TD>\n";
    // SEARCH
    echo "<TD><A HREF=\"" . make_link("search", $dir, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"_img/_search.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["searchlink"] . "\" TITLE=\"" . $GLOBALS["messages"]["searchlink"];
    echo "\"></A></TD>\n";
    echo "<TD>::</TD>";
    // print the edit buttons
    _print_edit_buttons($dir);
    // ADMIN & LOGOUT
    if (login_ok()) {
        echo "<TD>::</TD>";
        // ADMIN
        _print_link("admin", permissions_grant(NULL, NULL, "admin") || permissions_grant(NULL, NULL, "password"), $dir, NULL);
        // LOGOUT
        _print_link("logout", true, $dir, NULL);
    }
    echo "</TR></TABLE></TD>\n";
    // Create File / Dir
    if (permissions_grant($dir, NULL, "create")) {
        echo "<TD align=\"right\"><TABLE><FORM action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\">\n<TR><TD>";
        echo "<SELECT name=\"mktype\"><option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>";
        echo "<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option></SELECT>\n";
        echo "<INPUT name=\"mkname\" type=\"text\" size=\"15\">";
        echo "<INPUT type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"];
        echo "\"></TD></TR></FORM></TABLE></TD>\n";
    }
    echo "</TR></TABLE>\n";
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<TABLE WIDTH=\"95%\"><FORM name=\"selform\" method=\"POST\" action=\"" . make_link("post", $dir, NULL) . "\">\n";
    echo "<INPUT type=\"hidden\" name=\"do_action\"><INPUT type=\"hidden\" name=\"first\" value=\"y\">\n";
    // Table Header
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR><TD WIDTH=\"2%\" class=\"header\">\n";
    echo "<INPUT TYPE=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\"></TD>\n";
    echo "<TD WIDTH=\"44%\" class=\"header\"><B>\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"10%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"16%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"14%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $_img;
    }
    echo "</A></B></TD><TD WIDTH=\"8%\" class=\"header\"><B>" . $GLOBALS["messages"]["permheader"] . "</B>\n";
    echo "</TD><TD WIDTH=\"6%\" class=\"header\"><B>" . $GLOBALS["messages"]["actionheader"] . "</B></TD></TR>\n";
    echo "<TR><TD colspan=\"7\"><HR></TD></TR>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list));
    // print number of items & total filesize
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR>\n<TD class=\"header\"></TD>";
    echo "<TD class=\"header\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
    if (function_exists("disk_free_space")) {
        $free = parse_file_size(disk_free_space(get_abs_dir($dir)));
    } elseif (function_exists("diskfreespace")) {
        $free = parse_file_size(diskfreespace(get_abs_dir($dir)));
    } else {
        $free = "?";
    }
    // echo "Total: ".parse_file_size(disk_total_space(get_abs_dir($dir))).", ";
    echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</TD>\n";
    echo "<TD class=\"header\">" . parse_file_size($tot_file_size) . "</TD>\n";
    for ($i = 0; $i < 4; ++$i) {
        echo "<TD class=\"header\"></TD>";
    }
    echo "</TR>\n<TR><TD colspan=\"7\"><HR></TD></TR></FORM></TABLE>\n";
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	// Uncheck all items (to avoid problems with new items)
	var ml = document.selform;
	var len = ml.elements.length;
	for(var i=0; i<len; ++i) {
		var e = ml.elements[i];
		if(e.name == "selitems[]" && e.checked == true) {
			e.checked=false;
		}
	}
// -->
</script><?php 
}
Ejemplo n.º 6
0
/**
 * 
 * Shows eXtplorer information
 */
function show_about()
{
    //$sess = print_r($_SESSION,true);
    //echo str_replace(array("\r", "\n"),array('',''),$sess);
    echo "\n<div id=\"ext_footer\" style=\"text-align:center;\">\n\t<img src=\"" . _EXT_URL . "/images/eXtplorer_logo.png\" align=\"middle\" alt=\"eXtplorer Logo\" />\n\t<br />\n\t" . ext_Lang::msg('your_version') . ": <a href=\"" . $GLOBALS['ext_home'] . "\" target=\"_blank\">eXtplorer {$GLOBALS['ext_version']}</a>\n\t<br />\n (<a href=\"http://extplorer.net/version_check?myVersion=" . $GLOBALS['ext_version'] . "\" onclick=\"javascript:void window.open('http://extplorer.net/version_check?myVersion=" . $GLOBALS['ext_version'] . "', 'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=580,directories=no,location=no'); return false;\" title=\"" . $GLOBALS["messages"]["check_version"] . "\">" . $GLOBALS["messages"]["check_version"] . "</a>)\n\n\t";
    $size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']);
    $free = parse_file_size($size);
    echo '<br />' . $GLOBALS["messages"]["miscfree"] . ": " . $free . " \n";
    if (extension_loaded("posix")) {
        $owner_info = '<br /><br />' . ext_Lang::msg('current_user') . ' ';
        if (ext_isFTPMode()) {
            $my_user_info = posix_getpwnam($_SESSION['ftp_login']);
            $my_group_info = posix_getgrgid($my_user_info['gid']);
        } else {
            $my_user_info = posix_getpwuid(posix_geteuid());
            $my_group_info = posix_getgrgid(posix_getegid());
        }
        $owner_info .= $my_user_info['name'] . ' (' . $my_user_info['uid'] . '), ' . $my_group_info['name'] . ' (' . $my_group_info['gid'] . ')';
        echo $owner_info;
    }
    echo "\n\t</div>";
}
Ejemplo n.º 7
0
function list_dir($dir)
{
    // list directory contents
    global $QUIXPATH;
    $allow = ($GLOBALS["permissions"] & 01) == 01;
    $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02;
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        show_error($dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $s_dir = $dir;
    if (strlen($s_dir) > 50) {
        $s_dir = "..." . substr($s_dir, -47);
    }
    show_header($GLOBALS["messages"]["actdir"] . ": /" . get_rel_item("", $s_dir));
    // Javascript functions:
    include $QUIXPATH . ".include/javascript.php";
    // Sorting of items
    $_img = "&nbsp;<IMG width=\"10\" height=\"10\" border=\"0\" align=\"ABSMIDDLE\" src=\"../files/quixexplorer/";
    if ($GLOBALS["srt"] == "yes") {
        $_srt = "no";
        $_img .= "_arrowup.gif\" ALT=\"^\">";
    } else {
        $_srt = "yes";
        $_img .= "_arrowdown.gif\" ALT=\"v\">";
    }
    // Toolbar
    echo "<BR><TABLE width=\"95%\"><TR><TD><TABLE><TR>\n";
    // PARENT DIR
    echo "<TD><A HREF=\"" . make_link("list", $dir_up, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_up.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["uplink"] . "\" TITLE=\"" . $GLOBALS["messages"]["uplink"] . "\"></A></TD>\n";
    // HOME DIR
    echo "<TD><A HREF=\"" . make_link("list", NULL, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_home.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["homelink"] . "\" TITLE=\"" . $GLOBALS["messages"]["homelink"] . "\"></A></TD>\n";
    // RELOAD
    echo "<TD><A HREF=\"javascript:location.reload();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
    echo "align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_refresh.gif\" ALT=\"" . $GLOBALS["messages"]["reloadlink"];
    echo "\" TITLE=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></TD>\n";
    // SEARCH
    echo "<TD><A HREF=\"" . make_link("search", $dir, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_search.gif\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["searchlink"] . "\" TITLE=\"" . $GLOBALS["messages"]["searchlink"];
    echo "\"></A></TD>\n";
    echo "<TD>::</TD>";
    if ($allow) {
        // COPY
        echo "<TD><A HREF=\"javascript:Copy();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
        echo "align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_copy.gif\" ALT=\"" . $GLOBALS["messages"]["copylink"];
        echo "\" TITLE=\"" . $GLOBALS["messages"]["copylink"] . "\"></A></TD>\n";
        // MOVE
        echo "<TD><A HREF=\"javascript:Move();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
        echo "align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_move.gif\" ALT=\"" . $GLOBALS["messages"]["movelink"];
        echo "\" TITLE=\"" . $GLOBALS["messages"]["movelink"] . "\"></A></TD>\n";
        // DELETE
        echo "<TD><A HREF=\"javascript:Delete();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
        echo "align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_delete.gif\" ALT=\"" . $GLOBALS["messages"]["dellink"];
        echo "\" TITLE=\"" . $GLOBALS["messages"]["dellink"] . "\"></A></TD>\n";
        // UPLOAD
        if (get_cfg_var("file_uploads")) {
            echo "<TD><A HREF=\"" . make_link("upload", $dir, NULL) . "\">";
            echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
            echo "src=\"../files/quixexplorer/_upload.gif\" ALT=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" TITLE=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></A></TD>\n";
        } else {
            echo "<TD><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
            echo "src=\"../files/quixexplorer/_upload_.gif\" ALT=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" TITLE=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></TD>\n";
        }
        // ARCHIVE
        if ($GLOBALS["zip"] || $GLOBALS["tar"] || $GLOBALS["tgz"]) {
            echo "<TD><A HREF=\"javascript:Archive();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
            echo "align=\"ABSMIDDLE\" src=\"../files/quixexplorer/_archive.gif\" ALT=\"" . $GLOBALS["messages"]["comprlink"];
            echo "\" TITLE=\"" . $GLOBALS["messages"]["comprlink"] . "\"></A></TD>\n";
        }
    } else {
        // COPY
        echo "<TD><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
        echo "src=\"../files/quixexplorer/_copy_.gif\" ALT=\"" . $GLOBALS["messages"]["copylink"] . "\" TITLE=\"";
        echo $GLOBALS["messages"]["copylink"] . "\"></TD>\n";
        // MOVE
        echo "<TD><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
        echo "src=\"../files/quixexplorer/_move_.gif\" ALT=\"" . $GLOBALS["messages"]["movelink"] . "\" TITLE=\"";
        echo $GLOBALS["messages"]["movelink"] . "\"></TD>\n";
        // DELETE
        echo "<TD><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
        echo "src=\"../files/quixexplorer/_delete_.gif\" ALT=\"" . $GLOBALS["messages"]["dellink"] . "\" TITLE=\"";
        echo $GLOBALS["messages"]["dellink"] . "\"></TD>\n";
        // UPLOAD
        echo "<TD><IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
        echo "src=\"../files/quixexplorer/_upload_.gif\" ALT=\"" . $GLOBALS["messages"]["uplink"];
        echo "\" TITLE=\"" . $GLOBALS["messages"]["uplink"] . "\"></TD>\n";
    }
    // ADMIN & LOGOUT
    if ($GLOBALS["require_login"]) {
        echo "<TD>::</TD>";
        // ADMIN
        if ($admin) {
            echo "<TD><A HREF=\"" . make_link("admin", $dir, NULL) . "\">";
            echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
            echo "src=\"../files/quixexplorer/_admin.gif\" ALT=\"" . $GLOBALS["messages"]["adminlink"] . "\" TITLE=\"";
            echo $GLOBALS["messages"]["adminlink"] . "\"></A></TD>\n";
        }
        // LOGOUT
        echo "<TD><A HREF=\"" . make_link("logout", NULL, NULL) . "\">";
        echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" ";
        echo "src=\"../files/quixexplorer/_logout.gif\" ALT=\"" . $GLOBALS["messages"]["logoutlink"] . "\" TITLE=\"";
        echo $GLOBALS["messages"]["logoutlink"] . "\"></A></TD>\n";
    }
    echo "</TR></TABLE></TD>\n";
    // Create File / Dir
    if ($allow) {
        echo "<TD align=\"right\"><TABLE><FORM action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\">\n<TR><TD>";
        echo "<SELECT name=\"mktype\"><option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>";
        echo "<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option></SELECT>\n";
        echo "<INPUT name=\"mkname\" type=\"text\" size=\"15\">";
        echo "<INPUT type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"];
        echo "\"></TD></TR></FORM></TABLE></TD>\n";
    }
    echo "</TR></TABLE>\n";
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<TABLE WIDTH=\"95%\"><FORM name=\"selform\" method=\"POST\" action=\"" . make_link("post", $dir, NULL) . "\">\n";
    echo "<INPUT type=\"hidden\" name=\"do_action\"><INPUT type=\"hidden\" name=\"first\" value=\"y\">\n";
    // Table Header
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR><TD WIDTH=\"2%\" class=\"header\">\n";
    echo "<INPUT TYPE=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\"></TD>\n";
    echo "<TD WIDTH=\"44%\" class=\"header\"><B>\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"10%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"16%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"14%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $_img;
    }
    echo "</A></B></TD><TD WIDTH=\"8%\" class=\"header\"><B>" . $GLOBALS["messages"]["permheader"] . "</B>\n";
    echo "</TD><TD WIDTH=\"6%\" class=\"header\"><B>" . $GLOBALS["messages"]["actionheader"] . "</B></TD></TR>\n";
    echo "<TR><TD colspan=\"7\"><HR></TD></TR>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list), $allow);
    // print number of items & total filesize
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR>\n<TD class=\"header\"></TD>";
    echo "<TD class=\"header\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
    if (function_exists("disk_free_space")) {
        $free = parse_file_size(disk_free_space(get_abs_dir($dir)));
    } elseif (function_exists("diskfreespace")) {
        $free = parse_file_size(diskfreespace(get_abs_dir($dir)));
    } else {
        $free = "?";
    }
    // echo "Total: ".parse_file_size(disk_total_space(get_abs_dir($dir))).", ";
    echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</TD>\n";
    echo "<TD class=\"header\">" . parse_file_size($tot_file_size) . "</TD>\n";
    for ($i = 0; $i < 4; ++$i) {
        echo "<TD class=\"header\"></TD>";
    }
    echo "</TR>\n<TR><TD colspan=\"7\"><HR></TD></TR></FORM></TABLE>\n";
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	// Uncheck all items (to avoid problems with new items)
	var ml = document.selform;
	var len = ml.elements.length;
	for(var i=0; i<len; ++i) {
		var e = ml.elements[i];
		if(e.name == "selitems[]" && e.checked == true) {
			e.checked=false;
		}
	}
// -->
</script><?php 
}
Ejemplo n.º 8
0
/**
MAIN FUNCTION
*/
function list_dir($dir)
{
    _debug("list_dir: displaying directory {$dir}");
    if (!get_show_item($dir, NULL)) {
        show_error($GLOBALS["error_msg"]["accessdir"] . " : '{$dir}'");
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $s_dir = $dir;
    if (strlen($s_dir) > 50) {
        $s_dir = "..." . substr($s_dir, -47);
    }
    show_header($GLOBALS["messages"]["actdir"] . ": " . _breadcrumbs($dir));
    // show_header($GLOBALS["messages"]["actdir"].": /".get_rel_item("",$s_dir));
    // Javascript functions:
    include "./_include/javascript.php";
    // Sorting of items
    $_img = "&nbsp;<IMG width=\"10\" height=\"10\" border=\"0\" align=\"ABSMIDDLE\" src=\"_img/";
    if ($GLOBALS["srt"] == "yes") {
        $_srt = "no";
        $_img .= "_arrowup.gif\" ALT=\"^\">";
    } else {
        $_srt = "yes";
        $_img .= "_arrowdown.gif\" ALT=\"v\">";
    }
    // Toolbar
    echo "<BR><TABLE width=\"95%\"><TR><TD><TABLE><TR>\n";
    // PARENT DIR
    echo "<TD><A HREF=\"" . make_link("list", path_up($dir), NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["up"] . "\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["uplink"] . "\" TITLE=\"" . $GLOBALS["messages"]["uplink"] . "\"></A></TD>\n";
    // HOME DIR
    echo "<TD><A HREF=\"" . make_link("list", NULL, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["home"] . "\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["homelink"] . "\" TITLE=\"" . $GLOBALS["messages"]["homelink"] . "\"></A></TD>\n";
    // RELOAD
    echo "<TD><A HREF=\"javascript:location.reload();\"><IMG border=\"0\" width=\"16\" height=\"16\" ";
    echo "align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["reload"] . "\" ALT=\"" . $GLOBALS["messages"]["reloadlink"];
    echo "\" TITLE=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></TD>\n";
    // SEARCH
    echo "<TD><A HREF=\"" . make_link("search", $dir, NULL) . "\">";
    echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["search"] . "\" ";
    echo "ALT=\"" . $GLOBALS["messages"]["searchlink"] . "\" TITLE=\"" . $GLOBALS["messages"]["searchlink"];
    echo "\"></A></TD>\n";
    echo "<TD>::</TD>";
    // print the download button
    _print_link("download_selected", permissions_grant($dir, NULL, "read"), $dir, NULL);
    // print the edit buttons
    _print_edit_buttons($dir);
    // ADMIN & LOGOUT
    if (login_is_user_logged_in()) {
        echo "<TD>::</TD>";
        // ADMIN
        _print_link("admin", permissions_grant(NULL, NULL, "admin") || permissions_grant(NULL, NULL, "password"), $dir, NULL);
        // LOGOUT
        _print_link("logout", true, $dir, NULL);
    }
    echo "<TD>::</TD>";
    //Languages
    foreach ($GLOBALS["langs"] as $langs) {
        echo "<TD><A HREF=\"" . make_link("list", $dir, NULL, NULL, NULL, $langs[0]) . "\">";
        if (!file_exists($langs[1])) {
            echo "&nbsp;{$langs['0']} ";
        } else {
            echo "<IMG border=\"0\" width=\"16\" height=\"11\" ";
            echo "align=\"ABSMIDDLE\" src=\"" . $langs[1] . "\" ALT=\"" . $langs[0];
            echo "\" TITLE=\"" . $langs[2] . "\"/></A></TD>\n";
        }
        //list($slang,$img,$ext,$type)	= $mime;
        /*if(@eregi($ext,$item)) {
        			$mime_type	= $desc;
        			$image		= $img;
        			if($query=="img"){ return $image;}
        			else if($query=="ext"){ return $type;}
        			else return $mime_type;
        		*/
    }
    //
    echo "</TR></TABLE></TD>\n";
    // Create File / Dir
    if (permissions_grant($dir, NULL, "create")) {
        echo "<TD align=\"right\"><TABLE><FORM action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\">\n<TR><TD>";
        echo "<IMG border=\"0\" width=\"16\" height=\"16\" align=\"ABSMIDDLE\" src=\"" . $GLOBALS["baricons"]["add"] . "\" />";
        echo "<SELECT name=\"mktype\">";
        echo "<option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>";
        echo "<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option></SELECT>\n";
        echo "<INPUT name=\"mkname\" type=\"text\" size=\"15\">";
        echo "<INPUT type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"];
        echo "\"></TD></TR></FORM></TABLE></TD>\n";
    }
    echo "</TR></TABLE>\n";
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<TABLE WIDTH=\"95%\"><FORM name=\"selform\" method=\"POST\" action=\"" . make_link("post", $dir, NULL) . "\">\n";
    echo "<INPUT type=\"hidden\" name=\"do_action\"><INPUT type=\"hidden\" name=\"first\" value=\"y\">\n";
    // Table Header
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR><TD WIDTH=\"2%\" class=\"header\">\n";
    echo "<INPUT TYPE=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\"></TD>\n";
    echo "<TD WIDTH=\"44%\" class=\"header\"><B>\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"10%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"16%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $_img;
    }
    echo "</A></B></TD>\n<TD WIDTH=\"14%\" class=\"header\"><B>";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<A href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $_img;
    }
    echo "</A></B></TD><TD WIDTH=\"8%\" class=\"header\"><B>" . $GLOBALS["messages"]["permheader"] . "</B>\n";
    echo "</TD><TD WIDTH=\"6%\" class=\"header\"><B>" . $GLOBALS["messages"]["actionheader"] . "</B></TD></TR>\n";
    echo "<TR><TD colspan=\"7\"><HR></TD></TR>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list));
    // print number of items & total filesize
    echo "<TR><TD colspan=\"7\"><HR></TD></TR><TR>\n<TD class=\"header\"></TD>";
    echo "<TD class=\"header\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
    $free = parse_file_size(diskfreespace("/"));
    echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</TD>\n";
    echo "<TD class=\"header\">" . parse_file_size($tot_file_size) . "</TD>\n";
    echo "<TD class=\"header\" colspan=4></TD>";
    echo "</TR>\n<TR><TD colspan=\"7\"><HR></TD></TR></FORM></TABLE>\n";
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	// Uncheck all items (to avoid problems with new items)
	var ml = document.selform;
	var len = ml.elements.length;
	for(var i=0; i<len; ++i) {
		var e = ml.elements[i];
		if(e.name == "selitems[]" && e.checked == true) {
			e.checked=false;
		}
	}
// -->
</script><?php 
}