PageRenderTime 58ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/admin228c4ef56/filemanager/dialog.php

https://gitlab.com/staging06/myproject
PHP | 1225 lines | 1144 code | 72 blank | 9 comment | 164 complexity | d05e921c5ddb169173cdca2ca9c3a6e8 MD5 | raw file
  1. <?php
  2. include('config/config.php');
  3. $_SESSION["verify"] = "RESPONSIVEfilemanager";
  4. if (isset($_POST['submit'])) {
  5. include('upload.php');
  6. } else {
  7. include('include/utils.php');
  8. if (isset($_GET['fldr'])
  9. && !empty($_GET['fldr'])
  10. && preg_match('/\.{1,2}[\/|\\\]/', urldecode($_GET['fldr'])) === 0
  11. ) {
  12. $subdir = str_replace("\0", '', urldecode(trim($_GET['fldr'], '/').'/'));
  13. } else {
  14. $subdir = '';
  15. }
  16. //remember last position
  17. setcookie('last_position', $subdir, time() + (86400 * 7));
  18. if ($subdir == '') {
  19. if (!empty($_COOKIE['last_position'])
  20. && strpos($_COOKIE['last_position'], '.') === false
  21. ) {
  22. $subdir = trim($_COOKIE['last_position']);
  23. }
  24. }
  25. if ($subdir == '/') {
  26. $subdir = '';
  27. }
  28. /***
  29. *SUB-DIR CODE
  30. ***/
  31. if (!isset($_SESSION['subfolder'])) {
  32. $_SESSION['subfolder'] = '';
  33. }
  34. $subfolder = '';
  35. if (!empty($_SESSION['subfolder']) && strpos($_SESSION['subfolder'], '../') === false
  36. && strpos($_SESSION['subfolder'], './') === false && strpos($_SESSION['subfolder'], '/') !== 0
  37. && strpos($_SESSION['subfolder'], '.') === false
  38. ) {
  39. $subfolder = $_SESSION['subfolder'];
  40. }
  41. if ($subfolder != '' && $subfolder[strlen($subfolder) - 1] != '/') {
  42. $subfolder .= '/';
  43. }
  44. if (!file_exists($current_path.$subfolder.$subdir)) {
  45. $subdir = '';
  46. if (!file_exists($current_path.$subfolder.$subdir)) {
  47. $subfolder = '';
  48. }
  49. }
  50. if (trim($subfolder) == '') {
  51. $cur_dir = $upload_dir.$subdir;
  52. $cur_path = $current_path.$subdir;
  53. $thumbs_path = $thumbs_base_path;
  54. $parent = $subdir;
  55. } else {
  56. $cur_dir = $upload_dir.$subfolder.$subdir;
  57. $cur_path = $current_path.$subfolder.$subdir;
  58. $thumbs_path = $thumbs_base_path.$subfolder;
  59. $parent = $subfolder.$subdir;
  60. }
  61. $cycle = true;
  62. $max_cycles = 50;
  63. $i = 0;
  64. while ($cycle && $i < $max_cycles) {
  65. $i++;
  66. if ($parent == './') {
  67. $parent = '';
  68. }
  69. if (file_exists($current_path.$parent.'config.php')) {
  70. require_once($current_path.$parent.'config.php');
  71. $cycle = false;
  72. }
  73. if ($parent == '') {
  74. $cycle = false;
  75. } else {
  76. $parent = fix_dirname($parent).'/';
  77. }
  78. }
  79. if (!is_dir($thumbs_path.$subdir)) {
  80. create_folder(false, $thumbs_path.$subdir);
  81. }
  82. if (isset($_GET['popup'])) {
  83. $popup = $_GET['popup'];
  84. } else {
  85. $popup = 0;
  86. }
  87. //Sanitize popup
  88. $popup = !!$popup;
  89. //view type
  90. if (!isset($_SESSION['view_type'])) {
  91. $view = $default_view;
  92. $_SESSION['view_type'] = $view;
  93. }
  94. if (isset($_GET['view'])) {
  95. $view = $_GET['view'];
  96. $_SESSION['view_type'] = $view;
  97. }
  98. $view = $_SESSION['view_type'];
  99. if (isset($_GET['filter'])) {
  100. $filter = fix_filename($_GET['filter'], $transliteration);
  101. } else {
  102. $filter = '';
  103. }
  104. if (!isset($_SESSION['sort_by'])) {
  105. $_SESSION['sort_by'] = '';
  106. }
  107. if (isset($_GET['sort_by'])) {
  108. $sort_by = $_SESSION['sort_by'] = fix_filename($_GET['sort_by'], $transliteration);
  109. } else {
  110. $sort_by = $_SESSION['sort_by'];
  111. }
  112. if (!isset($_SESSION['descending'])) {
  113. $_SESSION['descending'] = false;
  114. }
  115. if (isset($_GET['descending'])) {
  116. $descending = $_SESSION['descending'] = fix_filename($_GET['descending'], $transliteration) === 'true';
  117. } else {
  118. $descending = $_SESSION['descending'];
  119. }
  120. $lang = $default_language;
  121. if (isset($_GET['lang']) && $_GET['lang'] != 'undefined' && $_GET['lang'] != '') {
  122. $lang = $_GET['lang'];
  123. }
  124. $language_file = 'lang/'.$default_language.'.php';
  125. if ($lang != $default_language) {
  126. $path_parts = pathinfo($lang);
  127. if (is_readable('lang/'.$path_parts['basename'].'.php')) {
  128. $language_file = 'lang/'.$path_parts['basename'].'.php';
  129. } else {
  130. $lang = $default_language;
  131. }
  132. }
  133. require_once $language_file;
  134. if (!isset($_GET['type'])) {
  135. $_GET['type'] = 0;
  136. }
  137. if (!isset($_GET['field_id'])) {
  138. $_GET['field_id'] = '';
  139. }
  140. $get_params = http_build_query(
  141. array(
  142. 'type' => Tools::safeOutput($_GET['type']),
  143. 'lang' => Tools::safeOutput($lang),
  144. 'popup' => $popup,
  145. 'field_id' => isset($_GET['field_id']) ? (int)$_GET['field_id'] : '',
  146. 'fldr' => ''
  147. )
  148. );
  149. ?>
  150. <!DOCTYPE html>
  151. <html xmlns="https://www.w3.org/1999/xhtml">
  152. <head>
  153. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  154. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  155. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  156. <meta name="robots" content="noindex,nofollow">
  157. <title>Responsive FileManager</title>
  158. <link rel="shortcut icon" href="img/ico/favicon.ico">
  159. <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
  160. <link href="css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"/>
  161. <link href="css/bootstrap-lightbox.min.css" rel="stylesheet" type="text/css"/>
  162. <link href="css/style.css" rel="stylesheet" type="text/css"/>
  163. <link href="css/dropzone.min.css" type="text/css" rel="stylesheet"/>
  164. <link href="css/jquery.contextMenu.min.css" rel="stylesheet" type="text/css"/>
  165. <link href="css/bootstrap-modal.min.css" rel="stylesheet" type="text/css"/>
  166. <link href="jPlayer/skin/blue.monday/jplayer.blue.monday.css" rel="stylesheet" type="text/css">
  167. <!--[if lt IE 8]>
  168. <style>
  169. .img-container span, .img-container-mini span {
  170. display: inline-block;
  171. height: 100%;
  172. }
  173. </style><![endif]-->
  174. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  175. <script type="text/javascript">
  176. if (typeof jQuery === 'undefined') {
  177. document.write(unescape("%3Cscript src='js/jquery.js' type='text/javascript'%3E%3C/script%3E"));
  178. }
  179. </script>
  180. <script type="text/javascript" src="js/bootstrap.min.js"></script>
  181. <script type="text/javascript" src="js/bootstrap-lightbox.min.js"></script>
  182. <script type="text/javascript" src="js/dropzone.min.js"></script>
  183. <script type="text/javascript" src="js/jquery.touchSwipe.min.js"></script>
  184. <script type="text/javascript" src="js/modernizr.custom.js"></script>
  185. <script type="text/javascript" src="js/bootbox.min.js"></script>
  186. <script type="text/javascript" src="js/bootstrap-modal.min.js"></script>
  187. <script type="text/javascript" src="js/bootstrap-modalmanager.min.js"></script>
  188. <script type="text/javascript" src="jPlayer/jquery.jplayer.min.js"></script>
  189. <script type="text/javascript" src="js/imagesloaded.pkgd.min.js"></script>
  190. <script type="text/javascript" src="js/jquery.queryloader2.min.js"></script>
  191. <?php
  192. if ($aviary_active) {
  193. if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
  194. ?>
  195. <script type="text/javascript" src="https://dme0ih8comzn4.cloudfront.net/js/feather.js"></script>
  196. <?php
  197. } else {
  198. ?>
  199. <script type="text/javascript" src="http://feather.aviary.com/js/feather.js "></script>
  200. <?php
  201. }
  202. }
  203. ?>
  204. <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
  205. <!--[if lt IE 9]>
  206. <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
  207. <![endif]-->
  208. <script src="js/jquery.ui.position.min.js" type="text/javascript"></script>
  209. <script src="js/jquery.contextMenu.min.js" type="text/javascript"></script>
  210. <script>
  211. var ext_img = new Array('<?php echo implode("','", $ext_img)?>');
  212. var allowed_ext = new Array('<?php echo implode("','", $ext)?>');
  213. var loading_bar =<?php echo $loading_bar?"true":"false";
  214. ?>;
  215. var image_editor =<?php echo $aviary_active?"true":"false";
  216. ?>;
  217. //dropzone config
  218. Dropzone.options.myAwesomeDropzone = {
  219. dictInvalidFileType: "<?php echo lang_Error_extension;
  220. ?>",
  221. dictFileTooBig: "<?php echo lang_Error_Upload;
  222. ?>",
  223. dictResponseError: "SERVER ERROR",
  224. paramName: "file", // The name that will be used to transfer the file
  225. maxFilesize: <?php echo $MaxSizeUpload;
  226. ?>, // MB
  227. url: "upload.php",
  228. accept: function (file, done) {
  229. var extension = file.name.split('.').pop();
  230. extension = extension.toLowerCase();
  231. if ($.inArray(extension, allowed_ext) > -1) {
  232. done();
  233. }
  234. else {
  235. done("<?php echo lang_Error_extension;
  236. ?>");
  237. }
  238. }
  239. };
  240. if (image_editor) {
  241. var featherEditor = new Aviary.Feather({
  242. apiKey: "<?php echo $aviary_key;
  243. ?>",
  244. apiVersion: <?php echo $aviary_version;
  245. ?>,
  246. language: "<?php echo $aviary_language;
  247. ?>",
  248. theme: 'light',
  249. tools: 'all',
  250. onSave: function (imageID, newURL) {
  251. show_animation();
  252. var img = document.getElementById(imageID);
  253. img.src = newURL;
  254. $.ajax({
  255. type: "POST",
  256. url: "ajax_calls.php?action=save_img",
  257. data: { url: newURL, path: $('#sub_folder').val() + $('#fldr_value').val(), name: $('#aviary_img').data('name') }
  258. }).done(function (msg) {
  259. featherEditor.close();
  260. d = new Date();
  261. $("figure[data-name='" + $('#aviary_img').data('name') + "']").find('img').each(function () {
  262. $(this).attr('src', $(this).attr('src') + "?" + d.getTime());
  263. });
  264. $("figure[data-name='" + $('#aviary_img').data('name') + "']").find('figcaption a.preview').each(function () {
  265. $(this).data('url', $(this).data('url') + "?" + d.getTime());
  266. });
  267. hide_animation();
  268. });
  269. return false;
  270. },
  271. onError: function (errorObj) {
  272. bootbox.alert(errorObj.message);
  273. }
  274. });
  275. }
  276. </script>
  277. <script type="text/javascript" src="js/include.min.js"></script>
  278. </head>
  279. <body>
  280. <input type="hidden" id="popup" value="<?php echo Tools::safeOutput($popup);
  281. ?>"/>
  282. <input type="hidden" id="view" value="<?php echo Tools::safeOutput($view);
  283. ?>"/>
  284. <input type="hidden" id="cur_dir" value="<?php echo Tools::safeOutput($cur_dir);
  285. ?>"/>
  286. <input type="hidden" id="cur_dir_thumb" value="<?php echo Tools::safeOutput($subdir);
  287. ?>"/>
  288. <input type="hidden" id="insert_folder_name" value="<?php echo Tools::safeOutput(lang_Insert_Folder_Name);
  289. ?>"/>
  290. <input type="hidden" id="new_folder" value="<?php echo Tools::safeOutput(lang_New_Folder);
  291. ?>"/>
  292. <input type="hidden" id="ok" value="<?php echo Tools::safeOutput(lang_OK);
  293. ?>"/>
  294. <input type="hidden" id="cancel" value="<?php echo Tools::safeOutput(lang_Cancel);
  295. ?>"/>
  296. <input type="hidden" id="rename" value="<?php echo Tools::safeOutput(lang_Rename);
  297. ?>"/>
  298. <input type="hidden" id="lang_duplicate" value="<?php echo Tools::safeOutput(lang_Duplicate);
  299. ?>"/>
  300. <input type="hidden" id="duplicate" value="<?php if ($duplicate_files) {
  301. echo 1;
  302. } else {
  303. echo 0;
  304. }
  305. ?>"/>
  306. <input type="hidden" id="base_url" value="<?php echo Tools::safeOutput($base_url) ?>"/>
  307. <input type="hidden" id="base_url_true" value="<?php echo base_url();
  308. ?>"/>
  309. <input type="hidden" id="fldr_value" value="<?php echo Tools::safeOutput($subdir);
  310. ?>"/>
  311. <input type="hidden" id="sub_folder" value="<?php echo Tools::safeOutput($subfolder);
  312. ?>"/>
  313. <input type="hidden" id="file_number_limit_js" value="<?php echo Tools::safeOutput($file_number_limit_js);
  314. ?>"/>
  315. <input type="hidden" id="descending" value="<?php echo $descending ? "true" : "false";
  316. ?>"/>
  317. <?php $protocol = 'http';
  318. ?>
  319. <input type="hidden" id="current_url" value="<?php echo str_replace(array('&filter='.$filter), array(''), $protocol."://".$_SERVER['HTTP_HOST'].Tools::safeOutput($_SERVER['REQUEST_URI']));
  320. ?>"/>
  321. <input type="hidden" id="lang_show_url" value="<?php echo Tools::safeOutput(lang_Show_url);
  322. ?>"/>
  323. <input type="hidden" id="lang_extract" value="<?php echo Tools::safeOutput(lang_Extract);
  324. ?>"/>
  325. <input type="hidden" id="lang_file_info" value="<?php echo fix_strtoupper(lang_File_info);
  326. ?>"/>
  327. <input type="hidden" id="lang_edit_image" value="<?php echo Tools::safeOutput(lang_Edit_image);
  328. ?>"/>
  329. <input type="hidden" id="transliteration" value="<?php echo $transliteration ? "true" : "false";
  330. ?>"/>
  331. <?php if ($upload_files) {
  332. ?>
  333. <!----- uploader div start ------->
  334. <div class="uploader">
  335. <center>
  336. <button class="btn btn-inverse close-uploader">
  337. <i class="icon-backward icon-white"></i> <?php echo Tools::safeOutput(lang_Return_Files_List) ?></button>
  338. </center>
  339. <div class="space10"></div>
  340. <div class="space10"></div>
  341. <?php if ($java_upload) {
  342. ?>
  343. <div class="tabbable upload-tabbable"> <!-- Only required for left/right tabs -->
  344. <ul class="nav nav-tabs">
  345. <li class="active"><a href="#tab1" data-toggle="tab"><?php echo Tools::safeOutput(lang_Upload_base);
  346. ?></a></li>
  347. <li><a href="#tab2" id="uploader-btn" data-toggle="tab"><?php echo Tools::safeOutput(lang_Upload_java);
  348. ?></a></li>
  349. </ul>
  350. <div class="tab-content">
  351. <div class="tab-pane active" id="tab1">
  352. <?php
  353. }
  354. ?>
  355. <form action="dialog.php" method="post" enctype="multipart/form-data" id="myAwesomeDropzone" class="dropzone">
  356. <input type="hidden" name="path" value="<?php echo Tools::safeOutput($subfolder.$subdir);
  357. ?>"/>
  358. <input type="hidden" name="path_thumb" value="<?php echo Tools::safeOutput($subfolder.$subdir);
  359. ?>"/>
  360. <div class="fallback">
  361. <?php echo lang_Upload_file ?>:<br/>
  362. <input name="file" type="file"/>
  363. <input type="hidden" name="fldr" value="<?php echo Tools::safeOutput($subdir);
  364. ?>"/>
  365. <input type="hidden" name="view" value="<?php echo Tools::safeOutput($view);
  366. ?>"/>
  367. <input type="hidden" name="type" value="<?php echo Tools::safeOutput($_GET['type']);
  368. ?>"/>
  369. <input type="hidden" name="field_id" value="<?php echo (int)$_GET['field_id'];
  370. ?>"/>
  371. <input type="hidden" name="popup" value="<?php echo Tools::safeOutput($popup);
  372. ?>"/>
  373. <input type="hidden" name="lang" value="<?php echo Tools::safeOutput($lang);
  374. ?>"/>
  375. <input type="hidden" name="filter" value="<?php echo Tools::safeOutput($filter);
  376. ?>"/>
  377. <input type="submit" name="submit" value="<?php echo lang_OK ?>"/>
  378. </div>
  379. </form>
  380. <div class="upload-help"><?php echo Tools::safeOutput(lang_Upload_base_help);
  381. ?></div>
  382. <?php if ($java_upload) {
  383. ?>
  384. </div>
  385. <div class="tab-pane" id="tab2">
  386. <div id="iframe-container">
  387. </div>
  388. <div class="upload-help"><?php echo Tools::safeOutput(lang_Upload_java_help);
  389. ?></div>
  390. </div>
  391. <?php
  392. }
  393. ?>
  394. </div>
  395. </div>
  396. </div>
  397. <!----- uploader div start ------->
  398. <?php
  399. }
  400. ?>
  401. <div class="container-fluid">
  402. <?php
  403. $class_ext = '';
  404. $src = '';
  405. if ($_GET['type'] == 1) {
  406. $apply = 'apply_img';
  407. } elseif ($_GET['type'] == 2) {
  408. $apply = 'apply_link';
  409. } elseif ($_GET['type'] == 0 && $_GET['field_id'] == '') {
  410. $apply = 'apply_none';
  411. } elseif ($_GET['type'] == 3) {
  412. $apply = 'apply_video';
  413. } else {
  414. $apply = 'apply';
  415. }
  416. $files = scandir($current_path.$subfolder.$subdir);
  417. $n_files = count($files);
  418. //php sorting
  419. $sorted = array();
  420. $current_folder = array();
  421. $prev_folder = array();
  422. foreach ($files as $k => $file) {
  423. if ($file == ".") {
  424. $current_folder = array('file' => $file);
  425. } elseif ($file == "..") {
  426. $prev_folder = array('file' => $file);
  427. } elseif (is_dir($current_path.$subfolder.$subdir.$file)) {
  428. $date = filemtime($current_path.$subfolder.$subdir.$file);
  429. $size = foldersize($current_path.$subfolder.$subdir.$file);
  430. $file_ext = lang_Type_dir;
  431. $sorted[$k] = array('file' => $file, 'date' => $date, 'size' => $size, 'extension' => $file_ext);
  432. } else {
  433. $file_path = $current_path.$subfolder.$subdir.$file;
  434. $date = filemtime($file_path);
  435. $size = filesize($file_path);
  436. $file_ext = substr(strrchr($file, '.'), 1);
  437. $sorted[$k] = array('file' => $file, 'date' => $date, 'size' => $size, 'extension' => $file_ext);
  438. }
  439. }
  440. function filenameSort($x, $y)
  441. {
  442. return $x['file'] < $y['file'];
  443. }
  444. function dateSort($x, $y)
  445. {
  446. return $x['date'] < $y['date'];
  447. }
  448. function sizeSort($x, $y)
  449. {
  450. return $x['size'] - $y['size'];
  451. }
  452. function extensionSort($x, $y)
  453. {
  454. return $x['extension'] < $y['extension'];
  455. }
  456. switch ($sort_by) {
  457. case 'name':
  458. usort($sorted, 'filenameSort');
  459. break;
  460. case 'date':
  461. usort($sorted, 'dateSort');
  462. break;
  463. case 'size':
  464. usort($sorted, 'sizeSort');
  465. break;
  466. case 'extension':
  467. usort($sorted, 'extensionSort');
  468. break;
  469. default:
  470. break;
  471. }
  472. if ($descending) {
  473. $sorted = array_reverse($sorted);
  474. }
  475. $files = array();
  476. if (!empty($prev_folder)) {
  477. $files = array($prev_folder);
  478. }
  479. if (!empty($current_folder)) {
  480. $files = array_merge($files, array($current_folder));
  481. }
  482. $files = array_merge($files, $sorted);
  483. ?>
  484. <!----- header div start ------->
  485. <div class="navbar navbar-fixed-top">
  486. <div class="navbar-inner">
  487. <div class="container-fluid">
  488. <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  489. <span class="icon-bar"></span>
  490. <span class="icon-bar"></span>
  491. <span class="icon-bar"></span>
  492. </button>
  493. <div class="brand"><?php echo Tools::safeOutput(lang_Toolbar);
  494. ?> -></div>
  495. <div class="nav-collapse collapse">
  496. <div class="filters">
  497. <div class="row-fluid">
  498. <div class="span3 half">
  499. <span><?php echo Tools::safeOutput(lang_Actions);
  500. ?>:</span>
  501. <?php if ($upload_files) {
  502. ?>
  503. <button class="tip btn upload-btn" title="<?php echo Tools::safeOutput(lang_Upload_file);
  504. ?>">
  505. <i class="icon-plus"></i><i class="icon-file"></i></button>
  506. <?php
  507. }
  508. ?>
  509. <?php if ($create_folders) {
  510. ?>
  511. <button class="tip btn new-folder" title="<?php echo Tools::safeOutput(lang_New_Folder) ?>">
  512. <i class="icon-plus"></i><i class="icon-folder-open"></i></button>
  513. <?php
  514. }
  515. ?>
  516. </div>
  517. <div class="span3 half view-controller">
  518. <span><?php echo lang_View;
  519. ?>:</span>
  520. <button class="btn tip<?php if ($view == 0) {
  521. echo " btn-inverse";
  522. }
  523. ?>" id="view0" data-value="0" title="<?php echo Tools::safeOutput(lang_View_boxes);
  524. ?>">
  525. <i class="icon-th <?php if ($view == 0) {
  526. echo "icon-white";
  527. }
  528. ?>"></i></button>
  529. <button class="btn tip<?php if ($view == 1) {
  530. echo " btn-inverse";
  531. }
  532. ?>" id="view1" data-value="1" title="<?php echo Tools::safeOutput(lang_View_list);
  533. ?>">
  534. <i class="icon-align-justify <?php if ($view == 1) {
  535. echo "icon-white";
  536. }
  537. ?>"></i>
  538. </button>
  539. <button class="btn tip<?php if ($view == 2) {
  540. echo " btn-inverse";
  541. }
  542. ?>" id="view2" data-value="2" title="<?php echo Tools::safeOutput(lang_View_columns_list);
  543. ?>">
  544. <i class="icon-fire <?php if ($view == 2) {
  545. echo "icon-white";
  546. }
  547. ?>"></i></button>
  548. </div>
  549. <div class="span6 types">
  550. <span><?php echo Tools::safeOutput(lang_Filters);
  551. ?>:</span>
  552. <?php if ($_GET['type'] != 1 && $_GET['type'] != 3) {
  553. ?>
  554. <input id="select-type-1" name="radio-sort" type="radio" data-item="ff-item-type-1" checked="checked" class="hide"/>
  555. <label id="ff-item-type-1" title="<?php echo Tools::safeOutput(lang_Files);
  556. ?>" for="select-type-1" class="tip btn ff-label-type-1"><i class="icon-file"></i></label>
  557. <input id="select-type-2" name="radio-sort" type="radio" data-item="ff-item-type-2" class="hide"/>
  558. <label id="ff-item-type-2" title="<?php echo Tools::safeOutput(lang_Images);
  559. ?>" for="select-type-2" class="tip btn ff-label-type-2"><i class="icon-picture"></i></label>
  560. <input id="select-type-3" name="radio-sort" type="radio" data-item="ff-item-type-3" class="hide"/>
  561. <label id="ff-item-type-3" title="<?php echo Tools::safeOutput(lang_Archives);
  562. ?>" for="select-type-3" class="tip btn ff-label-type-3"><i class="icon-inbox"></i></label>
  563. <input id="select-type-4" name="radio-sort" type="radio" data-item="ff-item-type-4" class="hide"/>
  564. <label id="ff-item-type-4" title="<?php echo Tools::safeOutput(lang_Videos);
  565. ?>" for="select-type-4" class="tip btn ff-label-type-4"><i class="icon-film"></i></label>
  566. <input id="select-type-5" name="radio-sort" type="radio" data-item="ff-item-type-5" class="hide"/>
  567. <label id="ff-item-type-5" title="<?php echo Tools::safeOutput(lang_Music);
  568. ?>" for="select-type-5" class="tip btn ff-label-type-5"><i class="icon-music"></i></label>
  569. <?php
  570. }
  571. ?>
  572. <input accesskey="f" type="text" class="filter-input" id="filter-input" name="filter" placeholder="<?php echo fix_strtolower(lang_Text_filter);
  573. ?>..." value="<?php echo Tools::safeOutput($filter);
  574. ?>"/><?php if ($n_files > $file_number_limit_js) {
  575. ?><label id="filter" class="btn"><i class="icon-play"></i></label><?php
  576. }
  577. ?>
  578. <input id="select-type-all" name="radio-sort" type="radio" data-item="ff-item-type-all" class="hide"/>
  579. <label id="ff-item-type-all" title="<?php echo Tools::safeOutput(lang_All);
  580. ?>" <?php if (Tools::getValue('type') == 1 || Tools::getValue('type') == 3) {
  581. ?>style="visibility: hidden;" <?php
  582. }
  583. ?> 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>
  584. </div>
  585. </div>
  586. </div>
  587. </div>
  588. </div>
  589. </div>
  590. </div>
  591. <!----- header div end ------->
  592. <!----- breadcrumb div start ------->
  593. <div class="row-fluid">
  594. <?php
  595. $link = "dialog.php?".$get_params;
  596. ?>
  597. <ul class="breadcrumb">
  598. <li class="pull-left"><a href="<?php echo Tools::safeOutput($link) ?>/"><i class="icon-home"></i></a></li>
  599. <li><span class="divider">/</span></li>
  600. <?php
  601. $bc = explode("/", $subdir);
  602. $tmp_path = '';
  603. if (!empty($bc)) {
  604. foreach ($bc as $k => $b) {
  605. $tmp_path .= $b."/";
  606. if ($k == count($bc) - 2) {
  607. ?>
  608. <li class="active"><?php echo Tools::safeOutput($b) ?></li><?php
  609. } elseif ($b != "") {
  610. ?>
  611. <li><a href="<?php echo Tools::safeOutput($link.$tmp_path)?>"><?php echo Tools::safeOutput($b) ?></a></li>
  612. <li><span class="divider"><?php echo "/";
  613. ?></span></li>
  614. <?php
  615. }
  616. }
  617. }
  618. ?>
  619. <li class="pull-right">
  620. <a class="btn-small" href="javascript:void('')" id="info"><i class="icon-question-sign"></i></a></li>
  621. <li class="pull-right">
  622. <a id="refresh" class="btn-small" href="dialog.php?<?php echo Tools::safeOutput($get_params.$subdir."&".uniqid()) ?>"><i class="icon-refresh"></i></a>
  623. </li>
  624. <li class="pull-right">
  625. <div class="btn-group">
  626. <a class="btn dropdown-toggle sorting-btn" data-toggle="dropdown" href="#">
  627. <i class="icon-signal"></i>
  628. <span class="caret"></span>
  629. </a>
  630. <ul class="dropdown-menu pull-left sorting">
  631. <li>
  632. <center><strong><?php echo Tools::safeOutput(lang_Sorting) ?></strong></center>
  633. </li>
  634. <li><a class="sorter sort-name <?php if ($sort_by == "name") {
  635. echo ($descending) ? "descending" : "ascending";
  636. }
  637. ?>" href="javascript:void('')" data-sort="name"><?php echo Tools::safeOutput(lang_Filename);
  638. ?></a></li>
  639. <li><a class="sorter sort-date <?php if ($sort_by == "date") {
  640. echo ($descending) ? "descending" : "ascending";
  641. }
  642. ?>" href="javascript:void('')" data-sort="date"><?php echo Tools::safeOutput(lang_Date);
  643. ?></a></li>
  644. <li><a class="sorter sort-size <?php if ($sort_by == "size") {
  645. echo ($descending) ? "descending" : "ascending";
  646. }
  647. ?>" href="javascript:void('')" data-sort="size"><?php echo Tools::safeOutput(lang_Size);
  648. ?></a></li>
  649. <li><a class="sorter sort-extension <?php if ($sort_by == "extension") {
  650. echo ($descending) ? "descending" : "ascending";
  651. }
  652. ?>" href="javascript:void('')" data-sort="extension"><?php echo Tools::safeOutput(lang_Type);
  653. ?></a></li>
  654. </ul>
  655. </div>
  656. </li>
  657. </ul>
  658. </div>
  659. <!----- breadcrumb div end ------->
  660. <div class="row-fluid ff-container">
  661. <div class="span12">
  662. <?php if (@opendir($current_path.$subfolder.$subdir) === false) {
  663. ?>
  664. <br/>
  665. <div class="alert alert-error">There is an error! The upload folder there isn't. Check your config.php file.
  666. </div>
  667. <?php
  668. } else {
  669. ?>
  670. <h4 id="help"><?php echo Tools::safeOutput(lang_Swipe_help);
  671. ?></h4>
  672. <?php if (isset($folder_message)) {
  673. ?>
  674. <div class="alert alert-block"><?php echo Tools::safeOutput($folder_message);
  675. ?></div>
  676. <?php
  677. }
  678. ?>
  679. <?php if ($show_sorting_bar) {
  680. ?>
  681. <!-- sorter -->
  682. <div class="sorter-container <?php echo "list-view".Tools::safeOutput($view);
  683. ?>">
  684. <div class="file-name"><a class="sorter sort-name <?php if ($sort_by == "name") {
  685. echo ($descending) ? "descending" : "ascending";
  686. }
  687. ?>" href="javascript:void('')" data-sort="name"><?php echo Tools::safeOutput(lang_Filename);
  688. ?></a></div>
  689. <div class="file-date"><a class="sorter sort-date <?php if ($sort_by == "date") {
  690. echo ($descending) ? "descending" : "ascending";
  691. }
  692. ?>" href="javascript:void('')" data-sort="date"><?php echo Tools::safeOutput(lang_Date);
  693. ?></a></div>
  694. <div class="file-size"><a class="sorter sort-size <?php if ($sort_by == "size") {
  695. echo ($descending) ? "descending" : "ascending";
  696. }
  697. ?>" href="javascript:void('')" data-sort="size"><?php echo Tools::safeOutput(lang_Size);
  698. ?></a></div>
  699. <div class='img-dimension'><?php echo Tools::safeOutput(lang_Dimension);
  700. ?></div>
  701. <div class='file-extension'><a class="sorter sort-extension <?php if ($sort_by == "extension") {
  702. echo ($descending) ? "descending" : "ascending";
  703. }
  704. ?>" href="javascript:void('')" data-sort="extension"><?php echo Tools::safeOutput(lang_Type);
  705. ?></a></div>
  706. <div class='file-operations'><?php echo Tools::safeOutput(lang_Operations);
  707. ?></div>
  708. </div>
  709. <?php
  710. }
  711. ?>
  712. <input type="hidden" id="file_number" value="<?php echo Tools::safeOutput($n_files);
  713. ?>"/>
  714. <!--ul class="thumbnails ff-items"-->
  715. <ul class="grid cs-style-2 <?php echo "list-view".Tools::safeOutput($view);
  716. ?>">
  717. <?php
  718. $jplayer_ext = array(
  719. "mp4",
  720. "flv",
  721. "webmv",
  722. "webma",
  723. "webm",
  724. "m4a",
  725. "m4v",
  726. "ogv",
  727. "oga",
  728. "mp3",
  729. "midi",
  730. "mid",
  731. "ogg",
  732. "wav"
  733. );
  734. foreach ($files as $file_array) {
  735. $file = $file_array['file'];
  736. 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)) {
  737. continue;
  738. }
  739. $new_name = fix_filename($file, $transliteration);
  740. if ($file != '..' && $file != $new_name) {
  741. //rename
  742. rename_folder($current_path.$subdir.$new_name, $new_name, $transliteration);
  743. $file = $new_name;
  744. }
  745. //add in thumbs folder if not exist
  746. if (!file_exists($thumbs_path.$subdir.$file)) {
  747. create_folder(false, $thumbs_path.$subdir.$file);
  748. }
  749. $class_ext = 3;
  750. if ($file == '..' && trim($subdir) != '') {
  751. $src = explode("/", $subdir);
  752. unset($src[count($src) - 2]);
  753. $src = implode("/", $src);
  754. if ($src == '') {
  755. $src = "/";
  756. }
  757. } elseif ($file != '..') {
  758. $src = $subdir.$file."/";
  759. }
  760. ?>
  761. <li data-name="<?php echo Tools::safeOutput($file) ?>" <?php if ($file == '..') {
  762. echo 'class="back"';
  763. } else {
  764. echo 'class="dir"';
  765. }
  766. ?>>
  767. <figure data-name="<?php echo Tools::safeOutput($file) ?>" class="<?php if ($file == "..") {
  768. echo "back-";
  769. }
  770. ?>directory" data-type="<?php if ($file != "..") {
  771. echo "dir";
  772. }
  773. ?>">
  774. <a class="folder-link" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>">
  775. <div class="img-precontainer">
  776. <div class="img-container directory"><span></span>
  777. <img class="directory-img" src="img/<?php echo Tools::safeOutput($icon_theme);
  778. ?>/folder<?php if ($file == "..") {
  779. echo "_back";
  780. }
  781. ?>.jpg" alt="folder"/>
  782. </div>
  783. </div>
  784. <div class="img-precontainer-mini directory">
  785. <div class="img-container-mini">
  786. <span></span>
  787. <img class="directory-img" src="img/<?php echo Tools::safeOutput($icon_theme);
  788. ?>/folder<?php if ($file == "..") {
  789. echo "_back";
  790. }
  791. ?>.png" alt="folder"/>
  792. </div>
  793. </div>
  794. <?php if ($file == "..") {
  795. ?>
  796. <div class="box no-effect">
  797. <h4><?php echo Tools::safeOutput(lang_Back) ?></h4>
  798. </div>
  799. </a>
  800. <?php
  801. } else {
  802. ?>
  803. </a>
  804. <div class="box">
  805. <h4 class="<?php if ($ellipsis_title_after_first_row) {
  806. echo "ellipsis";
  807. }
  808. ?>">
  809. <a class="folder-link" data-file="<?php echo Tools::safeOutput($file) ?>" href="dialog.php?<?php echo Tools::safeOutput($get_params.rawurlencode($src)."&".uniqid()) ?>"><?php echo Tools::safeOutput($file);
  810. ?></a>
  811. </h4>
  812. </div>
  813. <input type="hidden" class="name" value=""/>
  814. <input type="hidden" class="date" value="<?php echo Tools::safeOutput($file_array['date']);
  815. ?>"/>
  816. <input type="hidden" class="size" value="<?php echo Tools::safeOutput($file_array['size']);
  817. ?>"/>
  818. <input type="hidden" class="extension" value="<?php echo lang_Type_dir;
  819. ?>"/>
  820. <div class="file-date"><?php echo date(lang_Date_type, $file_array['date']) ?></div>
  821. <?php if ($show_folder_size) {
  822. ?>
  823. <div class="file-size"><?php echo makeSize($file_array['size']) ?></div><?php
  824. }
  825. ?>
  826. <div class='file-extension'><?php echo lang_Type_dir;
  827. ?></div>
  828. <figcaption>
  829. <a href="javascript:void('')" class="tip-left edit-button <?php if ($rename_folders) {
  830. echo "rename-folder";
  831. }
  832. ?>" title="<?php echo lang_Rename ?>" data-path="<?php echo Tools::safeOutput($subfolder.$subdir.$file);
  833. ?>" data-thumb="<?php echo Tools::safeOutput($subdir.$file);
  834. ?>">
  835. <i class="icon-pencil <?php if (!$rename_folders) {
  836. echo 'icon-white';
  837. }
  838. ?>"></i></a>
  839. <a href="javascript:void('')" class="tip-left erase-button <?php if ($delete_folders) {
  840. echo "delete-folder";
  841. }
  842. ?>" title="<?php echo lang_Erase ?>" data-confirm="<?php echo lang_Confirm_Folder_del;
  843. ?>" data-path="<?php echo Tools::safeOutput($subfolder.$subdir.$file);
  844. ?>" data-thumb="<?php echo Tools::safeOutput($subdir.$file);
  845. ?>">
  846. <i class="icon-trash <?php if (!$delete_folders) {
  847. echo 'icon-white';
  848. }
  849. ?>"></i>
  850. </a>
  851. </figcaption>
  852. <?php
  853. }
  854. ?>
  855. </figure>
  856. </li>
  857. <?php
  858. }
  859. foreach ($files as $nu => $file_array) {
  860. $file = $file_array['file'];
  861. if ($file == '.' || $file == '..' || is_dir($current_path.$subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter != '' && strpos($file, $filter) === false)) {
  862. continue;
  863. }
  864. $file_path = $current_path.$subfolder.$subdir.$file;
  865. //check if file have illegal caracter
  866. $filename = substr($file, 0, '-'.(strlen($file_array['extension']) + 1));
  867. if ($file != fix_filename($file, $transliteration)) {
  868. $file1 = fix_filename($file, $transliteration);
  869. $file_path1 = ($current_path.$subfolder.$subdir.$file1);
  870. if (file_exists($file_path1)) {
  871. $i = 1;
  872. $info = pathinfo($file1);
  873. while (file_exists($current_path.$subfolder.$subdir.$info['filename'].".[".$i."].".$info['extension'])) {
  874. $i++;
  875. }
  876. $file1 = $info['filename'].".[".$i."].".$info['extension'];
  877. $file_path1 = ($current_path.$subfolder.$subdir.$file1);
  878. }
  879. $filename = substr($file1, 0, '-'.(strlen($file_array['extension']) + 1));
  880. rename_file($file_path, fix_filename($filename, $transliteration), $transliteration);
  881. $file = $file1;
  882. $file_array['extension'] = fix_filename($file_array['extension'], $transliteration);
  883. $file_path = $file_path1;
  884. }
  885. $is_img = false;
  886. $is_video = false;
  887. $is_audio = false;
  888. $show_original = false;
  889. $show_original_mini = false;
  890. $mini_src = "";
  891. $src_thumb = "";
  892. $extension_lower = fix_strtolower($file_array['extension']);
  893. if (in_array($extension_lower, $ext_img)) {
  894. $src = $base_url.$cur_dir.rawurlencode($file);
  895. $mini_src = $src_thumb = $thumbs_path.$subdir.$file;
  896. //add in thumbs folder if not exist
  897. if (!file_exists($src_thumb)) {
  898. try {
  899. create_img_gd($file_path, $src_thumb, 122, 91);
  900. new_thumbnails_creation($current_path.$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, $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);
  901. } catch (Exception $e) {
  902. $src_thumb = $mini_src = "";
  903. }
  904. }
  905. $is_img = true;
  906. //check if is smaller than thumb
  907. list($img_width, $img_height, $img_type, $attr) = getimagesize($file_path);
  908. if ($img_width < 122 && $img_height < 91) {
  909. $src_thumb = $current_path.$subfolder.$subdir.$file;
  910. $show_original = true;
  911. }
  912. if ($img_width < 45 && $img_height < 38) {
  913. $mini_src = $current_path.$subfolder.$subdir.$file;
  914. $show_original_mini = true;
  915. }
  916. }
  917. $is_icon_thumb = false;
  918. $is_icon_thumb_mini = false;
  919. $no_thumb = false;
  920. if ($src_thumb == "") {
  921. $no_thumb = true;
  922. if (file_exists('img/'.$icon_theme.'/'.$extension_lower.".jpg")) {
  923. $src_thumb = 'img/'.$icon_theme.'/'.$extension_lower.".jpg";
  924. } else {
  925. $src_thumb = "img/".$icon_theme."/default.jpg";
  926. }
  927. $is_icon_thumb = true;
  928. }
  929. if ($mini_src == "") {
  930. $is_icon_thumb_mini = false;
  931. }
  932. $class_ext = 0;
  933. if (in_array($extension_lower, $ext_video)) {
  934. $class_ext = 4;
  935. $is_video = true;
  936. } elseif (in_array($extension_lower, $ext_img)) {
  937. $class_ext = 2;
  938. } elseif (in_array($extension_lower, $ext_music)) {
  939. $class_ext = 5;
  940. $is_audio = true;
  941. } elseif (in_array($extension_lower, $ext_misc)) {
  942. $class_ext = 3;
  943. } else {
  944. $class_ext = 1;
  945. }
  946. /* PrestaShop */
  947. if (isset($src_thumb) && $src_thumb) {
  948. if (($src_thumb = preg_replace('#('.addslashes($current_path).')#ism', Tools::safeOutput(Context::getContext()->shop->physical_uri.'img/cms/'), $src_thumb)) == $src_thumb) {
  949. $src_thumb = preg_replace('#('.addslashes($thumbs_base_path).')#ism', Tools::safeOutput(Context::getContext()->shop->physical_uri.'img/tmp/cms/'), $src_thumb);
  950. }
  951. }
  952. if (isset($mini_src) && $mini_src) {
  953. if (($mini_src = preg_replace('#('.addslashes($current_path).')#ism', Tools::safeOutput(Context::getContext()->shop->physical_uri.'img/cms/'), $mini_src)) == $mini_src) {
  954. $mini_src = preg_replace('#('.addslashes($thumbs_base_path).')#ism', Tools::safeOutput(Context::getContext()->shop->physical_uri.'img/tmp/cms/'), $mini_src);
  955. }
  956. }
  957. /* END PrestaShop */
  958. if ((!(Tools::getValue('type') == 1 && !$is_img) && !((Tools::getValue('type') == 3 && !$is_video) && (Tools::getValue('type') == 3 && !$is_audio))) && $class_ext > 0) {
  959. ?>
  960. <li class="ff-item-type-<?php echo Tools::safeOutput($class_ext);
  961. ?> file" data-name="<?php echo Tools::safeOutput($file);
  962. ?>">
  963. <figure data-name="<?php echo Tools::safeOutput($file) ?>" data-type="<?php if ($is_img) {
  964. echo "img";
  965. } else {
  966. echo "file";
  967. }
  968. ?>">
  969. <a href="javascript:void('')" class="link" data-file="<?php echo Tools::safeOutput($file);
  970. ?>" data-field_id="" data-function="<?php echo Tools::safeOutput($apply);
  971. ?>">
  972. <div class="img-precontainer">
  973. <?php if ($is_icon_thumb) {
  974. ?>
  975. <div class="filetype"><?php echo $extension_lower ?></div><?php
  976. }
  977. ?>
  978. <div class="img-container">
  979. <span></span>
  980. <img alt="<?php echo Tools::safeOutput($filename." thumbnails");
  981. ?>" class="<?php echo $show_original ? "original" : "" ?> <?php echo $is_icon_thumb ? "icon" : "" ?>" src="<?php echo Tools::safeOutput($src_thumb);
  982. ?>">
  983. </div>
  984. </div>
  985. <div class="img-precontainer-mini <?php if ($is_img) {
  986. echo 'original-thumb';
  987. }
  988. ?>">
  989. <div class="filetype <?php echo $extension_lower ?> <?php if (!$is_icon_thumb) {
  990. echo "hide";
  991. }
  992. ?>"><?php echo $extension_lower ?></div>
  993. <div class="img-container-mini">
  994. <span></span>
  995. <?php if ($mini_src != "") {
  996. ?>
  997. <img alt="<?php echo Tools::safeOutput($filename." thumbnails");
  998. ?>" class="<?php echo $show_original_mini ? "original" : "" ?> <?php echo $is_icon_thumb_mini ? "icon" : "" ?>" src="<?php echo Tools::safeOutput($mini_src);
  999. ?>">
  1000. <?php
  1001. }
  1002. ?>
  1003. </div>
  1004. </div>
  1005. <?php if ($is_icon_thumb) {
  1006. ?>
  1007. <div class="cover"></div>
  1008. <?php
  1009. }
  1010. ?>
  1011. </a>
  1012. <div class="box">
  1013. <h4 class="<?php if ($ellipsis_title_after_first_row) {
  1014. echo "ellipsis";
  1015. }
  1016. ?>">
  1017. <a href="javascript:void('')" class="link" data-file="<?php echo Tools::safeOutput($file);
  1018. ?>" data-field_id="" data-function="<?php echo Tools::safeOutput($apply);
  1019. ?>">
  1020. <?php echo Tools::safeOutput($filename);
  1021. ?></a></h4>
  1022. </div>
  1023. <input type="hidden" class="date" value="<?php echo $file_array['date'];
  1024. ?>"/>
  1025. <input type="hidden" class="size" value="<?php echo $file_array['size'] ?>"/>
  1026. <input type="hidden" class="extension" value="<?php echo $extension_lower;
  1027. ?>"/>
  1028. <input type="hidden" class="name" value=""/>
  1029. <div class="file-date"><?php echo date(lang_Date_type, $file_array['date']) ?></div>
  1030. <div class="file-size"><?php echo makeSize($file_array['size']) ?></div>
  1031. <div class='img-dimension'><?php if ($is_img) {
  1032. echo $img_width."x".$img_height;
  1033. }
  1034. ?></div>
  1035. <div class='file-extension'><?php echo Tools::safeOutput($extension_lower);
  1036. ?></div>
  1037. <figcaption>
  1038. <form action="force_download.php" method="post" class="download-form" id="form<?php echo Tools::safeOutput($nu);
  1039. ?>">
  1040. <input type="hidden" name="path" value="<?php echo Tools::safeOutput($subfolder.$subdir) ?>"/>
  1041. <input type="hidden" class="name_download" name="name" value="<?php echo Tools::safeOutput($file) ?>"/>
  1042. <a title="<?php echo lang_Download ?>" class="tip-right" href="javascript:void('')" onclick="$('#form<?php echo Tools::safeOutput($nu);
  1043. ?>').submit();"><i class="icon-download"></i></a>
  1044. <?php if ($is_img && $src_thumb != "") {
  1045. ?>
  1046. <a class="tip-right preview" title="<?php echo lang_Preview ?>" data-url="<?php echo Tools::safeOutput($src);
  1047. ?>" data-toggle="lightbox" href="#previewLightbox"><i class=" icon-eye-open"></i></a>
  1048. <?php
  1049. } elseif (($is_video || $is_audio) && in_array($extension_lower, $jplayer_ext)) {
  1050. ?>
  1051. <a class="tip-right modalAV <?php if ($is_audio) {
  1052. echo "audio";
  1053. } else {
  1054. echo "video";
  1055. }
  1056. ?>"
  1057. title="<?php echo lang_Preview ?>" data-url="ajax_calls.php?action=media_preview&title=<?php echo Tools::safeOutput($filename);
  1058. ?>&file=<?php echo Tools::safeOutput(Context::getContext()->shop->physical_uri.'img/cms/'.$subfolder.$subdir.$file);
  1059. ?>"
  1060. href="javascript:void('');"><i class=" icon-eye-open"></i></a>
  1061. <?php
  1062. } else {
  1063. ?>
  1064. <a class="preview disabled"><i class="icon-eye-open icon-white"></i></a>
  1065. <?php
  1066. }
  1067. ?>
  1068. <a href="javascript:void('')" class="tip-left edit-button <?php if ($rename_files) {
  1069. echo "rename-file";
  1070. }
  1071. ?>" title="<?php echo lang_Rename ?>" data-path="<?php echo Tools::safeOutput($subfolder.$subdir.$file);
  1072. ?>" data-thumb="<?php echo Tools::safeOutput($subdir.$file);
  1073. ?>">
  1074. <i class="icon-pencil <?php if (!$rename_files) {
  1075. echo 'icon-white';
  1076. }
  1077. ?>"></i></a>
  1078. <a href="javascript:void('')" class="tip-left erase-button <?php if ($delete_files) {
  1079. echo "delete-file";
  1080. }
  1081. ?>" title="<?php echo lang_Erase ?>" data-confirm="<?php echo lang_Confirm_del;
  1082. ?>" data-path="<?php echo Tools::safeOutput($subfolder.$subdir.$file);
  1083. ?>" data-thumb="<?php echo Tools::safeOutput($subdir.$file);
  1084. ?>">
  1085. <i class="icon-trash <?php if (!$delete_files) {
  1086. echo 'icon-white';
  1087. }
  1088. ?>"></i>
  1089. </a>
  1090. </form>
  1091. </figcaption>
  1092. </figure>
  1093. </li>
  1094. <?php
  1095. }
  1096. }
  1097. ?></div>
  1098. </ul>
  1099. <?php
  1100. }
  1101. ?>
  1102. </div>
  1103. </div>
  1104. </div>
  1105. <!----- lightbox div start ------->
  1106. <div id="previewLightbox" class="lightbox hide fade" tabindex="-1" role="dialog" aria-hidden="true">
  1107. <div class='lightbox-content'>
  1108. <img id="full-img" src="">
  1109. </div>
  1110. </div>
  1111. <!----- lightbox div end ------->
  1112. <!----- loading div start ------->
  1113. <div id="loading_container" style="display:none;">
  1114. <div id="loading" style="background-color:#000; position:fixed; width:100%; height:100%; top:0px; left:0px;z-index:100000"></div>
  1115. <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%"/>
  1116. </div>
  1117. <!----- loading div end ------->
  1118. <!----- player div start ------->
  1119. <div class="modal hide fade" id="previewAV">
  1120. <div class="modal-header">
  1121. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  1122. <h3><?php echo lang_Preview;
  1123. ?></h3>
  1124. </div>
  1125. <div class="modal-body">
  1126. <div class="row-fluid body-preview">
  1127. </div>
  1128. </div>
  1129. </div>
  1130. <!----- player div end ------->
  1131. <img id='aviary_img' src='' class="hide"/>
  1132. </body>
  1133. </html>
  1134. <?php
  1135. } ?>