ajaxfilemanager.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. <?php
  2. /**
  3. * file manager platform
  4. * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
  5. * @link www.phpletter.com
  6. * @since 22/May/2007
  7. *
  8. * Modify system config setting for Chamilo
  9. * @author Juan Carlos Raña Trabado
  10. * @since 31/December/2008
  11. */
  12. include '../../../../../../inc/global.inc.php'; // Integrating with Chamilo
  13. api_block_anonymous_users();// from Chamilo
  14. require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php";
  15. //$session->gc(); // Disabled for integration with Chamilo
  16. require_once CLASS_SESSION_ACTION;
  17. $sessionAction = new SessionAction();
  18. if (CONFIG_LOAD_DOC_LATTER) {
  19. $fileList = array();
  20. $folderInfo = array('path'=>getCurrentFolderPath());
  21. } else {
  22. require_once(CLASS_MANAGER);
  23. $manager = new manager();
  24. $manager->setSessionAction($sessionAction);
  25. $fileList = $manager->getFileList();
  26. $folderInfo = $manager->getFolderInfo();
  27. }
  28. if(CONFIG_SYS_THUMBNAIL_VIEW_ENABLE) {
  29. $views = array(
  30. 'detail'=>LBL_BTN_VIEW_DETAILS,
  31. 'thumbnail'=>LBL_BTN_VIEW_THUMBNAIL,
  32. );
  33. } else {
  34. $views = array(
  35. 'detail'=>LBL_BTN_VIEW_DETAILS,
  36. );
  37. }
  38. if(!empty($_GET['view'])) {
  39. switch($_GET['view']) {
  40. case 'detail':
  41. case 'thumbnail':
  42. $view = Security::remove_XSS($_GET['view']);
  43. break;
  44. default:
  45. $view = CONFIG_DEFAULT_VIEW;
  46. }
  47. } else {
  48. $view = CONFIG_DEFAULT_VIEW;
  49. }
  50. ?>
  51. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  52. <html xmlns="http://www.w3.org/1999/xhtml" debug="true" xml:lang="<?php echo CONFIG_LANG_DEFAULT; ?>" lang="<?php echo CONFIG_LANG_DEFAULT; ?>"><!-- hack fon lang default Chamilo -->
  53. <head>
  54. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  55. <title>Ajax File Manager</title>
  56. <script type="text/javascript" src="jscripts/jquery.js"></script>
  57. <script type="text/javascript" src="jscripts/form.js"></script>
  58. <script type="text/javascript" src="jscripts/select.js"></script>
  59. <script type="text/javascript" src="jscripts/thickbox.js"></script>
  60. <script type="text/javascript" src="jscripts/calendar.js"></script>
  61. <script type="text/javascript" src="jscripts/contextmenu.js"></script>
  62. <script type="text/javascript" src="jscripts/media.js"></script>
  63. <script type="text/javascript" src="jscripts/ajaxfileupload.js"></script>
  64. <script type="text/javascript" src="jscripts/ajaxfilemanager.js"></script>
  65. <script type="text/javascript">
  66. var mode_editor = '<?php echo Security::remove_XSS($_GET['editor']);?>';<!-- Chamilo hack for general my files users -->
  67. if (!mode_editor){
  68. // Added by Ivan Tcholakov, 22-JUL-2009.
  69. // For integration with the editor's dialig system.
  70. var oEditor = null ;
  71. if ( !window.opener && window.parent ) {
  72. // The file manager is inside a dialog.
  73. oEditor = window.parent.InnerDialogLoaded() ;
  74. }
  75. //end hack
  76. }
  77. var globalSettings = {'upload_init':false};
  78. var queryString = '<?php echo makeQueryString(array('path')); ?>';
  79. var paths = {'root':'<?php echo addTrailingSlash(backslashToSlash(CONFIG_SYS_ROOT_PATH)); ?>', 'root_title':'<?php echo LBL_FOLDER_ROOT; ?>'};
  80. <!-- Chamilo hack for breadcrumb into shared folders -->
  81. var shared_folder = '<?php echo get_lang('UserFolders');?>';
  82. <?php
  83. $course_session = explode('_', basename($currentPath));
  84. $course_session = strtolower($course_session[sizeof($course_session) - 1]);
  85. ?>
  86. <!--var shared_folder_session = '<?php //echo get_lang('UserFolders').' ('.api_get_session_name($course_session).')';?>'; --><!--// problem does not refresh, does not synchronize with javascript -->
  87. var shared_folder_session = '<?php echo get_lang('UserFolders').'*';?>';
  88. <?php
  89. //$userinfo=Database::get_user_info_from_id(substr(basename($folderInfo['path']), 8)); // problem with $folderInfo['path'] does not refresh, sincronisation with javascript?>
  90. <!--var shared_user_folder = '<?php //echo api_get_person_name($userinfo['firstname'], $userinfo['lastname']);?>'; --><!--// problem does not refresh, does not synchronize with javascript -->
  91. var shared_user_folder = '<?php echo get_lang('User');?>';
  92. <!--end hack -->
  93. var parentFolder = {};
  94. var urls = {
  95. 'upload':'<?php echo CONFIG_URL_UPLOAD; ?>',
  96. 'preview':'<?php echo CONFIG_URL_PREVIEW; ?>',
  97. 'cut':'<?php echo CONFIG_URL_CUT; ?>',
  98. 'copy':'<?php echo CONFIG_URL_COPY; ?>',
  99. 'paste':'<?php echo CONFIG_URL_FILE_PASTE; ?>',
  100. 'delete':'<?php echo CONFIG_URL_DELETE; ?>',
  101. 'rename':'<?php echo CONFIG_URL_SAVE_NAME; ?>',
  102. 'thumbnail':'<?php echo CONFIG_URL_IMG_THUMBNAIL; ?>',
  103. 'create_folder':'<?php echo CONFIG_URL_CREATE_FOLDER; ?>',
  104. 'text_editor':'<?php echo CONFIG_URL_TEXT_EDITOR; ?>',
  105. 'image_editor':'<?php echo CONFIG_URL_IMAGE_EDITOR; ?>',
  106. 'download':'<?php echo CONFIG_URL_DOWNLOAD; ?>',
  107. 'present':'<?php echo getCurrentUrl(); ?>',
  108. 'home':'<?php echo CONFIG_URL_HOME; ?>',
  109. 'view':'<?php echo CONFIG_URL_LIST_LISTING; ?>'
  110. };
  111. var permits = { 'del':<?php echo (CONFIG_OPTIONS_DELETE?1:0); ?>,
  112. 'cut':<?php echo (CONFIG_OPTIONS_CUT?'1':'0'); ?>,
  113. 'copy':<?php echo (CONFIG_OPTIONS_COPY?1:0); ?>,
  114. 'newfolder':<?php echo (CONFIG_OPTIONS_NEWFOLDER?1:0); ?>,
  115. 'rename':<?php echo (CONFIG_OPTIONS_RENAME?1:0); ?>,
  116. 'upload':<?php echo (CONFIG_OPTIONS_UPLOAD?1:0); ?>,
  117. 'edit':<?php echo (CONFIG_OPTIONS_EDITABLE?1:0); ?>,
  118. 'view_only':<?php echo (CONFIG_SYS_VIEW_ONLY?1:0); ?>};
  119. var currentFolder = {};
  120. var warningDelete = '<?php echo WARNING_DELETE; ?>';
  121. var newFile = {'num':1, 'label':'<?php echo FILE_LABEL_SELECT; ?>', 'upload':'<?php echo FILE_LBL_UPLOAD; ?>'};
  122. var counts = {'new_file':1};
  123. var thickbox = {'width':'<?php echo CONFIG_THICKBOX_MAX_WIDTH; ?>',
  124. 'height':'<?php echo CONFIG_THICKBOX_MAX_HEIGHT; ?>',
  125. 'next':'<img src="theme/default/images/next.png" title="<?php echo THICKBOX_NEXT; ?>" style="float:right;">',
  126. 'previous':'<img src="theme/default/images/prev.png" title="<?php echo THICKBOX_PREVIOUS; ?>" style="float:left">',
  127. 'close':'<img src="theme/default/images/flagno.png"title="<?php echo THICKBOX_CLOSE; ?>"><?php echo THICKBOX_CLOSE; ?>'
  128. };
  129. var tb_pathToImage = "theme/<?php echo CONFIG_THEME_NAME; ?>/images/loadingAnimation.gif";
  130. var msgInvalidFolderName = '<?php echo ERR_FOLDER_FORMAT; ?>';
  131. var msgInvalidFileName = '<?php echo ERR_FILE_NAME_FORMAT; ?>';
  132. var msgInvalidExt = '<?php echo ERR_FILE_TYPE_NOT_ALLOWED; ?>';
  133. var msgNotPreview = '<?php echo PREVIEW_NOT_PREVIEW; ?>';
  134. var warningCutPaste = '<?php echo WARNING_CUT_PASTE; ?>';
  135. var warningCopyPaste = '<?php echo WARNING_COPY_PASTE; ?>';
  136. var warningDel = '<?php echo WARNING_DELETE; ?>';
  137. var warningNotDocSelected = '<?php echo ERR_NOT_DOC_SELECTED; ?>';
  138. //var noFileSelected = '<?php //echo ERR_NOT_FILE_SELECTED; ?>';// Chamilo
  139. var noFileSelected = '<?php echo TXT_EXT_NOT_SELECTED; ?>';// Chamilo
  140. var unselectAllText = '<?php echo TIP_UNSELECT_ALL; ?>';
  141. var selectAllText = '<?php echo TIP_SELECT_ALL; ?>';
  142. var action = '<?php echo $sessionAction->getAction(); ?>';
  143. var numFiles = <?php echo $sessionAction->count(); ?>;
  144. var warningCloseWindow = '<?php echo WARING_WINDOW_CLOSE; ?>';
  145. var numRows = 0;
  146. var wordCloseWindow = '<?php echo LBL_ACTION_CLOSE; ?>';
  147. var wordPreviewClick = '<?php echo LBL_CLICK_PREVIEW; ?>';
  148. var searchRequired = false;
  149. var supporedPreviewExts = '<?php echo CONFIG_VIEWABLE_VALID_EXTS; ?>';
  150. var supportedUploadExts = '<?php echo CONFIG_UPLOAD_VALID_EXTS; ?>'
  151. var elementId = <?php echo (!empty($_GET['elementId'])?"'" . Security::remove_XSS($_GET['elementId']) . "'":'null'); ?>;
  152. var files = {};
  153. $(document).ready(
  154. function() {
  155. jQuery(document).bind('keypress', function(event) {
  156. var code=event.charCode || event.keyCode;
  157. if(code && code == 13) {// if enter is pressed
  158. event.preventDefault(); //prevent browser from following the actual href
  159. };
  160. });
  161. if(typeof(cancelSelectFile) != 'undefined') {
  162. $('#linkClose').show();
  163. }
  164. $('input[@name=view]').each(
  165. function() {
  166. if(this.value == '<?php echo $view; ?>') {
  167. this.checked = true;
  168. } else {
  169. this.checked = false;
  170. }
  171. }
  172. );
  173. popUpCal.clearText = '<?php echo CALENDAR_CLEAR; ?>';
  174. popUpCal.closeText = '<?php echo CALENDAR_CLOSE; ?>';
  175. popUpCal.prevText = '<?php echo CALENDAR_PREVIOUS; ?>';
  176. popUpCal.nextText = '<?php echo CALENDAR_NEXT; ?>';
  177. popUpCal.currentText = '<?php echo CALENDAR_CURRENT; ?>';
  178. popUpCal.buttonImageOnly = true;
  179. 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; ?>');
  180. 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; ?>');
  181. popUpCal.dateFormat = 'YMD-';
  182. $('.inputMtime').calendar({autoPopUp:'both', buttonImage:'theme/<?php echo CONFIG_THEME_NAME; ?>/images/date_picker.png'});
  183. initAfterListingLoaded();
  184. //addMoreFile();
  185. } );
  186. </script>
  187. <?php
  188. if(file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'jscripts' . DIRECTORY_SEPARATOR . 'for_' . CONFIG_EDITOR_NAME . ".js") {
  189. ?>
  190. <script type="text/javascript" src="jscripts/<?php echo 'for_' . CONFIG_EDITOR_NAME . '.js'; ?>"></script>
  191. <?php
  192. }
  193. ?>
  194. <link rel="stylesheet" type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/<?php echo CONFIG_EDITOR_NAME; ?>.css" />
  195. <link rel="stylesheet" type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/jquery-calendar.css" />
  196. <link rel="stylesheet" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/thickbox.css" type="text/css" media="screen" />
  197. <!--[if IE 6]>
  198. <link href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/ie6.css" type="text/css" rel="Stylesheet" media="screen">
  199. <![endif]-->
  200. </head>
  201. <body dir="<?php echo CONFIG_LANG_TEXT_DIRECTION_DEFAULT; ?>"><!-- move style to css and hack for default lang Chamilo -->
  202. <div id="wrapper">
  203. <div id="header">
  204. <dl id="currentFolderInfo">
  205. <dt><?php echo LBL_CURRENT_FOLDER_PATH; ?></dt>
  206. <dt id="currentFolderPath"><?php echo $folderInfo['path']; ?></dt><!-- hack for breadcrumb for Chamilo change <dd> by <dt> -->
  207. </dl>
  208. <br />
  209. <div id="viewList">
  210. <label><?php echo LBL_BTN_VIEW_OPTIONS; ?></label>
  211. <?php
  212. foreach($views as $k=>$v) {
  213. ?>
  214. <input type="radio" name="view" class="radio" onclick="return changeView(this);" value="<?php echo $k; ?>" <?php echo ($k==$view?'checked':''); ?>> <?php echo $v; ?> &nbsp;&nbsp;
  215. <?php
  216. }
  217. ?></div>
  218. <ul id="actionHeader">
  219. <li><a href="#" id="actionRefresh" onclick="return windowRefresh();"><span><?php echo LBL_ACTION_REFRESH; ?></span></a></li>
  220. <li><a href="#" id="actionSelectAll" class="check_all" onclick="return checkAll(this);"><span><?php echo LBL_ACTION_SELECT_ALL; ?></span></a></li>
  221. <?php
  222. if (CONFIG_OPTIONS_DELETE) {
  223. ?>
  224. <li><a href="#" id="actionDelete" onclick="return deleteDocuments();"><span><?php echo LBL_ACTION_DELETE; ?></span></a></li>
  225. <?php
  226. }
  227. ?>
  228. <?php
  229. if(CONFIG_OPTIONS_CUT)
  230. {
  231. ?>
  232. <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>
  233. <?php
  234. }
  235. ?>
  236. <?php
  237. if(CONFIG_OPTIONS_COPY)
  238. {
  239. ?>
  240. <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>
  241. <?php
  242. }
  243. ?>
  244. <?php
  245. if(CONFIG_OPTIONS_CUT || CONFIG_OPTIONS_COPY)
  246. {
  247. ?>
  248. <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>
  249. <?php
  250. }
  251. ?>
  252. <?php
  253. if(CONFIG_OPTIONS_NEWFOLDER)
  254. {
  255. ?>
  256. <li><a id="actionNewFolder" href="#" onclick="return newFolderWin(this);"><span><?php echo LBL_BTN_NEW_FOLDER; ?></span></a></li>
  257. <?php
  258. }
  259. ?>
  260. <?php
  261. if(CONFIG_OPTIONS_UPLOAD)
  262. {
  263. ?>
  264. <li><a id="actionUpload" href="#" onclick="return uploadFileWin(this);"><span><?php echo LBL_BTN_UPLOAD; ?></span></a></li>
  265. <?php
  266. }
  267. ?>
  268. <!-- <li><a href="#" id="actionClose" onclick="closeWindow('<?php echo IMG_WARING_WIN_CLOSE; ?>');"><?php echo IMG_BTN_CLOSE; ?></a></li>-->
  269. <!--<li><a href="#" class="thickbox" id="actionInfo" onclick="return infoWin(this);"><span>Info</span></a></li> -->
  270. <!-- thest functions will be added in the near future
  271. <li ><a href="#" id="actionZip"><span>Zip</span></a><li>
  272. <li ><a href="#" id="actionUnzip"><span>Unzip</span></a><li>-->
  273. </ul>
  274. <form action="" method="post" name="formAction" id="formAction">
  275. <input type="hidden" name="currentFolderPath" id="currentFolderPathVal" value="" />
  276. <select name="selectedDoc[]" id="selectedDoc" style="display:none;" multiple="multiple"></select>
  277. <input type="hidden" name="action_value" value="" id="action_value" />
  278. </form>
  279. </div>
  280. <div id="body">
  281. <div id="rightCol">
  282. <?php
  283. if(CONFIG_LOAD_DOC_LATTER ) {
  284. $currentPath = getCurrentFolderPath();
  285. ?>
  286. <script type="text/javascript">
  287. parentFolder = {'path_base64':'<?php echo base64_encode(getParentFolderPath($currentPath)); ?>', 'path':'<?php echo getParentFolderPath($currentPath); ?>'};
  288. currentFolder = {'friendly_path':'<?php echo transformFilePath($currentPath); ?>'};
  289. $(document).ready(
  290. function()
  291. {
  292. var url = getUrl('view', false, false, false);
  293. $('#rightCol').empty();
  294. ajaxStart('#rightCol');
  295. $('#rightCol').load(url,
  296. {},
  297. function(){
  298. ajaxStop('#rightCol img.ajaxLoadingImg');
  299. urls.present = getUrl('home', true, true);
  300. initAfterListingLoaded();
  301. });
  302. }
  303. );
  304. </script>
  305. <?php
  306. } else {
  307. include_once CONFIG_URL_LIST_LISTING;
  308. }
  309. ?>
  310. </div>
  311. <div id="leftCol">
  312. <fieldset id="folderFieldSet" >
  313. <legend><?php echo LBL_FOLDER_INFO; ?></legend>
  314. <table cellpadding="0" cellspacing="0" class="tableSummary" id="folderInfo">
  315. <tbody>
  316. <tr>
  317. <th><?php echo LBL_FOLDER_PATH; ?></th>
  318. <td colspan="3" id="folderPath"><?php echo transformFilePath($folderInfo['path']); ?></td>
  319. </tr>
  320. <tr>
  321. <th><?php echo LBL_FOLDER_CREATED; ?></th>
  322. <td colspan="3" id="folderCtime"><?php echo (!empty($folderInfo['ctime'])?date(DATE_TIME_FORMAT,$folderInfo['ctime']):'&nbsp;') ; ?></td>
  323. </tr>
  324. <tr>
  325. <th><?php echo LBL_FOLDER_MODIFIED; ?></th>
  326. <!-- comment these lines while integrating into Chamilo -->
  327. <th><?php //echo LBL_FOLDER_MODIFIED; ?></th>
  328. <!-- <td colspan="3" id="folderMtime"><?php //echo (!empty($folderInfo['mtime'])?date(DATE_TIME_FORMAT,$folderInfo['mtime']):'&nbsp;'); ?></td> -->
  329. </tr>
  330. <tr>
  331. <th><?php echo LBL_FOLDER_SUDDIR; ?></th>
  332. <td colspan="3" id="folderSubdir"><?php echo (isset($folderInfo['subdir'])?$folderInfo['subdir']:"&nbsp;"); ?></td>
  333. </tr>
  334. <tr>
  335. <th><?php echo LBL_FOLDER_FIELS; ?></th>
  336. <td colspan="3" id="folderFile"><?php echo (isset($folderInfo['file'])?$folderInfo['file']:'&nbsp;'); ?></td>
  337. </tr>
  338. <tr>
  339. <!-- comment these lines while integrating into Chamilo -->
  340. <th><?php // echo LBL_FOLDER_WRITABLE; ?></th>
  341. <!-- <td id="folderWritable"><span class="<?php //echo (isset($folderInfo['is_readable'])?($folderInfo['is_readable']?'flagYes':'flagNo'):'&nbsp;'); ?>">&nbsp;</span></td> -->
  342. <th><?php // echo LBL_FOLDER_READABLE; ?></th>
  343. <!--<td id="folderReadable"><span class="<?php //echo (isset($folderInfo['is_writable'])?($folderInfo['is_writable']?'flagYes':'flagNo'):'&nbsp;'); ?>">&nbsp;</span></td> -->
  344. </tr>
  345. </tbody>
  346. </table>
  347. </fieldset>
  348. <fieldset id="fileFieldSet" style="display:none" >
  349. <legend><?php echo LBL_FILE_INFO; ?></legend>
  350. <table cellpadding="0" cellspacing="0" class="tableSummary" id="fileInfo">
  351. <tbody>
  352. <tr>
  353. <th><?php echo LBL_FILE_NAME; ?></th>
  354. <td colspan="3" id="fileName"></td>
  355. </tr>
  356. <tr>
  357. <th><?php echo LBL_FILE_CREATED; ?></th>
  358. <td colspan="3" id="fileCtime"></td>
  359. </tr>
  360. <tr>
  361. <!-- comment these lines while integrating into Chamilo -->
  362. <th><?php //echo LBL_FILE_MODIFIED; ?></th>
  363. <!--<td colspan="3" id="fileMtime"></td> -->
  364. </tr>
  365. <tr>
  366. <th><?php echo LBL_FILE_SIZE; ?></th>
  367. <td colspan="3" id="fileSize"></td>
  368. </tr>
  369. <tr>
  370. <th><?php echo LBL_FILE_TYPE; ?></th>
  371. <td colspan="3" id="fileType"></td>
  372. </tr>
  373. <tr>
  374. <!-- comment these lines while integrating into Chamilo -->
  375. <th><?php //echo LBL_FILE_WRITABLE; ?></th>
  376. <!--<td id="fileWritable"><span class="flagYes">&nbsp;</span></td> -->
  377. <th><?php //echo LBL_FILE_READABLE; ?></th>
  378. <!--<td id="fileReadable"><span class="flagNo">&nbsp;</span></td> -->
  379. </tr>
  380. </tbody>
  381. </table>
  382. <p class="searchButtons" id="returnCurrentUrl">
  383. <span class="right" id="linkSelect">
  384. <input type="button" value="<?php echo MENU_SELECT; ?>" id="selectCurrentUrl" class="select_button">
  385. <!-- Change button class by Chamilo select_button class -->
  386. </span>
  387. </p>
  388. </fieldset>
  389. <fieldset class="boxSearch">
  390. <legend><?php echo LBL_SEARCH; ?></legend>
  391. <table cellpadding="0" cellspacing="0" class="tableSearch">
  392. <tbody>
  393. <tr>
  394. <td>
  395. <!-- comment these lines while integrating into Chamilo -->
  396. <b><?php //echo LBL_SEARCH_NAME; ?></b> <br />
  397. <input type="text" class="input inputSearch" name="search_name" id="search_name" />
  398. </td>
  399. </tr>
  400. <tr>
  401. <td >
  402. <!-- comment these lines while integrating into Chamilo -->
  403. <b><?php // echo LBL_SEARCH_FOLDER; ?></b><br />
  404. <span id="searchFolderContainer">
  405. <?php
  406. if(CONFIG_LOAD_DOC_LATTER)
  407. {
  408. ?>
  409. <script type="text/javascript">
  410. $(document).ready(
  411. function()
  412. {
  413. ajaxStart('#searchFolderContainer');
  414. $('#searchFolderContainer').load('<?php echo CONFIG_URL_LOAD_FOLDERS; ?>');
  415. }
  416. );
  417. </script>
  418. <?php
  419. }else
  420. {
  421. ?>
  422. <select class="input inputSearchSelect" name="search_folder" id="search_folder"><!-- Chamilo integrating, modify name class for disable by css -->
  423. <?php
  424. foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
  425. {
  426. if(hideFolderName($k))
  427. {
  428. //show only those permitted by Chamilo
  429. ?>
  430. <option value="<?php echo $v; ?>" <?php echo (removeTrailingSlash(backslashToSlash(($folderInfo['path']))) == removeTrailingSlash(backslashToSlash(($v)))?' selected="selected"':''); ?>><?php echo hideFolderName(shortenFileName($k, 30));
  431. ?></option>
  432. <?php
  433. }
  434. }
  435. ?>
  436. </select>
  437. <?php
  438. }
  439. ?></span>
  440. <!-- </td>
  441. </tr>
  442. <tr>
  443. <td> -->
  444. <b><?php //echo LBL_SEARCH_MTIME; ?></b><br />
  445. <!--<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']:''); ?>" /> -->
  446. <!--<span class="leftToRightArrow">&nbsp;</span> -->
  447. <!--<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']:''); ?>" /> -->
  448. <!--This lines replace above lines while integrating into Chamilo -->
  449. <input type="hidden" name="search_mtime_from" id="search_mtime_from" value="<?php //echo (!empty($_GET['search_mtime_from'])?$_GET['search_mtime_from']:''); ?>" />
  450. <input type="hidden" name="search_mtime_to" id="search_mtime_to" value="<?php //echo (!empty($_GET['search_mtime_to'])?$_GET['search_mtime_to']:''); ?>" />
  451. <!--</td></tr>
  452. <tr>
  453. <td> --><!-- comment these lines while integrating into Chamilo -->
  454. </td><td><!--add a col while integrating -->
  455. <b><?php // echo LBL_SEARCH_RECURSIVELY; ?></b>&nbsp;&nbsp;
  456. <!--change for Chamilo recursively by default -->
  457. <!-- <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; ?> -->
  458. <!-- <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; ?> -->
  459. </td>
  460. </tr>
  461. </tbody>
  462. </table>
  463. <p class="searchButtons">
  464. <span class="left" id="linkClose" style="display:none">
  465. <!-- comment these lines while integrating into Chamilo -->
  466. <!--<input type="button" value="<?php // echo LBL_ACTION_CLOSE; ?>" onclick="return cancelSelectFile();" class="button"> -->
  467. </span>
  468. <span class="right" id="linkSearch">
  469. <input type="button" value="<?php echo BTN_SEARCH; ?>" onclick="return search();" class="search_button">
  470. </span>
  471. </p>
  472. </fieldset>
  473. </div>
  474. <div class="clear"></div>
  475. </div>
  476. </div>
  477. <div class="clear"></div>
  478. <div id="ajaxLoading" style="display:none">
  479. <img class="ajaxLoadingImg" src="theme/<?php echo CONFIG_THEME_NAME; ?>/images/ajaxLoading.gif" /></div>
  480. <div id="winUpload" style="display:none">
  481. <div class="jqmContainer">
  482. <div class="jqmHeader">
  483. <a href="#" onclick="tb_remove();">
  484. <img src="theme/default/images/flagno.png"title="<?php echo LBL_ACTION_CLOSE; ?>">
  485. <?php echo LBL_ACTION_CLOSE; ?>
  486. </a>
  487. <!-- Add close image for Chamilo -->
  488. </div>
  489. <div class="jqmBody">
  490. <form id="formUpload" name="formUpload" method="post" enctype="multipart/form-data" action="">
  491. <table class="tableForm" cellpadding="0" cellspacing="0">
  492. <thead>
  493. <tr>
  494. <th colspan="2">
  495. <?php echo FILE_FORM_TITLE; ?>
  496. </th>
  497. </tr>
  498. <tr>
  499. <th colspan="2" align="left">
  500. <label>
  501. <a class="action" href="#" title="<?php echo FILE_LBL_MORE; ?>" onclick="return addMoreFile();">
  502. <label><?php echo FILE_LBL_MORE; ?></label><span class="addMore">&nbsp;</span></a>
  503. </label>
  504. </th>
  505. </tr>
  506. </thead>
  507. <tbody id="fileUploadBody">
  508. <tr style="display:none">
  509. <th><label><?php echo FILE_LABEL_SELECT; ?></label></th>
  510. <td>
  511. <input type="file" class="input" name="file" />
  512. <input type="button" class="upload_button" value="<?php echo FILE_LBL_UPLOAD; ?>" /><!-- change style of upload button by Chamilo -->
  513. <a href="#" class="action" title="<?php echo get_lang('Cancel')?>" style="display:none" ><!-- Chamilo lang var added -->
  514. <span class="cancel">&nbsp;</span>
  515. </a>
  516. <span class="uploadProcessing" style="display:none">&nbsp;</span>
  517. </td>
  518. </tr>
  519. </tbody>
  520. </table>
  521. </form>
  522. </div>
  523. </div>
  524. </div>
  525. <div id="winNewFolder" style="display:none">
  526. <div class="jqmContainer">
  527. <div class="jqmHeader">
  528. <a href="#" onclick="return tb_remove();"><img src="theme/default/images/flagno.png"title="<?php echo LBL_ACTION_CLOSE; ?>"><?php echo LBL_ACTION_CLOSE; ?></a><!-- Add close image for Chamilo -->
  529. </div>
  530. <div class="jqmBody">
  531. <form id="formNewFolder" name="formNewFolder" method="post" action="">
  532. <input type="hidden" name="currentFolderPath" value="" id="currentNewfolderPath" />
  533. <table class="tableForm" cellpadding="0" cellspacing="0">
  534. <thead>
  535. <tr>
  536. <th colspan="2"><?php echo FOLDER_FORM_TITLE; ?></th>
  537. </tr>
  538. </thead>
  539. <tbody>
  540. <tr>
  541. <th><label><?php echo FOLDER_LBL_TITLE; ?></label></th>
  542. <td><input type="text" name="new_folder" id="new_folder" value="" class="input"></td>
  543. </tr>
  544. </tbody>
  545. <tfoot>
  546. <tr>
  547. <th>&nbsp;</th>
  548. <td><input type="button" value="<?php echo FOLDER_LBL_CREATE; ?>" class="create_button" onclick="return doCreateFolder();" /></td>
  549. </tr>
  550. </tfoot>
  551. </table>
  552. </form>
  553. </div>
  554. </div>
  555. </div>
  556. <div id="winPlay" style="display:none">
  557. <div class="jqmContainer">
  558. <div class="jqmHeader">
  559. <a href="#" onclick="return closeWinPlay();"><img src="theme/default/images/flagno.png"title="<?php echo LBL_ACTION_CLOSE; ?>"><?php echo LBL_ACTION_CLOSE; ?></a><!-- Add close image for Chamilo -->
  560. </div>
  561. <div class="jqmBody">
  562. <div id="playGround"></div>
  563. </div>
  564. </div>
  565. </div>
  566. <div id="winRename" style="display:none">
  567. <div class="jqmContainer">
  568. <div class="jqmHeader">
  569. <a href="#" onclick="return tb_remove();"><img src="theme/default/images/flagno.png"title="<?php echo LBL_ACTION_CLOSE; ?>"><?php echo LBL_ACTION_CLOSE; ?></a><!-- Add close image for Chamilo -->
  570. </div>
  571. <div class="jqmBody">
  572. <form id="formRename" name="formRename" method="post" action="">
  573. <input type="hidden" name="original_path" id="original_path" />
  574. <input type="hidden" name="num" id="renameNum" value="" />
  575. <table class="tableForm" cellpadding="0" cellspacing="0">
  576. <thead>
  577. <tr>
  578. <th colspan="2"><?php echo RENAME_FORM_TITLE; ?></th>
  579. </tr>
  580. </thead>
  581. <tbody>
  582. <tr>
  583. <th><label><?php echo RENAME_NEW_NAME; ?></label></th>
  584. <td><input type="name" id="renameName" class="input" name="name" /> <!-- Chamilo delete style="width:250px"-->
  585. </td>
  586. </tr>
  587. </tbody>
  588. <tfoot>
  589. <tr>
  590. <th>&nbsp;</th>
  591. <td><input type="button" value="<?php echo RENAME_LBL_RENAME; ?>" class="create_button" onclick="return doRename();" /></td>
  592. </tr>
  593. </tfoot>
  594. </table>
  595. </form>
  596. </div>
  597. </div>
  598. </div>
  599. <div id="winInfo" style="display:none">
  600. <div class="jqmContainer">
  601. <div class="jqmHeader">
  602. <a href="#" onclick="tb_remove();"><?php echo LBL_ACTION_CLOSE; ?></a>
  603. </div>
  604. <div class="jqmBody">
  605. <table class="tableInfo" cellpadding="0" cellspacing="0">
  606. <tbody>
  607. <tr>
  608. <th nowrap>
  609. <label>Author:</label>
  610. </th>
  611. <td>
  612. <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>
  613. </td>
  614. </tr>
  615. <tr>
  616. <th nowrap>
  617. <label>Template Designer:</label>
  618. </th>
  619. <td>
  620. <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>
  621. </td>
  622. </tr>
  623. <tr>
  624. <th nowrap>
  625. <label>Official Website:</label>
  626. </th>
  627. <td>
  628. <a href="http://www.phpletter.com">http://www.phpletter.com</a>
  629. </td>
  630. </tr>
  631. <tr>
  632. <th nowrap>
  633. <label>Support Forum:</label>
  634. </th>
  635. <td>
  636. <a href="http://www.phpletter.com/forum/">http://www.phpletter.com/forum/</a>
  637. </td>
  638. </tr>
  639. <tr>
  640. <th nowrap>
  641. <label>&copy;Copyright:</label>
  642. </th>
  643. <td>
  644. 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.
  645. </td>
  646. </tr>
  647. </tbody>
  648. </table>
  649. </div>
  650. </div>
  651. </div>
  652. <div id="contextMenu" style="display:none">
  653. <ul>
  654. <li><a href="#" class="contentMenuItem" id="menuSelect"><?php echo MENU_SELECT; ?></a></li>
  655. <li><a href="#" class="contentMenuItem" id="menuPreview"><?php echo MENU_PREVIEW; ?></a></li>
  656. <li><a href="#" class="contentMenuItem" id="menuDownload"><?php echo MENU_DOWNLOAD; ?></a></li>
  657. <li><a href="#" class="contentMenuItem" id="menuRename"><?php echo MENU_RENAME; ?></a></li>
  658. <li><a href="#" class="contentMenuItem" id="menuEdit"><?php echo MENU_EDIT; ?></a></li>
  659. <li><a href="#" class="contentMenuItem" id="menuCut"><?php echo MENU_CUT; ?></a></li>
  660. <li><a href="#" class="contentMenuItem" id="menuCopy"><?php echo MENU_COPY; ?></a></li>
  661. <li><a href="#" class="contentMenuItem" id="menuPaste"><?php echo MENU_PASTE; ?></a></li>
  662. <li><a href="#" class="contentMenuItem" id="menuDelete"><?php echo MENU_DELETE; ?></a></li>
  663. <li><a href="#" class="contentMenuItem" id="menuPlay"><?php echo MENU_PLAY; ?></a></li>
  664. </ul>
  665. </div>
  666. </body>
  667. </html>