Skip to content
Browse files

Merge branch '2.7' into 2.8

  • Loading branch information...
2 parents 9e18bd8 + bbb7e31 commit 1b8c6bcfd17be6a61170672c8817e3ab761fe7e2 @thorsten committed Apr 14, 2012
Showing with 10,273 additions and 10,674 deletions.
  1. +2 −1 CHANGELOG
  2. +59 −59 phpmyfaq/admin/editor/plugins/ajaxfilemanager/_ajax_get_details_listing.php
  3. +41 −42 phpmyfaq/admin/editor/plugins/ajaxfilemanager/_ajax_get_thumbnail_listing.php
  4. +5 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/_ajax_load_folders.php
  5. +1 −1 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_file_upload.php
  6. +136 −136 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_get_file_listing.php
  7. +11 −4 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_image_editor.php
  8. +9 −2 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_image_save.php
  9. +1 −1 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_login.php
  10. +2 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_save_name.php
  11. +166 −166 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_text_editor.php
  12. +735 −686 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajaxfilemanager.php
  13. +52 −43 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/class.auth.php
  14. +17 −1 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/class.file.php
  15. +5 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/class.history.php
  16. +37 −11 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/class.image.php
  17. +5 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/class.manager.php
  18. +5 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/class.pagination.php
  19. +188 −187 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/class.search.php
  20. +5 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/class.session.php
  21. +5 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/class.sessionaction.php
  22. +7 −2 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/class.upload.php
  23. +23 −18 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/config.base.php
  24. +115 −111 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/config.php
  25. +7 −6 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/config.tinymce.php
  26. +6 −4 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/data.php
  27. +1,240 −1,258 phpmyfaq/admin/editor/plugins/ajaxfilemanager/inc/function.base.php
  28. +1,842 −1,844 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/ajaxfilemanager.js
  29. +558 −563 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/ajaxfilemanager_c.js
  30. +191 −225 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/ajaxfileupload.js
  31. +877 −873 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/ajaximageeditor.js
  32. +26 −26 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/ajaximageeditor_c.js
  33. +90 −90 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/ajaxtexteditor.js
  34. +13 −13 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/ajaxtexteditor_c.js
  35. +1 −1 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/contextmenu.js
  36. +1 −1 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/edit_area/edit_area_full.js
  37. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/edit_area/images/Thumbs.db
  38. +24 −26 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/for_fckeditor.js
  39. +17 −16 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/for_form.js
  40. +1 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/for_stand_alone.js
  41. +249 −247 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/for_tinymce.js
  42. +807 −807 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/form.js
  43. +763 −763 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/interface.js
  44. +526 −526 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/iresizable.js
  45. +4 −4 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/jquery.js
  46. +444 −444 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/media.js
  47. +68 −68 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/rotate.js
  48. +323 −323 phpmyfaq/admin/editor/plugins/ajaxfilemanager/jscripts/thickbox.js
  49. +1 −1 phpmyfaq/admin/editor/plugins/ajaxfilemanager/session/gc_counter.ajax.php
  50. +1 −1 phpmyfaq/admin/editor/plugins/ajaxfilemanager/session/gc_log.ajax.php
  51. +555 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/css/ajaxfilemanager.css
  52. +3 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/css/ajaximageeditor.css
  53. +1 −536 phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/css/fckeditor.css
  54. +1 −0 phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/css/stand_alone.css
  55. +1 −537 phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/css/tinymce.css
  56. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/New Folder/Thumbs.db
  57. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/New Folder/folder_explore.png
  58. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/Thumbs.db
  59. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/action/Thumbs.db
  60. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/action/cross.png
  61. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/action/folder_add.png
  62. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/big_icon/Thumbs.db
  63. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/button/grey_lc.png
  64. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/button/grey_rc.png
  65. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/grey_lc.png
  66. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/pagination/Thumbs.db
  67. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/programm2008.jpg
  68. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/Thumbs.db
  69. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileAcrobat.png
  70. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileCode.png
  71. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileExcel.png
  72. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileExe.png
  73. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileFlash.png
  74. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileMusic.png
  75. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/filePicture.png
  76. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/filePowerpoint.png
  77. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileRTF.png
  78. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileText.png
  79. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileUnknown.png
  80. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileVideo.png
  81. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileWord.png
  82. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileXml.png
  83. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/fileZip.png
  84. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/folder.png
  85. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/folderEmpty.png
  86. BIN phpmyfaq/admin/editor/plugins/ajaxfilemanager/theme/default/images/small_icon/folderParent.png
