skins.inc.php 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017
  1. <?php
  2. // -------------------------------------------------------------------------------
  3. // | net2ftp: a web based FTP client |
  4. // | Copyright (c) 2003-2013 by David Gartner |
  5. // | |
  6. // | This program is free software; you can redistribute it and/or |
  7. // | modify it under the terms of the GNU General Public License |
  8. // | as published by the Free Software Foundation; either version 2 |
  9. // | of the License, or (at your option) any later version. |
  10. // | |
  11. // -------------------------------------------------------------------------------
  12. // **************************************************************************************
  13. // **************************************************************************************
  14. // ** **
  15. // ** **
  16. function getSkinArray() {
  17. // --------------
  18. // This function returns an array of skin names, file names, ...
  19. // --------------
  20. global $net2ftp_globals, $net2ftp_settings;
  21. // -------------------------------------------------------------------------
  22. // Blue
  23. // -------------------------------------------------------------------------
  24. $skinArray["blue"]["name"] = __("Blue");
  25. $skinArray["blue"]["iconset"] = "nuvola";
  26. $skinArray["blue"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/blue/images";
  27. $skinArray["blue"]["icon_size_mime"] = "16";
  28. // -------------------------------------------------------------------------
  29. // India
  30. // -------------------------------------------------------------------------
  31. $skinArray["india"]["name"] = "India";
  32. $skinArray["india"]["iconset"] = "nuvola";
  33. $skinArray["india"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/india/images";
  34. $skinArray["india"]["icon_size_mime"] = "32";
  35. // -------------------------------------------------------------------------
  36. // Mobile
  37. // -------------------------------------------------------------------------
  38. $skinArray["mobile"]["name"] = "Mobile";
  39. $skinArray["mobile"]["iconset"] = "nuvola";
  40. $skinArray["mobile"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/mobile/images";
  41. $skinArray["mobile"]["icon_size_mime"] = "0";
  42. // -------------------------------------------------------------------------
  43. // iPhone
  44. // -------------------------------------------------------------------------
  45. $skinArray["iphone"]["name"] = "iPhone";
  46. $skinArray["iphone"]["iconset"] = "nuvola";
  47. $skinArray["iphone"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/iphone/images";
  48. $skinArray["iphone"]["icon_size_mime"] = "0";
  49. $skinArray["iphone"]["css"] = "";
  50. $skinArray["iphone"]["javascript"] = "";
  51. // -------------------------------------------------------------------------
  52. // Mambo
  53. // -------------------------------------------------------------------------
  54. if (defined("_VALID_MOS") == true) {
  55. $skinArray["mambo"]["name"] = "Mambo";
  56. $skinArray["mambo"]["iconset"] = "nuvola";
  57. $skinArray["mambo"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/blue/images";
  58. $skinArray["mambo"]["icon_size_mime"] = "16";
  59. }
  60. // -------------------------------------------------------------------------
  61. // Xoops
  62. // -------------------------------------------------------------------------
  63. if (defined("XOOPS_ROOT_PATH") == true) {
  64. $skinArray["xoops"]["name"] = "Xoops";
  65. $skinArray["xoops"]["iconset"] = "nuvola";
  66. $skinArray["xoops"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/blue/images";
  67. $skinArray["xoops"]["icon_size_mime"] = "16";
  68. }
  69. // -------------------------------------------------------------------------
  70. // Drupal
  71. // -------------------------------------------------------------------------
  72. if (defined("CACHE_PERMANENT") == true) {
  73. $skinArray["drupal"]["name"] = "Drupal";
  74. $skinArray["drupal"]["iconset"] = "nuvola";
  75. $skinArray["drupal"]["image_url"] = $net2ftp_globals["application_rootdir_url"] . "/skins/blue/images";
  76. $skinArray["drupal"]["icon_size_mime"] = "16";
  77. }
  78. return $skinArray;
  79. } // End function getSkinArray
  80. // ** **
  81. // ** **
  82. // **************************************************************************************
  83. // **************************************************************************************
  84. // **************************************************************************************
  85. // **************************************************************************************
  86. // ** **
  87. // ** **
  88. function net2ftp_skin_printCSS() {
  89. global $net2ftp_globals;
  90. $skinArray = getSkinArray();
  91. if ($net2ftp_globals["skin"] != "") { $currentskin = $net2ftp_globals["skin"]; }
  92. elseif ($net2ftp_globals["cookie_skin"] != "") { $currentskin = $net2ftp_globals["cookie_skin"]; }
  93. else { $currentskin = "shinra"; }
  94. echo @(string)$skinArray[$currentskin]["css"];
  95. } // End function net2ftp_skin_printCSS
  96. // ** **
  97. // ** **
  98. // **************************************************************************************
  99. // **************************************************************************************
  100. // **************************************************************************************
  101. // **************************************************************************************
  102. // ** **
  103. // ** **
  104. function net2ftp_skin_printJavascript() {
  105. global $net2ftp_globals;
  106. $skinArray = getSkinArray();
  107. if ($net2ftp_globals["skin"] != "") { $currentskin = $net2ftp_globals["skin"]; }
  108. elseif ($net2ftp_globals["cookie_skin"] != "") { $currentskin = $net2ftp_globals["cookie_skin"]; }
  109. else { $currentskin = "shinra"; }
  110. echo @(string)$skinArray[$currentskin]["javascript"];
  111. } // End function net2ftp_skin_printJavascript
  112. // ** **
  113. // ** **
  114. // **************************************************************************************
  115. // **************************************************************************************
  116. // **************************************************************************************
  117. // **************************************************************************************
  118. // ** **
  119. // ** **
  120. function printSkinSelect($fieldname, $onchange, $style, $class) {
  121. // --------------
  122. // This function prints a select with the available skins
  123. // Skin nr 1 is the default skin
  124. // --------------
  125. global $net2ftp_globals;
  126. $skinArray = getSkinArray();
  127. if ($net2ftp_globals["skin"] != "") { $currentskin = $net2ftp_globals["skin"]; }
  128. elseif ($net2ftp_globals["cookie_skin"] != "") { $currentskin = $net2ftp_globals["cookie_skin"]; }
  129. else { $currentskin = "blue"; }
  130. if ($onchange == "") { $onchange_full = ""; }
  131. else { $onchange_full = "onchange=\"$onchange\""; }
  132. if ($style == "") { $style_full = ""; }
  133. else { $style_full = "style=\"$style\""; }
  134. if ($class == "") { $class_full = ""; }
  135. else { $class_full = "class=\"$class\""; }
  136. echo "<select name=\"$fieldname\" id=\"$fieldname\" $onchange_full $style_full $class_full>\n";
  137. foreach ($skinArray as $key => $value) {
  138. // $key loops over "blue", "pastel", ...
  139. // $value will be an array like $value["name"] = "Blue"
  140. if ($key == $currentskin) { $selected = "selected=\"selected\""; }
  141. else { $selected = ""; }
  142. echo "<option value=\"" . $key . "\" $selected>" . $value["name"] . "</option>\n";
  143. } // end while
  144. echo "</select>\n";
  145. } // End function printSkinSelect
  146. // ** **
  147. // ** **
  148. // **************************************************************************************
  149. // **************************************************************************************
  150. // **************************************************************************************
  151. // **************************************************************************************
  152. // ** **
  153. // ** **
  154. function getMime($listline) {
  155. // --------------
  156. // Checks the extension of a file to determine which is the type of the file and the icon
  157. // --------------
  158. // -------------------------------------------------------------------------
  159. // Global variables and settings
  160. // -------------------------------------------------------------------------
  161. global $net2ftp_globals, $net2ftp_settings;
  162. $skinArray = getSkinArray();
  163. if ($listline["dirorfile"] == "d") { $last = "directory"; }
  164. elseif ($listline["dirorfile"] == "l") { $last = "symlink"; }
  165. else { $last = get_filename_extension($listline["dirfilename"]); }
  166. // -------------------------------------------------------------------------
  167. // Icon names
  168. // -------------------------------------------------------------------------
  169. if ($last == "directory") {
  170. $icon = "folder";
  171. $type = __("Directory");
  172. }
  173. elseif ($last == "symlink") {
  174. $icon = "folder_grey";
  175. $type = __("Symlink");
  176. }
  177. // Web files
  178. elseif ($last == "asp") {
  179. $icon = "";
  180. $type = __("ASP script");
  181. }
  182. elseif ($last == "css") {
  183. $icon = "stylesheet";
  184. $type = __("Cascading Style Sheet");
  185. }
  186. elseif ($last == "htm" || $last == "html") {
  187. $icon = "html";
  188. $type = __("HTML file");
  189. }
  190. elseif ($last == "java") {
  191. $icon = "source_java";
  192. $type = __("Java source file");
  193. }
  194. elseif ($last == "js") {
  195. $icon = "";
  196. $type = __("JavaScript file");
  197. }
  198. elseif ($last == "phps") {
  199. $icon = "php";
  200. $type = __("PHP Source");
  201. }
  202. elseif (substr($last,0,3) == "php") {
  203. $icon = "php";
  204. $type = __("PHP script");
  205. }
  206. elseif ($last == "txt") {
  207. $icon = "document";
  208. $type = __("Text file");
  209. }
  210. // Images
  211. elseif ($last == "bmp") {
  212. $icon = "colors";
  213. $type = __("Bitmap file");
  214. }
  215. elseif ($last == "gif") {
  216. $icon = "colors";
  217. $type = __("GIF file");
  218. }
  219. elseif ($last == "jpg" || $last == "jpeg") {
  220. $icon = "colors";
  221. $type = __("JPEG file");
  222. }
  223. elseif ($last == "png") {
  224. $icon = "colors";
  225. $type = __("PNG file");
  226. }
  227. elseif ($last == "tif" || $last == "tiff") {
  228. $icon = "colors";
  229. $type = __("TIF file");
  230. }
  231. elseif ($last == "xcf") {
  232. $icon = "gimp";
  233. $type = __("GIMP file");
  234. }
  235. // Executables and scripts
  236. elseif ($last == "exe" || $last == "com") {
  237. $icon = "exec";
  238. $type = __("Executable");
  239. }
  240. elseif ($last == "sh") {
  241. $icon = "terminal";
  242. $type = __("Shell script");
  243. }
  244. // MS Office
  245. elseif ($last == "doc") {
  246. $icon = "";
  247. $type = __("MS Office - Word document");
  248. }
  249. elseif ($last == "xls") {
  250. $icon = "";
  251. $type = __("MS Office - Excel spreadsheet");
  252. }
  253. elseif ($last == "ppt") {
  254. $icon = "";
  255. $type = __("MS Office - PowerPoint presentation");
  256. }
  257. elseif ($last == "mdb") {
  258. $icon = "";
  259. $type = __("MS Office - Access database");
  260. }
  261. elseif ($last == "vsd") {
  262. $icon = "";
  263. $type = __("MS Office - Visio drawing");
  264. }
  265. elseif ($last == "mpp") {
  266. $icon = "";
  267. $type = __("MS Office - Project file");
  268. }
  269. // OpenOffice 6
  270. elseif ($last == "sxw") {
  271. $icon = "openoffice";
  272. $type = __("OpenOffice - Writer 6.0 document");
  273. }
  274. elseif ($last == "stw") {
  275. $icon = "openoffice";
  276. $type = __("OpenOffice - Writer 6.0 template");
  277. }
  278. elseif ($last == "sxc") {
  279. $icon = "openoffice";
  280. $type = __("OpenOffice - Calc 6.0 spreadsheet");
  281. }
  282. elseif ($last == "stc") {
  283. $icon = "openoffice";
  284. $type = __("OpenOffice - Calc 6.0 template");
  285. }
  286. elseif ($last == "sxd") {
  287. $icon = "openoffice";
  288. $type = __("OpenOffice - Draw 6.0 document");
  289. }
  290. elseif ($last == "std") {
  291. $icon = "openoffice";
  292. $type = __("OpenOffice - Draw 6.0 template");
  293. }
  294. elseif ($last == "sxi") {
  295. $icon = "openoffice";
  296. $type = __("OpenOffice - Impress 6.0 presentation");
  297. }
  298. elseif ($last == "sti") {
  299. $icon = "openoffice";
  300. $type = __("OpenOffice - Impress 6.0 template");
  301. }
  302. elseif ($last == "sxg") {
  303. $icon = "openoffice";
  304. $type = __("OpenOffice - Writer 6.0 global document");
  305. }
  306. elseif ($last == "sxm") {
  307. $icon = "openoffice";
  308. $type = __("OpenOffice - Math 6.0 document");
  309. }
  310. // StarOffice 5
  311. elseif ($last == "sdw") {
  312. $icon = "openoffice";
  313. $type = __("StarOffice - StarWriter 5.x document");
  314. }
  315. elseif ($last == "sgl") {
  316. $icon = "openoffice";
  317. $type = __("StarOffice - StarWriter 5.x global document");
  318. }
  319. elseif ($last == "sdc") {
  320. $icon = "openoffice";
  321. $type = __("StarOffice - StarCalc 5.x spreadsheet");
  322. }
  323. elseif ($last == "sda") {
  324. $icon = "openoffice";
  325. $type = __("StarOffice - StarDraw 5.x document");
  326. }
  327. elseif ($last == "sdd") {
  328. $icon = "openoffice";
  329. $type = __("StarOffice - StarImpress 5.x presentation");
  330. }
  331. elseif ($last == "sdp") {
  332. $icon = "openoffice";
  333. $type = __("StarOffice - StarImpress Packed 5.x file");
  334. }
  335. elseif ($last == "smf") {
  336. $icon = "openoffice";
  337. $type = __("StarOffice - StarMath 5.x document");
  338. }
  339. elseif ($last == "sds") {
  340. $icon = "openoffice";
  341. $type = __("StarOffice - StarChart 5.x document");
  342. }
  343. elseif ($last == "sdm") {
  344. $icon = "openoffice";
  345. $type = __("StarOffice - StarMail 5.x mail file");
  346. }
  347. // PDF and PS
  348. elseif ($last == "pdf") {
  349. $icon = "acroread";
  350. $type = __("Adobe Acrobat document");
  351. }
  352. // Archives
  353. elseif ($last == "arc") {
  354. $icon = "tgz";
  355. $type = __("ARC archive");
  356. }
  357. elseif ($last == "arj") {
  358. $icon = "tgz";
  359. $type = __("ARJ archive");
  360. }
  361. elseif ($last == "rpm") {
  362. $icon = "rpm";
  363. $type = __("RPM");
  364. }
  365. elseif ($last == "gz") {
  366. $icon = "tgz";
  367. $type = __("GZ archive");
  368. }
  369. elseif ($last == "tar") {
  370. $icon = "tar";
  371. $type = __("TAR archive");
  372. }
  373. elseif ($last == "zip") {
  374. $icon = "tgz";
  375. $type = __("Zip archive");
  376. }
  377. // Movies
  378. elseif ($last == "mov") {
  379. $icon = "video";
  380. $type = __("MOV movie file");
  381. }
  382. elseif ($last == "mpg" || $last == "mpeg") {
  383. $icon = "video";
  384. $type = __("MPEG movie file");
  385. }
  386. elseif ($last == "rm" || $last == "ram") {
  387. $icon = "realplayer";
  388. $type = __("Real movie file");
  389. }
  390. elseif ($last == "qt") {
  391. $icon = "quicktime";
  392. $type = __("Quicktime movie file");
  393. }
  394. // Flash
  395. elseif ($last == "fla") {
  396. $icon = "";
  397. $type = __("Shockwave flash file");
  398. }
  399. elseif ($last == "swf") {
  400. $icon = "";
  401. $type = __("Shockwave file");
  402. }
  403. // Sound
  404. elseif ($last == "wav") {
  405. $icon = "sound";
  406. $type = __("WAV sound file");
  407. }
  408. // Fonts
  409. elseif ($last == "ttf") {
  410. $icon = "fonts";
  411. $type = __("Font file");
  412. }
  413. // Default Extension
  414. elseif ($last) {
  415. $icon = "mime";
  416. $type = __("%1\$s File", strtoupper($last));
  417. }
  418. // Default File
  419. else {
  420. $icon = "mime";
  421. $type = __("File");
  422. }
  423. if ($icon == "") { $icon = "mime"; }
  424. if ($type == "") { $type = __("File"); }
  425. // -------------------------------------------------------------------------
  426. // Return mime icon and mime type
  427. // -------------------------------------------------------------------------
  428. // OpenLaszlo skin doesn't need HTML tags
  429. if ($net2ftp_globals["skin"] == "openlaszlo") {
  430. $icon .= ".png";
  431. $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/mime";
  432. $mime["mime_icon"] = "$icon_directory/$icon";
  433. }
  434. // Internet Explorer does not display transparent PNG images correctly.
  435. // A solution is described here: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714
  436. 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")) {
  437. $icon .= ".png";
  438. $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/mime";
  439. $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";
  440. }
  441. else {
  442. $icon .= ".png";
  443. $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/mime";
  444. $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";
  445. }
  446. $mime["mime_type"] = $type;
  447. return $mime;
  448. } // end getMime
  449. // ** **
  450. // ** **
  451. // **************************************************************************************
  452. // **************************************************************************************
  453. // **************************************************************************************
  454. // **************************************************************************************
  455. // ** **
  456. // ** **
  457. function printMime($what, $listline) {
  458. // --------------
  459. // Prints the Mime icon
  460. // --------------
  461. $mime = getMime($listline);
  462. if ($what == "icon") {
  463. echo $mime["mime_icon"];
  464. }
  465. elseif ($what == "type") {
  466. echo $mime["mime_type"];
  467. }
  468. } // end printMimeIcon
  469. // ** **
  470. // ** **
  471. // **************************************************************************************
  472. // **************************************************************************************
  473. // **************************************************************************************
  474. // **************************************************************************************
  475. // ** **
  476. // ** **
  477. function printActionIcon($action, $onclick) {
  478. // --------------
  479. // Checks the icon related to an action
  480. // --------------
  481. // -------------------------------------------------------------------------
  482. // Global variables and settings
  483. // -------------------------------------------------------------------------
  484. global $net2ftp_globals, $net2ftp_settings;
  485. $skinArray = getSkinArray();
  486. // -------------------------------------------------------------------------
  487. // Icon name
  488. // -------------------------------------------------------------------------
  489. if ($action == "back") {
  490. $alt = __("Back");
  491. $icon = "back";
  492. $accesskey = "b";
  493. }
  494. elseif ($action == "forward") {
  495. $alt = __("Submit");
  496. $icon = "button_ok";
  497. $accesskey = "v";
  498. }
  499. elseif ($action == "refresh") {
  500. $alt = __("Refresh");
  501. $icon = "reload";
  502. $accesskey = "r";
  503. }
  504. elseif ($action == "view_details") {
  505. $alt = __("Details");
  506. $icon = "view_detailed";
  507. $accesskey = "";
  508. }
  509. elseif ($action == "view_icons") {
  510. $alt = __("Icons");
  511. $icon = "view_icon";
  512. $accesskey = "";
  513. }
  514. elseif ($action == "listdirectories") {
  515. $alt = __("List");
  516. $icon = "view_tree";
  517. $accesskey = "";
  518. }
  519. elseif ($action == "logout") {
  520. $alt = __("Logout");
  521. $icon = "exit";
  522. $accesskey = "l";
  523. }
  524. elseif ($action == "help") {
  525. $alt = __("Help");
  526. $icon = "info";
  527. $accesskey = "i";
  528. }
  529. elseif ($action == "bookmark") {
  530. $alt = __("Bookmark");
  531. $icon = "bookmark";
  532. $accesskey = "h";
  533. }
  534. elseif ($action == "save") {
  535. $alt = __("Save");
  536. $icon = "filesave";
  537. $accesskey = "s";
  538. }
  539. elseif ($action == "up") {
  540. $alt = __("Up");
  541. $icon = "up";
  542. $accesskey = "u";
  543. }
  544. else {
  545. $alt = __("Default");
  546. $icon = "mime";
  547. $accesskey = "";
  548. }
  549. $icon .= ".png";
  550. if ($accesskey != "") {
  551. $alt = $alt . " (accesskey $accesskey)";
  552. $accesskeytag = "accesskey=\"$accesskey\"" ;
  553. }
  554. else {
  555. $accesskeytag = "";
  556. }
  557. // -------------------------------------------------------------------------
  558. // Icon directory
  559. // -------------------------------------------------------------------------
  560. $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/actions";
  561. // -------------------------------------------------------------------------
  562. // URL
  563. // Do not include a URL if $onclick is empty
  564. // -------------------------------------------------------------------------
  565. if ($onclick != "") {
  566. $href_start = "<a href=\"javascript:$onclick\" title=\"$alt\" $accesskeytag>";
  567. $href_end = "</a>";
  568. }
  569. else {
  570. $href_start = "";
  571. $href_end = "";
  572. }
  573. // -------------------------------------------------------------------------
  574. // Return text (for mobile skin) or icon (for all other skins)
  575. // -------------------------------------------------------------------------
  576. if ($skinArray[$net2ftp_globals["skin"]]["icon_size_mime"] == 0) {
  577. $icon_total = "$href_start$action ($accesskey)$href_end\n";
  578. }
  579. // Internet Explorer does not display transparent PNG images correctly.
  580. // A solution is described here: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714
  581. 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")) {
  582. $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";
  583. }
  584. else {
  585. $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";
  586. }
  587. echo $icon_total;
  588. /* -------------------------------------------------------------------------
  589. ---------------------------
  590. Accesskey documentation
  591. ---------------------------
  592. Tutorial
  593. http://www.cs.tut.fi/~jkorpela/forms/accesskey.html
  594. ALT-A and ALT-F may not be used on IE
  595. Login page
  596. ---------------------------
  597. l login
  598. Logout page
  599. ---------------------------
  600. l link to login page
  601. Browse page
  602. ---------------------------
  603. See icons above.
  604. Used: b, v, r, l, i, h, s
  605. g directory textbox
  606. Actions
  607. w new dir
  608. y new file
  609. e install template
  610. u upload, up
  611. n advanced
  612. c copy
  613. m move
  614. d delete
  615. o rename
  616. p chmod
  617. x download
  618. z zip
  619. q size
  620. j search
  621. Headers
  622. k up
  623. t all
  624. Items
  625. 1 item 1
  626. 2 item 2
  627. ...
  628. 9 item 9
  629. ------------------------------------------------------------------------- */
  630. } // end printActionIcon
  631. // ** **
  632. // ** **
  633. // **************************************************************************************
  634. // **************************************************************************************
  635. // **************************************************************************************
  636. // **************************************************************************************
  637. // ** **
  638. // ** **
  639. function printModeIcon($setting, $on_off, $onclick) {
  640. // --------------
  641. // Checks the icon related to a mode
  642. // --------------
  643. // -------------------------------------------------------------------------
  644. // Global variables and settings
  645. // -------------------------------------------------------------------------
  646. global $net2ftp_globals, $net2ftp_settings;
  647. if ($setting == "details") {
  648. $alt = __("Details");
  649. $icon = "view_detailed";
  650. }
  651. elseif ($setting == "icons") {
  652. $alt = __("Icons");
  653. $icon = "view_icon";
  654. }
  655. // Default
  656. else {
  657. $alt = __("Default");
  658. $icon = "mime";
  659. }
  660. // Default
  661. if ($alt == "") { $alt = "Default"; }
  662. if ($icon == "") { $icon = "mime"; }
  663. // On or off: icon and style
  664. if ($on_off == "on") {
  665. $icon_normal = $icon;
  666. $icon_onmouseover = $icon;
  667. }
  668. else {
  669. $icon_normal = $icon . "_light";
  670. $icon_onmouseover = $icon;
  671. }
  672. // -------------------------------------------------------------------------
  673. // Icon directory
  674. // -------------------------------------------------------------------------
  675. $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/settings";
  676. // -------------------------------------------------------------------------
  677. // Return icon
  678. // -------------------------------------------------------------------------
  679. // DO NOT CLOSE THE IMAGE TAG TO ALLOW ADDITIONAL ACTIONS
  680. if ($on_off == "on") {
  681. 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")) {
  682. $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";
  683. }
  684. else {
  685. $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";
  686. }
  687. }
  688. else {
  689. 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")) {
  690. $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";
  691. }
  692. else {
  693. $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";
  694. }
  695. }
  696. return $icon_total;
  697. } // end printModeIcon
  698. // ** **
  699. // ** **
  700. // **************************************************************************************
  701. // **************************************************************************************
  702. // **************************************************************************************
  703. // **************************************************************************************
  704. // ** **
  705. // ** **
  706. function printTitleIcon() {
  707. // --------------
  708. // This function returns the title icon based on the $state and $state2 variables
  709. // --------------
  710. // -------------------------------------------------------------------------
  711. // Global variables and settings
  712. // -------------------------------------------------------------------------
  713. global $net2ftp_globals, $net2ftp_settings;
  714. $skinArray = getSkinArray();
  715. // -------------------------------------------------------------------------
  716. // Icon names
  717. // -------------------------------------------------------------------------
  718. if ($net2ftp_globals["state"] == "admin" || $net2ftp_globals["state"] == "admin_createtables" || $net2ftp_globals["state"] == "admin_emptylogs" || $net2ftp_globals["state"] == "admin_viewlogs") {
  719. $icon = "kcontrol";
  720. }
  721. elseif ($net2ftp_globals["state"] == "advanced" || $net2ftp_globals["state"] == "advanced_ftpserver" || $net2ftp_globals["state"] == "advanced_parsing" || $net2ftp_globals["state"] == "advanced_webserver") {
  722. $icon = "misc";
  723. }
  724. elseif ($net2ftp_globals["state"] == "bookmark") {
  725. $icon = "bookmark";
  726. }
  727. elseif ($net2ftp_globals["state"] == "calculatesize") {
  728. $icon = "";
  729. }
  730. elseif ($net2ftp_globals["state"] == "chmod") {
  731. $icon = "kgpg_info";
  732. }
  733. elseif ($net2ftp_globals["state"] == "copymovedelete") {
  734. if ($net2ftp_globals["state2"] == "copy") { $icon = "editcopy"; }
  735. elseif ($net2ftp_globals["state2"] == "move") { $icon = "editcut"; }
  736. elseif ($net2ftp_globals["state2"] == "delete") { $icon = "edittrash"; }
  737. }
  738. elseif ($net2ftp_globals["state"] == "easywebsite") {
  739. $icon = "colorize";
  740. }
  741. elseif ($net2ftp_globals["state"] == "edit") {
  742. $icon = "package_editors";
  743. }
  744. elseif ($net2ftp_globals["state"] == "findstring") {
  745. $icon = "viewmag";
  746. }
  747. elseif ($net2ftp_globals["state"] == "jupload" || $net2ftp_globals["state"] == "upload") {
  748. $icon = "konquest";
  749. }
  750. elseif ($net2ftp_globals["state"] == "login" || $net2ftp_globals["state"] == "login_small") {
  751. $icon = "kgpg_identity";
  752. }
  753. elseif ($net2ftp_globals["state"] == "newdir") {
  754. $icon = "folder_new";
  755. }
  756. elseif ($net2ftp_globals["state"] == "rename") {
  757. $icon = "folder_txt";
  758. }
  759. elseif ($net2ftp_globals["state"] == "updatefile") {
  760. $icon = "view_left_right";
  761. }
  762. elseif ($net2ftp_globals["state"] == "view") {
  763. if ($net2ftp_globals["state2"] == "image") { $icon = "thumbnail"; }
  764. elseif ($net2ftp_globals["state2"] == "flash") { $icon = "aktion"; }
  765. elseif ($net2ftp_globals["state2"] == "text") { $icon = "terminal"; }
  766. }
  767. elseif ($net2ftp_globals["state"] == "zip") {
  768. $icon = "ark";
  769. }
  770. // Default File
  771. else {
  772. $icon = "misc";
  773. }
  774. if ($icon == "") { $icon = "misc"; }
  775. // -------------------------------------------------------------------------
  776. // Return title icon
  777. // -------------------------------------------------------------------------
  778. $icon .= ".png";
  779. $icon_directory = $skinArray[$net2ftp_globals["skin"]]["image_url"] . "/titles";
  780. // Internet Explorer does not display transparent PNG images correctly.
  781. // A solution is described here: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714
  782. 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")) {
  783. $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";
  784. }
  785. else {
  786. $icon_total = "<img src=\"$icon_directory/$icon\" alt=\"icon\" style=\"width: 48px; height: 48px; vertical-align: middle;\" />\n";
  787. }
  788. echo $icon_total;
  789. } // end printTitleIcon
  790. // ** **
  791. // ** **
  792. // **************************************************************************************
  793. // **************************************************************************************
  794. // **************************************************************************************
  795. // **************************************************************************************
  796. // ** **
  797. // ** **
  798. function printPngImage($src, $alt, $style) {
  799. // --------------
  800. // This function prints a .png image with or without the fix for IE
  801. // Prerequisite: spacer.gif must exist in the same directory as the image
  802. // --------------
  803. // -------------------------------------------------------------------------
  804. // Global variables and settings
  805. // -------------------------------------------------------------------------
  806. global $net2ftp_globals, $net2ftp_settings;
  807. // -------------------------------------------------------------------------
  808. // Calculate the src of spacer.gif
  809. // -------------------------------------------------------------------------
  810. $last_slash_position = strrpos($src, "/");
  811. if ($last_slash_position === false) { $src_spacer = "spacer.gif"; }
  812. else {
  813. $src_spacer = substr($src, 0, $last_slash_position+1) . "spacer.gif";
  814. }
  815. // -------------------------------------------------------------------------
  816. // Form the HTML
  817. // -------------------------------------------------------------------------
  818. // Internet Explorer does not display transparent PNG images correctly.
  819. // A solution is described here: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294714
  820. 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")) {
  821. $image = "<img src=\"$src_spacer\" alt=\"$alt\" style=\"$style; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$src', sizingMethod='scale')\" />\n";
  822. }
  823. else {
  824. $image = "<img src=\"$src\" alt=\"$alt\" style=\"$style\" />\n";
  825. }
  826. echo $image;
  827. } // end printPngImage
  828. // ** **
  829. // ** **
  830. // **************************************************************************************
  831. // **************************************************************************************
  832. ?>