| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017 |
- <?php
- // -------------------------------------------------------------------------------
- // | net2ftp: a web based FTP client |
- // | Copyright (c) 2003-2013 by David Gartner |
- // | |
- // | This program is free software; you can redistribute it and/or |
- // | modify it under the terms of the GNU General Public License |
- // | as published by the Free Software Foundation; either version 2 |
- // | of the License, or (at your option) any later version. |
- // | |
- // -------------------------------------------------------------------------------
- // **************************************************************************************
- // **************************************************************************************
- // ** **
- // ** **
- function getSkinArray() {
- // --------------
- // This function returns an array of skin names, file names, ...
- // --------------
- global $net2ftp_globals, $net2ftp_settings;
- // -------------------------------------------------------------------------
- // Blue
- // -------------------------------------------------------------------------
- $skinArray["blue"]["name"] = __("Blue");
- $skinArray["blue"]["iconset"] = "nuvola";
- $skinArray["blue"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/blue/images";
- $skinArray["blue"]["icon_size_mime"] = "16";
- // -------------------------------------------------------------------------
- // India
- // -------------------------------------------------------------------------
- $skinArray["india"]["name"] = "India";
- $skinArray["india"]["iconset"] = "nuvola";
- $skinArray["india"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/india/images";
- $skinArray["india"]["icon_size_mime"] = "32";
- // -------------------------------------------------------------------------
- // Mobile
- // -------------------------------------------------------------------------
- $skinArray["mobile"]["name"] = "Mobile";
- $skinArray["mobile"]["iconset"] = "nuvola";
- $skinArray["mobile"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/mobile/images";
- $skinArray["mobile"]["icon_size_mime"] = "0";
- // -------------------------------------------------------------------------
- // iPhone
- // -------------------------------------------------------------------------
- $skinArray["iphone"]["name"] = "iPhone";
- $skinArray["iphone"]["iconset"] = "nuvola";
- $skinArray["iphone"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/iphone/images";
- $skinArray["iphone"]["icon_size_mime"] = "0";
- $skinArray["iphone"]["css"] = "";
- $skinArray["iphone"]["javascript"] = "";
- // -------------------------------------------------------------------------
- // Mambo
- // -------------------------------------------------------------------------
- if (defined("_VALID_MOS") == true) {
- $skinArray["mambo"]["name"] = "Mambo";
- $skinArray["mambo"]["iconset"] = "nuvola";
- $skinArray["mambo"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/blue/images";
- $skinArray["mambo"]["icon_size_mime"] = "16";
- }
- // -------------------------------------------------------------------------
- // Xoops
- // -------------------------------------------------------------------------
- if (defined("XOOPS_ROOT_PATH") == true) {
- $skinArray["xoops"]["name"] = "Xoops";
- $skinArray["xoops"]["iconset"] = "nuvola";
- $skinArray["xoops"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/blue/images";
- $skinArray["xoops"]["icon_size_mime"] = "16";
- }
- // -------------------------------------------------------------------------
- // Drupal
- // -------------------------------------------------------------------------
- if (defined("CACHE_PERMANENT") == true) {
- $skinArray["drupal"]["name"] = "Drupal";
- $skinArray["drupal"]["iconset"] = "nuvola";
- $skinArray["drupal"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/blue/images";
- $skinArray["drupal"]["icon_size_mime"] = "16";
- }
- return $skinArray;
- } // End function getSkinArray
- // ** **
- // ** **
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // ** **
- // ** **
- function net2ftp_skin_printCSS() {
- global $net2ftp_globals;
- $skinArray = getSkinArray();
- if ($net2ftp_globals["skin"] != "") { $currentskin = $net2ftp_globals["skin"]; }
- elseif ($net2ftp_globals["cookie_skin"] != "") { $currentskin = $net2ftp_globals["cookie_skin"]; }
- else { $currentskin = "shinra"; }
- echo @(string)$skinArray[$currentskin]["css"];
- } // End function net2ftp_skin_printCSS
- // ** **
- // ** **
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // ** **
- // ** **
- function net2ftp_skin_printJavascript() {
- global $net2ftp_globals;
- $skinArray = getSkinArray();
- if ($net2ftp_globals["skin"] != "") { $currentskin = $net2ftp_globals["skin"]; }
- elseif ($net2ftp_globals["cookie_skin"] != "") { $currentskin = $net2ftp_globals["cookie_skin"]; }
- else { $currentskin = "shinra"; }
- echo @(string)$skinArray[$currentskin]["javascript"];
- } // End function net2ftp_skin_printJavascript
- // ** **
- // ** **
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // ** **
- // ** **
- function printSkinSelect($fieldname, $onchange, $style, $class) {
- // --------------
- // This function prints a select with the available skins
- // Skin nr 1 is the default skin
- // --------------
- global $net2ftp_globals;
- $skinArray = getSkinArray();
- if ($net2ftp_globals["skin"] != "") { $currentskin = $net2ftp_globals["skin"]; }
- elseif ($net2ftp_globals["cookie_skin"] != "") { $currentskin = $net2ftp_globals["cookie_skin"]; }
- else { $currentskin = "blue"; }
- if ($onchange == "") { $onchange_full = ""; }
- else { $onchange_full = "onchange=\"$onchange\""; }
- if ($style == "") { $style_full = ""; }
- else { $style_full = "style=\"$style\""; }
- if ($class == "") { $class_full = ""; }
- else { $class_full = "class=\"$class\""; }
- echo "<select name=\"$fieldname\" id=\"$fieldname\" $onchange_full $style_full $class_full>\n";
- foreach ($skinArray as $key => $value) {
- // $key loops over "blue", "pastel", ...
- // $value will be an array like $value["name"] = "Blue"
- if ($key == $currentskin) { $selected = "selected=\"selected\""; }
- else { $selected = ""; }
- echo "<option value=\"" . $key . "\" $selected>" . $value["name"] . "</option>\n";
- } // end while
- echo "</select>\n";
- } // End function printSkinSelect
- // ** **
- // ** **
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // ** **
- // ** **
- function getMime($listline) {
- // --------------
- // Checks the extension of a file to determine which is the type of the file and the icon
- // --------------
- // -------------------------------------------------------------------------
- // Global variables and settings
- // -------------------------------------------------------------------------
- global $net2ftp_globals, $net2ftp_settings;
- $skinArray = getSkinArray();
- if ($listline["dirorfile"] == "d") { $last = "directory"; }
- elseif ($listline["dirorfile"] == "l") { $last = "symlink"; }
- else { $last = get_filename_extension($listline["dirfilename"]); }
- // -------------------------------------------------------------------------
- // Icon names
- // -------------------------------------------------------------------------
- if ($last == "directory") {
- $icon = "folder";
- $type = __("Directory");
- }
- elseif ($last == "symlink") {
- $icon = "folder_grey";
- $type = __("Symlink");
- }
- // Web files
- elseif ($last == "asp") {
- $icon = "";
- $type = __("ASP script");
- }
- elseif ($last == "css") {
- $icon = "stylesheet";
- $type = __("Cascading Style Sheet");
- }
- elseif ($last == "htm" || $last == "html") {
- $icon = "html";
- $type = __("HTML file");
- }
- elseif ($last == "java") {
- $icon = "source_java";
- $type = __("Java source file");
- }
- elseif ($last == "js") {
- $icon = "";
- $type = __("JavaScript file");
- }
- elseif ($last == "phps") {
- $icon = "php";
- $type = __("PHP Source");
- }
- elseif (substr($last,0,3) == "php") {
- $icon = "php";
- $type = __("PHP script");
- }
- elseif ($last == "txt") {
- $icon = "document";
- $type = __("Text file");
- }
- // Images
- elseif ($last == "bmp") {
- $icon = "colors";
- $type = __("Bitmap file");
- }
- elseif ($last == "gif") {
- $icon = "colors";
- $type = __("GIF file");
- }
- elseif ($last == "jpg" || $last == "jpeg") {
- $icon = "colors";
- $type = __("JPEG file");
- }
- elseif ($last == "png") {
- $icon = "colors";
- $type = __("PNG file");
- }
- elseif ($last == "tif" || $last == "tiff") {
- $icon = "colors";
- $type = __("TIF file");
- }
- elseif ($last == "xcf") {
- $icon = "gimp";
- $type = __("GIMP file");
- }
- // Executables and scripts
- elseif ($last == "exe" || $last == "com") {
- $icon = "exec";
- $type = __("Executable");
- }
- elseif ($last == "sh") {
- $icon = "terminal";
- $type = __("Shell script");
- }
- // MS Office
- elseif ($last == "doc") {
- $icon = "";
- $type = __("MS Office - Word document");
- }
- elseif ($last == "xls") {
- $icon = "";
- $type = __("MS Office - Excel spreadsheet");
- }
- elseif ($last == "ppt") {
- $icon = "";
- $type = __("MS Office - PowerPoint presentation");
- }
- elseif ($last == "mdb") {
- $icon = "";
- $type = __("MS Office - Access database");
- }
- elseif ($last == "vsd") {
- $icon = "";
- $type = __("MS Office - Visio drawing");
- }
- elseif ($last == "mpp") {
- $icon = "";
- $type = __("MS Office - Project file");
- }
- // OpenOffice 6
- elseif ($last == "sxw") {
- $icon = "openoffice";
- $type = __("OpenOffice - Writer 6.0 document");
- }
- elseif ($last == "stw") {
- $icon = "openoffice";
- $type = __("OpenOffice - Writer 6.0 template");
- }
- elseif ($last == "sxc") {
- $icon = "openoffice";
- $type = __("OpenOffice - Calc 6.0 spreadsheet");
- }
- elseif ($last == "stc") {
- $icon = "openoffice";
- $type = __("OpenOffice - Calc 6.0 template");
- }
- elseif ($last == "sxd") {
- $icon = "openoffice";
- $type = __("OpenOffice - Draw 6.0 document");
- }
- elseif ($last == "std") {
- $icon = "openoffice";
- $type = __("OpenOffice - Draw 6.0 template");
- }
- elseif ($last == "sxi") {
- $icon = "openoffice";
- $type = __("OpenOffice - Impress 6.0 presentation");
- }
- elseif ($last == "sti") {
- $icon = "openoffice";
- $type = __("OpenOffice - Impress 6.0 template");
- }
- elseif ($last == "sxg") {
- $icon = "openoffice";
- $type = __("OpenOffice - Writer 6.0 global document");
- }
- elseif ($last == "sxm") {
- $icon = "openoffice";
- $type = __("OpenOffice - Math 6.0 document");
- }
- // StarOffice 5
- elseif ($last == "sdw") {
- $icon = "openoffice";
- $type = __("StarOffice - StarWriter 5.x document");
- }
- elseif ($last == "sgl") {
- $icon = "openoffice";
- $type = __("StarOffice - StarWriter 5.x global document");
- }
- elseif ($last == "sdc") {
- $icon = "openoffice";
- $type = __("StarOffice - StarCalc 5.x spreadsheet");
- }
- elseif ($last == "sda") {
- $icon = "openoffice";
- $type = __("StarOffice - StarDraw 5.x document");
- }
- elseif ($last == "sdd") {
- $icon = "openoffice";
- $type = __("StarOffice - StarImpress 5.x presentation");
- }
- elseif ($last == "sdp") {
- $icon = "openoffice";
- $type = __("StarOffice - StarImpress Packed 5.x file");
- }
- elseif ($last == "smf") {
- $icon = "openoffice";
- $type = __("StarOffice - StarMath 5.x document");
- }
- elseif ($last == "sds") {
- $icon = "openoffice";
- $type = __("StarOffice - StarChart 5.x document");
- }
- elseif ($last == "sdm") {
- $icon = "openoffice";
- $type = __("StarOffice - StarMail 5.x mail file");
- }
- // PDF and PS
- elseif ($last == "pdf") {
- $icon = "acroread";
- $type = __("Adobe Acrobat document");
- }
- // Archives
- elseif ($last == "arc") {
- $icon = "tgz";
- $type = __("ARC archive");
- }
- elseif ($last == "arj") {
- $icon = "tgz";
- $type = __("ARJ archive");
- }
- elseif ($last == "rpm") {
- $icon = "rpm";
- $type = __("RPM");
- }
- elseif ($last == "gz") {
- $icon = "tgz";
- $type = __("GZ archive");
- }
- elseif ($last == "tar") {
- $icon = "tar";
- $type = __("TAR archive");
- }
- elseif ($last == "zip") {
- $icon = "tgz";
- $type = __("Zip archive");
- }
- // Movies
- elseif ($last == "mov") {
- $icon = "video";
- $type = __("MOV movie file");
- }
- elseif ($last == "mpg" || $last == "mpeg") {
- $icon = "video";
- $type = __("MPEG movie file");
- }
- elseif ($last == "rm" || $last == "ram") {
- $icon = "realplayer";
- $type = __("Real movie file");
- }
- elseif ($last == "qt") {
- $icon = "quicktime";
- $type = __("Quicktime movie file");
- }
- // Flash
- elseif ($last == "fla") {
- $icon = "";
- $type = __("Shockwave flash file");
- }
- elseif ($last == "swf") {
- $icon = "";
- $type = __("Shockwave file");
- }
- // Sound
- elseif ($last == "wav") {
- $icon = "sound";
- $type = __("WAV sound file");
- }
- // Fonts
- elseif ($last == "ttf") {
- $icon = "fonts";
- $type = __("Font file");
- }
- // Default Extension
- elseif ($last) {
- $icon = "mime";
- $type = __("%1\$s File", strtoupper($last));
- }
- // Default File
- else {
- $icon = "mime";
- $type = __("File");
- }
- if ($icon == "") { $icon = "mime"; }
- if ($type == "") { $type = __("File"); }
- // -------------------------------------------------------------------------
- // Return mime icon and mime type
- // -------------------------------------------------------------------------
- // OpenLaszlo skin doesn't need HTML tags
- if ($net2ftp_globals["skin"] == "openlaszlo") {
- $icon .= ".png";
- $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/mime";
- $mime["mime_icon"] = "$icon_directory/$icon";
- }
- // Internet Explorer does not display transparent PNG images correctly.
- // A solution is described here: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714
- elseif ($net2ftp_settings["fix_png"] == "yes" && $net2ftp_globals["browser_agent"] == "IE" && $net2ftp_globals["browser_platform"] == "Win" && ($net2ftp_globals["browser_version"] == "5.5" || $net2ftp_globals["browser_version"] == "6.0" || $net2ftp_globals["browser_version"] == "7.0")) {
- $icon .= ".png";
- $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/mime";
- $mime["mime_icon"] = "<img src=\"$icon_directory/spacer.gif\" alt=\"icon\" style=\"width: " . $skinArray[$net2ftp_globals["skin"]]["icon_size_mime"] . "px; height: " . $skinArray[$net2ftp_globals["skin"]]["icon_size_mime"] . "px; border: 0px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$icon_directory/$icon', sizingMethod='scale')\" />\n";
- }
- else {
- $icon .= ".png";
- $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/mime";
- $mime["mime_icon"] = "<img src=\"$icon_directory/$icon\" alt=\"icon\" style=\"width: " . $skinArray[$net2ftp_globals["skin"]]["icon_size_mime"] . "px; height: " . $skinArray[$net2ftp_globals["skin"]]["icon_size_mime"] . "px; border: 0px;\" />\n";
- }
- $mime["mime_type"] = $type;
- return $mime;
- } // end getMime
- // ** **
- // ** **
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // ** **
- // ** **
- function printMime($what, $listline) {
- // --------------
- // Prints the Mime icon
- // --------------
- $mime = getMime($listline);
- if ($what == "icon") {
- echo $mime["mime_icon"];
- }
- elseif ($what == "type") {
- echo $mime["mime_type"];
- }
- } // end printMimeIcon
- // ** **
- // ** **
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // ** **
- // ** **
- function printActionIcon($action, $onclick) {
- // --------------
- // Checks the icon related to an action
- // --------------
- // -------------------------------------------------------------------------
- // Global variables and settings
- // -------------------------------------------------------------------------
- global $net2ftp_globals, $net2ftp_settings;
- $skinArray = getSkinArray();
- // -------------------------------------------------------------------------
- // Icon name
- // -------------------------------------------------------------------------
- if ($action == "back") {
- $alt = __("Back");
- $icon = "back";
- $accesskey = "b";
- }
- elseif ($action == "forward") {
- $alt = __("Submit");
- $icon = "button_ok";
- $accesskey = "v";
- }
- elseif ($action == "refresh") {
- $alt = __("Refresh");
- $icon = "reload";
- $accesskey = "r";
- }
- elseif ($action == "view_details") {
- $alt = __("Details");
- $icon = "view_detailed";
- $accesskey = "";
- }
- elseif ($action == "view_icons") {
- $alt = __("Icons");
- $icon = "view_icon";
- $accesskey = "";
- }
- elseif ($action == "listdirectories") {
- $alt = __("List");
- $icon = "view_tree";
- $accesskey = "";
- }
- elseif ($action == "logout") {
- $alt = __("Logout");
- $icon = "exit";
- $accesskey = "l";
- }
- elseif ($action == "help") {
- $alt = __("Help");
- $icon = "info";
- $accesskey = "i";
- }
- elseif ($action == "bookmark") {
- $alt = __("Bookmark");
- $icon = "bookmark";
- $accesskey = "h";
- }
- elseif ($action == "save") {
- $alt = __("Save");
- $icon = "filesave";
- $accesskey = "s";
- }
- elseif ($action == "up") {
- $alt = __("Up");
- $icon = "up";
- $accesskey = "u";
- }
- else {
- $alt = __("Default");
- $icon = "mime";
- $accesskey = "";
- }
- $icon .= ".png";
- if ($accesskey != "") {
- $alt = $alt . " (accesskey $accesskey)";
- $accesskeytag = "accesskey=\"$accesskey\"" ;
- }
- else {
- $accesskeytag = "";
- }
- // -------------------------------------------------------------------------
- // Icon directory
- // -------------------------------------------------------------------------
- $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/actions";
- // -------------------------------------------------------------------------
- // URL
- // Do not include a URL if $onclick is empty
- // -------------------------------------------------------------------------
- if ($onclick != "") {
- $href_start = "<a href=\"javascript:$onclick\" title=\"$alt\" $accesskeytag>";
- $href_end = "</a>";
- }
- else {
- $href_start = "";
- $href_end = "";
- }
- // -------------------------------------------------------------------------
- // Return text (for mobile skin) or icon (for all other skins)
- // -------------------------------------------------------------------------
- if ($skinArray[$net2ftp_globals["skin"]]["icon_size_mime"] == 0) {
- $icon_total = "$href_start$action ($accesskey)$href_end\n";
- }
- // Internet Explorer does not display transparent PNG images correctly.
- // A solution is described here: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714
- elseif ($net2ftp_settings["fix_png"] == "yes" && $net2ftp_globals["browser_agent"] == "IE" && $net2ftp_globals["browser_platform"] == "Win" && ($net2ftp_globals["browser_version"] == "5.5" || $net2ftp_globals["browser_version"] == "6.0" || $net2ftp_globals["browser_version"] == "7.0")) {
- $icon_total = "$href_start<img src=\"$icon_directory/spacer.gif\" alt=\"$alt\" onmouseover=\"this.style.margin='0px';this.style.width='34px';this.style.height='34px';\" onmouseout=\"this.style.margin='1px';this.style.width='32px';this.style.height='32px';\" style=\"border: 0px; margin: 1px; width: 32px; height: 32px; vertical-align: middle; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$icon_directory/$icon', sizingMethod='scale');\" />$href_end\n";
- }
- else {
- $icon_total = "$href_start<img src=\"$icon_directory/$icon\" alt=\"$alt\" onmouseover=\"this.style.margin='0px';this.style.width='34px';this.style.height='34px';\" onmouseout=\"this.style.margin='1px';this.style.width='32px';this.style.height='32px';\" style=\"border: 0px; margin: 1px; width: 32px; height: 32px; vertical-align: middle;\" />$href_end\n";
- }
- echo $icon_total;
- /* -------------------------------------------------------------------------
- ---------------------------
- Accesskey documentation
- ---------------------------
- Tutorial
- http://www.cs.tut.fi/~jkorpela/forms/accesskey.html
- ALT-A and ALT-F may not be used on IE
- Login page
- ---------------------------
- l login
- Logout page
- ---------------------------
- l link to login page
- Browse page
- ---------------------------
- See icons above.
- Used: b, v, r, l, i, h, s
- g directory textbox
- Actions
- w new dir
- y new file
- e install template
- u upload, up
- n advanced
- c copy
- m move
- d delete
- o rename
- p chmod
- x download
- z zip
- q size
- j search
- Headers
- k up
- t all
- Items
- 1 item 1
- 2 item 2
- ...
- 9 item 9
- ------------------------------------------------------------------------- */
- } // end printActionIcon
- // ** **
- // ** **
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // ** **
- // ** **
- function printModeIcon($setting, $on_off, $onclick) {
- // --------------
- // Checks the icon related to a mode
- // --------------
- // -------------------------------------------------------------------------
- // Global variables and settings
- // -------------------------------------------------------------------------
- global $net2ftp_globals, $net2ftp_settings;
- if ($setting == "details") {
- $alt = __("Details");
- $icon = "view_detailed";
- }
- elseif ($setting == "icons") {
- $alt = __("Icons");
- $icon = "view_icon";
- }
- // Default
- else {
- $alt = __("Default");
- $icon = "mime";
- }
- // Default
- if ($alt == "") { $alt = "Default"; }
- if ($icon == "") { $icon = "mime"; }
- // On or off: icon and style
- if ($on_off == "on") {
- $icon_normal = $icon;
- $icon_onmouseover = $icon;
- }
- else {
- $icon_normal = $icon . "_light";
- $icon_onmouseover = $icon;
- }
- // -------------------------------------------------------------------------
- // Icon directory
- // -------------------------------------------------------------------------
- $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/settings";
- // -------------------------------------------------------------------------
- // Return icon
- // -------------------------------------------------------------------------
- // DO NOT CLOSE THE IMAGE TAG TO ALLOW ADDITIONAL ACTIONS
- if ($on_off == "on") {
- if ($net2ftp_settings["fix_png"] == "yes" && $net2ftp_globals["browser_agent"] == "IE" && $net2ftp_globals["browser_platform"] == "Win" && ($net2ftp_globals["browser_version"] == "5.5" || $net2ftp_globals["browser_version"] == "6.0" || $net2ftp_globals["browser_version"] == "7.0")) {
- $icon_total = "<img src=\"$icon_directory/spacer.gif\" alt=\"$alt\" style=\"border: 2px solid #000000; padding-top: 1px; padding-left: 2px; width: 32px; height: 32px; vertical-align: middle; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$icon_directory/$icon', sizingMethod='scale');\" />\n";
- }
- else {
- $icon_total = "<img src=\"$icon_directory/$icon_normal\" alt=\"$alt\" style=\"border: 2px solid #000000; padding-top: 1px; padding-left: 2px; width: 32px; height: 32px; vertical-align: middle;\" />\n";
- }
- }
- else {
- if ($net2ftp_settings["fix_png"] == "yes" && $net2ftp_globals["browser_agent"] == "IE" && $net2ftp_globals["browser_platform"] == "Win" && ($net2ftp_globals["browser_version"] == "5.5" || $net2ftp_globals["browser_version"] == "6.0" || $net2ftp_globals["browser_version"] == "7.0")) {
- $icon_total = "<a href=\"javascript:$onClick\"><img src=\"$icon_directory/spacer.gif\" alt=\"$alt\" onmouseover=\"this.style.margin='0px';this.style.width='34px';this.style.height='34px';\" onmouseout=\"this.style.margin='1px';this.style.width='32px';this.style.height='32px';\" style=\"border: 0px; margin: 1px; width: 32px; height: 32px; vertical-align: middle; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$icon_directory/$icon', sizingMethod='scale');\" /></a>\n";
- }
- else {
- $icon_total = "<a href=\"javascript:$onClick\" title=\"$alt\"><img src=\"$icon_directory/$icon_normal\" alt=\"$alt\" onmouseover=\"this.style.margin='0px';this.style.width='34px';this.style.height='34px';\" onmouseout=\"this.style.margin='1px';this.style.width='32px';this.style.height='32px';\" style=\"border: 0px; margin: 1px; width: 32px; height: 32px; vertical-align: middle;\" /></a>\n";
- }
- }
- return $icon_total;
- } // end printModeIcon
- // ** **
- // ** **
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // ** **
- // ** **
- function printTitleIcon() {
- // --------------
- // This function returns the title icon based on the $state and $state2 variables
- // --------------
- // -------------------------------------------------------------------------
- // Global variables and settings
- // -------------------------------------------------------------------------
- global $net2ftp_globals, $net2ftp_settings;
- $skinArray = getSkinArray();
-
- // -------------------------------------------------------------------------
- // Icon names
- // -------------------------------------------------------------------------
- if ($net2ftp_globals["state"] == "admin" || $net2ftp_globals["state"] == "admin_createtables" || $net2ftp_globals["state"] == "admin_emptylogs" || $net2ftp_globals["state"] == "admin_viewlogs") {
- $icon = "kcontrol";
- }
- elseif ($net2ftp_globals["state"] == "advanced" || $net2ftp_globals["state"] == "advanced_ftpserver" || $net2ftp_globals["state"] == "advanced_parsing" || $net2ftp_globals["state"] == "advanced_webserver") {
- $icon = "misc";
- }
- elseif ($net2ftp_globals["state"] == "bookmark") {
- $icon = "bookmark";
- }
- elseif ($net2ftp_globals["state"] == "calculatesize") {
- $icon = "";
- }
- elseif ($net2ftp_globals["state"] == "chmod") {
- $icon = "kgpg_info";
- }
- elseif ($net2ftp_globals["state"] == "copymovedelete") {
- if ($net2ftp_globals["state2"] == "copy") { $icon = "editcopy"; }
- elseif ($net2ftp_globals["state2"] == "move") { $icon = "editcut"; }
- elseif ($net2ftp_globals["state2"] == "delete") { $icon = "edittrash"; }
- }
- elseif ($net2ftp_globals["state"] == "easywebsite") {
- $icon = "colorize";
- }
- elseif ($net2ftp_globals["state"] == "edit") {
- $icon = "package_editors";
- }
- elseif ($net2ftp_globals["state"] == "findstring") {
- $icon = "viewmag";
- }
- elseif ($net2ftp_globals["state"] == "jupload" || $net2ftp_globals["state"] == "upload") {
- $icon = "konquest";
- }
- elseif ($net2ftp_globals["state"] == "login" || $net2ftp_globals["state"] == "login_small") {
- $icon = "kgpg_identity";
- }
- elseif ($net2ftp_globals["state"] == "newdir") {
- $icon = "folder_new";
- }
- elseif ($net2ftp_globals["state"] == "rename") {
- $icon = "folder_txt";
- }
- elseif ($net2ftp_globals["state"] == "updatefile") {
- $icon = "view_left_right";
- }
- elseif ($net2ftp_globals["state"] == "view") {
- if ($net2ftp_globals["state2"] == "image") { $icon = "thumbnail"; }
- elseif ($net2ftp_globals["state2"] == "flash") { $icon = "aktion"; }
- elseif ($net2ftp_globals["state2"] == "text") { $icon = "terminal"; }
- }
- elseif ($net2ftp_globals["state"] == "zip") {
- $icon = "ark";
- }
- // Default File
- else {
- $icon = "misc";
- }
- if ($icon == "") { $icon = "misc"; }
- // -------------------------------------------------------------------------
- // Return title icon
- // -------------------------------------------------------------------------
- $icon .= ".png";
- $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/titles";
-
- // Internet Explorer does not display transparent PNG images correctly.
- // A solution is described here: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714
- if ($net2ftp_settings["fix_png"] == "yes" && $net2ftp_globals["browser_agent"] == "IE" && $net2ftp_globals["browser_platform"] == "Win" && ($net2ftp_globals["browser_version"] == "5.5" || $net2ftp_globals["browser_version"] == "6.0" || $net2ftp_globals["browser_version"] == "7.0")) {
- $icon_total = "<img src=\"$icon_directory/spacer.gif\" alt=\"icon\" style=\"width: 48px; height: 48px; vertical-align: middle; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$icon_directory/$icon', sizingMethod='scale')\" />\n";
- }
- else {
- $icon_total = "<img src=\"$icon_directory/$icon\" alt=\"icon\" style=\"width: 48px; height: 48px; vertical-align: middle;\" />\n";
- }
- echo $icon_total;
- } // end printTitleIcon
- // ** **
- // ** **
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // **************************************************************************************
- // ** **
- // ** **
- function printPngImage($src, $alt, $style) {
- // --------------
- // This function prints a .png image with or without the fix for IE
- // Prerequisite: spacer.gif must exist in the same directory as the image
- // --------------
- // -------------------------------------------------------------------------
- // Global variables and settings
- // -------------------------------------------------------------------------
- global $net2ftp_globals, $net2ftp_settings;
- // -------------------------------------------------------------------------
- // Calculate the src of spacer.gif
- // -------------------------------------------------------------------------
- $last_slash_position = strrpos($src, "/");
- if ($last_slash_position === false) { $src_spacer = "spacer.gif"; }
- else {
- $src_spacer = substr($src, 0, $last_slash_position+1) . "spacer.gif";
- }
- // -------------------------------------------------------------------------
- // Form the HTML
- // -------------------------------------------------------------------------
- // Internet Explorer does not display transparent PNG images correctly.
- // A solution is described here: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714
- if ($net2ftp_settings["fix_png"] == "yes" && $net2ftp_globals["browser_agent"] == "IE" && $net2ftp_globals["browser_platform"] == "Win" && ($net2ftp_globals["browser_version"] == "5.5" || $net2ftp_globals["browser_version"] == "6.0" || $net2ftp_globals["browser_version"] == "7.0")) {
- $image = "<img src=\"$src_spacer\" alt=\"$alt\" style=\"$style; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$src', sizingMethod='scale')\" />\n";
- }
- else {
- $image = "<img src=\"$src\" alt=\"$alt\" style=\"$style\" />\n";
- }
- echo $image;
- } // end printPngImage
- // ** **
- // ** **
- // **************************************************************************************
- // **************************************************************************************
- ?>
|