View
3 CHANGELOG
@@ -24,7 +24,8 @@ Version 2.8.0-alpha2 - 2012-
- updated bundled Twitter Bootstrap to version 2.0.2 (Thorsten)
- fixed some bugs (Thorsten, Florian)
-Version 2.7.5 - 2012-04-
+Version 2.7.5 - 2012-04-14
+- fixed serious security issue in bundled ImageManager library (Thorsten)
- full support for Microsoft SQL Server Driver for PHP (Thorsten)
- added online verification check (Thorsten, Florian)
- added experimental support for SQLite3 (Thorsten)
View
118 phpmyfaq/admin/editor/plugins/ajaxfilemanager/_ajax_get_details_listing.php
@@ -1,60 +1,60 @@
-<?php
-if (!defined('IS_VALID_PHPMYFAQ')) {
- header('Location: http://'.$_SERVER['HTTP_HOST']);
- exit();
-}
-?>
-<div id="content">
-<table class="tableList" id="tableList" cellpadding="0" cellspacing="0" border="0">
- <thead>
- <tr>
- <th width="5"><a href="#" class="check_all" id="tickAll" title="<?php echo TIP_SELECT_ALL; ?>" onclick="checkAll(this);">&nbsp;</a></th>
- <th width="10" class="fileColumns">&nbsp;</th>
- <th class="docName"><?php echo LBL_NAME; ?></th>
- <th width="70" class="fileColumns"><?php echo LBL_SIZE; ?></th>
- <th class="fileColumns"><?php echo LBL_MODIFIED; ?></th>
- </tr>
- </thead>
- <tbody id="fileList">
- <?php
- $count = 1;
- $css = "";
- //list all documents (files and folders) under this current folder,
- //<?php echo appendQueryString(appendQueryString(CONFIG_URL_FILEnIMAGE_MANAGER, "path=" . $file['path']), makeQueryString(array('path')));
- foreach($fileList as $file)
- {
- $css = ($css == "" || $css == "even"?"odd":"even");
- $strDisabled = ($file['is_writable']?"":" disabled");
- $strClass = ($file['is_writable']?"left":" leftDisabled");
- if($file['type'] == 'file')
- {
-
- ?>
- <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" >
- <td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?> />
- </td>
- <td align="center" class="fileColumns" id="tdst<?php echo $count; ?>">&nbsp;<a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" target="_blank"><span class="<?php echo $file['cssClass']; ?>">&nbsp;</span></a></td>
- <td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><?php echo $file['name']; ?></td>
- <td class="docInfo" id="tdrd<?php echo $count; ?>"><?php echo transformFileSize($file['size']); ?></td>
- <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td>
- </tr>
- <?php
- }else
- {
- ?>
- <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" >
- <td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?>/>
- </td>
- <td lign="center" class="fileColumns" id="tdst<?php echo $count; ?>">&nbsp;<a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" <?php echo $file['cssClass'] == 'filePicture'?'rel="ajaxPhotos"':''; ?> ><span class="<?php echo ($file['file']||$file['subdir']?$file['cssClass']:"folderEmpty"); ?>">&nbsp;</span></a></td>
- <td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><?php echo $file['name']; ?></td>
- <td class="docInfo" id="tdrd<?php echo $count; ?>">&nbsp;</td>
- <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td>
- </tr>
- <?php
- }
- $count++;
- }
- ?>
- </tbody>
- </table>
+<?php
+ if(!defined('AJAX_INIT_DONE'))
+ {
+ die('Permission denied');
+ }
+?>
+<div id="content">
+<table class="tableList" id="tableList" cellpadding="0" cellspacing="0" border="0">
+ <thead>
+ <tr>
+ <th width="5"><a href="#" class="check_all" id="tickAll" title="<?php echo TIP_SELECT_ALL; ?>" onclick="checkAll(this);">&nbsp;</a></th>
+ <th width="10" class="fileColumns">&nbsp;</th>
+ <th class="docName"><?php echo LBL_NAME; ?></th>
+ <th width="70" class="fileColumns"><?php echo LBL_SIZE; ?></th>
+ <th class="fileColumns"><?php echo LBL_MODIFIED; ?></th>
+ </tr>
+ </thead>
+ <tbody id="fileList">
+ <?php
+ $count = 1;
+ $css = "";
+ //list all documents (files and folders) under this current folder,
+ //<?php echo appendQueryString(appendQueryString(CONFIG_URL_FILEnIMAGE_MANAGER, "path=" . $file['path']), makeQueryString(array('path')));
+ foreach($fileList as $file)
+ {
+ $css = ($css == "" || $css == "even"?"odd":"even");
+ $strDisabled = ($file['is_writable']?"":" disabled");
+ $strClass = ($file['is_writable']?"left":" leftDisabled");
+ if($file['type'] == 'file')
+ {
+
+ ?>
+ <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" >
+ <td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?> />
+ </td>
+ <td align="center" class="fileColumns" id="tdst<?php echo $count; ?>">&nbsp;<a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" target="_blank"><span class="<?php echo $file['cssClass']; ?>">&nbsp;</span></a></td>
+ <td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>"><?php echo $file['name']; ?></a></td>
+ <td class="docInfo" id="tdrd<?php echo $count; ?>"><?php echo transformFileSize($file['size']); ?></td>
+ <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td>
+ </tr>
+ <?php
+ }else
+ {
+ ?>
+ <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" >
+ <td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?>/>
+ </td>
+ <td align="center" class="fileColumns" id="tdst<?php echo $count; ?>">&nbsp;<a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" <?php echo $file['cssClass'] == 'filePicture'?'rel="ajaxPhotos"':''; ?> ><span class="<?php echo ($file['file']||$file['subdir']?$file['cssClass']:"folderEmpty"); ?>">&nbsp;</span></a></td>
+ <td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><?php echo $file['name']; ?></td>
+ <td class="docInfo" id="tdrd<?php echo $count; ?>">&nbsp;</td>
+ <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td>
+ </tr>
+ <?php
+ }
+ $count++;
+ }
+ ?>
+ </tbody>
+ </table>
</div>
View
83 phpmyfaq/admin/editor/plugins/ajaxfilemanager/_ajax_get_thumbnail_listing.php
@@ -1,43 +1,42 @@
-<?php
-if (!defined('IS_VALID_PHPMYFAQ')) {
- header('Location: http://'.$_SERVER['HTTP_HOST']);
- exit();
-}
-?>
-<div id="content">
-<?php
-
- $count = 1;
- $thumbnailBaseUrl = appendQueryString(CONFIG_URL_IMG_THUMBNAIL, makeQueryString(array('path')));
- foreach($fileList as $file)
-
- {
- ?>
- <dl class="thumbnailListing" id="dl<?php echo $count; ?>">
- <dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' && empty($file['file']) && empty($file['subdir'])?'folderEmpty':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
- <?php
- switch($file['cssClass'])
- {
- case 'filePicture':
- echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">';
- echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n";
- break;
- case 'fileFlash':
- case 'fileVideo':
- case 'fileMusic':
- break;
- default:
- echo '&nbsp;';
- }
- ?>
-
- </dt>
- <dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable']?'':'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" />
- <a <?php echo ($file['cssClass']== 'filePicture'?'rel="orgImg"':''); ?> href="<?php echo $file['path']; ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a></dd>
-
- </dl>
- <?php
- $count++;
- }
-?>
+<?php
+ if(!defined('AJAX_INIT_DONE'))
+ {
+ die('Permission denied');
+ }
+?><div id="content">
+<?php
+
+ $count = 1;
+ $thumbnailBaseUrl = appendQueryString(CONFIG_URL_IMG_THUMBNAIL, makeQueryString(array('path')));
+ foreach($fileList as $file)
+
+ {
+ ?>
+ <dl class="thumbnailListing" id="dl<?php echo $count; ?>">
+ <dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' && empty($file['file']) && empty($file['subdir'])?'folderEmpty':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
+ <?php
+ switch($file['cssClass'])
+ {
+ case 'filePicture':
+ echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">';
+ echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n";
+ break;
+ case 'fileFlash':
+ case 'fileVideo':
+ case 'fileMusic':
+ break;
+ default:
+ echo '&nbsp;';
+ }
+ ?>
+
+ </dt>
+ <dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable']?'':'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" />
+ <a <?php echo ($file['cssClass']== 'filePicture'?'rel="orgImg"':''); ?> href="<?php echo $file['path']; ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a></dd>
+
+ </dl>
+ <?php
+ $count++;
+ }
+?>
</div>
View
5 phpmyfaq/admin/editor/plugins/ajaxfilemanager/_ajax_load_folders.php
@@ -1,4 +1,9 @@
<?php
+ if(!defined('AJAX_INIT_DONE'))
+ {
+ die('Permission denied');
+ }
+?><?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
?>
<select class="input inputSearch" name="search_folder" id="search_folder">
View
2 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_file_upload.php
@@ -6,7 +6,7 @@
* @since 22/May/2007
*
*/
- sleep(3);
+
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
echo "{";
$error = "";
View
272 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_get_file_listing.php
@@ -1,137 +1,137 @@
-<?php
-
- /**
- * the php script used to get the list of file or folders under a specific folder
- * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
- * @link www.phpletter.com
- * @since 22/May/2007
- *
- */
-
- if(!isset($manager))
- {
- /**
- * this is part of script for processing file paste
- */
- //$_GET = $_POST;
- include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
- include_once(CLASS_PAGINATION);
- $pagination = new pagination(false);
- if (!empty($_GET['search']) && is_dir($_GET['search_folder']))
- {
- include_once(CLASS_SEARCH);
-
- $search = new Search($_GET['search_folder']);
- $search->addSearchKeyword('recursive', @$_GET['search_recursively']);
- $search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']);
- $search->addSearchKeyword('mtime_to', @$_GET['search_mtime_to']);
- $search->addSearchKeyword('size_from', @$_GET['search_size_from']);
- $search->addSearchKeyword('size_to', @$_GET['search_size_to']);
- $search->addSearchKeyword('recursive', @$_GET['search_recursively']);
- $search->addSearchKeyword('name', @$_GET['search_name']);
- $search->doSearch();
- $fileList = $search->getFoundFiles();
- $folderInfo = $search->getRootFolderInfo();
-
- }else
- {
- include_once(CLASS_MANAGER);
- include_once(CLASS_SESSION_ACTION);
- $sessionAction = new SessionAction();
- include_once(DIR_AJAX_INC . "class.manager.php");
-
- $manager = new manager();
- $manager->setSessionAction($sessionAction);
-
- $fileList = $manager->getFileList();
- $folderInfo = $manager->getFolderInfo();
-
- }
- $pagination->setUrl(CONFIG_URL_FILEnIMAGE_MANAGER);
-
- }else
- {
- include_once(CLASS_PAGINATION);
- $pagination = new pagination(false);
- }
-
-
- $pagination->setTotal(sizeof($fileList));
- $pagination->setFirstText(PAGINATION_FIRST);
- $pagination->setPreviousText(PAGINATION_PREVIOUS);
- $pagination->setNextText(PAGINATION_NEXT);
- $pagination->setLastText(PAGINATION_LAST);
- $pagination->setLimit(!empty($_GET['limit'])?intval($_GET['limit']):CONFIG_DEFAULT_PAGINATION_LIMIT);
- echo $pagination->getPaginationHTML();
- echo "<script type=\"text/javascript\">\n";
-
- echo "parentFolder = {path:'" . getParentFolderPath($folderInfo['path']). "'};\n";
- echo 'currentFolder ={';
- $count =1;
- foreach($folderInfo as $k=>$v)
- {
- echo ($count++ == 1?'':',') . "'" . $k . "':'" . ($k=='ctime'|| $k=='mtime'?date(DATE_TIME_FORMAT, $v):$v) . "'";
-
- }
- echo "};\n";
- $fileList = array_slice($fileList, $pagination->getPageOffset(), $pagination->getLimit());
- echo 'numRows = ' . sizeof($fileList) . ";\n";
- echo "files = {\n";
- $count = 1;
-
-
- foreach($fileList as $file)
- {
- echo (($count > 1)?",":'').$count++ . ":{";
- $j = 1;
- foreach($file as $k=>$v)
- {
-
- if($k == 'ctime' || $k == 'mtime')
- {
- $v = @date(DATE_TIME_FORMAT, $v);
- }
- if($k == 'size')
- {
- $v = transformFileSize($v);
- }
- echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'";
- }
- echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'";
- echo "}\n";
- }
- echo "};</script>\n";
- if(!empty($_GET['view']))
- {
- switch($_GET['view'])
- {
- case 'detail':
- case 'thumbnail':
- case 'text':
- $view = $_GET['view'];
- break;
- default:
- $view = CONFIG_DEFAULT_VIEW;
- }
- }else
- {
- $view = CONFIG_DEFAULT_VIEW;
- }
- switch($view)
- {
- case 'text':
- //list file name only
- include_once(DIR_AJAX_ROOT . '_ajax_get_text_listing.php');
- break;
- case 'thumbnail':
- //list file with thumbnail
- include_once(DIR_AJAX_ROOT . '_ajax_get_thumbnail_listing.php');
- break;
- case 'detail':
- default:
- include_once(DIR_AJAX_ROOT . '_ajax_get_details_listing.php');
- }
-
-
-
+<?php
+
+ /**
+ * the php script used to get the list of file or folders under a specific folder
+ * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
+ * @link www.phpletter.com
+ * @since 22/May/2007
+ *
+ */
+
+ if(!isset($manager))
+ {
+ /**
+ * this is part of script for processing file paste
+ */
+ //$_GET = $_POST;
+ include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
+ include_once(CLASS_PAGINATION);
+ $pagination = new pagination(false);
+ if(!empty($_GET['search']))
+ {
+ include_once(CLASS_SEARCH);
+
+ $search = new Search($_GET['search_folder']);
+ $search->addSearchKeyword('recursive', @$_GET['search_recursively']);
+ $search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']);
+ $search->addSearchKeyword('mtime_to', @$_GET['search_mtime_to']);
+ $search->addSearchKeyword('size_from', @$_GET['search_size_from']);
+ $search->addSearchKeyword('size_to', @$_GET['search_size_to']);
+ $search->addSearchKeyword('recursive', @$_GET['search_recursively']);
+ $search->addSearchKeyword('name', @$_GET['search_name']);
+ $search->doSearch();
+ $fileList = $search->getFoundFiles();
+ $folderInfo = $search->getRootFolderInfo();
+
+ }else
+ {
+ include_once(CLASS_MANAGER);
+ include_once(CLASS_SESSION_ACTION);
+ $sessionAction = new SessionAction();
+ include_once(DIR_AJAX_INC . "class.manager.php");
+
+ $manager = new manager();
+ $manager->setSessionAction($sessionAction);
+
+ $fileList = $manager->getFileList();
+ $folderInfo = $manager->getFolderInfo();
+
+ }
+ $pagination->setUrl(CONFIG_URL_FILEnIMAGE_MANAGER);
+
+ }else
+ {
+ include_once(CLASS_PAGINATION);
+ $pagination = new pagination(false);
+ }
+
+
+ $pagination->setTotal(sizeof($fileList));
+ $pagination->setFirstText(PAGINATION_FIRST);
+ $pagination->setPreviousText(PAGINATION_PREVIOUS);
+ $pagination->setNextText(PAGINATION_NEXT);
+ $pagination->setLastText(PAGINATION_LAST);
+ $pagination->setLimit(!empty($_GET['limit'])?intval($_GET['limit']):CONFIG_DEFAULT_PAGINATION_LIMIT);
+ echo $pagination->getPaginationHTML();
+ echo "<script type=\"text/javascript\">\n";
+
+ echo "parentFolder = {path:'" . getParentFolderPath($folderInfo['path']). "'};\n";
+ echo 'currentFolder ={';
+ $count =1;
+ foreach($folderInfo as $k=>$v)
+ {
+ echo ($count++ == 1?'':',') . "'" . $k . "':'" . ($k=='ctime'|| $k=='mtime'?date(DATE_TIME_FORMAT, $v):$v) . "'";
+
+ }
+ echo "};\n";
+ $fileList = array_slice($fileList, $pagination->getPageOffset(), $pagination->getLimit());
+ echo 'numRows = ' . sizeof($fileList) . ";\n";
+ echo "files = {\n";
+ $count = 1;
+
+
+ foreach($fileList as $file)
+ {
+ echo (($count > 1)?",":'').$count++ . ":{";
+ $j = 1;
+ foreach($file as $k=>$v)
+ {
+
+ if($k == 'ctime' || $k == 'mtime')
+ {
+ $v = @date(DATE_TIME_FORMAT, $v);
+ }
+ if($k == 'size')
+ {
+ $v = transformFileSize($v);
+ }
+ echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'";
+ }
+ echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'";
+ echo "}\n";
+ }
+ echo "};</script>\n";
+ if(!empty($_GET['view']))
+ {
+ switch($_GET['view'])
+ {
+ case 'detail':
+ case 'thumbnail':
+ case 'text':
+ $view = $_GET['view'];
+ break;
+ default:
+ $view = CONFIG_DEFAULT_VIEW;
+ }
+ }else
+ {
+ $view = CONFIG_DEFAULT_VIEW;
+ }
+ switch($view)
+ {
+ case 'text':
+ //list file name only
+ include_once(DIR_AJAX_ROOT . '_ajax_get_text_listing.php');
+ break;
+ case 'thumbnail':
+ //list file with thumbnail
+ include_once(DIR_AJAX_ROOT . '_ajax_get_thumbnail_listing.php');
+ break;
+ case 'detail':
+ default:
+ include_once(DIR_AJAX_ROOT . '_ajax_get_details_listing.php');
+ }
+
+
+
?>
View
15 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_image_editor.php
@@ -44,15 +44,15 @@
<meta name="author" content="Logan Cai" />
<meta name="website" content="http://www.phpletter.com" />
<script type="text/javascript" src="jscripts/ajaximageeditor_c.js"></script>
-<!--
-<script type="text/javascript" src="jscripts/jquery.js"></script>
+
+<!--<script type="text/javascript" src="jscripts/jquery.js"></script>
<script type="text/javascript" src="jscripts/form.js"></script>
<script type="text/javascript" src="jscripts/select.js"></script>
<script type="text/javascript" src="jscripts/jqModal.js"></script>
<script type="text/javascript" src="jscripts/rotate.js"></script>
-<script type="text/javascript" src="jscripts/interface.js"></script>
+<script type="text/javascript" src="jscripts/interface.js"></script>-->
+
--->
<script type="text/javascript" src="jscripts/ajaximageeditor.js"></script>
@@ -85,6 +85,13 @@ function()
$(getImageElement()).clone().appendTo("#hiddenImage");
changeMode();
initDisabledButtons(true);
+ $("#formImageInfo").bind("keypress", function(e) {
+ if (e.keyCode == 13) {
+
+ return false;
+
+ }
+ });
}
);
View
11 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_image_save.php
@@ -114,7 +114,14 @@
if($isSaveAsRequest)
{//save as request
//check save to folder if exists
- $imagePath = addTrailingSlash(backslashToSlash($_POST['save_to'])) . $_POST['new_name'] . "." . getFileExt($_POST['path']);
+ if(isset($_POST['save_to']) && strlen($_POST['save_to']))
+ {
+ $imagePath = $originalImage;
+ }else
+ {
+ $imagePath = addTrailingSlash(backslashToSlash($_POST['save_to'])) . $_POST['new_name'] . "." . getFileExt($_POST['path']);
+ }
+
if(!file_exists($_POST['save_to']) || !is_dir($_POST['save_to']))
{
$error = IMG_SAVE_AS_FOLDER_NOT_FOUND;
@@ -172,7 +179,7 @@
}
}else
{
- $error = IMG_SAVE_IMG_OPEN_FAILED;
+ $error = IMG_SAVE_IMG_OPEN_FAILED . $originalImage;
}
}else
View
2 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_login.php
@@ -10,7 +10,7 @@
$user = PMF_User_CurrentUser::getFromSession($faqConfig);
-if ($user) {
+if ($user instanceof PMF_User_CurrentUser) {
$_SESSION['ajax_user'] = true;
header('Location: ' . appendQueryString(CONFIG_URL_HOME, makeQueryString()));
exit;
View
2 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_save_name.php
@@ -59,11 +59,13 @@
include_once(CLASS_FILE);
$file = new file($path);
$fileInfo = $file->getFileInfo();
+ $fileInfo['mtime'] = date(DATE_TIME_FORMAT,$fileInfo['mtime']);
}else
{
include_once(CLASS_MANAGER);
$manager = new manager($path, false);
$fileInfo = $manager->getFolderInfo();
+ $fileInfo['mtime'] = date(DATE_TIME_FORMAT,$fileInfo['mtime']);
}
}
View
332 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_text_editor.php
@@ -1,166 +1,166 @@
-<?php
- /**
- * Ajax image editor platform
- * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
- * @link www.phpletter.com
- * @since 22/May/2007
- *
- */
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
- if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE)
- {
- die(SYS_DISABLED);
- }
- $session->gc();
- $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path'];
- if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
- {
- $path = $_GET['path'];
- }else
- {
- die(TXT_FILE_NOT_FOUND);
- }
- if(file_exists(DIR_AJAX_EDIT_AREA . "reg_syntax" . DIRECTORY_SEPARATOR . getFileExt($path) . ".js"))
- {
- $syntax = getFileExt($path);
- }else
- {
- switch (getFileExt($path))
- {
- case 'htm':
- $syntax = 'html';
- break;
- default:
- $syntax = 'basic';
- }
- }
- if(array_search(getFileExt($path), getValidTextEditorExts())=== false)
- {
- die(TXT_DISALLOWED_EXT);
- }
- ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="author" content="Logan Cai" />
-<meta name="website" content="http://www.phpletter.com" />
-<script type="text/javascript" src="jscripts/ajaxtexteditor_c.js"></script>
-<!--<script type="text/javascript" src="jscripts/jquery.js"></script>
-<script type="text/javascript" src="jscripts/form.js"></script>
-<script type="text/javascript" src="jscripts/select.js"></script>
-<script type="text/javascript" src="jscripts/jqModal.js"></script>
-<script type="text/javascript" src="jscripts/ajaxtexteditor.js"></script>
--->
-<script type="text/javascript" src="jscripts/edit_area/edit_area_full.js"></script>
-<script type="text/javascript">
- var warningExtNotSelected = '<?php echo TXT_EXT_NOT_SELECTED; ?>';
- var urlGetFolderList = '<?php echo appendQueryString(CONFIG_URL_GET_FOLDER_LIST, makeQueryString(array('path'))); ?>';
- var warningInvalidName = '<?php echo TXT_SAVE_AS_ERR_NAME_INVALID; ?>';
- var waringFolderNotSelected = '<?php echo TXT_DEST_FOLDER_NOT_SELECTED; ?>';
- var currentFolder = '<?php echo dirname($path); ?>';
- var currentName = '<?php echo basename($path); ?>';
-
- jQuery(document).ready(
- function()
- {
- editAreaLoader.init({
- id: "content" // id of the textarea to transform
- ,start_highlight: false // if start with highlight
- ,allow_resize: "both"
- ,gecko_spellcheck:true
- ,allow_toggle: true
- ,toolbar:"search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, highlight, reset_highlight, |, save, save_as"
- ,save_callback:"save"
- ,save_as_callback:"save_as"
- ,language: "<?php echo (file_exists(DIR_AJAX_EDIT_AREA . 'langs' . DIRECTORY_SEPARATOR .CONFIG_LANG_INDEX . ".js")?CONFIG_LANG_INDEX:'en'); ?>"
- ,syntax: "<?php echo $syntax; ?>"
- });
- jQuery('#windowSaveAs').jqm();
- jQuery('#windowProcessing').jqm({modal:true});
- }
- );
-
-
-
-
-</script>
-
-<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/ajaxtexteditor.css" type="text/css" rel="stylesheet" />
-<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/jqModal.css" type="text/css" rel="stylesheet" />
-<title>Ajax Text Editor</title>
-</head>
-<body>
-
-<div id="pageBody">
- <textarea name="content" id="content" style="height:500px; width: 97%;"><?php echo getFileContent($path); ?></textarea>
-</div>
-<div id="windowProcessing" class="jqmWindow" style="display:none">
- <form name="frmProcessing" id="frmProcessing" method="post" action="<?php echo appendQueryString(CONFIG_URL_SAVE_TEXT, makeQueryString(array('path')));?>">
- <input type="hidden" name="folder" id="folder" value="<?php echo dirname($path); ?>" />
- <input type="hidden" name="name" id="name" value="<?php echo basename($path); ?>" />
- <input type="hidden" name="save_as_request" id="save_as_request" value="0" />
- <div style="display:none"><textarea name="text" id="text"></textarea></div>
- </form>
- <a href="#" class="jqmClose" id="windowSaveClose"><?php echo IMG_BTN_CANCEL; ?></a>
- <p><img src="theme/<?php echo CONFIG_THEME_NAME; ?>/images/loading.gif" /></p>
-</div>
-<div id="windowSaveAs" class="jqmWindow" style="display:none">
- <a href="#" class="jqmClose" id="windowSaveClose"><?php echo IMG_BTN_CANCEL; ?></a>
- <form id="formSaveAs" name="formSaveAs" action="" method="post">
- <table class="tableForm" cellpadding="0" cellspacing="0">
- <thead>
- <tr>
- <th colspan="2"><?php echo IMG_LBL_SAVE_AS; ?></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th>
- <label><?php echo IMG_LBL_NEW_NAME; ?></label>
- </th>
- <td>
- <input type="text" id="new_name" class="input" name="new_name" value="" />
- &nbsp;.&nbsp;<select id="ext" name="ext">
- <?php
- foreach(getValidTextEditorExts() as $v)
- {
- ?>
- <option value="<?php echo $v; ?>" <?php echo (strtolower($v) == strtolower(getFileExt($path))?'selected':''); ?>><?php echo $v; ?></option>
- <?php
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <th>
- <label><?php echo IMG_LBL_SAVE_TO; ?></label>
- </th>
- <td>
- <select class="input" name="save_to" id="save_to">
-
- </select>
- </td>
- </tr>
- <tr>
- <th>&nbsp;
- </th>
- <td>
- <span class="comments">*</span>
- <?php echo IMG_NEW_NAME_COMMENTS; ?>
- </td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <th>&nbsp;</th>
- <td><input type="button" class="button" value="<?php echo IMG_BTN_SAVE_AS; ?>" onclick="return do_save_as();" /></td>
- </tr>
- </tfoot>
- </table>
- </form>
- </div>
-
-</body></html>
-
+<?php
+ /**
+ * Ajax image editor platform
+ * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
+ * @link www.phpletter.com
+ * @since 22/May/2007
+ *
+ */
+ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
+ if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE)
+ {
+ die(SYS_DISABLED);
+ }
+ $session->gc();
+ $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path'];
+ if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
+ {
+ $path = $_GET['path'];
+ }else
+ {
+ die(TXT_FILE_NOT_FOUND);
+ }
+ if(file_exists(DIR_AJAX_EDIT_AREA . "reg_syntax" . DIRECTORY_SEPARATOR . getFileExt($path) . ".js"))
+ {
+ $syntax = getFileExt($path);
+ }else
+ {
+ switch (getFileExt($path))
+ {
+ case 'htm':
+ $syntax = 'html';
+ break;
+ default:
+ $syntax = 'basic';
+ }
+ }
+ if(array_search(getFileExt($path), getValidTextEditorExts())=== false)
+ {
+ die(TXT_DISALLOWED_EXT);
+ }
+ ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="author" content="Logan Cai" />
+<meta name="website" content="http://www.phpletter.com" />
+<script type="text/javascript" src="jscripts/ajaxtexteditor_c.js"></script>
+<!--<script type="text/javascript" src="jscripts/jquery.js"></script>
+<script type="text/javascript" src="jscripts/form.js"></script>
+<script type="text/javascript" src="jscripts/select.js"></script>
+<script type="text/javascript" src="jscripts/jqModal.js"></script>
+<script type="text/javascript" src="jscripts/ajaxtexteditor.js"></script>
+-->
+<script type="text/javascript" src="jscripts/edit_area/edit_area_full.js"></script>
+<script type="text/javascript">
+ var warningExtNotSelected = '<?php echo TXT_EXT_NOT_SELECTED; ?>';
+ var urlGetFolderList = '<?php echo appendQueryString(CONFIG_URL_GET_FOLDER_LIST, makeQueryString(array('path'))); ?>';
+ var warningInvalidName = '<?php echo TXT_SAVE_AS_ERR_NAME_INVALID; ?>';
+ var waringFolderNotSelected = '<?php echo TXT_DEST_FOLDER_NOT_SELECTED; ?>';
+ var currentFolder = '<?php echo dirname($path); ?>';
+ var currentName = '<?php echo basename($path); ?>';
+
+ jQuery(document).ready(
+ function()
+ {
+ editAreaLoader.init({
+ id: "content" // id of the textarea to transform
+ ,start_highlight: false // if start with highlight
+ ,allow_resize: "both"
+ ,gecko_spellcheck:true
+ ,allow_toggle: true
+ ,toolbar:"search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, highlight, reset_highlight, |, save, save_as"
+ ,save_callback:"save"
+ ,save_as_callback:"save_as"
+ ,language: "<?php echo (file_exists(DIR_AJAX_EDIT_AREA . 'langs' . DIRECTORY_SEPARATOR .CONFIG_LANG_INDEX . ".js")?CONFIG_LANG_INDEX:'en'); ?>"
+ ,syntax: "<?php echo $syntax; ?>"
+ });
+ jQuery('#windowSaveAs').jqm();
+ jQuery('#windowProcessing').jqm({modal:true});
+ }
+ );
+
+
+
+
+</script>
+
+<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/ajaxtexteditor.css" type="text/css" rel="stylesheet" />
+<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/jqModal.css" type="text/css" rel="stylesheet" />
+<title>Ajax Text Editor</title>
+</head>
+<body>
+
+<div id="pageBody">
+ <textarea name="content" id="content" style="height:500px; width: 97%;"><?php echo getFileContent($path); ?></textarea>
+</div>
+<div id="windowProcessing" class="jqmWindow" style="display:none">
+ <form name="frmProcessing" id="frmProcessing" method="POST" action="<?php echo appendQueryString(CONFIG_URL_SAVE_TEXT, makeQueryString(array('path')));?>">
+ <input type="hidden" name="folder" id="folder" value="<?php echo dirname($path); ?>" />
+ <input type="hidden" name="name" id="name" value="<?php echo basename($path); ?>" />
+ <input type="hidden" name="save_as_request" id="save_as_request" value="0" />
+ <div style="display:none"><textarea name="text" id="text"></textarea></div>
+ </form>
+ <a href="#" class="jqmClose" id="windowSaveClose"><?php echo IMG_BTN_CANCEL; ?></a>
+ <p><img src="theme/<?php echo CONFIG_THEME_NAME; ?>/images/loading.gif" /></p>
+</div>
+<div id="windowSaveAs" class="jqmWindow" style="display:none">
+ <a href="#" class="jqmClose" id="windowSaveClose"><?php echo IMG_BTN_CANCEL; ?></a>
+ <form id="formSaveAs" name="formSaveAs" action="" method="post">
+ <table class="tableForm" cellpadding="0" cellspacing="0">
+ <thead>
+ <tr>
+ <th colspan="2"><?php echo IMG_LBL_SAVE_AS; ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th>
+ <label><?php echo IMG_LBL_NEW_NAME; ?></label>
+ </th>
+ <td>
+ <input type="text" id="new_name" class="input" name="new_name" value="" />
+ &nbsp;.&nbsp;<select id="ext" name="ext">
+ <?php
+ foreach(getValidTextEditorExts() as $v)
+ {
+ ?>
+ <option value="<?php echo $v; ?>" <?php echo (strtolower($v) == strtolower(getFileExt($path))?'selected':''); ?>><?php echo $v; ?></option>
+ <?php
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th>
+ <label><?php echo IMG_LBL_SAVE_TO; ?></label>
+ </th>
+ <td>
+ <select class="input" name="save_to" id="save_to">
+
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th>&nbsp;
+ </th>
+ <td>
+ <span class="comments">*</span>
+ <?php echo IMG_NEW_NAME_COMMENTS; ?>
+ </td>
+ </tr>
+ </tbody>
+ <tfoot>
+ <tr>
+ <th>&nbsp;</th>
+ <td><input type="button" class="button" value="<?php echo IMG_BTN_SAVE_AS; ?>" onclick="return do_save_as();" /></td>
+ </tr>
+ </tfoot>
+ </table>
+ </form>
+ </div>
+
+</body></html>
+
View
1,421 phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajaxfilemanager.php
@@ -1,687 +1,736 @@
-<?php
- /**
- * file manager platform
- * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
- * @link www.phpletter.com
- * @since 22/May/2007
- *
- */
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
- $session->gc();
- require_once(CLASS_SESSION_ACTION);
- $sessionAction = new SessionAction();
- if(CONFIG_LOAD_DOC_LATTER)
- {
- $fileList = array();
- $folderInfo = array('path'=>getCurrentFolderPath());
- }else
- {
- require_once(CLASS_MANAGER);
-
-
- $manager = new manager();
- $manager->setSessionAction($sessionAction);
- $fileList = $manager->getFileList();
- $folderInfo = $manager->getFolderInfo();
- }
- if(CONFIG_SYS_THUMBNAIL_VIEW_ENABLE)
- {
- $views = array(
- 'detail'=>LBL_BTN_VIEW_DETAILS,
- 'thumbnail'=>LBL_BTN_VIEW_THUMBNAIL,
- );
- }else
- {
- $views = array(
- 'detail'=>LBL_BTN_VIEW_DETAILS,
- );
- }
-
- if(!empty($_GET['view']))
- {
- switch($_GET['view'])
- {
- case 'detail':
- case 'thumbnail':
- $view = $_GET['view'];
- break;
- default:
- $view = CONFIG_DEFAULT_VIEW;
- }
- }else
- {
- $view = CONFIG_DEFAULT_VIEW;
- }
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" debug="true">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Ajax File Manager</title>
-<script type="text/javascript" src="jscripts/ajaxfilemanager_c.js"></script>
-<!--<script type="text/javascript" src="jscripts/jquery.js"></script>
-<script type="text/javascript" src="jscripts/form.js"></script>
-<script type="text/javascript" src="jscripts/select.js"></script>
-<script type="text/javascript" src="jscripts/thickbox.js"></script>
-<script type="text/javascript" src="jscripts/calendar.js"></script>
-<script type="text/javascript" src="jscripts/contextmenu.js"></script>
-<script type="text/javascript" src="jscripts/media.js"></script>
-<script type="text/javascript" src="jscripts/ajaxfileupload.js"></script>
-<script type="text/javascript" src="jscripts/ajaxfilemanager.js"></script>-->
-<script type="text/javascript">
- var globalSettings = {'upload_init':false};
- var queryString = '<?php echo makeQueryString(array('path')); ?>';
- var paths = {'root':'<?php echo addTrailingSlash(backslashToSlash(CONFIG_SYS_ROOT_PATH)); ?>', 'root_title':'<?php echo LBL_FOLDER_ROOT; ?>'};
- var parentFolder = {};
- var urls = {
- 'upload':'<?php echo CONFIG_URL_UPLOAD; ?>',
- 'preview':'<?php echo CONFIG_URL_PREVIEW; ?>',
- 'cut':'<?php echo CONFIG_URL_CUT; ?>',
- 'copy':'<?php echo CONFIG_URL_COPY; ?>',
- 'paste':'<?php echo CONFIG_URL_FILE_PASTE; ?>',
- 'delete':'<?php echo CONFIG_URL_DELETE; ?>',
- 'rename':'<?php echo CONFIG_URL_SAVE_NAME; ?>',
- 'thumbnail':'<?php echo CONFIG_URL_IMG_THUMBNAIL; ?>',
- 'create_folder':'<?php echo CONFIG_URL_CREATE_FOLDER; ?>',
- 'text_editor':'<?php echo CONFIG_URL_TEXT_EDITOR; ?>',
- 'image_editor':'<?php echo CONFIG_URL_IMAGE_EDITOR; ?>',
- 'download':'<?php echo CONFIG_URL_DOWNLOAD; ?>',
- 'present':'<?php echo getCurrentUrl(); ?>',
- 'home':'<?php echo CONFIG_URL_HOME; ?>',
- 'view':'<?php echo CONFIG_URL_LIST_LISTING; ?>'
- };
- var permits = {'del':<?php echo (CONFIG_OPTIONS_DELETE?1:0); ?>, 'cut':<?php echo (CONFIG_OPTIONS_CUT?'1':'0'); ?>, 'copy':<?php echo (CONFIG_OPTIONS_COPY?1:0); ?>, 'newfolder':<?php echo (CONFIG_OPTIONS_NEWFOLDER?1:0); ?>, 'rename':<?php echo (CONFIG_OPTIONS_RENAME?1:0); ?>, 'upload':<?php echo (CONFIG_OPTIONS_UPLOAD?1:0); ?>, 'edit':<?php echo (CONFIG_OPTIONS_EDITABLE?1:0); ?>, 'view_only':<?php echo (CONFIG_SYS_VIEW_ONLY?1:0); ?>};
- var currentFolder = {};
- var warningDelete = '<?php echo WARNING_DELETE; ?>';
- var newFile = {'num':1, 'label':'<?php echo FILE_LABEL_SELECT; ?>', 'upload':'<?php echo FILE_LBL_UPLOAD; ?>'};
- var counts = {'new_file':1};
- var thickbox = {'width':'<?php echo CONFIG_THICKBOX_MAX_WIDTH; ?>',
- 'height':'<?php echo CONFIG_THICKBOX_MAX_HEIGHT; ?>',
- 'next':'<?php echo THICKBOX_NEXT; ?>',
- 'previous':'<?php echo THICKBOX_PREVIOUS; ?>',
- 'close':'<?php echo THICKBOX_CLOSE; ?>'
-
- };
-
- var tb_pathToImage = "theme/<?php echo CONFIG_THEME_NAME; ?>/images/loadingAnimation.gif";
- var msgInvalidFolderName = '<?php echo ERR_FOLDER_FORMAT; ?>';
- var msgInvalidFileName = '<?php echo ERR_FILE_NAME_FORMAT; ?>';
- var msgInvalidExt = '<?php echo ERR_FILE_TYPE_NOT_ALLOWED; ?>';
- var msgNotPreview = '<?php echo PREVIEW_NOT_PREVIEW; ?>';
-
- var warningCutPaste = '<?php echo WARNING_CUT_PASTE; ?>';
- var warningCopyPaste = '<?php echo WARNING_COPY_PASTE; ?>';
- var warningDel = '<?php echo WARNING_DELETE; ?>';
- var warningNotDocSelected = '<?php echo ERR_NOT_DOC_SELECTED; ?>';
- var noFileSelected = '<?php echo ERR_NOT_FILE_SELECTED; ?>';
- var unselectAllText = '<?php echo TIP_UNSELECT_ALL; ?>';
- var selectAllText = '<?php echo TIP_SELECT_ALL; ?>';
- var action = '<?php echo $sessionAction->getAction(); ?>';
- var numFiles = <?php echo $sessionAction->count(); ?>;
- var warningCloseWindow = '<?php echo WARING_WINDOW_CLOSE; ?>';
- var numRows = 0;
-
- var wordCloseWindow = '<?php echo LBL_ACTION_CLOSE; ?>';
- var wordPreviewClick = '<?php echo LBL_CLICK_PREVIEW; ?>';
-
- var searchRequired = false;
- var supporedPreviewExts = '<?php echo CONFIG_VIEWABLE_VALID_EXTS; ?>';
- var supportedUploadExts = '<?php echo CONFIG_UPLOAD_VALID_EXTS; ?>'
- var elementId = <?php echo (!empty($_GET['elementId'])?"'" . $_GET['elementId'] . "'":'null'); ?>;
- var files = {};
-$(document).ready(
- function()
- {
- jQuery(document).bind('keypress', function(event) {
- var code=event.charCode || event.keyCode;
- if(code && code == 13) {// if enter is pressed
- event.preventDefault(); //prevent browser from following the actual href
- };
- });
- if(typeof(cancelSelectFile) != 'undefined')
- {
- $('#linkClose').show();
- }
- $('input[@name=view]').each(
- function()
- {
-
- if(this.value == '<?php echo $view; ?>')
- {
- this.checked = true;
- }else
- {
- this.checked = false;
- }
- }
- );
-
- popUpCal.clearText = '<?php echo CALENDAR_CLEAR; ?>';
- popUpCal.closeText = '<?php echo CALENDAR_CLOSE; ?>';
- popUpCal.prevText = '<?php echo CALENDAR_PREVIOUS; ?>';
- popUpCal.nextText = '<?php echo CALENDAR_NEXT; ?>';
- popUpCal.currentText = '<?php echo CALENDAR_CURRENT; ?>';
- popUpCal.buttonImageOnly = true;
- popUpCal.dayNames = new Array('<?php echo CALENDAR_SUN; ?>','<?php echo CALENDAR_MON; ?>','<?php echo CALENDAR_TUE; ?>','<?php echo CALENDAR_WED; ?>','<?php echo CALENDAR_THU; ?>','<?php echo CALENDAR_FRI; ?>','<?php echo CALENDAR_SAT; ?>');
- popUpCal.monthNames = new Array('<?php echo CALENDAR_JAN; ?>','<?php echo CALENDAR_FEB; ?>','<?php echo CALENDAR_MAR; ?>','<?php echo CALENDAR_APR; ?>','<?php echo CALENDAR_MAY; ?>','<?php echo CALENDAR_JUN; ?>','<?php echo CALENDAR_JUL; ?>','<?php echo CALENDAR_AUG; ?>','<?php echo CALENDAR_SEP; ?>','<?php echo CALENDAR_OCT; ?>','<?php echo CALENDAR_NOV; ?>','<?php echo CALENDAR_DEC; ?>');
- popUpCal.dateFormat = 'YMD-';
- $('.inputMtime').calendar({autoPopUp:'both', buttonImage:'theme/<?php echo CONFIG_THEME_NAME; ?>/images/standard/date_picker.png'});
-
-
- initAfterListingLoaded();
- //addMoreFile();
-
- } );
-
-
-</script>
-<?php
- if(file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'jscripts' . DIRECTORY_SEPARATOR . 'for_' . CONFIG_EDITOR_NAME . ".js")
- {
- ?>
- <script type="text/javascript" src="jscripts/<?php echo 'for_' . CONFIG_EDITOR_NAME . '.js'; ?>"></script>
- <?php
- }
-?>
-<link rel="stylesheet" type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/template.css" />
-<link rel="stylesheet" type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/jquery-calendar.css" />
-<link rel="stylesheet" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/thickbox.css" type="text/css" media="screen" />
-<!--[if IE 6]>
-<link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/ie6.css" type="text/css" rel="Stylesheet" media="screen">
-<![endif]-->
-</head>
-<body style="background-color:#E8E8E8;">
- <div id="wrapper">
- <div id="header">
- <dl id="currentFolderInfo">
- <dt><?php echo LBL_CURRENT_FOLDER_PATH; ?></dt>
- <dd id="currentFolderPath"><?php echo $folderInfo['path']; ?></dd>
- </dl>
- <div id="viewList">
-
-
- <label><?php echo LBL_BTN_VIEW_OPTIONS; ?></label>
- <?php
- foreach($views as $k=>$v)
- {
- ?>
- <input type="radio" name="view" class="radio" onclick="changeView(this);" value="<?php echo $k; ?>" <?php echo ($k==$view?'checked':''); ?>> <?php echo $v; ?> &nbsp;&nbsp;
-
- <?php
- }
- ?></div>
- <ul id="actionHeader">
- <li><a href="#" id="actionRefresh" onclick="return windowRefresh();"><span><?php echo LBL_ACTION_REFRESH; ?></span></a></li>
- <li><a href="#" id="actionSelectAll" class="check_all" onclick="return checkAll(this);"><span><?php echo LBL_ACTION_SELECT_ALL; ?></span></a></li>
- <?php
- if(CONFIG_OPTIONS_DELETE)
- {
- ?>
- <li><a href="#" id="actionDelete" onclick="return deleteDocuments();"><span><?php echo LBL_ACTION_DELETE; ?></span></a></li>
- <?php
- }
- ?>
- <?php
- if(CONFIG_OPTIONS_CUT)
- {
- ?>
- <li><a href="#" id="actionCut" onclick="return cutDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_CUT; ?>');"><span><?php echo LBL_ACTION_CUT; ?></span></a></li>
- <?php
- }
- ?>
- <?php
- if(CONFIG_OPTIONS_COPY)
- {
- ?>
- <li><a href="#" id="actionCopy" onclick="return copyDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_COPY; ?>');"><span><?php echo LBL_ACTION_COPY; ?></span></a></li>
- <?php
- }
- ?>
- <?php
- if(CONFIG_OPTIONS_CUT || CONFIG_OPTIONS_COPY)
- {
- ?>
- <li><a href="#" id="actionPaste" onclick="return pasteDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_PASTE; ?>');"><span><?php echo LBL_ACTION_PASTE; ?></span></a></li>
- <?php
- }
- ?>
-
- <?php
- if(CONFIG_OPTIONS_NEWFOLDER)
- {
- ?>
- <li><a id="actionNewFolder" href="#" onclick="return newFolderWin(this);"><span><?php echo LBL_BTN_NEW_FOLDER; ?></span></a></li>
- <?php
- }
- ?>
- <?php
- if(CONFIG_OPTIONS_UPLOAD)
- {
- ?>
- <li><a id="actionUpload" href="#" onclick="return uploadFileWin(this);"><span><?php echo LBL_BTN_UPLOAD; ?></span></a></li>
- <?php
- }
- ?>
-
-
-
-
-
-
-<!-- <li><a href="#" id="actionClose" onclick="closeWindow('<?php echo IMG_WARING_WIN_CLOSE; ?>');"><?php echo IMG_BTN_CLOSE; ?></a></li>-->
- <li><a href="#" class="thickbox" id="actionInfo" onclick="return infoWin(this);"><span>Info</span></a></li>
- <!-- thest functions will be added in the near future
- <li ><a href="#" id="actionZip"><span>Zip</span></a><li>
- <li ><a href="#" id="actionUnzip"><span>Unzip</span></a><li>-->
- </ul>
-<form action="" method="post" name="formAction" id="formAction"><input type="hidden" name="currentFolderPath" id="currentFolderPathVal" value="" /><select name="selectedDoc[]" id="selectedDoc" style="display:none;" multiple="multiple"></select><input type="hidden" name="action_value" value="" id="action_value" /></form>
- </div>
-
- <div id="body">
-
-
- <div id="rightCol">
- <?php
- if(CONFIG_LOAD_DOC_LATTER )
- {
- $currentPath = getCurrentFolderPath();
- ?>
- <script type="text/javascript">
- parentFolder = {path:'<?php echo getParentFolderPath($currentPath); ?>'};
- currentFolder = {'friendly_path':'<?php echo transformFilePath($currentPath); ?>'};
- $(document).ready(
- function()
- {
- var url = getUrl('view', false, false, false);
- $('#rightCol').empty();
- ajaxStart('#rightCol');
-
- $('#rightCol').load(url,
- {},
- function(){
- ajaxStop('#rightCol img.ajaxLoadingImg');
- urls.present = getUrl('home', true, true);
- initAfterListingLoaded();
- });
- }
- );
- </script>
- <?php
- }else
- {
- include_once(CONFIG_URL_LIST_LISTING);
- }
- ?>
- </div>
-
- <div id="leftCol">
-
-
-
- <fieldset id="folderFieldSet" >
-
- <legend><?php echo LBL_FOLDER_INFO; ?></legend>
- <table cellpadding="0" cellspacing="0" class="tableSummary" id="folderInfo">
- <tbody>
- <tr>
- <th><?php echo LBL_FOLDER_PATH; ?></th>
- <td colspan="3" id="folderPath"><?php echo transformFilePath($folderInfo['path']); ?></td>
- </tr>
- <tr>
- <th><?php echo LBL_FOLDER_CREATED; ?></th>
- <td colspan="3" id="folderCtime"><?php echo (!empty($folderInfo['ctime'])?date(DATE_TIME_FORMAT,$folderInfo['ctime']):'&nbsp;') ; ?></td>
-
- </tr>
- <tr>
- <th><?php echo LBL_FOLDER_MODIFIED; ?></th>
- <td colspan="3" id="folderMtime"><?php echo (!empty($folderInfo['mtime'])?date(DATE_TIME_FORMAT,$folderInfo['mtime']):'&nbsp;'); ?></td>
- </tr>
- <tr>
- <th><?php echo LBL_FOLDER_SUDDIR; ?></th>
- <td colspan="3" id="folderSubdir"><?php echo (isset($folderInfo['subdir'])?$folderInfo['subdir']:"&nbsp;"); ?></td>
-
- </tr>
- <tr>
- <th><?php echo LBL_FOLDER_FIELS; ?></th>
- <td colspan="3" id="folderFile"><?php echo (isset($folderInfo['file'])?$folderInfo['file']:'&nbsp;'); ?></td>
- </tr>
-
- <tr>
- <th><?php echo LBL_FOLDER_WRITABLE; ?></th>
- <td id="folderWritable"><span class="<?php echo (isset($folderInfo['is_readable'])?($folderInfo['is_readable']?'flagYes':'flagNo'):'&nbsp;'); ?>">&nbsp;</span></td>
- <th><?php echo LBL_FOLDER_READABLE; ?></th>
- <td id="folderReadable"><span class="<?php echo (isset($folderInfo['is_writable'])?($folderInfo['is_writable']?'flagYes':'flagNo'):'&nbsp;'); ?>">&nbsp;</span></td>
-
- </tr>
-
-
-
- </tbody>
- </table>
- </fieldset>
- <fieldset id="fileFieldSet" style="display:none" >
- <legend><?php echo LBL_FILE_INFO; ?></legend>
- <table cellpadding="0" cellspacing="0" class="tableSummary" id="fileInfo">
- <tbody>
- <tr>
- <th><?php echo LBL_FILE_NAME; ?></th>
- <td colspan="3" id="fileName"></td>
- </tr>
- <tr>
- <th><?php echo LBL_FILE_CREATED; ?></th>
- <td colspan="3" id="fileCtime"></td>
-
- </tr>
- <tr>
- <th><?php echo LBL_FILE_MODIFIED; ?></th>
- <td colspan="3" id="fileMtime"></td>
- </tr>
- <tr>
- <th><?php echo LBL_FILE_SIZE; ?></th>
- <td colspan="3" id="fileSize"></td>
-
- </tr>
- <tr>
- <th><?php echo LBL_FILE_TYPE; ?></th>
- <td colspan="3" id="fileType"></td>
- </tr>
- <tr>
- <th><?php echo LBL_FILE_WRITABLE; ?></th>
- <td id="fileWritable"><span class="flagYes">&nbsp;</span></td>
- <th><?php echo LBL_FILE_READABLE; ?></th>
- <td id="fileReadable"><span class="flagNo">&nbsp;</span></td>
- </tr>
-
- </tbody>
- </table>
-
- <p class="searchButtons" id="returnCurrentUrl">
-
- <span class="right" id="linkSelect">
- <input type="button" value="<?php echo MENU_SELECT; ?>" id="selectCurrentUrl" class="button">
- </span>
-
- </p>
- </fieldset>
-
-
-
- <fieldset class="boxSearch">
- <legend><?php echo LBL_SEARCH; ?></legend>
-
-
-
- <table cellpadding="0" cellspacing="0" class="tableSearch">
- <tbody>
- <tr>
- <td>
- <b><?php echo LBL_SEARCH_NAME; ?></b> <br />
- <input type="text" class="input inputSearch" name="search_name" id="search_name" />
- </td>
- </tr>
- <tr>
- <td >
- <b><?php echo LBL_SEARCH_FOLDER; ?></b><br />
- <span id="searchFolderContainer">
- <?php
- if(CONFIG_LOAD_DOC_LATTER)
- {
- ?>
- <script type="text/javascript">
- $(document).ready(
- function()
- {
- ajaxStart('#searchFolderContainer');
- $('#searchFolderContainer').load('<?php echo CONFIG_URL_LOAD_FOLDERS; ?>');
- }
- );
- </script>
- <?php
- }else
- {
- ?>
- <select class="input inputSearch" name="search_folder" id="search_folder">
- <?php
-
- foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
- {
- ?>
- <option value="<?php echo $v; ?>" <?php echo (removeTrailingSlash(backslashToSlash(($folderInfo['path']))) == removeTrailingSlash(backslashToSlash(($v)))?' selected="selected"':''); ?>><?php echo shortenFileName($k, 30); ?></option>
- <?php
- }
-
- ?>
- </select>
- <?php
- }
- ?></span>
- </td>
- </tr>
- <tr>
- <td>
- <b><?php echo LBL_SEARCH_MTIME; ?></b><br />
- <input type="text" class="input inputMtime" name="search_mtime_from" id="search_mtime_from" value="<?php echo (!empty($_GET['search_mtime_from'])?$_GET['search_mtime_from']:''); ?>" />
- <span class="leftToRightArrow">&nbsp;</span>
- <input type="text" class="input inputMtime" name="search_mtime_to" id="search_mtime_to" value="<?php echo (!empty($_GET['search_mtime_to'])?$_GET['search_mtime_to']:''); ?>" />
- </td></tr>
-
- <tr>
- <td>
- <b><?php echo LBL_SEARCH_RECURSIVELY; ?></b>&nbsp;&nbsp;
- <input type="radio" name="search_recursively" value="1" id="search_recursively_1" class="radio" <?php echo (!empty($_GET['search_recursively'])?'checked="checked"':''); ?> /> <?php echo LBL_RECURSIVELY_YES; ?>
- <input type="radio" name="search_recursively" value="0" id="search_recursively_0" class="radio" <?php echo (empty($_GET['search_recursively'])?'checked="checked"':''); ?> /> <?php echo LBL_RECURSIVELY_NO; ?>
- </td>
- </tr>
- </tbody>
-</table>
-
-
-
-
- <p class="searchButtons">
- <span class="left" id="linkClose" style="display:none">
- <input type="button" value="<?php echo LBL_ACTION_CLOSE; ?>" onclick="return cancelSelectFile();" class="button">
- </span>
- <span class="right" id="linkSearch">
- <input type="button" value="<?php echo BTN_SEARCH; ?>" onclick="return search();" class="button">
- </span>
-
- </p>
- </fieldset>
-
- </div>
-
- <div class="clear"></div>
- </div>
-
-
- </div>
- <div class="clear"></div>
-
-
-
- <div id="ajaxLoading" style="display:none"><img class="ajaxLoadingImg" src="theme/<?php echo CONFIG_THEME_NAME; ?>/images/ajaxLoading.gif" /></div>
- <div id="winUpload" style="display:none">
- <div class="jqmContainer">
- <div class="jqmHeader">
- <a href="#" onclick="tb_remove();"><?php echo LBL_ACTION_CLOSE; ?></a>
- </div>
- <div class="jqmBody">
- <form id="formUpload" name="formUpload" method="post" enctype="multipart/form-data" action="">
- <table class="tableForm" cellpadding="0" cellspacing="0">
- <thead>
- <tr>
- <th colspan="2"><?php echo FILE_FORM_TITLE; ?><a class="action" href="#" title="<?php echo FILE_LBL_MORE; ?>" onclick="return addMoreFile();"><span class="addMore">&nbsp;</span></a></th>
- </tr>
- </thead>
- <tbody id="fileUploadBody">
- <tr style="display:none">
- <th><label><?php echo FILE_LABEL_SELECT; ?></label></th>
- <td><input type="file" class="input" name="file" /> <input type="button" class="button" value="<?php echo FILE_LBL_UPLOAD; ?>" /> <a href="#" class="action" title="Cancel" style="display:none" ><span class="cancel">&nbsp;</span></a> <span class="uploadProcessing" style="display:none">&nbsp;<span></td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <th>&nbsp;</th>
- <td></td>
- </tr>
- </tfoot>
- </table>
- </form>
- </div>
-
- </div>
- </div>
- <div id="winNewFolder" style="display:none">
- <div class="jqmContainer">
- <div class="jqmHeader">
- <a href="#" onclick="tb_remove();"><?php echo LBL_ACTION_CLOSE; ?></a>
- </div>
- <div class="jqmBody">
- <form id="formNewFolder" name="formNewFolder" method="post" action="">
- <input type="hidden" name="currentFolderPath" value="" id="currentNewfolderPath" />
- <table class="tableForm" cellpadding="0" cellspacing="0">
- <thead>
- <tr>
- <th colspan="2"><?php echo FOLDER_FORM_TITLE; ?></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th><label><?php echo FOLDER_LBL_TITLE; ?></label></th>
- <td><input type="text" name="new_folder" id="new_folder" value="" class="input"></td>
- </tr>
-
-
- </tbody>
- <tfoot>
- <tr>
- <th>&nbsp;</th>
- <td><input type="button" value="<?php echo FOLDER_LBL_CREATE; ?>" class="button" onclick="return doCreateFolder();" /></td>
- </tr>
- </tfoot>
- </table>
- </form>
- </div>
-
-
-
- </div>
- </div>
- <div id="winPlay" style="display:none">
- <div class="jqmContainer">
- <div class="jqmHeader">
- <a href="#" onclick="closeWinPlay();"><?php echo LBL_ACTION_CLOSE; ?></a>
- </div>
- <div class="jqmBody">
- <div id="playGround"></div>
- </div>
- </div>
- </div>
- <div id="winRename" style="display:none">
- <div class="jqmContainer">
- <div class="jqmHeader">
- <a href="#" onclick="tb_remove();"><?php echo LBL_ACTION_CLOSE; ?></a>
- </div>
- <div class="jqmBody">
- <form id="formRename" name="formRename" method="post" action="">
- <input type="hidden" name="original_path" id="original_path" />
- <input type="hidden" name="num" id="renameNum" value="" />
- <table class="tableForm" cellpadding="0" cellspacing="0">
- <thead>
- <tr>
- <th colspan="2"><?php echo RENAME_FORM_TITLE; ?></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th><label><?php echo RENAME_NEW_NAME; ?></label></th>
- <td><input type="name" id="renameName" class="input" name="name" style="width:250px" />
- </td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <th>&nbsp;</th>
- <td><input type="button" value="<?php echo RENAME_LBL_RENAME; ?>" class="button" onclick="return doRename();" /></td>
- </tr>
- </tfoot>
- </table>
- </form>
- </div>
-
- </div>
-
- </div>
- <div id="winInfo" style="display:none">
- <div class="jqmContainer">
- <div class="jqmHeader">
- <a href="#" onclick="tb_remove();"><?php echo LBL_ACTION_CLOSE; ?></a>
- </div>
- <div class="jqmBody">
- <table class="tableInfo" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <th nowrap>
- <label>Author:</label>
- </th>
- <td>
- <a href="&#109;a&#105;l&#116;&#111;:&#99;&#97;&#105;&#108;&#111;&#110;&#103;&#113;&#117;&#110;&#64;&#121;&#97;&#104;&#111;&#111;&#46;&#99;&#111;&#109;&#46;&#99;&#110;">Logan Cai</a>
- </td>
- </tr>
- <tr>
- <th nowrap>
- <label>Template Designer:</label>
- </th>
- <td>
- <a href="&#109;a&#105;l&#116;&#111;:&#71;&#97;&#98;&#114;&#105;&#101;&#108;&#64;&#52;&#118;&#46;&#99;&#111;&#109;&#46;&#98;&#114;">Gabriel</a>
- </td>
- </tr>
- <tr>
- <th nowrap>
- <label>Official Website:</label>
- </th>
- <td>
- <a href="http://www.phpletter.com">http://www.phpletter.com</a>
- </td>
- </tr>
- <tr>
- <th nowrap>
- <label>Support Forum:</label>
- </th>
- <td>
- <a href="http://www.phpletter.com/forum/">http://www.phpletter.com/forum/</a>
- </td>
- </tr>
- <tr>
- <th nowrap>
- <label>&copy;Copyright:</label>
- </th>
- <td>
- All copyright declarations in the source must remain unchange. Please contact us if you need to make changes to it, in order to avoid any Legal Issues.
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-
-
- </div>
- </div>
- <div id="contextMenu" style="display:none">
- <ul>
- <li><a href="#" class="contentMenuItem" id="menuSelect"><?php echo MENU_SELECT; ?></a></li>
- <li><a href="#" class="contentMenuItem" id="menuPreview"><?php echo MENU_PREVIEW; ?></a></li>
- <li><a href="#" class="contentMenuItem" id="menuDownload"><?php echo MENU_DOWNLOAD; ?></a></li>
- <li><a href="#" class="contentMenuItem" id="menuRename"><?php echo MENU_RENAME; ?></a></li>
- <li><a href="#" class="contentMenuItem" id="menuEdit"><?php echo MENU_EDIT; ?></a></li>
- <li><a href="#" class="contentMenuItem" id="menuCut"><?php echo MENU_CUT; ?></a></li>
- <li><a href="#" class="contentMenuItem" id="menuCopy"><?php echo MENU_COPY; ?></a></li>
- <li><a href="#" class="contentMenuItem" id="menuPaste"><?php echo MENU_PASTE; ?></a></li>
- <li><a href="#" class="contentMenuItem" id="menuDelete"><?php echo MENU_DELETE; ?></a></li>
- <li><a href="#" class="contentMenuItem" id="menuPlay"><?php echo MENU_PLAY; ?></a></li>
- </ul>
- </div>
-</body>
+<?php
+ /**
+ * file manager platform
+ * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
+ * @link www.phpletter.com
+ * @since 22/May/2007
+ *
+ */
+ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
+ $session->gc();
+ require_once(CLASS_SESSION_ACTION);
+ $sessionAction = new SessionAction();
+ if(CONFIG_LOAD_DOC_LATTER)
+ {
+ $fileList = array();
+ $folderInfo = array('path'=>getCurrentFolderPath());
+ }else
+ {
+ require_once(CLASS_MANAGER);
+
+
+ $manager = new manager();
+ $manager->setSessionAction($sessionAction);
+ $fileList = $manager->getFileList();
+ $folderInfo = $manager->getFolderInfo();
+ }
+ if(CONFIG_SYS_THUMBNAIL_VIEW_ENABLE)
+ {
+ $views = array(
+ 'detail'=>LBL_BTN_VIEW_DETAILS,
+ 'thumbnail'=>LBL_BTN_VIEW_THUMBNAIL,
+ );
+ }else
+ {
+ $views = array(
+ 'detail'=>LBL_BTN_VIEW_DETAILS,
+ );
+ }
+
+ if(!empty($_GET['view']))
+ {
+ switch($_GET['view'])
+ {