PageRenderTime 53ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/filemanager/dialog.php

https://github.com/molnarzoli82/viola
PHP | 987 lines | 900 code | 73 blank | 14 comment | 146 complexity | f9ca033917d345929e20055188d620ed MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0
  1. <?php
  2. include('config/config.php');
  3. if (USE_ACCESS_KEYS == TRUE){
  4. if (!isset($_GET['akey'], $access_keys) || empty($access_keys)){
  5. die('Access Denied!');
  6. }
  7. $_GET['akey'] = strip_tags(preg_replace( "/[^a-zA-Z0-9\._-]/", '', $_GET['akey']));
  8. if (!in_array($_GET['akey'], $access_keys)){
  9. die('Access Denied!');
  10. }
  11. }
  12. $_SESSION['RF']["verify"] = "RESPONSIVEfilemanager";
  13. if(isset($_POST['submit'])){
  14. include('upload.php');
  15. }
  16. else {
  17. include('include/utils.php');
  18. if (isset($_GET['fldr'])
  19. && !empty($_GET['fldr'])
  20. && strpos($_GET['fldr'],'../') === FALSE
  21. && strpos($_GET['fldr'],'./') === FALSE)
  22. {
  23. $subdir = urldecode(trim(strip_tags($_GET['fldr']),"/") ."/");
  24. }
  25. else { $subdir = ''; }
  26. if($subdir == "")
  27. {
  28. if(!empty($_COOKIE['last_position'])
  29. && strpos($_COOKIE['last_position'],'.') === FALSE)
  30. $subdir= trim($_COOKIE['last_position']);
  31. }
  32. //remember last position
  33. setcookie('last_position',$subdir,time() + (86400 * 7));
  34. if ($subdir == "/") { $subdir = ""; }
  35. /***
  36. *SUB-DIR CODE
  37. ***/
  38. if (!isset($_SESSION['RF']["subfolder"]))
  39. {
  40. $_SESSION['RF']["subfolder"] = '';
  41. }
  42. $rfm_subfolder = '';
  43. if (!empty($_SESSION['RF']["subfolder"]) && strpos($_SESSION['RF']["subfolder"],'../') === FALSE
  44. && strpos($_SESSION['RF']["subfolder"],'./') === FALSE && strpos($_SESSION['RF']["subfolder"],"/") !== 0
  45. && strpos($_SESSION['RF']["subfolder"],'.') === FALSE)
  46. {
  47. $rfm_subfolder = $_SESSION['RF']['subfolder'];
  48. }
  49. if ($rfm_subfolder != "" && $rfm_subfolder[strlen($rfm_subfolder)-1] != "/") { $rfm_subfolder .= "/"; }
  50. if (!file_exists($current_path . $rfm_subfolder.$subdir))
  51. {
  52. $subdir = '';
  53. if (!file_exists($current_path . $rfm_subfolder.$subdir))
  54. {
  55. $rfm_subfolder = "";
  56. }
  57. }
  58. if (trim($rfm_subfolder) == "")
  59. {
  60. $cur_dir = $upload_dir . $subdir;
  61. $cur_path = $current_path . $subdir;
  62. $thumbs_path = $thumbs_base_path;
  63. $parent = $subdir;
  64. }
  65. else
  66. {
  67. $cur_dir = $upload_dir . $rfm_subfolder.$subdir;
  68. $cur_path = $current_path . $rfm_subfolder.$subdir;
  69. $thumbs_path = $thumbs_base_path. $rfm_subfolder;
  70. $parent = $rfm_subfolder.$subdir;
  71. }
  72. $cycle = TRUE;
  73. $max_cycles = 50;
  74. $i = 0;
  75. while($cycle && $i < $max_cycles){
  76. $i++;
  77. if ($parent=="./") $parent="";
  78. if (file_exists($current_path.$parent."config.php"))
  79. {
  80. require_once($current_path.$parent."config.php");
  81. $cycle = FALSE;
  82. }
  83. if ($parent == "") $cycle = FALSE;
  84. else $parent = fix_dirname($parent)."/";
  85. }
  86. if (!is_dir($thumbs_path.$subdir))
  87. {
  88. create_folder(FALSE, $thumbs_path.$subdir);
  89. }
  90. if (isset($_GET['popup']))
  91. {
  92. $popup = strip_tags($_GET['popup']);
  93. }
  94. else $popup=0;
  95. //Sanitize popup
  96. $popup=!!$popup;
  97. if (isset($_GET['crossdomain']))
  98. {
  99. $crossdomain = strip_tags($_GET['crossdomain']);
  100. }
  101. else $crossdomain=0;
  102. //Sanitize crossdomain
  103. $crossdomain=!!$crossdomain;
  104. //view type
  105. if(!isset($_SESSION['RF']["view_type"]))
  106. {
  107. $view = $default_view;
  108. $_SESSION['RF']["view_type"] = $view;
  109. }
  110. if (isset($_GET['view']))
  111. {
  112. $view = fix_get_params($_GET['view']);
  113. $_SESSION['RF']["view_type"] = $view;
  114. }
  115. $view = $_SESSION['RF']["view_type"];
  116. if(isset($_GET["filter"]))
  117. {
  118. $filter = fix_get_params($_GET["filter"]);
  119. }
  120. else $filter = '';
  121. if (!isset($_SESSION['RF']['sort_by']))
  122. {
  123. $_SESSION['RF']['sort_by'] = '';
  124. }
  125. if (isset($_GET["sort_by"]))
  126. {
  127. $sort_by = $_SESSION['RF']['sort_by'] = fix_get_params($_GET["sort_by"]);
  128. }
  129. else $sort_by = $_SESSION['RF']['sort_by'];
  130. if (!isset($_SESSION['RF']['descending']))
  131. {
  132. $_SESSION['RF']['descending'] = FALSE;
  133. }
  134. if (isset($_GET["descending"]))
  135. {
  136. $descending = $_SESSION['RF']['descending'] = fix_get_params($_GET["descending"])==="true";
  137. }
  138. else $descending = $_SESSION['RF']['descending'];
  139. // language
  140. if (!isset($_SESSION['RF']['language'])
  141. || file_exists($_SESSION['RF']['language_file']) === FALSE
  142. || !is_readable($_SESSION['RF']['language_file']))
  143. {
  144. $lang = $default_language;
  145. if (isset($_GET['lang']) && $_GET['lang'] != 'undefined' && $_GET['lang']!='')
  146. {
  147. $lang = fix_get_params($_GET['lang']);
  148. $lang = trim($lang);
  149. }
  150. $language_file = 'lang/'.$default_language.'.php';
  151. if ($lang != $default_language)
  152. {
  153. $path_parts = pathinfo($lang);
  154. if (is_readable('lang/' .$path_parts['basename']. '.php'))
  155. {
  156. $language_file = 'lang/' .$path_parts['basename']. '.php';
  157. }
  158. else
  159. {
  160. echo "<script>console.log('The ".$lang." language file is not readable! Falling back...');</script>";
  161. }
  162. }
  163. // add lang file to session for easy include
  164. $_SESSION['RF']['language'] = $lang;
  165. $_SESSION['RF']['language_file'] = $language_file;
  166. }
  167. else
  168. {
  169. $lang = $_SESSION['RF']['language'];
  170. $language_file = $_SESSION['RF']['language_file'];
  171. }
  172. require_once $language_file;
  173. if (!isset($_GET['type'])) $_GET['type'] = 0;
  174. if (!isset($_GET['field_id'])) $_GET['field_id'] = '';
  175. $field_id = isset($_GET['field_id']) ? fix_get_params($_GET['field_id']) : '';
  176. $type_param = fix_get_params($_GET['type']);
  177. $get_params = http_build_query(array(
  178. 'type' => $type_param,
  179. 'lang' => $lang,
  180. 'popup' => $popup,
  181. 'crossdomain' => $crossdomain,
  182. 'field_id' => $field_id,
  183. 'akey' => (isset($_GET['akey']) && $_GET['akey'] != '' ? $_GET['akey'] : 'key'),
  184. 'fldr' => ''
  185. ));
  186. ?>
  187. <!DOCTYPE html>
  188. <html xmlns="https://www.w3.org/1999/xhtml">
  189. <head>
  190. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
  191. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  192. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  193. <meta name="robots" content="noindex,nofollow">
  194. <title>Responsive FileManager</title>
  195. <link rel="shortcut icon" href="img/ico/favicon.ico">
  196. <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  197. <link href="css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css" />
  198. <link href="css/bootstrap-lightbox.min.css" rel="stylesheet" type="text/css" />
  199. <link href="css/style.css" rel="stylesheet" type="text/css" />
  200. <link href="css/dropzone.min.css" type="text/css" rel="stylesheet" />
  201. <?php
  202. $sprite_lang_file = 'img/spritemap_'.$lang.'.png';
  203. $sprite_lang_file2 = 'img/spritemap@2x_'.$lang.'.png';
  204. if ( ! file_exists($sprite_lang_file) || ! file_exists($sprite_lang_file2)){
  205. //fallback
  206. $sprite_lang_file = 'img/spritemap_en_EN.png';
  207. $sprite_lang_file2 = 'img/spritemap@2x_en_EN.png';
  208. if ( ! file_exists($sprite_lang_file) || ! file_exists($sprite_lang_file2)){
  209. // we are in deep ****
  210. echo '<script>console.log("Error: Spritemap not found!");</script>';
  211. // exit();
  212. }
  213. }
  214. ?>
  215. <style>
  216. .dropzone .dz-default.dz-message,
  217. .dropzone .dz-preview .dz-error-mark,
  218. .dropzone-previews .dz-preview .dz-error-mark,
  219. .dropzone .dz-preview .dz-success-mark,
  220. .dropzone-previews .dz-preview .dz-success-mark,
  221. .dropzone .dz-preview .dz-progress .dz-upload,
  222. .dropzone-previews .dz-preview .dz-progress .dz-upload {
  223. background-image: url(<?php echo $sprite_lang_file; ?>);
  224. }
  225. @media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
  226. .dropzone .dz-default.dz-message,
  227. .dropzone .dz-preview .dz-error-mark,
  228. .dropzone-previews .dz-preview .dz-error-mark,
  229. .dropzone .dz-preview .dz-success-mark,
  230. .dropzone-previews .dz-preview .dz-success-mark,
  231. .dropzone .dz-preview .dz-progress .dz-upload,
  232. .dropzone-previews .dz-preview .dz-progress .dz-upload {
  233. background-image: url(<?php echo $sprite_lang_file; ?>);
  234. }
  235. }
  236. </style>
  237. <link href="css/jquery.contextMenu.min.css" rel="stylesheet" type="text/css" />
  238. <link href="css/bootstrap-modal.min.css" rel="stylesheet" type="text/css" />
  239. <link href="jPlayer/skin/blue.monday/jplayer.blue.monday.css" rel="stylesheet" type="text/css">
  240. <!--[if lt IE 8]><style>
  241. .img-container span, .img-container-mini span {
  242. display: inline-block;
  243. height: 100%;
  244. }
  245. </style><![endif]-->
  246. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  247. <script type="text/javascript">
  248. if (typeof jQuery === 'undefined')
  249. {
  250. document.write(unescape("%3Cscript src='js/jquery.js' type='text/javascript'%3E%3C/script%3E"));
  251. }
  252. </script>
  253. <script type="text/javascript" src="js/bootstrap.min.js"></script>
  254. <script type="text/javascript" src="js/bootstrap-lightbox.min.js"></script>
  255. <script type="text/javascript" src="js/dropzone.min.js"></script>
  256. <script type="text/javascript" src="js/jquery.touchSwipe.min.js"></script>
  257. <script type="text/javascript" src="js/modernizr.custom.js"></script>
  258. <script type="text/javascript" src="js/bootbox.min.js"></script>
  259. <script type="text/javascript" src="js/bootstrap-modal.min.js"></script>
  260. <script type="text/javascript" src="js/bootstrap-modalmanager.min.js"></script>
  261. <script type="text/javascript" src="jPlayer/jquery.jplayer.min.js"></script>
  262. <script type="text/javascript" src="js/imagesloaded.pkgd.min.js"></script>
  263. <script type="text/javascript" src="js/jquery.queryloader2.min.js"></script>
  264. <?php
  265. if ($aviary_active){
  266. if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { ?>
  267. <script type="text/javascript" src="https://dme0ih8comzn4.cloudfront.net/js/feather.js"></script>
  268. <?php }else{ ?>
  269. <script type="text/javascript" src="http://feather.aviary.com/js/feather.js "></script>
  270. <?php }} ?>
  271. <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
  272. <!--[if lt IE 9]>
  273. <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
  274. <![endif]-->
  275. <script src="js/jquery.ui.position.min.js" type="text/javascript"></script>
  276. <script src="js/jquery-ui-1.10.4.custom.js" type="text/javascript"></script>
  277. <script src="js/jquery.contextMenu.min.js" type="text/javascript"></script>
  278. <script>
  279. var ext_img=new Array('<?php echo implode("','", $ext_img)?>');
  280. var allowed_ext=new Array('<?php echo implode("','", $ext)?>');
  281. var loading_bar=<?php echo $loading_bar?"true":"false"; ?>;
  282. var image_editor=<?php echo $aviary_active?"true":"false"; ?>;
  283. //dropzone config
  284. Dropzone.options.myAwesomeDropzone = {
  285. dictInvalidFileType: "<?php echo lang_Error_extension;?>",
  286. dictFileTooBig: "<?php echo lang_Error_Upload; ?>",
  287. dictResponseError: "SERVER ERROR",
  288. paramName: "file", // The name that will be used to transfer the file
  289. maxFilesize: <?php echo $MaxSizeUpload; ?>, // MB
  290. url: "upload.php",
  291. accept: function(file, done) {
  292. var extension=file.name.split('.').pop();
  293. extension=extension.toLowerCase();
  294. if ($.inArray(extension, allowed_ext) > -1) {
  295. done();
  296. }
  297. else {
  298. done("<?php echo lang_Error_extension;?>");
  299. }
  300. }
  301. };
  302. if (image_editor) {
  303. var featherEditor = new Aviary.Feather({
  304. apiKey: "<?php echo $aviary_key; ?>",
  305. apiVersion: <?php echo $aviary_version; ?>,
  306. language: "<?php echo $aviary_language; ?>",
  307. theme: 'light',
  308. tools: 'all',
  309. onSave: function(imageID, newURL) {
  310. show_animation();
  311. var img = document.getElementById(imageID);
  312. img.src = newURL;
  313. $.ajax({
  314. type: "POST",
  315. url: "ajax_calls.php?action=save_img",
  316. data: { url: newURL, path:$('#sub_folder').val()+$('#fldr_value').val(), name:$('#aviary_img').data('name') }
  317. }).done(function( msg ) {
  318. featherEditor.close();
  319. d = new Date();
  320. $("figure[data-name='"+$('#aviary_img').data('name')+"']").find('img').each(function(){
  321. $(this).attr('src',$(this).attr('src')+"?"+d.getTime());
  322. });
  323. $("figure[data-name='"+$('#aviary_img').data('name')+"']").find('figcaption a.preview').each(function(){
  324. $(this).data('url',$(this).data('url')+"?"+d.getTime());
  325. });
  326. hide_animation();
  327. });
  328. return false;
  329. },
  330. onError: function(errorObj) {
  331. bootbox.alert(errorObj.message);
  332. }
  333. });
  334. }
  335. </script>
  336. <script type="text/javascript" src="js/include.min.js"></script>
  337. </head>
  338. <body>
  339. <input type="hidden" id="popup" value="<?php echo $popup; ?>" />
  340. <input type="hidden" id="crossdomain" value="<?php echo $crossdomain; ?>" />
  341. <input type="hidden" id="view" value="<?php echo $view; ?>" />
  342. <input type="hidden" id="cur_dir" value="<?php echo $cur_dir; ?>" />
  343. <input type="hidden" id="cur_dir_thumb" value="<?php echo $thumbs_path.$subdir; ?>" />
  344. <input type="hidden" id="insert_folder_name" value="<?php echo lang_Insert_Folder_Name; ?>" />
  345. <input type="hidden" id="new_folder" value="<?php echo lang_New_Folder; ?>" />
  346. <input type="hidden" id="ok" value="<?php echo lang_OK; ?>" />
  347. <input type="hidden" id="cancel" value="<?php echo lang_Cancel; ?>" />
  348. <input type="hidden" id="rename" value="<?php echo lang_Rename; ?>" />
  349. <input type="hidden" id="lang_duplicate" value="<?php echo lang_Duplicate; ?>" />
  350. <input type="hidden" id="duplicate" value="<?php if($duplicate_files) echo 1; else echo 0; ?>" />
  351. <input type="hidden" id="base_url" value="<?php echo $base_url?>"/>
  352. <input type="hidden" id="base_url_true" value="<?php echo base_url(); ?>"/>
  353. <input type="hidden" id="fldr_value" value="<?php echo $subdir; ?>"/>
  354. <input type="hidden" id="sub_folder" value="<?php echo $rfm_subfolder; ?>"/>
  355. <input type="hidden" id="file_number_limit_js" value="<?php echo $file_number_limit_js; ?>" />
  356. <input type="hidden" id="descending" value="<?php echo $descending?"true":"false"; ?>" />
  357. <?php $protocol = 'http'; ?>
  358. <input type="hidden" id="current_url" value="<?php echo str_replace(array('&filter='.$filter),array(''),$protocol."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?>" />
  359. <input type="hidden" id="lang_show_url" value="<?php echo lang_Show_url; ?>" />
  360. <input type="hidden" id="copy_cut_files_allowed" value="<?php if($copy_cut_files) echo 1; else echo 0; ?>" />
  361. <input type="hidden" id="copy_cut_dirs_allowed" value="<?php if($copy_cut_dirs) echo 1; else echo 0; ?>" />
  362. <input type="hidden" id="copy_cut_max_size" value="<?php echo $copy_cut_max_size; ?>" />
  363. <input type="hidden" id="copy_cut_max_count" value="<?php echo $copy_cut_max_count; ?>" />
  364. <input type="hidden" id="lang_copy" value="<?php echo lang_Copy; ?>" />
  365. <input type="hidden" id="lang_cut" value="<?php echo lang_Cut; ?>" />
  366. <input type="hidden" id="lang_paste" value="<?php echo lang_Paste; ?>" />
  367. <input type="hidden" id="lang_paste_here" value="<?php echo lang_Paste_Here; ?>" />
  368. <input type="hidden" id="lang_paste_confirm" value="<?php echo lang_Paste_Confirm; ?>" />
  369. <input type="hidden" id="lang_files_on_clipboard" value="<?php echo lang_Files_ON_Clipboard; ?>" />
  370. <input type="hidden" id="clipboard" value="<?php echo ((isset($_SESSION['RF']['clipboard']['path']) && trim($_SESSION['RF']['clipboard']['path']) != null) ? 1 : 0); ?>" />
  371. <input type="hidden" id="lang_clear_clipboard_confirm" value="<?php echo lang_Clear_Clipboard_Confirm; ?>" />
  372. <input type="hidden" id="lang_file_permission" value="<?php echo lang_File_Permission; ?>" />
  373. <input type="hidden" id="chmod_files_allowed" value="<?php if($chmod_files) echo 1; else echo 0; ?>" />
  374. <input type="hidden" id="chmod_dirs_allowed" value="<?php if($chmod_dirs) echo 1; else echo 0; ?>" />
  375. <input type="hidden" id="lang_lang_change" value="<?php echo lang_Lang_Change; ?>" />
  376. <input type="hidden" id="edit_text_files_allowed" value="<?php if($edit_text_files) echo 1; else echo 0; ?>" />
  377. <input type="hidden" id="lang_edit_file" value="<?php echo lang_Edit_File; ?>" />
  378. <input type="hidden" id="lang_new_file" value="<?php echo lang_New_File; ?>" />
  379. <input type="hidden" id="lang_filename" value="<?php echo lang_Filename; ?>" />
  380. <input type="hidden" id="lang_file_info" value="<?php echo fix_strtoupper(lang_File_info); ?>" />
  381. <input type="hidden" id="lang_edit_image" value="<?php echo lang_Edit_image; ?>" />
  382. <input type="hidden" id="lang_extract" value="<?php echo lang_Extract; ?>" />
  383. <input type="hidden" id="transliteration" value="<?php echo $transliteration?"true":"false"; ?>" />
  384. <input type="hidden" id="convert_spaces" value="<?php echo $convert_spaces?"true":"false"; ?>" />
  385. <?php if($upload_files){ ?>
  386. <!-- uploader div start -->
  387. <div class="uploader">
  388. <center><button class="btn btn-inverse close-uploader"><i class="icon-backward icon-white"></i> <?php echo lang_Return_Files_List?></button></center>
  389. <div class="space10"></div><div class="space10"></div>
  390. <div class="tabbable upload-tabbable"> <!-- Only required for left/right tabs -->
  391. <?php if($java_upload){ ?>
  392. <ul class="nav nav-tabs">
  393. <li class="active"><a href="#tab1" data-toggle="tab"><?php echo lang_Upload_base; ?></a></li>
  394. <li><a href="#tab2" id="uploader-btn" data-toggle="tab"><?php echo lang_Upload_java; ?></a></li>
  395. </ul>
  396. <div class="tab-content">
  397. <div class="tab-pane active" id="tab1">
  398. <?php } ?>
  399. <form action="dialog.php" method="post" enctype="multipart/form-data" id="myAwesomeDropzone" class="dropzone">
  400. <input type="hidden" name="path" value="<?php echo $cur_path?>"/>
  401. <input type="hidden" name="path_thumb" value="<?php echo $thumbs_path.$subdir?>"/>
  402. <div class="fallback">
  403. <?php echo lang_Upload_file?>:<br/>
  404. <input name="file" type="file" />
  405. <input type="hidden" name="fldr" value="<?php echo $subdir; ?>"/>
  406. <input type="hidden" name="view" value="<?php echo $view; ?>"/>
  407. <input type="hidden" name="type" value="<?php echo $type_param; ?>"/>
  408. <input type="hidden" name="field_id" value="<?php echo $field_id; ?>"/>
  409. <input type="hidden" name="popup" value="<?php echo $popup; ?>"/>
  410. <input type="hidden" name="lang" value="<?php echo $lang; ?>"/>
  411. <input type="hidden" name="filter" value="<?php echo $filter; ?>"/>
  412. <input type="submit" name="submit" value="<?php echo lang_OK?>" />
  413. </form>
  414. </div>
  415. <div class="upload-help"><?php echo lang_Upload_base_help; ?></div>
  416. <?php if($java_upload){ ?>
  417. </div>
  418. <div class="tab-pane" id="tab2">
  419. <div id="iframe-container"></div>
  420. <div class="upload-help"><?php echo lang_Upload_java_help; ?></div>
  421. <?php } ?>
  422. </div>
  423. </div>
  424. </div>
  425. </div>
  426. <!-- uploader div start -->
  427. <?php } ?>
  428. <div class="container-fluid">
  429. <?php
  430. $class_ext = '';
  431. $src = '';
  432. if ($_GET['type']==1) $apply = 'apply_img';
  433. elseif($_GET['type']==2) $apply = 'apply_link';
  434. elseif($_GET['type']==0 && $_GET['field_id']=='') $apply = 'apply_none';
  435. elseif($_GET['type']==3) $apply = 'apply_video';
  436. else $apply = 'apply';
  437. $files = scandir($current_path.$rfm_subfolder.$subdir);
  438. $n_files=count($files);
  439. //php sorting
  440. $sorted=array();
  441. $current_folder=array();
  442. $prev_folder=array();
  443. foreach($files as $k=>$file){
  444. if($file==".") $current_folder=array('file'=>$file);
  445. elseif($file=="..") $prev_folder=array('file'=>$file);
  446. elseif(is_dir($current_path.$rfm_subfolder.$subdir.$file)){
  447. $date=filemtime($current_path.$rfm_subfolder.$subdir. $file);
  448. if($show_folder_size){
  449. $size=foldersize($current_path.$rfm_subfolder.$subdir. $file);
  450. } else {
  451. $size=0;
  452. }
  453. $file_ext=lang_Type_dir;
  454. $sorted[$k]=array('file'=>$file,'date'=>$date,'size'=>$size,'extension'=>$file_ext);
  455. }else{
  456. $file_path=$current_path.$rfm_subfolder.$subdir.$file;
  457. $date=filemtime($file_path);
  458. $size=filesize($file_path);
  459. $file_ext = substr(strrchr($file,'.'),1);
  460. $sorted[$k]=array('file'=>$file,'date'=>$date,'size'=>$size,'extension'=>$file_ext);
  461. }
  462. }
  463. function filenameSort($x, $y) {
  464. return $x['file'] < $y['file'];
  465. }
  466. function dateSort($x, $y) {
  467. return $x['date'] < $y['date'];
  468. }
  469. function sizeSort($x, $y) {
  470. return $x['size'] - $y['size'];
  471. }
  472. function extensionSort($x, $y) {
  473. return $x['extension'] < $y['extension'];
  474. }
  475. switch($sort_by){
  476. case 'name':
  477. usort($sorted, 'filenameSort');
  478. break;
  479. case 'date':
  480. usort($sorted, 'dateSort');
  481. break;
  482. case 'size':
  483. usort($sorted, 'sizeSort');
  484. break;
  485. case 'extension':
  486. usort($sorted, 'extensionSort');
  487. break;
  488. default:
  489. break;
  490. }
  491. if($descending){
  492. $sorted=array_reverse($sorted);
  493. }
  494. $files=array_merge(array($prev_folder),array($current_folder),$sorted);
  495. ?>
  496. <!-- header div start -->
  497. <div class="navbar navbar-fixed-top">
  498. <div class="navbar-inner">
  499. <div class="container-fluid">
  500. <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  501. <span class="icon-bar"></span>
  502. <span class="icon-bar"></span>
  503. <span class="icon-bar"></span>
  504. </button>
  505. <div class="brand"><?php echo lang_Toolbar; ?> -></div>
  506. <div class="nav-collapse collapse">
  507. <div class="filters">
  508. <div class="row-fluid">
  509. <div class="span4 half">
  510. <span class="mobile-inline-visible"><?php echo lang_Operations; ?>:</span>
  511. <?php if($upload_files){ ?>
  512. <button class="tip btn upload-btn" title="<?php echo lang_Upload_file; ?>"><i class="rficon-upload"></i></button>
  513. <?php } ?>
  514. <?php if($create_text_files){ ?>
  515. <button class="tip btn create-file-btn" title="<?php echo lang_New_File; ?>"><i class="icon-plus"></i><i class="icon-file"></i></button>
  516. <?php } ?>
  517. <?php if($create_folders){ ?>
  518. <button class="tip btn new-folder" title="<?php echo lang_New_Folder?>"><i class="icon-plus"></i><i class="icon-folder-open"></i></button>
  519. <?php } ?>
  520. <?php if($copy_cut_files || $copy_cut_dirs){ ?>
  521. <button class="tip btn paste-here-btn" title="<?php echo lang_Paste_Here; ?>"><i class="rficon-clipboard-apply"></i></button>
  522. <button class="tip btn clear-clipboard-btn" title="<?php echo lang_Clear_Clipboard; ?>"><i class="rficon-clipboard-clear"></i></button>
  523. <?php } ?>
  524. </div>
  525. <div class="span2 half view-controller">
  526. <span class="mobile-inline-visible"><?php echo lang_View; ?>:</span>
  527. <button class="btn tip<?php if($view==0) echo " btn-inverse"; ?>" id="view0" data-value="0" title="<?php echo lang_View_boxes; ?>"><i class="icon-th <?php if($view==0) echo "icon-white"; ?>"></i></button>
  528. <button class="btn tip<?php if($view==1) echo " btn-inverse"; ?>" id="view1" data-value="1" title="<?php echo lang_View_list; ?>"><i class="icon-align-justify <?php if($view==1) echo "icon-white"; ?>"></i></button>
  529. <button class="btn tip<?php if($view==2) echo " btn-inverse"; ?>" id="view2" data-value="2" title="<?php echo lang_View_columns_list; ?>"><i class="icon-fire <?php if($view==2) echo "icon-white"; ?>"></i></button>
  530. </div>
  531. <div class="span6 half types">
  532. <span><?php echo lang_Filters; ?>:</span>
  533. <?php if($_GET['type']!=1 && $_GET['type']!=3){ ?>
  534. <input id="select-type-1" name="radio-sort" type="radio" data-item="ff-item-type-1" checked="checked" class="hide" />
  535. <label id="ff-item-type-1" title="<?php echo lang_Files; ?>" for="select-type-1" class="tip btn ff-label-type-1"><i class="icon-file"></i></label>
  536. <input id="select-type-2" name="radio-sort" type="radio" data-item="ff-item-type-2" class="hide" />
  537. <label id="ff-item-type-2" title="<?php echo lang_Images; ?>" for="select-type-2" class="tip btn ff-label-type-2"><i class="icon-picture"></i></label>
  538. <input id="select-type-3" name="radio-sort" type="radio" data-item="ff-item-type-3" class="hide" />
  539. <label id="ff-item-type-3" title="<?php echo lang_Archives; ?>" for="select-type-3" class="tip btn ff-label-type-3"><i class="icon-inbox"></i></label>
  540. <input id="select-type-4" name="radio-sort" type="radio" data-item="ff-item-type-4" class="hide" />
  541. <label id="ff-item-type-4" title="<?php echo lang_Videos; ?>" for="select-type-4" class="tip btn ff-label-type-4"><i class="icon-film"></i></label>
  542. <input id="select-type-5" name="radio-sort" type="radio" data-item="ff-item-type-5" class="hide" />
  543. <label id="ff-item-type-5" title="<?php echo lang_Music; ?>" for="select-type-5" class="tip btn ff-label-type-5"><i class="icon-music"></i></label>
  544. <?php } ?>
  545. <input accesskey="f" type="text" class="filter-input <?php echo (($_GET['type']!=1 && $_GET['type']!=3) ? '' : 'filter-input-notype'); ?>" id="filter-input" name="filter" placeholder="<?php echo fix_strtolower(lang_Text_filter); ?>..." value="<?php echo $filter; ?>"/><?php if($n_files>$file_number_limit_js){ ?><label id="filter" class="btn"><i class="icon-play"></i></label><?php } ?>
  546. <input id="select-type-all" name="radio-sort" type="radio" data-item="ff-item-type-all" class="hide" />
  547. <label id="ff-item-type-all" title="<?php echo lang_All; ?>" <?php if($_GET['type']==1 || $_GET['type']==3){ ?>style="visibility: hidden;" <?php } ?> data-item="ff-item-type-all" for="select-type-all" style="margin-rigth:0px;" class="tip btn btn-inverse ff-label-type-all"><i class="icon-align-justify icon-white"></i></label>
  548. </div>
  549. </div>
  550. </div>
  551. </div>
  552. </div>
  553. </div>
  554. </div>
  555. <!-- header div end -->
  556. <!-- breadcrumb div start -->
  557. <div class="row-fluid">
  558. <?php
  559. $link="dialog.php?".$get_params;
  560. ?>
  561. <ul class="breadcrumb">
  562. <li class="pull-left"><a href="<?php echo $link?>/"><i class="icon-home"></i></a></li>
  563. <li><span class="divider">/</span></li>
  564. <?php
  565. $bc=explode("/",$subdir);
  566. $tmp_path='';
  567. if(!empty($bc))
  568. foreach($bc as $k=>$b){
  569. $tmp_path.=$b."/";
  570. if($k==count($bc)-2){
  571. ?> <li class="active"><?php echo $b?></li><?php
  572. }elseif($b!=""){ ?>
  573. <li><a href="<?php echo $link.$tmp_path?>"><?php echo $b?></a></li><li><span class="divider"><?php echo "/"; ?></span></li>
  574. <?php }
  575. }
  576. ?>
  577. <li class="pull-right"><a class="btn-small" href="javascript:void('')" id="info"><i class="icon-question-sign"></i></a></li>
  578. <li class="pull-right"><a class="btn-small" href="javascript:void('')" id="change_lang_btn"><i class="icon-globe"></i></a></li>
  579. <li class="pull-right"><a id="refresh" class="btn-small" href="dialog.php?<?php echo $get_params.$subdir."&".uniqid() ?>"><i class="icon-refresh"></i></a></li>
  580. <li class="pull-right">
  581. <div class="btn-group">
  582. <a class="btn dropdown-toggle sorting-btn" data-toggle="dropdown" href="#">
  583. <i class="icon-signal"></i>
  584. <span class="caret"></span>
  585. </a>
  586. <ul class="dropdown-menu pull-left sorting">
  587. <li><center><strong><?php echo lang_Sorting ?></strong></center></li>
  588. <li><a class="sorter sort-name <?php if($sort_by=="name"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="name"><?php echo lang_Filename; ?></a></li>
  589. <li><a class="sorter sort-date <?php if($sort_by=="date"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="date"><?php echo lang_Date; ?></a></li>
  590. <li><a class="sorter sort-size <?php if($sort_by=="size"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="size"><?php echo lang_Size; ?></a></li>
  591. <li><a class="sorter sort-extension <?php if($sort_by=="extension"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="extension"><?php echo lang_Type; ?></a></li>
  592. </ul>
  593. </div>
  594. </li>
  595. </ul>
  596. </div>
  597. <!-- breadcrumb div end -->
  598. <div class="row-fluid ff-container">
  599. <div class="span12">
  600. <?php if(@opendir($current_path.$rfm_subfolder.$subdir)===FALSE){ ?>
  601. <br/>
  602. <div class="alert alert-error">There is an error! The upload folder there isn't. Check your config.php file. </div>
  603. <?php }else{ ?>
  604. <h4 id="help"><?php echo lang_Swipe_help; ?></h4>
  605. <?php if(isset($folder_message)){ ?>
  606. <div class="alert alert-block"><?php echo $folder_message; ?></div>
  607. <?php } ?>
  608. <?php if($show_sorting_bar){ ?>
  609. <!-- sorter -->
  610. <div class="sorter-container <?php echo "list-view".$view; ?>">
  611. <div class="file-name"><a class="sorter sort-name <?php if($sort_by=="name"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="name"><?php echo lang_Filename; ?></a></div>
  612. <div class="file-date"><a class="sorter sort-date <?php if($sort_by=="date"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="date"><?php echo lang_Date; ?></a></div>
  613. <div class="file-size"><a class="sorter sort-size <?php if($sort_by=="size"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="size"><?php echo lang_Size; ?></a></div>
  614. <div class='img-dimension'><?php echo lang_Dimension; ?></div>
  615. <div class='file-extension'><a class="sorter sort-extension <?php if($sort_by=="extension"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="extension"><?php echo lang_Type; ?></a></div>
  616. <div class='file-operations'><?php echo lang_Operations; ?></div>
  617. </div>
  618. <?php } ?>
  619. <input type="hidden" id="file_number" value="<?php echo $n_files; ?>" />
  620. <!--ul class="thumbnails ff-items"-->
  621. <ul class="grid cs-style-2 <?php echo "list-view".$view; ?>" id="main-item-container">
  622. <?php
  623. $jplayer_ext=array("mp4","flv","webmv","webma","webm","m4a","m4v","ogv","oga","mp3","midi","mid","ogg","wav");
  624. foreach ($files as $file_array) {
  625. $file=$file_array['file'];
  626. if($file == '.' || (isset($file_array['extension']) && $file_array['extension']!=lang_Type_dir) || ($file == '..' && $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' && $file!=".." && strpos($file,$filter)===false))
  627. continue;
  628. $new_name=fix_filename($file,$transliteration);
  629. if($file!='..' && $file!=$new_name){
  630. //rename
  631. rename_folder($current_path.$subdir.$new_name,$new_name,$transliteration);
  632. $file=$new_name;
  633. }
  634. //add in thumbs folder if not exist
  635. if (!file_exists($thumbs_path.$subdir.$file)) create_folder(false,$thumbs_path.$subdir.$file);
  636. $class_ext = 3;
  637. if($file=='..' && trim($subdir) != '' ){
  638. $src = explode("/",$subdir);
  639. unset($src[count($src)-2]);
  640. $src=implode("/",$src);
  641. if($src=='') $src="/";
  642. }
  643. elseif ($file!='..') {
  644. $src = $subdir . $file."/";
  645. }
  646. ?>
  647. <li data-name="<?php echo $file ?>" <?php if($file=='..') echo 'class="back"'; else echo 'class="dir"'; ?>><?php
  648. $file_prevent_rename = false;
  649. $file_prevent_delete = false;
  650. if (isset($filePermissions[$file])) {
  651. $file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
  652. $file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
  653. }
  654. ?> <figure data-name="<?php echo $file ?>" class="<?php if($file=="..") echo "back-"; ?>directory" data-type="<?php if($file!=".."){ echo "dir"; } ?>">
  655. <a class="folder-link" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>">
  656. <div class="img-precontainer">
  657. <div class="img-container directory"><span></span>
  658. <img class="directory-img" src="img/<?php echo $icon_theme; ?>/folder<?php if($file==".."){ echo "_back"; }?>.jpg" alt="folder" />
  659. </div>
  660. </div>
  661. <div class="img-precontainer-mini directory">
  662. <div class="img-container-mini">
  663. <span></span>
  664. <img class="directory-img" src="img/<?php echo $icon_theme; ?>/folder<?php if($file==".."){ echo "_back"; }?>.png" alt="folder" />
  665. </div>
  666. </div>
  667. <?php if($file==".."){ ?>
  668. <div class="box no-effect">
  669. <h4><?php echo lang_Back ?></h4>
  670. </div>
  671. </a>
  672. <?php }else{ ?>
  673. </a>
  674. <div class="box">
  675. <h4 class="<?php if($ellipsis_title_after_first_row){ echo "ellipsis"; } ?>"><a class="folder-link" data-file="<?php echo $file ?>" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>"><?php echo $file; ?></a></h4>
  676. </div>
  677. <input type="hidden" class="name" value=""/>
  678. <input type="hidden" class="date" value="<?php echo $file_array['date']; ?>"/>
  679. <input type="hidden" class="size" value="<?php echo $file_array['size']; ?>"/>
  680. <input type="hidden" class="extension" value="<?php echo lang_Type_dir; ?>"/>
  681. <div class="file-date"><?php echo date(lang_Date_type,$file_array['date'])?></div>
  682. <?php if($show_folder_size){ ?><div class="file-size"><?php echo makeSize($file_array['size'])?></div><?php } ?>
  683. <div class='file-extension'><?php echo lang_Type_dir; ?></div>
  684. <figcaption>
  685. <a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_folders && !$file_prevent_rename) echo "rename-folder"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir.$file; ?>">
  686. <i class="icon-pencil <?php if(!$rename_folders || $file_prevent_rename) echo 'icon-white'; ?>"></i></a>
  687. <a href="javascript:void('')" class="tip-left erase-button <?php if($delete_folders && !$file_prevent_delete) echo "delete-folder"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_Folder_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
  688. <i class="icon-trash <?php if(!$delete_folders || $file_prevent_delete) echo 'icon-white'; ?>"></i>
  689. </a>
  690. </figcaption>
  691. <?php } ?>
  692. </figure>
  693. </li>
  694. <?php
  695. }
  696. $files_prevent_duplicate = array();
  697. foreach ($files as $nu=>$file_array) {
  698. $file=$file_array['file'];
  699. if($file == '.' || $file == '..' || is_dir($current_path.$rfm_subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter!='' && strpos($file,$filter)===false))
  700. continue;
  701. $file_path=$current_path.$rfm_subfolder.$subdir.$file;
  702. //check if file have illegal caracter
  703. $filename=substr($file, 0, '-' . (strlen($file_array['extension']) + 1));
  704. if($file!=fix_filename($file,$transliteration)){
  705. $file1=fix_filename($file,$transliteration);
  706. $file_path1=($current_path.$rfm_subfolder.$subdir.$file1);
  707. if(file_exists($file_path1)){
  708. $i = 1;
  709. $info=pathinfo($file1);
  710. while(file_exists($current_path.$rfm_subfolder.$subdir.$info['filename'].".[".$i."].".$info['extension'])) {
  711. $i++;
  712. }
  713. $file1=$info['filename'].".[".$i."].".$info['extension'];
  714. $file_path1=($current_path.$rfm_subfolder.$subdir.$file1);
  715. }
  716. $filename=substr($file1, 0, '-' . (strlen($file_array['extension']) + 1));
  717. rename_file($file_path,fix_filename($filename,$transliteration),$transliteration);
  718. $file=$file1;
  719. $file_array['extension']=fix_filename($file_array['extension'],$transliteration);
  720. $file_path=$file_path1;
  721. }
  722. $is_img=false;
  723. $is_video=false;
  724. $is_audio=false;
  725. $show_original=false;
  726. $show_original_mini=false;
  727. $mini_src="";
  728. $src_thumb="";
  729. $extension_lower=fix_strtolower($file_array['extension']);
  730. if(in_array($extension_lower, $ext_img)){
  731. $src = $base_url . $cur_dir . rawurlencode($file);
  732. $mini_src = $src_thumb = $thumbs_path.$subdir. $file;
  733. //add in thumbs folder if not exist
  734. if(!file_exists($src_thumb)){
  735. try {
  736. create_img_gd($file_path, $src_thumb, 122, 91);
  737. new_thumbnails_creation($current_path.$rfm_subfolder.$subdir,$file_path,$file,$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$relative_image_creation_option,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height,$fixed_image_creation_option);
  738. } catch (Exception $e) {
  739. $src_thumb=$mini_src="";
  740. }
  741. }
  742. $is_img=true;
  743. //check if is smaller than thumb
  744. list($img_width, $img_height, $img_type, $attr)=getimagesize($file_path);
  745. if($img_width<122 && $img_height<91){
  746. $src_thumb=$current_path.$rfm_subfolder.$subdir.$file;
  747. $show_original=true;
  748. }
  749. if($img_width<45 && $img_height<38){
  750. $mini_src=$current_path.$rfm_subfolder.$subdir.$file;
  751. $show_original_mini=true;
  752. }
  753. }
  754. $is_icon_thumb=false;
  755. $is_icon_thumb_mini=false;
  756. $no_thumb=false;
  757. if($src_thumb==""){
  758. $no_thumb=true;
  759. if(file_exists('img/'.$icon_theme.'/'.$extension_lower.".jpg")){
  760. $src_thumb ='img/'.$icon_theme.'/'.$extension_lower.".jpg";
  761. }else{
  762. $src_thumb = "img/".$icon_theme."/default.jpg";
  763. }
  764. $is_icon_thumb=true;
  765. }
  766. if($mini_src==""){
  767. $is_icon_thumb_mini=false;
  768. }
  769. $class_ext=0;
  770. if (in_array($extension_lower, $ext_video)) {
  771. $class_ext = 4;
  772. $is_video=true;
  773. }elseif (in_array($extension_lower, $ext_img)) {
  774. $class_ext = 2;
  775. }elseif (in_array($extension_lower, $ext_music)) {
  776. $class_ext = 5;
  777. $is_audio=true;
  778. }elseif (in_array($extension_lower, $ext_misc)) {
  779. $class_ext = 3;
  780. }else{
  781. $class_ext = 1;
  782. }
  783. if((!($_GET['type']==1 && !$is_img) && !(($_GET['type']==3 && !$is_video) && ($_GET['type']==3 && !$is_audio))) && $class_ext>0){
  784. ?>
  785. <li class="ff-item-type-<?php echo $class_ext; ?> file" data-name="<?php echo $file; ?>"><?php
  786. $file_prevent_rename = false;
  787. $file_prevent_delete = false;
  788. if (isset($filePermissions[$file])) {
  789. if (isset($filePermissions[$file]['prevent_duplicate']) && $filePermissions[$file]['prevent_duplicate']) {
  790. $files_prevent_duplicate[] = $file;
  791. }
  792. $file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
  793. $file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
  794. }
  795. ?> <figure data-name="<?php echo $file ?>" data-type="<?php if($is_img){ echo "img"; }else{ echo "file"; } ?>">
  796. <a href="javascript:void('')" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $field_id; ?>" data-function="<?php echo $apply; ?>">
  797. <div class="img-precontainer">
  798. <?php if($is_icon_thumb){ ?><div class="filetype"><?php echo $extension_lower ?></div><?php } ?>
  799. <div class="img-container">
  800. <span></span>
  801. <img alt="<?php echo $filename." thumbnails";?>" class="<?php echo $show_original ? "original" : "" ?> <?php echo $is_icon_thumb ? "icon" : "" ?>" src="<?php echo $src_thumb; ?>">
  802. </div>
  803. </div>
  804. <div class="img-precontainer-mini <?php if($is_img) echo 'original-thumb' ?>">
  805. <div class="filetype <?php echo $extension_lower ?> <?php if(in_array($extension_lower, $editable_text_file_exts)) echo 'edit-text-file-allowed' ?> <?php if(!$is_icon_thumb){ echo "hide"; }?>"><?php echo $extension_lower ?></div>
  806. <div class="img-container-mini">
  807. <span></span>
  808. <?php if($mini_src!=""){ ?>
  809. <img alt="<?php echo $filename." thumbnails";?>" class="<?php echo $show_original_mini ? "original" : "" ?> <?php echo $is_icon_thumb_mini ? "icon" : "" ?>" src="<?php echo $mini_src; ?>">
  810. <?php } ?>
  811. </div>
  812. </div>
  813. <?php if($is_icon_thumb){ ?>
  814. <div class="cover"></div>
  815. <?php } ?>
  816. </a>
  817. <div class="box">
  818. <h4 class="<?php if($ellipsis_title_after_first_row){ echo "ellipsis"; } ?>"><a href="javascript:void('')" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $field_id; ?>" data-function="<?php echo $apply; ?>">
  819. <?php echo $filename; ?></a> </h4>
  820. </div>
  821. <input type="hidden" class="date" value="<?php echo $file_array['date']; ?>"/>
  822. <input type="hidden" class="size" value="<?php echo $file_array['size'] ?>"/>
  823. <input type="hidden" class="extension" value="<?php echo $extension_lower; ?>"/>
  824. <input type="hidden" class="name" value=""/>
  825. <div class="file-date"><?php echo date(lang_Date_type,$file_array['date'])?></div>
  826. <div class="file-size"><?php echo makeSize($file_array['size'])?></div>
  827. <div class='img-dimension'><?php if($is_img){ echo $img_width."x".$img_height; } ?></div>
  828. <div class='file-extension'><?php echo $extension_lower; ?></div>
  829. <figcaption>
  830. <form action="force_download.php" method="post" class="download-form" id="form<?php echo $nu; ?>">
  831. <input type="hidden" name="path" value="<?php echo $rfm_subfolder.$subdir?>"/>
  832. <input type="hidden" class="name_download" name="name" value="<?php echo $file?>"/>
  833. <a title="<?php echo lang_Download?>" class="tip-right" href="javascript:void('')" onclick="$('#form<?php echo $nu; ?>').submit();"><i class="icon-download"></i></a>
  834. <?php if($is_img && $src_thumb!=""){ ?>
  835. <a class="tip-right preview" title="<?php echo lang_Preview?>" data-url="<?php echo $src;?>" data-toggle="lightbox" href="#previewLightbox"><i class=" icon-eye-open"></i></a>
  836. <?php }elseif(($is_video || $is_audio) && in_array($extension_lower,$jplayer_ext)){ ?>
  837. <a class="tip-right modalAV <?php if($is_audio){ echo "audio"; }else{ echo "video"; } ?>"
  838. title="<?php echo lang_Preview?>" data-url="ajax_calls.php?action=media_preview&title=<?php echo $filename; ?>&file=<?php echo $current_path.$rfm_subfolder.$subdir.$file;; ?>"
  839. href="javascript:void('');" ><i class=" icon-eye-open"></i></a>
  840. <?php }elseif($preview_text_files === TRUE && in_array($extension_lower,$previewable_text_file_exts)){ ?>
  841. <a class="tip-right file-preview-btn" title="<?php echo lang_Preview?>" data-url="ajax_calls.php?action=get_file&sub_action=preview&title=<?php echo $filename; ?>&file=<?php echo $current_path.$rfm_subfolder.$subdir.$file;; ?>"
  842. href="javascript:void('');" ><i class=" icon-eye-open"></i></a>
  843. <?php }else{ ?>
  844. <a class="preview disabled"><i class="icon-eye-open icon-white"></i></a>
  845. <?php } ?>
  846. <a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_files && !$file_prevent_rename) echo "rename-file"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir .$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
  847. <i class="icon-pencil <?php if(!$rename_files || $file_prevent_rename) echo 'icon-white'; ?>"></i></a>
  848. <a href="javascript:void('')" class="tip-left erase-button <?php if($delete_files && !$file_prevent_delete) echo "delete-file"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
  849. <i class="icon-trash <?php if(!$delete_files || $file_prevent_delete) echo 'icon-white'; ?>"></i>
  850. </a>
  851. </form>
  852. </figcaption>
  853. </figure>
  854. </li>
  855. <?php
  856. }
  857. }
  858. ?></div>
  859. </ul>
  860. <?php } ?>
  861. </div>
  862. </div>
  863. </div>
  864. <script>
  865. var files_prevent_duplicate = new Array();
  866. <?php
  867. foreach ($files_prevent_duplicate as $key => $value): ?>
  868. files_prevent_duplicate[<?php echo $key;?>] = '<?php echo $value; ?>';
  869. <?php endforeach; ?>
  870. </script>
  871. <!-- lightbox div start -->
  872. <div id="previewLightbox" class="lightbox hide fade" tabindex="-1" role="dialog" aria-hidden="true">
  873. <div class='lightbox-content'>
  874. <img id="full-img" src="">
  875. </div>
  876. </div>
  877. <!-- lightbox div end -->
  878. <!-- loading div start -->
  879. <div id="loading_container" style="display:none;">
  880. <div id="loading" style="background-color:#000; position:fixed; width:100%; height:100%; top:0px; left:0px;z-index:100000"></div>
  881. <img id="loading_animation" src="img/storing_animation.gif" alt="loading" style="z-index:10001; margin-left:-32px; margin-top:-32px; position:fixed; left:50%; top:50%"/>
  882. </div>
  883. <!-- loading div end -->
  884. <!-- player div start -->
  885. <div class="modal hide fade" id="previewAV">
  886. <div class="modal-header">
  887. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  888. <h3><?php echo lang_Preview; ?></h3>
  889. </div>
  890. <div class="modal-body">
  891. <div class="row-fluid body-preview">
  892. </div>
  893. </div>
  894. </div>
  895. <!-- player div end -->
  896. <img id='aviary_img' src='' class="hide"/>
  897. </body>
  898. </html>
  899. <?php } ?>