templates.php 603 B

12345678910111213141516171819
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once '../../global.inc.php';
  4. use Chamilo\CoreBundle\Component\Editor\CkEditor\CkEditor;
  5. $template = new Template();
  6. $table = Database::get_main_table(TABLE_MAIN_SYSTEM_TEMPLATE);
  7. $sql = "SELECT * FROM $table";
  8. $result = Database::query($sql);
  9. $templates = Database::store_result($result, 'ASSOC');
  10. if (!empty($templates)) {
  11. $editor = new CkEditor();
  12. $templates = $editor->simpleFormatTemplates($templates);
  13. $template->assign('templates', $templates);
  14. $template->display('default/javascript/editor/ckeditor/templates.tpl');
  15. }