home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / cms / template.inc < prev    next >
Text File  |  2004-03-08  |  4KB  |  167 lines

  1. <?php
  2. if ($template_id > 0)
  3. {
  4.     $check = (isset($template) && $template['restrict_editor'] == '1') ? true : false;
  5.     $name = $template['name'];
  6.     $style = $template['style'];
  7.     $additional_style= $template['additional_style'];
  8. }else
  9. {
  10.     $check = isset($_POST['restrict_editor']) ? true : false;
  11.     $name = isset($_POST['name']) ? $_POST['name'] : '';
  12.     $additional_style = isset($_POST['additional_style']) ? $_POST['additional_style'] : '';
  13.     $style = isset($_POST['style']) ? $_POST['style'] : "
  14. body{
  15.     margin: 0px;
  16. }
  17.  
  18.  
  19. hr{
  20.  
  21. }
  22.  
  23. a:link, a:visited, a:active, a:hover  {
  24.     color:  #000000;
  25. }
  26.  
  27. .search{
  28.  
  29. }
  30.  
  31. .folder {
  32.     font-family: Arial, Helvetica, sans-serif;
  33.     font-weight: bold;
  34.     font-size: 12px;
  35. }
  36.  
  37. a.folder:link, a.folder:visited, a.folder:active {
  38.     font-family: Arial, Helvetica, sans-serif;
  39.     font-weight: bold;
  40.     font-size: 12px;
  41.     text-decoration:    none;
  42. }
  43.  
  44. a.folder:hover{
  45.     text-decoration: underline;
  46. }
  47.  
  48. .file {
  49.     font-family: Arial, Helvetica, sans-serif;
  50.     font-weight: normal;
  51.     font-size: 12px;
  52. }
  53.  
  54. a.file:link, a.file:visited, a.file:active {
  55.     font-family: Arial, Helvetica, sans-serif;
  56.     font-weight: normal;
  57.     font-size: 12px;
  58.     text-decoration:    none;
  59. }
  60.  
  61. a.file:hover{
  62.     text-decoration: underline;
  63. }
  64.  
  65.  
  66. .path {
  67.     background: #000000;
  68.     font-family: Arial, Helvetica, sans-serif;
  69.     font-weight: bold;
  70.     font-size: 14px;
  71.     color: #f1f1f1;
  72. }
  73.  
  74. a.path:link, a.path:visited, a.path:active {
  75.     font-family: Arial, Helvetica, sans-serif;
  76.     font-weight: bold;
  77.     font-size: 14px;
  78.     color: #f1f1f1;
  79.     text-decoration:    none;
  80. }
  81.  
  82. a.path:hover{
  83.     text-decoration: underline;
  84. }
  85. .home {
  86.     background: #666666;
  87.     font-family: Arial, Helvetica, sans-serif;
  88.     font-weight: bold;
  89.     font-size: 14px;
  90.     color: #f1f1f1;
  91. }
  92.  
  93.  
  94. a.home:link, a.home:visited, a.home:active {
  95.     font-family: Arial, Helvetica, sans-serif;
  96.     font-weight: bold;
  97.     font-size: 14px;
  98.     text-decoration:    none;
  99.     color: #f1f1f1;
  100. }
  101.  
  102. a.home:hover{
  103.     text-decoration: underline;
  104. }";
  105. }
  106.  
  107.  
  108. ?>
  109. <input type="hidden" name="task" />
  110. <input type="hidden" name="template_id" value="<?php echo $template_id; ?>" />
  111. <input type="hidden" name="close" value="false" />
  112. <table border="0" cellpadding="10" cellspacing="0">
  113. <tr>
  114.     <td>
  115.     <?php
  116.     if(isset($feedback)) echo $feedback;
  117.     ?>
  118.     <table border="0">
  119.     <tr>
  120.         <td><?php echo $strName; ?>:</td>
  121.         <td><input type="text" value="<?php echo $name; ?>" name="name" class="textbox" size="30" /></d>
  122.     </tr>
  123.     <tr>
  124.         <td colspan="2">
  125.         <?php $checkbox = new checkbox('restrict_editor', 'true', $cms_restrict_editor, $check); ?></td>
  126.     </tr>
  127.     </table>
  128.     <table border="0">
  129.     <tr>
  130.         <td colspan="2">
  131.         <p><?php echo $cms_style; ?>:</p>
  132.         <input type="file" class="textbox" name="style_file" />    <a href="javascript:popup('template_file_selector.php?template_id=<?php echo $template_id; ?>&SET_FIELD=style','250','300')" class="normal"><?php echo $cms_insert_file_url; ?></a><br />
  133.         <textarea class="textbox" name="style" rows="10" style="width: 550px;"><?php echo $style; ?></textarea>
  134.         </td>
  135.     </tr>
  136.     <tr>
  137.         <td colspan="2">
  138.         <p><?php echo $cms_additional_style; ?>:</p>
  139.         <input type="file" class="textbox" name="additional_style_file" />    <a href="javascript:popup('template_file_selector.php?template_id=<?php echo $template_id; ?>&SET_FIELD=additional_style','250','300')" class="normal"><?php echo $cms_insert_file_url; ?></a><br />
  140.         <textarea class="textbox" name="additional_style" rows="10" style="width: 550px;"><?php echo $additional_style; ?></textarea>
  141.         </td>
  142.     </tr>
  143.     </table>
  144.     <br />
  145.     <?php
  146.     $button = new button($cmdOk, "javascript:save_close_template_item()");
  147.     echo '  ';
  148.     $button = new button($cmdSave, "javascript:save_template_item()");
  149.     echo '  ';
  150.     $button = new button($cmdClose, "javascript:document.location='index.php?tabindex=2'");
  151.     ?>
  152.     </td>
  153. </tr>
  154. </table>
  155.     <script type="text/javascript">
  156.     function save_template_item()
  157.     {
  158.         document.forms[0].task.value='save_template';
  159.         document.forms[0].submit();
  160.     }
  161.     function save_close_template_item()
  162.     {
  163.         document.forms[0].close.value='true';
  164.         document.forms[0].task.value='save_template';
  165.         document.forms[0].submit();
  166.     }
  167.     </script>