create_document.php 20 KB

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