ajaxfilemanager.php 33 KB

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