createtemplate.html.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  2. <?php include $app->getModuleRoot() . 'common/view/kindeditor.html.php';?>
  3. <?php include $app->getModuleRoot() . 'common/view/markdown.html.php';?>
  4. <div id="mainContent" class="main-content fade">
  5. <div class="center-block">
  6. <div class="main-header">
  7. <h2><?php echo $lang->baseline->createTemplate;?></h2>
  8. </div>
  9. <form class="load-indicator main-form form-ajax" method='post' enctype='multipart/form-data' id='dataform'>
  10. <table class="table table-form">
  11. <tbody>
  12. <tr>
  13. <th class='w-110px'><?php echo $lang->baseline->templateType;?></th>
  14. <td><?php echo html::select('templateType', $lang->baseline->objectList, '', "class='form-control chosen'");?></td>
  15. <td></td>
  16. </tr>
  17. <tr>
  18. <th class='w-110px'><?php echo $lang->baseline->templateTitle;?></th>
  19. <td><?php echo html::input('title', '', "class='form-control'");?></td>
  20. </tr>
  21. <tr>
  22. <th class='w-110px'><?php echo $lang->baseline->docType;?></th>
  23. <?php unset($lang->baseline->docTypeList['markdown']);?>
  24. <td><?php echo html::radio('type', $lang->baseline->docTypeList, 'html', "onchange=toggleEditor(this.value)");?></td>
  25. </tr>
  26. <tr id='contentBox'>
  27. <th class='w-110px'><?php echo $lang->baseline->docContent;?></th>
  28. <td colspan='2'>
  29. <div class='contenthtml'><?php echo html::textarea('content', '', "style='width:100%;height:200px'");?></div>
  30. <div class='contentmarkdown hidden'><?php echo html::textarea('contentMarkdown', '', "style='width:100%;height:200px'");?></div>
  31. <?php echo html::hidden('contentType', 'html');?>
  32. </td>
  33. </tr>
  34. <tr>
  35. <td colspan='3' class='text-center form-actions'>
  36. <?php echo html::submitButton() . ' ' . html::backButton();?>
  37. </td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </form>
  42. </div>
  43. </div>
  44. <script>
  45. function toggleEditor(type)
  46. {
  47. if(type == 'html')
  48. {
  49. $('#contentBox').removeClass('hidden');
  50. $('.contenthtml').removeClass('hidden');
  51. $('.contentmarkdown').addClass('hidden');
  52. }
  53. else if(type == 'markdown')
  54. {
  55. $('#contentBox').removeClass('hidden');
  56. $('.contenthtml').addClass('hidden');
  57. $('.contentmarkdown').removeClass('hidden');
  58. }
  59. else if(type == 'book')
  60. {
  61. $('#contentBox').addClass('hidden');
  62. }
  63. $('#contentType').val(type);
  64. return false;
  65. }
  66. </script>
  67. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>