ajaxfilemanager.php 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  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. // Integrating with Chamilo
  13. require_once '../../../../../../inc/global.inc.php';
  14. api_block_anonymous_users();// from Chamilo
  15. require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php";
  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 isset($_GET['editor']) ? 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 = array();
  84. if (isset($currentPath)) {
  85. $course_session = explode('_', basename($currentPath));
  86. $course_session = strtolower($course_session[sizeof($course_session) - 1]);
  87. }
  88. ?>
  89. <!--var shared_folder_session = '<?php //echo get_lang('UserFolders').' ('.api_get_session_name($course_session).')';?>'; --><!--// problem does not refresh, does not synchronize with javascript -->
  90. var shared_folder_session = '<?php echo get_lang('UserFolders').'*';?>';
  91. <!--var shared_user_folder = '<?php //echo api_get_person_name($userinfo['firstname'], $userinfo['lastname']);?>'; --><!--// problem does not refresh, does not synchronize with javascript -->
  92. var shared_user_folder = '<?php echo get_lang('User');?>';
  93. <!--end hack -->
  94. var parentFolder = {};
  95. var urls = {
  96. 'upload':'<?php echo CONFIG_URL_UPLOAD; ?>',
  97. 'preview':'<?php echo CONFIG_URL_PREVIEW; ?>',
  98. 'cut':'<?php echo CONFIG_URL_CUT; ?>',
  99. 'copy':'<?php echo CONFIG_URL_COPY; ?>',
  100. 'paste':'<?php echo CONFIG_URL_FILE_PASTE; ?>',
  101. 'delete':'<?php echo CONFIG_URL_DELETE; ?>',
  102. 'rename':'<?php echo CONFIG_URL_SAVE_NAME; ?>',
  103. 'thumbnail':'<?php echo CONFIG_URL_IMG_THUMBNAIL; ?>',
  104. 'create_folder':'<?php echo CONFIG_URL_CREATE_FOLDER; ?>',
  105. 'text_editor':'<?php echo CONFIG_URL_TEXT_EDITOR; ?>',
  106. 'image_editor':'<?php echo CONFIG_URL_IMAGE_EDITOR; ?>',
  107. 'download':'<?php echo CONFIG_URL_DOWNLOAD; ?>',
  108. 'present':'<?php echo getCurrentUrl(); ?>',
  109. 'home':'<?php echo CONFIG_URL_HOME; ?>',
  110. 'view':'<?php echo CONFIG_URL_LIST_LISTING; ?>'
  111. };
  112. var permits = {
  113. 'del':<?php echo (CONFIG_OPTIONS_DELETE?1:0); ?>,
  114. 'cut':<?php echo (CONFIG_OPTIONS_CUT?'1':'0'); ?>,
  115. 'copy':<?php echo (CONFIG_OPTIONS_COPY?1:0); ?>,
  116. 'newfolder':<?php echo (CONFIG_OPTIONS_NEWFOLDER?1:0); ?>,
  117. 'rename':<?php echo (CONFIG_OPTIONS_RENAME?1:0); ?>,
  118. 'upload':<?php echo (CONFIG_OPTIONS_UPLOAD?1:0); ?>,
  119. 'edit':<?php echo (CONFIG_OPTIONS_EDITABLE?1:0); ?>,
  120. 'view_only':<?php echo (CONFIG_SYS_VIEW_ONLY?1:0); ?>
  121. };
  122. var currentFolder = {};
  123. var warningDelete = '<?php echo WARNING_DELETE; ?>';
  124. var newFile = {'num':1, 'label':'<?php echo FILE_LABEL_SELECT; ?>', 'upload':'<?php echo FILE_LBL_UPLOAD; ?>'};
  125. var counts = {'new_file':1};
  126. var thickbox = {
  127. 'width':'<?php echo CONFIG_THICKBOX_MAX_WIDTH; ?>',
  128. 'height':'<?php echo CONFIG_THICKBOX_MAX_HEIGHT; ?>',
  129. 'next':'<img src="theme/default/images/next.png" title="<?php echo THICKBOX_NEXT; ?>" style="float:right;">',
  130. 'previous':'<img src="theme/default/images/prev.png" title="<?php echo THICKBOX_PREVIOUS; ?>" style="float:left">',
  131. 'close':'<img src="theme/default/images/flagno.png"title="<?php echo THICKBOX_CLOSE; ?>"><?php echo THICKBOX_CLOSE; ?>'
  132. };
  133. var tb_pathToImage = "theme/<?php echo CONFIG_THEME_NAME; ?>/images/loadingAnimation.gif";
  134. var msgInvalidFolderName = '<?php echo ERR_FOLDER_FORMAT; ?>';
  135. var msgInvalidFileName = '<?php echo ERR_FILE_NAME_FORMAT; ?>';
  136. var msgInvalidExt = '<?php echo ERR_FILE_TYPE_NOT_ALLOWED; ?>';
  137. var msgNotPreview = '<?php echo PREVIEW_NOT_PREVIEW; ?>';
  138. var warningCutPaste = '<?php echo WARNING_CUT_PASTE; ?>';
  139. var warningCopyPaste = '<?php echo WARNING_COPY_PASTE; ?>';
  140. var warningDel = '<?php echo WARNING_DELETE; ?>';
  141. var warningNotDocSelected = '<?php echo ERR_NOT_DOC_SELECTED; ?>';
  142. //var noFileSelected = '<?php //echo ERR_NOT_FILE_SELECTED; ?>';// Chamilo
  143. var noFileSelected = '<?php echo TXT_EXT_NOT_SELECTED; ?>';// Chamilo
  144. var unselectAllText = '<?php echo TIP_UNSELECT_ALL; ?>';
  145. var selectAllText = '<?php echo TIP_SELECT_ALL; ?>';
  146. var action = '<?php echo $sessionAction->getAction(); ?>';
  147. var numFiles = <?php echo $sessionAction->count(); ?>;
  148. var warningCloseWindow = '<?php echo WARING_WINDOW_CLOSE; ?>';
  149. var numRows = 0;
  150. var wordCloseWindow = '<?php echo LBL_ACTION_CLOSE; ?>';
  151. var wordPreviewClick = '<?php echo LBL_CLICK_PREVIEW; ?>';
  152. var searchRequired = false;
  153. var supporedPreviewExts = '<?php echo CONFIG_VIEWABLE_VALID_EXTS; ?>';
  154. var supportedUploadExts = '<?php echo CONFIG_UPLOAD_VALID_EXTS; ?>'
  155. var elementId = <?php echo (!empty($_GET['elementId'])?"'" . Security::remove_XSS($_GET['elementId']) . "'":'null'); ?>;
  156. var files = {};
  157. $(document).ready(function() {
  158. jQuery(document).bind('keypress', function(event) {
  159. var code=event.charCode || event.keyCode;
  160. if(code && code == 13) {// if enter is pressed
  161. event.preventDefault(); //prevent browser from following the actual href
  162. };
  163. });
  164. if(typeof(cancelSelectFile) != 'undefined') {
  165. $('#linkClose').show();
  166. }
  167. $('input[@name=view]').each(
  168. function() {
  169. if(this.value == '<?php echo $view; ?>') {
  170. this.checked = true;
  171. } else {
  172. this.checked = false;
  173. }
  174. }
  175. );
  176. popUpCal.clearText = '<?php echo CALENDAR_CLEAR; ?>';
  177. popUpCal.closeText = '<?php echo CALENDAR_CLOSE; ?>';
  178. popUpCal.prevText = '<?php echo CALENDAR_PREVIOUS; ?>';
  179. popUpCal.nextText = '<?php echo CALENDAR_NEXT; ?>';
  180. popUpCal.currentText = '<?php echo CALENDAR_CURRENT; ?>';
  181. popUpCal.buttonImageOnly = true;
  182. 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; ?>');
  183. 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; ?>');
  184. popUpCal.dateFormat = 'YMD-';
  185. $('.inputMtime').calendar({autoPopUp:'both', buttonImage:'theme/<?php echo CONFIG_THEME_NAME; ?>/images/date_picker.png'});
  186. initAfterListingLoaded();
  187. //addMoreFile();
  188. } );
  189. </script>
  190. <?php
  191. if(file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'jscripts' . DIRECTORY_SEPARATOR . 'for_' . CONFIG_EDITOR_NAME . ".js") {
  192. ?>
  193. <script type="text/javascript" src="jscripts/<?php echo 'for_' . CONFIG_EDITOR_NAME . '.js'; ?>"></script>
  194. <?php
  195. }
  196. ?>
  197. <link rel="stylesheet" type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/<?php echo CONFIG_EDITOR_NAME; ?>.css" />
  198. <link rel="stylesheet" type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/jquery-calendar.css" />
  199. <link rel="stylesheet" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/thickbox.css" type="text/css" media="screen" />
  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. ?>
  218. </div>
  219. <ul id="actionHeader">
  220. <li><a href="#" id="actionRefresh" onclick="return windowRefresh();"><span><?php echo LBL_ACTION_REFRESH; ?></span></a></li>
  221. <li><a href="#" id="actionSelectAll" class="check_all" onclick="return checkAll(this);"><span><?php echo LBL_ACTION_SELECT_ALL; ?></span></a></li>
  222. <?php
  223. if (CONFIG_OPTIONS_DELETE) {
  224. ?>
  225. <li><a href="#" id="actionDelete" onclick="return deleteDocuments();"><span><?php echo LBL_ACTION_DELETE; ?></span></a></li>
  226. <?php
  227. }
  228. ?>
  229. <?php
  230. if(CONFIG_OPTIONS_CUT) {
  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. <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>
  240. <?php
  241. }
  242. ?>
  243. <?php
  244. if(CONFIG_OPTIONS_CUT || CONFIG_OPTIONS_COPY) {
  245. ?>
  246. <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>
  247. <?php
  248. }
  249. ?>
  250. <?php
  251. if(CONFIG_OPTIONS_NEWFOLDER) {
  252. ?>
  253. <li><a id="actionNewFolder" href="#" onclick="return newFolderWin(this);"><span><?php echo LBL_BTN_NEW_FOLDER; ?></span></a></li>
  254. <?php
  255. }
  256. ?>
  257. <?php
  258. if (CONFIG_OPTIONS_UPLOAD) {
  259. ?>
  260. <li><a id="actionUpload" href="#" onclick="return uploadFileWin(this);"><span><?php echo LBL_BTN_UPLOAD; ?></span></a></li>
  261. <?php
  262. }
  263. ?>
  264. </ul>
  265. <form action="" method="post" name="formAction" id="formAction">
  266. <input type="hidden" name="currentFolderPath" id="currentFolderPathVal" value="" />
  267. <select name="selectedDoc[]" id="selectedDoc" style="display:none;" multiple="multiple"></select>
  268. <input type="hidden" name="action_value" value="" id="action_value" />
  269. </form>
  270. </div>
  271. <div id="body">
  272. <div id="rightCol">
  273. <?php
  274. if (CONFIG_LOAD_DOC_LATTER) {
  275. $currentPath = getCurrentFolderPath();
  276. ?>
  277. <script>
  278. parentFolder = {'path_base64':'<?php echo base64_encode(getParentFolderPath($currentPath)); ?>', 'path':'<?php echo getParentFolderPath($currentPath); ?>'};
  279. currentFolder = {'friendly_path':'<?php echo transformFilePath($currentPath); ?>'};
  280. $(document).ready(function(){
  281. var url = getUrl('view', false, false, false);
  282. $('#rightCol').empty();
  283. ajaxStart('#rightCol');
  284. $('#rightCol').load(url,{},function(){
  285. ajaxStop('#rightCol img.ajaxLoadingImg');
  286. urls.present = getUrl('home', true, true);
  287. initAfterListingLoaded();
  288. });
  289. });
  290. </script>
  291. <?php
  292. } else {
  293. include_once CONFIG_URL_LIST_LISTING;
  294. }
  295. ?>
  296. </div>
  297. <div id="leftCol">
  298. <fieldset id="folderFieldSet">
  299. <legend><?php echo LBL_FOLDER_INFO; ?></legend>
  300. <table cellpadding="0" cellspacing="0" class="tableSummary" id="folderInfo">
  301. <tbody>
  302. <tr>
  303. <th><?php echo LBL_FOLDER_PATH; ?></th>
  304. <td colspan="3" id="folderPath"><?php echo transformFilePath($folderInfo['path']); ?></td>
  305. </tr>
  306. <tr>
  307. <th><?php echo LBL_FOLDER_CREATED; ?></th>
  308. <td colspan="3" id="folderCtime"><?php echo (!empty($folderInfo['ctime'])?date(DATE_TIME_FORMAT,$folderInfo['ctime']):'&nbsp;') ; ?></td>
  309. </tr>
  310. <tr>
  311. <th><?php echo LBL_FOLDER_MODIFIED; ?></th>
  312. <!-- comment these lines while integrating into Chamilo -->
  313. <th><?php //echo LBL_FOLDER_MODIFIED; ?></th>
  314. <!-- <td colspan="3" id="folderMtime"><?php //echo (!empty($folderInfo['mtime'])?date(DATE_TIME_FORMAT,$folderInfo['mtime']):'&nbsp;'); ?></td> -->
  315. </tr>
  316. <tr>
  317. <th><?php echo LBL_FOLDER_SUDDIR; ?></th>
  318. <td colspan="3" id="folderSubdir"><?php echo (isset($folderInfo['subdir'])?$folderInfo['subdir']:"&nbsp;"); ?></td>
  319. </tr>
  320. <tr>
  321. <th><?php echo LBL_FOLDER_FIELS; ?></th>
  322. <td colspan="3" id="folderFile"><?php echo (isset($folderInfo['file'])?$folderInfo['file']:'&nbsp;'); ?></td>
  323. </tr>
  324. <tr>
  325. <!-- comment these lines while integrating into Chamilo -->
  326. <th><?php // echo LBL_FOLDER_WRITABLE; ?></th>
  327. <!-- <td id="folderWritable"><span class="<?php //echo (isset($folderInfo['is_readable'])?($folderInfo['is_readable']?'flagYes':'flagNo'):'&nbsp;'); ?>">&nbsp;</span></td> -->
  328. <th><?php // echo LBL_FOLDER_READABLE; ?></th>
  329. <!--<td id="folderReadable"><span class="<?php //echo (isset($folderInfo['is_writable'])?($folderInfo['is_writable']?'flagYes':'flagNo'):'&nbsp;'); ?>">&nbsp;</span></td> -->
  330. </tr>
  331. </tbody>
  332. </table>
  333. </fieldset>
  334. <fieldset id="fileFieldSet" style="display:none" >
  335. <legend><?php echo LBL_FILE_INFO; ?></legend>
  336. <table cellpadding="0" cellspacing="0" class="tableSummary" id="fileInfo">
  337. <tbody>
  338. <tr>
  339. <th><?php echo LBL_FILE_NAME; ?></th>
  340. <td colspan="3" id="fileName"></td>
  341. </tr>
  342. <tr>
  343. <th><?php echo LBL_FILE_CREATED; ?></th>
  344. <td colspan="3" id="fileCtime"></td>
  345. </tr>
  346. <tr>
  347. <!-- comment these lines while integrating into Chamilo -->
  348. <th><?php //echo LBL_FILE_MODIFIED; ?></th>
  349. <!--<td colspan="3" id="fileMtime"></td> -->
  350. </tr>
  351. <tr>
  352. <th><?php echo LBL_FILE_SIZE; ?></th>
  353. <td colspan="3" id="fileSize"></td>
  354. </tr>
  355. <tr>
  356. <th><?php echo LBL_FILE_TYPE; ?></th>
  357. <td colspan="3" id="fileType"></td>
  358. </tr>
  359. <tr>
  360. <!-- comment these lines while integrating into Chamilo -->
  361. <th><?php //echo LBL_FILE_WRITABLE; ?></th>
  362. <!--<td id="fileWritable"><span class="flagYes">&nbsp;</span></td> -->
  363. <th><?php //echo LBL_FILE_READABLE; ?></th>
  364. <!--<td id="fileReadable"><span class="flagNo">&nbsp;</span></td> -->
  365. </tr>
  366. </tbody>
  367. </table>
  368. <p class="searchButtons" id="returnCurrentUrl">
  369. <span class="right" id="linkSelect">
  370. <input type="button" value="<?php echo MENU_SELECT; ?>" id="selectCurrentUrl" class="select_button">
  371. <!-- Change button class by Chamilo select_button class -->
  372. </span>
  373. </p>
  374. </fieldset>
  375. <fieldset class="boxSearch">
  376. <legend><?php echo LBL_SEARCH; ?></legend>
  377. <table cellpadding="0" cellspacing="0" class="tableSearch">
  378. <tbody>
  379. <tr>
  380. <td>
  381. <!-- comment these lines while integrating into Chamilo -->
  382. <b><?php //echo LBL_SEARCH_NAME; ?></b> <br />
  383. <input type="text" class="input inputSearch" name="search_name" id="search_name" size="18"/>
  384. </td>
  385. </tr>
  386. <tr>
  387. <td >
  388. <!-- comment these lines while integrating into Chamilo -->
  389. <b><?php // echo LBL_SEARCH_FOLDER; ?></b><br />
  390. <span id="searchFolderContainer">
  391. <?php
  392. if(CONFIG_LOAD_DOC_LATTER)
  393. {
  394. ?>
  395. <script type="text/javascript">
  396. $(document).ready(
  397. function()
  398. {
  399. ajaxStart('#searchFolderContainer');
  400. $('#searchFolderContainer').load('<?php echo CONFIG_URL_LOAD_FOLDERS; ?>');
  401. }
  402. );
  403. </script>
  404. <?php
  405. }else
  406. {
  407. ?>
  408. <select class="input inputSearchSelect" name="search_folder" id="search_folder"><!-- Chamilo integrating, modify name class for disable by css -->
  409. <?php
  410. foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
  411. {
  412. if(hideFolderName($k))
  413. {
  414. //show only those permitted by Chamilo
  415. ?>
  416. <option value="<?php echo $v; ?>" <?php echo (removeTrailingSlash(backslashToSlash(($folderInfo['path']))) == removeTrailingSlash(backslashToSlash(($v)))?' selected="selected"':''); ?>><?php echo hideFolderName(shortenFileName($k, 30));
  417. ?></option>
  418. <?php
  419. }
  420. }
  421. ?>
  422. </select>
  423. <?php
  424. }
  425. ?></span>
  426. <!-- </td>
  427. </tr>
  428. <tr>
  429. <td> -->
  430. <b><?php //echo LBL_SEARCH_MTIME; ?></b><br />
  431. <!--<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']:''); ?>" /> -->
  432. <!--<span class="leftToRightArrow">&nbsp;</span> -->
  433. <!--<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']:''); ?>" /> -->
  434. <!--This lines replace above lines while integrating into Chamilo -->
  435. <input type="hidden" name="search_mtime_from" id="search_mtime_from" value="<?php //echo (!empty($_GET['search_mtime_from'])?$_GET['search_mtime_from']:''); ?>" />
  436. <input type="hidden" name="search_mtime_to" id="search_mtime_to" value="<?php //echo (!empty($_GET['search_mtime_to'])?$_GET['search_mtime_to']:''); ?>" />
  437. <!--</td></tr>
  438. <tr>
  439. <td> --><!-- comment these lines while integrating into Chamilo -->
  440. </td><td><!--add a col while integrating -->
  441. <b><?php // echo LBL_SEARCH_RECURSIVELY; ?></b>&nbsp;&nbsp;
  442. <!--change for Chamilo recursively by default -->
  443. <!-- <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; ?> -->
  444. <!-- <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; ?> -->
  445. </td>
  446. </tr>
  447. </tbody>
  448. </table>
  449. <p class="searchButtons">
  450. <span class="left" id="linkClose" style="display:none">
  451. <!-- comment these lines while integrating into Chamilo -->
  452. <!--<input type="button" value="<?php // echo LBL_ACTION_CLOSE; ?>" onclick="return cancelSelectFile();" class="button"> -->
  453. </span>
  454. <span class="right" id="linkSearch">
  455. <input type="button" value="<?php echo BTN_SEARCH; ?>" onclick="return search();" class="search_button">
  456. </span>
  457. </p>
  458. </fieldset>
  459. </div>
  460. <div class="clear"></div>
  461. </div>
  462. </div>
  463. <div class="clear"></div>
  464. <div id="ajaxLoading" style="display:none">
  465. <img class="ajaxLoadingImg" src="theme/<?php echo CONFIG_THEME_NAME; ?>/images/ajaxLoading.gif" /></div>
  466. <div id="winUpload" style="display:none">
  467. <div class="jqmContainer">
  468. <div class="jqmHeader">
  469. <!-- Adding return windowRefresch() for Chamilo -->
  470. <a href="#" onclick="tb_remove();return windowRefresh();">
  471. <img src="theme/default/images/flagno.png"title="<?php echo LBL_ACTION_CLOSE; ?>">
  472. <?php echo LBL_ACTION_CLOSE; ?>
  473. </a>
  474. <!-- Add close image for Chamilo -->
  475. </div>
  476. <div class="jqmBody">
  477. <form id="formUpload" name="formUpload" method="post" enctype="multipart/form-data" action="">
  478. <table class="tableForm" cellpadding="0" cellspacing="0">
  479. <thead>
  480. <tr>
  481. <th colspan="2">
  482. <?php echo FILE_FORM_TITLE; ?>
  483. </th>
  484. </tr>
  485. <tr>
  486. <th colspan="2" align="left">
  487. <label>
  488. <a class="action" href="#" title="<?php echo FILE_LBL_MORE; ?>" onclick="return addMoreFile();">
  489. <label><?php echo FILE_LBL_MORE; ?></label><span class="addMore">&nbsp;</span></a>
  490. </label>
  491. </th>
  492. </tr>
  493. </thead>
  494. <tbody id="fileUploadBody">
  495. <tr style="display:none">
  496. <th><label><?php echo FILE_LABEL_SELECT; ?></label></th>
  497. <td>
  498. <input type="file" class="input" name="file" />
  499. <input type="button" class="upload_button" value="<?php echo FILE_LBL_UPLOAD; ?>" /><!-- change style of upload button by Chamilo -->
  500. <a href="#" class="action" title="<?php echo get_lang('Cancel')?>" style="display:none" ><!-- Chamilo lang var added -->
  501. <span class="cancel">&nbsp;</span><span class="uploadProcessing" style="display:none">&nbsp;</span>
  502. </a>
  503. </td>
  504. </tr>
  505. </tbody>
  506. </table>
  507. </form>
  508. </div>
  509. </div>
  510. </div>
  511. <div id="winNewFolder" style="display:none">
  512. <div class="jqmContainer">
  513. <div class="jqmHeader">
  514. <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 -->
  515. </div>
  516. <div class="jqmBody">
  517. <form id="formNewFolder" name="formNewFolder" method="post" action="">
  518. <input type="hidden" name="currentFolderPath" value="" id="currentNewfolderPath" />
  519. <table class="tableForm" cellpadding="0" cellspacing="0">
  520. <thead>
  521. <tr>
  522. <th colspan="2"><?php echo FOLDER_FORM_TITLE; ?></th>
  523. </tr>
  524. </thead>
  525. <tbody>
  526. <tr>
  527. <th><label><?php echo FOLDER_LBL_TITLE; ?></label></th>
  528. <td><input type="text" name="new_folder" id="new_folder" value="" class="input"></td>
  529. </tr>
  530. </tbody>
  531. <tfoot>
  532. <tr>
  533. <th>&nbsp;</th>
  534. <td><input type="button" value="<?php echo FOLDER_LBL_CREATE; ?>" class="create_button" onclick="return doCreateFolder();" /></td>
  535. </tr>
  536. </tfoot>
  537. </table>
  538. </form>
  539. </div>
  540. </div>
  541. </div>
  542. <div id="winPlay" style="display:none">
  543. <div class="jqmContainer">
  544. <div class="jqmHeader">
  545. <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 -->
  546. </div>
  547. <div class="jqmBody">
  548. <div id="playGround"></div>
  549. </div>
  550. </div>
  551. </div>
  552. <div id="winRename" style="display:none">
  553. <div class="jqmContainer">
  554. <div class="jqmHeader">
  555. <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 -->
  556. </div>
  557. <div class="jqmBody">
  558. <form id="formRename" name="formRename" method="post" action="">
  559. <input type="hidden" name="original_path" id="original_path" />
  560. <input type="hidden" name="num" id="renameNum" value="" />
  561. <table class="tableForm" cellpadding="0" cellspacing="0">
  562. <thead>
  563. <tr>
  564. <th colspan="2"><?php echo RENAME_FORM_TITLE; ?></th>
  565. </tr>
  566. </thead>
  567. <tbody>
  568. <tr>
  569. <th><label><?php echo RENAME_NEW_NAME; ?></label></th>
  570. <td><input type="name" id="renameName" class="input" name="name" /> <!-- Chamilo delete style="width:250px"-->
  571. </td>
  572. </tr>
  573. </tbody>
  574. <tfoot>
  575. <tr>
  576. <th>&nbsp;</th>
  577. <td><input type="button" value="<?php echo RENAME_LBL_RENAME; ?>" class="create_button" onclick="return doRename();" /></td>
  578. </tr>
  579. </tfoot>
  580. </table>
  581. </form>
  582. </div>
  583. </div>
  584. </div>
  585. <div id="winInfo" style="display:none">
  586. <div class="jqmContainer">
  587. <div class="jqmHeader">
  588. <a href="#" onclick="tb_remove();"><?php echo LBL_ACTION_CLOSE; ?></a>
  589. </div>
  590. <div class="jqmBody">
  591. <table class="tableInfo" cellpadding="0" cellspacing="0">
  592. <tbody>
  593. <tr>
  594. <th nowrap>
  595. <label>Author:</label>
  596. </th>
  597. <td>
  598. <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>
  599. </td>
  600. </tr>
  601. <tr>
  602. <th nowrap>
  603. <label>Template Designer:</label>
  604. </th>
  605. <td>
  606. <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>
  607. </td>
  608. </tr>
  609. <tr>
  610. <th nowrap>
  611. <label>Official Website:</label>
  612. </th>
  613. <td>
  614. <a href="http://www.phpletter.com">http://www.phpletter.com</a>
  615. </td>
  616. </tr>
  617. <tr>
  618. <th nowrap>
  619. <label>Support Forum:</label>
  620. </th>
  621. <td>
  622. <a href="http://www.phpletter.com/forum/">http://www.phpletter.com/forum/</a>
  623. </td>
  624. </tr>
  625. <tr>
  626. <th nowrap>
  627. <label>&copy;Copyright:</label>
  628. </th>
  629. <td>
  630. 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.
  631. </td>
  632. </tr>
  633. </tbody>
  634. </table>
  635. </div>
  636. </div>
  637. </div>
  638. <div id="contextMenu" style="display:none">
  639. <ul>
  640. <li><a href="#" class="contentMenuItem" id="menuSelect"><?php echo MENU_SELECT; ?></a></li>
  641. <li><a href="#" class="contentMenuItem" id="menuPreview"><?php echo MENU_PREVIEW; ?></a></li>
  642. <li><a href="#" class="contentMenuItem" id="menuDownload"><?php echo MENU_DOWNLOAD; ?></a></li>
  643. <li><a href="#" class="contentMenuItem" id="menuRename"><?php echo MENU_RENAME; ?></a></li>
  644. <li><a href="#" class="contentMenuItem" id="menuEdit"><?php echo MENU_EDIT; ?></a></li>
  645. <li><a href="#" class="contentMenuItem" id="menuCut"><?php echo MENU_CUT; ?></a></li>
  646. <li><a href="#" class="contentMenuItem" id="menuCopy"><?php echo MENU_COPY; ?></a></li>
  647. <li><a href="#" class="contentMenuItem" id="menuPaste"><?php echo MENU_PASTE; ?></a></li>
  648. <li><a href="#" class="contentMenuItem" id="menuDelete"><?php echo MENU_DELETE; ?></a></li>
  649. <li><a href="#" class="contentMenuItem" id="menuPlay"><?php echo MENU_PLAY; ?></a></li>
  650. </ul>
  651. </div>
  652. </body>
  653. </html>