create_document.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This file allows creating new html documents with an online WYSIWYG html editor.
  5. *
  6. * @package chamilo.document
  7. */
  8. require_once '../inc/global.inc.php';
  9. $_SESSION['whereami'] = 'document/create';
  10. $this_section = SECTION_COURSES;
  11. $htmlHeadXtra[] = '
  12. <script>
  13. var hide_bar = function() {
  14. $("#template_col").hide();
  15. $("#doc_form").removeClass("col-md-9");
  16. $("#doc_form").addClass("col-md-11");
  17. $("#hide_bar_template").css({"background-image" : \'url("../img/hide2.png")\'})
  18. }
  19. jQuery(document).ready(function(){
  20. jQuery(".scrollbar-macosx").scrollbar();
  21. });
  22. $(document).ready(function() {
  23. if ($(window).width() <= 785 ) {
  24. hide_bar();
  25. }
  26. $("#hide_bar_template").click(function() {
  27. $("#template_col").toggleClass("hide");
  28. if ($("#doc_form").is(".col-md-8")) {
  29. $("#doc_form").removeClass("col-md-8");
  30. $("#doc_form").addClass("col-md-11");
  31. } else {
  32. $("#doc_form").removeClass("col-md-11");
  33. $("#doc_form").addClass("col-md-8");
  34. }
  35. $("#hide_bar_template").toggleClass("hide_bar_template_not_hide");
  36. });
  37. CKEDITOR.on("instanceReady", function (e) {
  38. showTemplates();
  39. });
  40. });
  41. function setFocus() {
  42. $("#document_title").focus();
  43. }
  44. $(window).load(function () {
  45. setFocus();
  46. });
  47. </script>';
  48. //I'm in the certification module?
  49. $is_certificate_mode = false;
  50. if (isset($_REQUEST['certificate']) && $_REQUEST['certificate'] == 'true') {
  51. $is_certificate_mode = true;
  52. }
  53. if ($is_certificate_mode) {
  54. $nameTools = get_lang('CreateCertificate');
  55. } else {
  56. $nameTools = get_lang('CreateDocument');
  57. }
  58. /* Constants and variables */
  59. $doc_table = Database::get_course_table(TABLE_DOCUMENT);
  60. $course_id = api_get_course_int_id();
  61. $courseCode = api_get_course_id();
  62. $sessionId = api_get_session_id();
  63. $userId = api_get_user_id();
  64. $_course = api_get_course_info();
  65. $groupId = api_get_group_id();
  66. $document_data = array();
  67. if (isset($_REQUEST['id'])) {
  68. $document_data = DocumentManager::get_document_data_by_id(
  69. $_REQUEST['id'],
  70. $courseCode,
  71. true,
  72. 0
  73. );
  74. }
  75. if (!empty($sessionId) && empty($document_data)) {
  76. $document_data = DocumentManager::get_document_data_by_id(
  77. $_REQUEST['id'],
  78. $courseCode,
  79. true,
  80. $sessionId
  81. );
  82. }
  83. if (empty($document_data)) {
  84. if (api_is_in_group()) {
  85. $group_properties = GroupManager::get_group_properties($groupId);
  86. $document_id = DocumentManager::get_document_id($_course, $group_properties['directory']);
  87. $document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
  88. $dir = $document_data['path'];
  89. $folder_id = $document_data['id'];
  90. } else {
  91. $dir = '/';
  92. $folder_id = 0;
  93. }
  94. } else {
  95. $folder_id = $document_data['id'];
  96. $dir = $document_data['path'];
  97. }
  98. /* MAIN CODE */
  99. // Please, do not modify this dirname formatting
  100. if (strstr($dir, '..')) {
  101. $dir = '/';
  102. }
  103. if ($dir[0] == '.') {
  104. $dir = substr($dir, 1);
  105. }
  106. if ($dir[0] != '/') {
  107. $dir = '/'.$dir;
  108. }
  109. if ($dir[strlen($dir) - 1] != '/') {
  110. $dir .= '/';
  111. }
  112. if ($is_certificate_mode) {
  113. $document_id = DocumentManager::get_document_id(api_get_course_info(), '/certificates');
  114. $document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id(), true);
  115. $folder_id = $document_data['id'];
  116. $dir = '/certificates/';
  117. }
  118. $doc_tree = explode('/', $dir);
  119. $count_dir = count($doc_tree) -2; // "2" because at the begin and end there are 2 "/"
  120. if (api_is_in_group()) {
  121. $group_properties = GroupManager::get_group_properties(api_get_group_id());
  122. // Level correction for group documents.
  123. if (!empty($group_properties['directory'])) {
  124. $count_dir = $count_dir > 0 ? $count_dir - 1 : 0;
  125. }
  126. }
  127. $relative_url = '';
  128. for ($i = 0; $i < ($count_dir); $i++) {
  129. $relative_url .= '../';
  130. }
  131. if ($relative_url== '') {
  132. $relative_url = '/';
  133. }
  134. $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
  135. $editorConfig = array(
  136. 'ToolbarSet' => ($is_allowed_to_edit ? 'Documents' : 'DocumentsStudent'),
  137. 'Width' => '100%',
  138. 'Height' => '400',
  139. 'cols-size' => [2, 10, 0],
  140. 'FullPage' => true,
  141. 'InDocument' => true,
  142. 'CreateDocumentDir' => $relative_url,
  143. 'CreateDocumentWebDir' => (empty($group_properties['directory']))
  144. ? api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/'
  145. : api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document'.$group_properties['directory'].'/',
  146. 'BaseHref' => api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$dir
  147. );
  148. if ($is_certificate_mode) {
  149. $editorConfig['CreateDocumentDir'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/';
  150. $editorConfig['CreateDocumentWebDir'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/';
  151. $editorConfig['BaseHref'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$dir;
  152. }
  153. $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
  154. if (!is_dir($filepath)) {
  155. $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
  156. $dir = '/';
  157. }
  158. $to_group_id = 0;
  159. if (!$is_certificate_mode) {
  160. if (api_is_in_group()) {
  161. $interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace'));
  162. $noPHP_SELF = true;
  163. $to_group_id = api_get_group_id();
  164. $path = explode('/', $dir);
  165. if ('/'.$path[1] != $group_properties['directory']) {
  166. api_not_allowed(true);
  167. }
  168. }
  169. $interbreadcrumb[] = array("url" => "./document.php?curdirpath=".urlencode($dir)."&".api_get_cidreq(), "name" => get_lang('Documents'));
  170. } else {
  171. $interbreadcrumb[]= array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
  172. }
  173. if (!$is_allowed_in_course) {
  174. api_not_allowed(true);
  175. }
  176. if (!($is_allowed_to_edit ||
  177. $_SESSION['group_member_with_upload_rights'] ||
  178. DocumentManager::is_my_shared_folder($userId, $dir, api_get_session_id()))
  179. ) {
  180. api_not_allowed(true);
  181. }
  182. /* Header */
  183. Event::event_access_tool(TOOL_DOCUMENT);
  184. $display_dir = $dir;
  185. if (isset($group_properties)) {
  186. $display_dir = explode('/', $dir);
  187. unset($display_dir[0]);
  188. unset($display_dir[1]);
  189. $display_dir = implode('/', $display_dir);
  190. }
  191. $select_cat = isset($_GET['selectcat']) ? intval($_GET['selectcat']) : null;
  192. $curDirPath = isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : null;
  193. // Create a new form
  194. $form = new FormValidator(
  195. 'create_document',
  196. 'post',
  197. api_get_self().'?'.api_get_cidreq().'&dir='.Security::remove_XSS(urlencode($dir)).'&selectcat='.$select_cat,
  198. null
  199. );
  200. // form title
  201. $form->addElement('header', $nameTools);
  202. if ($is_certificate_mode) {//added condition for certicate in gradebook
  203. $form->addElement('hidden','certificate','true',array('id'=>'certificate'));
  204. if (isset($_GET['selectcat'])) {
  205. $form->addElement('hidden','selectcat', $select_cat);
  206. }
  207. }
  208. // Hidden element with current directory
  209. $form->addElement('hidden', 'id');
  210. $defaults = array();
  211. $defaults['id'] = $folder_id;
  212. // Filename
  213. $form->addElement('hidden', 'title_edited', 'false', 'id="title_edited"');
  214. /**
  215. * Check if a document width the chosen filename already exists
  216. */
  217. function document_exists($filename)
  218. {
  219. global $dir;
  220. $cleanName = api_replace_dangerous_char($filename);
  221. // No "dangerous" files
  222. $cleanName = disable_dangerous_file($cleanName);
  223. return !DocumentManager::documentExists(
  224. $dir.$cleanName.'.html',
  225. api_get_course_info(),
  226. api_get_session_id(),
  227. api_get_group_id()
  228. );
  229. }
  230. // Add group to the form
  231. if ($is_certificate_mode) {
  232. $form->addText('title', get_lang('CertificateName'), true, array('cols-size' => [2, 10, 0], 'autofocus'));
  233. } else {
  234. $form->addText('title', get_lang('Title'), true, array('cols-size' => [2, 10, 0], 'autofocus'));
  235. }
  236. // Show read-only box only in groups
  237. if (!empty($groupId)) {
  238. $group[]= $form->createElement('checkbox', 'readonly', '', get_lang('ReadOnly'));
  239. }
  240. $form->addRule('title', get_lang('ThisFieldIsRequired'), 'required');
  241. $form->addRule('title', get_lang('FileExists'), 'callback', 'document_exists');
  242. $current_session_id = api_get_session_id();
  243. $form->addHtmlEditor('content','', true, true, $editorConfig, true);
  244. // Comment-field
  245. $folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is_allowed_to_edit);
  246. // If we are not in the certificates creation, display a folder chooser for the
  247. // new document created
  248. if (!$is_certificate_mode &&
  249. !DocumentManager::is_my_shared_folder($userId, $dir, $current_session_id)
  250. ) {
  251. $folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is_allowed_to_edit);
  252. //$parent_select = $form->addElement('select', 'curdirpath', array(null, get_lang('DestinationDirectory')));
  253. $parent_select = $form->addSelect('curdirpath', get_lang('DestinationDirectory'),null, array('cols-size' => [2, 10, 0]) );
  254. // Following two conditions copied from document.inc.php::build_directory_selector()
  255. $folder_titles = array();
  256. if (is_array($folders)) {
  257. $escaped_folders = array();
  258. foreach ($folders as $key => & $val) {
  259. // Hide some folders
  260. if ($val=='/HotPotatoes_files' || $val=='/certificates' || basename($val)=='css'){
  261. continue;
  262. }
  263. // Admin setting for Hide/Show the folders of all users
  264. if (api_get_setting('show_users_folders') == 'false' && (strstr($val, '/shared_folder') || strstr($val, 'shared_folder_session_'))){
  265. continue;
  266. }
  267. // Admin setting for Hide/Show Default folders to all users
  268. if (api_get_setting('show_default_folders') == 'false' && ($val=='/images' || $val=='/flash' || $val=='/audio' || $val=='/video' || strstr($val, '/images/gallery') || $val=='/video/flv')){
  269. continue;
  270. }
  271. // Admin setting for Hide/Show chat history folder
  272. if (api_get_setting('show_chat_folder') == 'false' && $val=='/chat_files'){
  273. continue;
  274. }
  275. $escaped_folders[$key] = Database::escape_string($val);
  276. }
  277. $folder_sql = implode("','", $escaped_folders);
  278. $sql = "SELECT * FROM $doc_table
  279. WHERE
  280. c_id = $course_id AND
  281. filetype='folder' AND
  282. path IN ('".$folder_sql."')";
  283. $res = Database::query($sql);
  284. $folder_titles = array();
  285. while ($obj = Database::fetch_object($res)) {
  286. $folder_titles[$obj->path] = $obj->title;
  287. }
  288. }
  289. if (empty($group_dir)) {
  290. $parent_select -> addOption(get_lang('HomeDirectory'), '/');
  291. if (is_array($folders)) {
  292. foreach ($folders as & $folder) {
  293. //Hide some folders
  294. if ($folder=='/HotPotatoes_files' || $folder=='/certificates' || basename($folder)=='css') {
  295. continue;
  296. }
  297. //Admin setting for Hide/Show the folders of all users
  298. if (api_get_setting('show_users_folders') == 'false' &&
  299. (strstr($folder, '/shared_folder') || strstr($folder, 'shared_folder_session_'))
  300. ){
  301. continue;
  302. }
  303. //Admin setting for Hide/Show Default folders to all users
  304. if (api_get_setting('show_default_folders') == 'false' &&
  305. (
  306. $folder == '/images' ||
  307. $folder == '/flash' ||
  308. $folder == '/audio' ||
  309. $folder == '/video' ||
  310. strstr($folder, '/images/gallery') ||
  311. $folder == '/video/flv'
  312. )
  313. ){
  314. continue;
  315. }
  316. //Admin setting for Hide/Show chat history folder
  317. if (api_get_setting('show_chat_folder') == 'false' &&
  318. $folder=='/chat_files'
  319. ){
  320. continue;
  321. }
  322. $selected = (substr($dir,0,-1) == $folder) ? ' selected="selected"' : '';
  323. $path_parts = explode('/', $folder);
  324. $folder_titles[$folder] = cut($folder_titles[$folder], 80);
  325. $space_counter =count($path_parts) - 2;
  326. if ($space_counter > 0) {
  327. $label = str_repeat('&nbsp;&nbsp;&nbsp;', $space_counter).' &mdash; '.$folder_titles[$folder];
  328. } else {
  329. $label = ' &mdash; '.$folder_titles[$folder];
  330. }
  331. $parent_select -> addOption($label, $folder);
  332. if ($selected != '') {
  333. $parent_select->setSelected($folder);
  334. }
  335. }
  336. }
  337. } else {
  338. foreach ($folders as & $folder) {
  339. $selected = (substr($dir,0,-1)==$folder) ? ' selected="selected"' : '';
  340. $label = $folder_titles[$folder];
  341. if ($folder == $group_dir) {
  342. $label = '/ ('.get_lang('HomeDirectory').')';
  343. } else {
  344. $path_parts = explode('/', str_replace($group_dir, '', $folder));
  345. $label = cut($label, 80);
  346. $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2).' &mdash; '.$label;
  347. }
  348. $parent_select -> addOption($label, $folder);
  349. if ($selected != '') {
  350. $parent_select->setSelected($folder);
  351. }
  352. }
  353. }
  354. }
  355. if ($is_certificate_mode) {
  356. $form->addButtonCreate(get_lang('CreateCertificate'));
  357. } else {
  358. $form->addButtonCreate(get_lang('CreateDoc'));
  359. }
  360. $form->setDefaults($defaults);
  361. // If form validates -> save the new document
  362. if ($form->validate()) {
  363. $values = $form->exportValues();
  364. $readonly = isset($values['readonly']) ? 1 : 0;
  365. $values['title'] = trim($values['title']);
  366. if ($dir[strlen($dir) - 1] != '/') {
  367. $dir .= '/';
  368. }
  369. // Setting the filename
  370. $filename = $values['title'];
  371. $filename = addslashes(trim($filename));
  372. $filename = Security::remove_XSS($filename);
  373. $filename = api_replace_dangerous_char($filename);
  374. $filename = disable_dangerous_file($filename);
  375. $filename .= DocumentManager::getDocumentSuffix(
  376. $_course,
  377. api_get_session_id(),
  378. api_get_group_id()
  379. );
  380. // Setting the title
  381. $title = $values['title'];
  382. // Setting the extension
  383. $extension = 'html';
  384. $content = Security::remove_XSS($values['content'], COURSEMANAGERLOWSECURITY);
  385. /*if (strpos($content, '/css/frames.css') == false) {
  386. $content = str_replace('</head>', '<link rel="stylesheet" href="./css/frames.css" type="text/css" /><style> body{margin:50px;}</style></head>', $content);
  387. }*/
  388. // Don't create file with the same name.
  389. if (file_exists($filepath.$filename.'.'.$extension)) {
  390. Display:: display_header($nameTools, 'Doc');
  391. Display:: display_error_message(get_lang('FileExists').' '.$title, false);
  392. Display:: display_footer();
  393. exit;
  394. }
  395. if ($fp = @fopen($filepath.$filename.'.'.$extension, 'w')) {
  396. $content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'].'/courses/', $content);
  397. fputs($fp, $content);
  398. fclose($fp);
  399. chmod($filepath.$filename.'.'.$extension, api_get_permissions_for_new_files());
  400. /*
  401. if (!is_dir($filepath.'css')) {
  402. mkdir($filepath.'css', api_get_permissions_for_new_directories());
  403. $doc_id = add_document($_course, $dir.'css', 'folder', 0, 'css');
  404. api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', $userId, null, null, null, null, $current_session_id);
  405. api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', $userId, null, null, null, null, $current_session_id);
  406. }
  407. if (!is_file($filepath.'css/frames.css')) {
  408. // Make a copy of the current css for the new document
  409. copy(api_get_path(SYS_CODE_PATH).'css/'.api_get_setting('stylesheets').'/frames.css', $filepath.'css/frames.css');
  410. $doc_id = add_document($_course, $dir.'css/frames.css', 'file', filesize($filepath.'css/frames.css'), 'frames.css');
  411. api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $userId, null, null, null, null, $current_session_id);
  412. api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', $userId, null, null, null, null, $current_session_id);
  413. }*/
  414. $file_size = filesize($filepath.$filename.'.'.$extension);
  415. $save_file_path = $dir.$filename.'.'.$extension;
  416. $document_id = add_document(
  417. $_course,
  418. $save_file_path,
  419. 'file',
  420. $file_size,
  421. $title,
  422. null,
  423. $readonly
  424. );
  425. if ($document_id) {
  426. api_item_property_update(
  427. $_course,
  428. TOOL_DOCUMENT,
  429. $document_id,
  430. 'DocumentAdded',
  431. $userId,
  432. $to_group_id,
  433. null,
  434. null,
  435. null,
  436. $current_session_id
  437. );
  438. // Update parent folders
  439. item_property_update_on_folder($_course, $dir, $userId);
  440. $new_comment = isset($_POST['comment']) ? trim($_POST['comment']) : '';
  441. $new_title = isset($_POST['title']) ? trim($_POST['title']) : '';
  442. $new_title = htmlspecialchars($new_title);
  443. if ($new_comment || $new_title) {
  444. $ct = '';
  445. $params = [];
  446. if ($new_comment) {
  447. $params['comment'] = $new_comment;
  448. }
  449. if ($new_title) {
  450. $params['title'] = $new_title;
  451. }
  452. if (!empty($params)) {
  453. Database::update(
  454. $doc_table,
  455. $params,
  456. ['c_id = ? AND id = ?' => [$course_id, $document_id]]
  457. );
  458. }
  459. }
  460. $dir= substr($dir,0,-1);
  461. $selectcat = '';
  462. if (isset($_REQUEST['selectcat']))
  463. $selectcat = "&selectcat=".Security::remove_XSS($_REQUEST['selectcat']);
  464. $certificate_condition = '';
  465. if ($is_certificate_mode) {
  466. $df = DocumentManager::get_default_certificate_id($_course['code']);
  467. if (!isset($df)) {
  468. DocumentManager::attach_gradebook_certificate ($_course['code'],$document_id);
  469. }
  470. $certificate_condition = '&certificate=true&curdirpath=/certificates';
  471. }
  472. header('Location: document.php?'.api_get_cidreq().'&id='.$folder_id.$selectcat.$certificate_condition);
  473. exit();
  474. } else {
  475. Display :: display_header($nameTools, 'Doc');
  476. Display :: display_error_message(get_lang('Impossible'));
  477. Display :: display_footer();
  478. }
  479. } else {
  480. Display :: display_header($nameTools, 'Doc');
  481. Display :: display_error_message(get_lang('Impossible'));
  482. Display :: display_footer();
  483. }
  484. } else {
  485. // Copied from document.php
  486. $dir_array = explode('/', $dir);
  487. $array_len = count($dir_array);
  488. // Breadcrumb for the current directory root path
  489. if (!empty($document_data)) {
  490. if (empty($document_data['parents'])) {
  491. $interbreadcrumb[] = array(
  492. 'url' => '#',
  493. 'name' => $document_data['title']
  494. );
  495. } else {
  496. foreach ($document_data['parents'] as $document_sub_data) {
  497. $interbreadcrumb[] = array(
  498. 'url' => $document_sub_data['document_url'],
  499. 'name' => $document_sub_data['title']
  500. );
  501. }
  502. }
  503. }
  504. Display :: display_header($nameTools, "Doc");
  505. // actions
  506. // link back to the documents overview
  507. if ($is_certificate_mode) {
  508. $actionsLeft = '<a href="document.php?certificate=true&id='.$folder_id.'&selectcat=' . Security::remove_XSS($_GET['selectcat']).'">'.
  509. Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>';
  510. } else {
  511. $actionsLeft = '<a href="document.php?curdirpath='.Security::remove_XSS($dir).'">'.
  512. Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
  513. }
  514. echo $toolbar = Display::toolbarAction('actions-documents', array(0 => $actionsLeft, 1 => ''));
  515. if ($is_certificate_mode) {
  516. $all_information_by_create_certificate = DocumentManager::get_all_info_to_certificate(api_get_user_id(), api_get_course_id());
  517. $str_info = '';
  518. foreach ($all_information_by_create_certificate[0] as $info_value) {
  519. $str_info.=$info_value.'<br/>';
  520. }
  521. $create_certificate = get_lang('CreateCertificateWithTags');
  522. Display::display_normal_message($create_certificate.': <br /><br/>'.$str_info,false);
  523. }
  524. // HTML-editor
  525. echo '<div class="row" style="overflow:hidden">
  526. <div id="template_col" class="col-md-3">
  527. <div class="panel panel-default">
  528. <div class="panel-body">
  529. <div id="frmModel" class="items-templates scrollbar-macosx"></div>
  530. </div>
  531. </div>
  532. </div>
  533. <div class="col-md-1">
  534. <div id="hide_bar_template"></div>
  535. </div>
  536. <div id="doc_form" class="col-md-8">
  537. '.$form->returnForm().'
  538. </div>
  539. </div>';
  540. Display :: display_footer();
  541. }