edit_document.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This file allows editing documents.
  5. *
  6. * Based on create_document, this file allows
  7. * - edit name
  8. * - edit comments
  9. * - edit metadata (requires a document table entry)
  10. * - edit html content (only for htm/html files)
  11. *
  12. * For all files
  13. * - show editable name field
  14. * - show editable comments field
  15. * Additionally, for html and text files
  16. * - show RTE
  17. *
  18. * Remember, all files and folders must always have an entry in the
  19. * database, regardless of wether they are visible/invisible, have
  20. * comments or not.
  21. *
  22. * @package chamilo.document
  23. * @todo improve script structure (FormValidator is used to display form, but
  24. * not for validation at the moment)
  25. */
  26. /* Included libraries */
  27. require_once '../inc/global.inc.php';
  28. // Template's javascript
  29. $htmlHeadXtra[] = '
  30. <script>
  31. var hide_bar = function() {
  32. $("#template_col").hide();
  33. $("#doc_form").removeClass("span9");
  34. $("#doc_form").addClass("span11");
  35. $("#hide_bar_template").css({"background-image" : \'url("../img/hide2.png")\'})
  36. }
  37. $(document).ready(function() {
  38. if ($(window).width() <= 785 ) {
  39. hide_bar();
  40. }
  41. $("#hide_bar_template").toggle(
  42. function() {
  43. hide_bar();
  44. },
  45. function() {
  46. $("#template_col").show();
  47. $("#doc_form").removeClass("span11");
  48. $("#doc_form").addClass("span9");
  49. $(this).css("background-image", \'url("../img/hide0.png")\');
  50. }
  51. );
  52. CKEDITOR.on("instanceReady", function (e) {
  53. showTemplates();
  54. });
  55. });
  56. </script>';
  57. $_SESSION['whereami'] = 'document/create';
  58. $this_section = SECTION_COURSES;
  59. $lib_path = api_get_path(LIBRARY_PATH);
  60. $course_info = api_get_course_info();
  61. $group_id = api_get_group_id();
  62. if (api_is_in_group()) {
  63. $group_properties = GroupManager::get_group_properties($group_id);
  64. }
  65. $dir = '/';
  66. $currentDirPath = isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : null;
  67. $readonly = false;
  68. if (isset($_GET['id'])) {
  69. $document_data = DocumentManager::get_document_data_by_id(
  70. $_GET['id'],
  71. api_get_course_id(),
  72. true
  73. );
  74. $document_id = $document_data['id'];
  75. $file = $document_data['path'];
  76. $parent_id = DocumentManager::get_document_id($course_info, dirname($file));
  77. $dir = dirname($document_data['path']);
  78. $dir_original = $dir;
  79. $doc = basename($file);
  80. $readonly = $document_data['readonly'];
  81. }
  82. if (empty($document_data)) {
  83. api_not_allowed();
  84. }
  85. $is_certificate_mode = DocumentManager::is_certificate_mode($dir);
  86. //Call from
  87. $call_from_tool = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : null;
  88. $slide_id = isset($_GET['origin_opt']) ? Security::remove_XSS($_GET['origin_opt']) : null;
  89. $file_name = $doc;
  90. $group_document = false;
  91. $sessionId = api_get_session_id();
  92. $user_id = api_get_user_id();
  93. $doc_tree = explode('/', $file);
  94. $count_dir = count($doc_tree) - 2; // "2" because at the begin and end there are 2 "/"
  95. // Level correction for group documents.
  96. if (!empty($group_properties['directory'])) {
  97. $count_dir = $count_dir > 0 ? $count_dir - 1 : 0;
  98. }
  99. $relative_url = '';
  100. for ($i = 0; $i < ($count_dir); $i++) {
  101. $relative_url .= '../';
  102. }
  103. $html_editor_config = array(
  104. 'ToolbarSet' => (api_is_allowed_to_edit(null, true) ? 'Documents' :'DocumentsStudent'),
  105. 'Width' => '100%',
  106. 'Height' => '600',
  107. 'FullPage' => true,
  108. 'InDocument' => true,
  109. 'CreateDocumentDir' => $relative_url,
  110. 'CreateDocumentWebDir' => (empty($group_properties['directory']))
  111. ? api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/'
  112. : api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document'.$group_properties['directory'].'/',
  113. 'BaseHref' => api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$dir
  114. );
  115. if ($is_certificate_mode) {
  116. $html_editor_config['CreateDocumentDir'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/';
  117. $html_editor_config['CreateDocumentWebDir'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/';
  118. $html_editor_config['BaseHref'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$dir;
  119. }
  120. $is_allowed_to_edit = api_is_allowed_to_edit(null, true) || $_SESSION['group_member_with_upload_rights']||
  121. DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $sessionId);
  122. $noPHP_SELF = true;
  123. /* Other initialization code */
  124. $dbTable = Database::get_course_table(TABLE_DOCUMENT);
  125. $course_id = api_get_course_int_id();
  126. if (!empty($group_id)) {
  127. $interbreadcrumb[] = array ('url' => '../group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace'));
  128. $group_document = true;
  129. $noPHP_SELF = true;
  130. }
  131. if (!$is_certificate_mode) {
  132. $interbreadcrumb[]=array("url"=>"./document.php?curdirpath=".urlencode($currentDirPath).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
  133. } else {
  134. $interbreadcrumb[]= array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
  135. }
  136. // Interbreadcrumb for the current directory root path
  137. if (empty($document_data['parents'])) {
  138. $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
  139. } else {
  140. foreach($document_data['parents'] as $document_sub_data) {
  141. if ($document_data['title'] == $document_sub_data['title']) {
  142. continue;
  143. }
  144. $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
  145. }
  146. }
  147. if (!api_is_allowed_to_edit()) {
  148. api_not_allowed(true);
  149. }
  150. Event::event_access_tool(TOOL_DOCUMENT);
  151. //TODO:check the below code and his funcionality
  152. if (!is_allowed_to_edit()) {
  153. if (DocumentManager::check_readonly($course_info, $user_id, $file)) {
  154. api_not_allowed();
  155. }
  156. }
  157. /* MAIN TOOL CODE */
  158. /* Code to change the comment */
  159. if (isset($_POST['comment'])) {
  160. // Fixing the path if it is wrong
  161. $comment = Database::escape_string(trim($_POST['comment']));
  162. $title = Database::escape_string(trim($_POST['title']));
  163. //Just in case see BT#3525
  164. if (empty($title)) {
  165. $title = $documen_data['title'];
  166. }
  167. if (empty($title)) {
  168. $title = get_document_title($_POST['filename']);
  169. }
  170. if (!empty($document_id)) {
  171. $query = "UPDATE $dbTable SET comment='".$comment."', title='".$title."' WHERE c_id = $course_id AND id = ".$document_id;
  172. Database::query($query);
  173. $info_message = get_lang('fileModified');
  174. }
  175. }
  176. /* WYSIWYG HTML EDITOR - Program Logic */
  177. if ($is_allowed_to_edit) {
  178. if (isset($_POST['formSent']) && $_POST['formSent'] == 1) {
  179. $filename = stripslashes($_POST['filename']);
  180. $extension = $_POST['extension'];
  181. $content = isset($_POST['content']) ? trim(str_replace(array("\r", "\n"), '', stripslashes($_POST['content']))) : null;
  182. $content = Security::remove_XSS($content, COURSEMANAGERLOWSECURITY);
  183. if (!strstr($content, '/css/frames.css')) {
  184. $content = str_replace('</title></head>', '</title><link rel="stylesheet" href="../css/frames.css" type="text/css" /></head>', $content);
  185. }
  186. if ($dir == '/') {
  187. $dir = '';
  188. }
  189. $file = $dir.'/'.$filename.'.'.$extension;
  190. $read_only_flag = isset($_POST['readonly']) ? $_POST['readonly'] : null;
  191. $read_only_flag = empty($read_only_flag) ? 0 : 1;
  192. if (empty($filename)) {
  193. $msgError = get_lang('NoFileName');
  194. } else {
  195. $file_size = filesize($document_data['absolute_path']);
  196. if ($read_only_flag == 0) {
  197. if (!empty($content)) {
  198. if ($fp = @fopen($document_data['absolute_path'], 'w')) {
  199. // For flv player, change absolute path temporarily to prevent from erasing it in the following lines
  200. $content = str_replace(array('flv=h', 'flv=/'), array('flv=h|', 'flv=/|'), $content);
  201. fputs($fp, $content);
  202. fclose($fp);
  203. $filepath = $document_data['absolute_parent_path'];
  204. if (!is_dir($filepath.'css')) {
  205. mkdir($filepath.'css', api_get_permissions_for_new_directories());
  206. $doc_id = add_document($_course, $dir.'css', 'folder', 0, 'css');
  207. api_item_property_update(
  208. $_course,
  209. TOOL_DOCUMENT,
  210. $doc_id,
  211. 'FolderCreated',
  212. api_get_user_id(),
  213. null,
  214. null,
  215. null,
  216. null,
  217. $sessionId
  218. );
  219. api_item_property_update(
  220. $_course,
  221. TOOL_DOCUMENT,
  222. $doc_id,
  223. 'invisible',
  224. api_get_user_id(),
  225. null,
  226. null,
  227. null,
  228. null,
  229. $sessionId
  230. );
  231. }
  232. if (!is_file($filepath.'css/frames.css')) {
  233. $platform_theme = api_get_setting('stylesheets');
  234. if (file_exists(api_get_path(SYS_CODE_PATH).'css/'.$platform_theme.'/frames.css')) {
  235. copy(api_get_path(SYS_CODE_PATH).'css/'.$platform_theme.'/frames.css', $filepath.'css/frames.css');
  236. $doc_id = add_document(
  237. $_course,
  238. $dir . 'css/frames.css',
  239. 'file',
  240. filesize($filepath . 'css/frames.css'),
  241. 'frames.css'
  242. );
  243. api_item_property_update(
  244. $_course,
  245. TOOL_DOCUMENT,
  246. $doc_id,
  247. 'DocumentAdded',
  248. api_get_user_id(),
  249. null,
  250. null,
  251. null,
  252. null,
  253. $sessionId
  254. );
  255. api_item_property_update(
  256. $_course,
  257. TOOL_DOCUMENT,
  258. $doc_id,
  259. 'invisible',
  260. api_get_user_id(),
  261. null,
  262. null,
  263. null,
  264. null,
  265. $sessionId
  266. );
  267. }
  268. }
  269. // "WHAT'S NEW" notification: update table item_property
  270. $document_id = DocumentManager::get_document_id($_course, $file);
  271. if ($document_id) {
  272. update_existing_document(
  273. $_course,
  274. $document_id,
  275. $file_size,
  276. $read_only_flag
  277. );
  278. api_item_property_update(
  279. $_course,
  280. TOOL_DOCUMENT,
  281. $document_id,
  282. 'DocumentUpdated',
  283. api_get_user_id(),
  284. null,
  285. null,
  286. null,
  287. null,
  288. $sessionId
  289. );
  290. // Update parent folders
  291. item_property_update_on_folder(
  292. $_course,
  293. $dir,
  294. api_get_user_id()
  295. );
  296. header('Location: document.php?id=' . $document_data['parent_id'] . '&' . api_get_cidreq());
  297. exit;
  298. } else {
  299. $msgError = get_lang('Impossible');
  300. }
  301. } else {
  302. $msgError = get_lang('Impossible');
  303. }
  304. } else {
  305. if ($document_id) {
  306. update_existing_document($_course, $document_id, $file_size, $read_only_flag);
  307. }
  308. }
  309. } else {
  310. if ($document_id) {
  311. update_existing_document($_course, $document_id, $file_size, $read_only_flag);
  312. }
  313. }
  314. }
  315. }
  316. }
  317. // Replace relative paths by absolute web paths (e.g. './' => 'http://www.chamilo.org/courses/ABC/document/')
  318. $content = null;
  319. $extension = null;
  320. $filename = null;
  321. if (file_exists($document_data['absolute_path'])) {
  322. $path_info = pathinfo($document_data['absolute_path']);
  323. $filename = $path_info['filename'];
  324. if (is_file($document_data['absolute_path'])) {
  325. $extension = $path_info['extension'];
  326. if (in_array($extension, array('html', 'htm'))) {
  327. $content = file($document_data['absolute_path']);
  328. $content = implode('', $content);
  329. }
  330. }
  331. }
  332. /* Display user interface */
  333. // Display the header
  334. $nameTools = get_lang('EditDocument') . ': '.Security::remove_XSS($document_data['title']);
  335. Display::display_header($nameTools, 'Doc');
  336. if (isset($msgError)) {
  337. Display::display_error_message($msgError);
  338. }
  339. if (isset($info_message)) {
  340. Display::display_confirmation_message($info_message);
  341. if (isset($_POST['origin'])) {
  342. $slide_id = $_POST['origin_opt'];
  343. $call_from_tool = $_POST['origin'];
  344. }
  345. }
  346. // Owner
  347. $document_info = api_get_item_property_info(
  348. api_get_course_int_id(),
  349. 'document',
  350. $document_id,
  351. 0
  352. );
  353. // Try to find this document in the session
  354. if (!empty($sessionId)) {
  355. $document_info = api_get_item_property_info(
  356. api_get_course_int_id(),
  357. 'document',
  358. $document_id,
  359. $sessionId
  360. );
  361. }
  362. $owner_id = $document_info['insert_user_id'];
  363. $last_edit_date = $document_info['lastedit_date'];
  364. if ($owner_id == api_get_user_id() ||
  365. api_is_platform_admin() ||
  366. $is_allowed_to_edit || GroupManager:: is_user_in_group(
  367. api_get_user_id(),
  368. api_get_group_id()
  369. )
  370. ) {
  371. $action = api_get_self().'?id='.$document_data['id'].'&'.api_get_cidreq();
  372. $form = new FormValidator('formEdit', 'post', $action, null, array('class' => 'form-vertical'));
  373. // Form title
  374. $form->addElement('header', $nameTools);
  375. $form->addElement('hidden', 'filename');
  376. $form->addElement('hidden', 'extension');
  377. $form->addElement('hidden', 'file_path');
  378. $form->addElement('hidden', 'commentPath');
  379. $form->addElement('hidden', 'showedit');
  380. $form->addElement('hidden', 'origin');
  381. $form->addElement('hidden', 'origin_opt');
  382. $form->addText('title', get_lang('Title'));
  383. $defaults['title'] = $document_data['title'];
  384. $form->addElement('hidden', 'formSent');
  385. $defaults['formSent'] = 1;
  386. $read_only_flag = isset($_POST['readonly']) ? $_POST['readonly'] : null;
  387. // Desactivation of IE proprietary commenting tags inside the text before loading it on the online editor.
  388. // This fix has been proposed by Hubert Borderiou, see Bug #573, http://support.chamilo.org/issues/573
  389. $defaults['content'] = str_replace('<!--[', '<!-- [', $content);
  390. //if ($extension == 'htm' || $extension == 'html')
  391. // HotPotatoes tests are html files, but they should not be edited in order their functionality to be preserved.
  392. $showSystemFolders = api_get_course_setting('show_system_folders');
  393. $condition = stripos($dir, '/HotPotatoes_files') === false;
  394. if ($showSystemFolders == 1) {
  395. $condition = true;
  396. }
  397. if (($extension == 'htm' || $extension == 'html') && $condition) {
  398. if (empty($readonly) && $readonly == 0) {
  399. $form->addHtmlEditor('content', '', false, false, $html_editor_config);
  400. }
  401. }
  402. if (!$group_document && !DocumentManager::is_my_shared_folder(api_get_user_id(), $currentDirPath, $sessionId)) {
  403. $metadata_link = '<a href="../metadata/index.php?eid='.urlencode('Document.'.$document_data['id']).'">'.get_lang('AddMetadata').'</a>';
  404. //Updated on field
  405. $last_edit_date = api_get_local_time($last_edit_date);
  406. $display_date = date_to_str_ago($last_edit_date).' <span class="dropbox_date">'.api_format_date($last_edit_date).'</span>';
  407. $form->addElement('static', null, get_lang('Metadata'), $metadata_link);
  408. $form->addElement('static', null, get_lang('UpdatedOn'), $display_date);
  409. }
  410. $form->addElement('textarea', 'comment', get_lang('Comment'));
  411. if ($owner_id == api_get_user_id() || api_is_platform_admin()) {
  412. $checked =& $form->addElement('checkbox', 'readonly', null, get_lang('ReadOnly'));
  413. if ($readonly == 1) {
  414. $checked->setChecked(true);
  415. }
  416. }
  417. if ($is_certificate_mode) {
  418. $form->addButtonUpdate(get_lang('SaveCertificate'));
  419. } else {
  420. $form->addButtonUpdate(get_lang('SaveDocument'));
  421. }
  422. $defaults['filename'] = $filename;
  423. $defaults['extension'] = $extension;
  424. $defaults['file_path'] = isset($_GET['file']) ? Security::remove_XSS($_GET['file']) : null;
  425. $defaults['commentPath'] = $file;
  426. $defaults['renameTo'] = $file_name;
  427. $defaults['comment'] = $document_data['comment'];
  428. $defaults['origin'] = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : null;
  429. $defaults['origin_opt'] = isset($_GET['origin_opt']) ? Security::remove_XSS($_GET['origin_opt']) : null;
  430. $form->setDefaults($defaults);
  431. show_return($parent_id, $dir_original, $call_from_tool, $slide_id, $is_certificate_mode);
  432. if ($is_certificate_mode) {
  433. $all_information_by_create_certificate=DocumentManager::get_all_info_to_certificate(api_get_user_id(), api_get_course_id());
  434. $str_info='';
  435. foreach ($all_information_by_create_certificate[0] as $info_value) {
  436. $str_info.=$info_value.'<br/>';
  437. }
  438. $create_certificate=get_lang('CreateCertificateWithTags');
  439. Display::display_normal_message($create_certificate.': <br /><br />'.$str_info,false);
  440. }
  441. if ($extension=='svg' && !api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true'){
  442. Display::display_warning_message(get_lang('BrowserDontSupportsSVG'));
  443. }
  444. echo '<div class="row-fluid" style="overflow:hidden">
  445. <div id="template_col" class="span3" style="width:200px">
  446. <div id="frmModel"></div>
  447. </div>
  448. <div id="hide_bar_template"></div>
  449. <div id="doc_form" class="span9">
  450. '.$form->return_form().'
  451. </div>
  452. </div>';
  453. }
  454. Display::display_footer();
  455. /**
  456. This function changes the name of a certain file.
  457. It needs no global variables, it takes all info from parameters.
  458. It returns nothing.
  459. @todo check if this function is used
  460. */
  461. function change_name($base_work_dir, $source_file, $rename_to, $dir, $doc) {
  462. $file_name_for_change = $base_work_dir.$dir.$source_file;
  463. //api_display_debug_info("call my_rename: params $file_name_for_change, $rename_to");
  464. $rename_to = disable_dangerous_file($rename_to); // Avoid renaming to .htaccess file
  465. $rename_to = my_rename($file_name_for_change, stripslashes($rename_to)); // fileManage API
  466. if ($rename_to) {
  467. if (isset($dir) && $dir != '') {
  468. $source_file = $dir.$source_file;
  469. $new_full_file_name = dirname($source_file).'/'.$rename_to;
  470. } else {
  471. $source_file = '/'.$source_file;
  472. $new_full_file_name = '/'.$rename_to;
  473. }
  474. update_db_info('update', $source_file, $new_full_file_name); // fileManage API
  475. $name_changed = get_lang('ElRen');
  476. $info_message = get_lang('fileModified');
  477. $GLOBALS['file_name'] = $rename_to;
  478. $GLOBALS['doc'] = $rename_to;
  479. return $info_message;
  480. } else {
  481. $dialogBox = get_lang('FileExists'); // TODO: This variable is not used.
  482. /* Return to step 1 */
  483. $rename = $source_file;
  484. unset($source_file);
  485. }
  486. }
  487. //return button back to
  488. function show_return($document_id, $path, $call_from_tool='', $slide_id=0, $is_certificate_mode=false)
  489. {
  490. global $parent_id;
  491. echo '<div class="actions">';
  492. $url = api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq().'&id='.$parent_id;
  493. if ($is_certificate_mode) {
  494. echo '<a href="document.php?curdirpath='.Security::remove_XSS($_GET['curdirpath']).'&selectcat=' . Security::remove_XSS($_GET['selectcat']).'">'.
  495. Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>';
  496. } elseif($call_from_tool=='slideshow') {
  497. echo '<a href="'.api_get_path(WEB_PATH).'main/document/slideshow.php?slide_id='.$slide_id.'&curdirpath='.Security::remove_XSS(urlencode($_GET['curdirpath'])).'">'.
  498. Display::return_icon('slideshow.png', get_lang('BackTo').' '.get_lang('ViewSlideshow'),'',ICON_SIZE_MEDIUM).'</a>';
  499. } elseif($call_from_tool=='editdraw') {
  500. echo '<a href="'.$url.'">'.
  501. Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
  502. echo '<a href="javascript:history.back(1)">'.Display::return_icon('draw.png', get_lang('BackTo').' '.get_lang('Draw'), array(), 32).'</a>';
  503. } elseif($call_from_tool=='editodf') {
  504. echo '<a href="'.$url.'">'.
  505. Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
  506. echo '<a href="javascript:history.back(1)">'.Display::return_icon('draw.png', get_lang('BackTo').' '.get_lang('Write'), array(), 32).'</a>';
  507. } elseif($call_from_tool=='editpaint'){
  508. echo '<a href="'.$url.'">'.
  509. Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), array(), ICON_SIZE_MEDIUM).'</a>';
  510. echo '<a href="javascript:history.back(1)">'.Display::return_icon('paint.png', get_lang('BackTo').' '.get_lang('Paint'), array(), 32).'</a>';
  511. } else {
  512. echo '<a href="'.$url.'">'.
  513. Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
  514. }
  515. echo '</div>';
  516. }