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

  1. <table border="0" cellpadding="10">
  2. <tr>
  3.     <td>
  4.     <?php
  5.     $task = isset($task) ? $task : '';
  6.     switch ($task)
  7.     {
  8.         case 'date_format':
  9.             $date_format_id = isset($_REQUEST['date_format_id']) ? $_REQUEST['date_format_id'] : 0;
  10.             if ($date_format_id > 0)
  11.             {
  12.                 $date_format = $xpath->getAttributes('/date_formats/date_format[@id='.$date_format_id.']');
  13.                 $php_format=$date_format['php_format'];
  14.                 $go_format=$date_format['go_format'];
  15.             }
  16.     
  17.             
  18.             if (isset($feedback)) echo $feedback;
  19.             ?>
  20.             <input type="hidden" value="date_format" name="task" />
  21.             <input type="hidden" name="date_format_id" value="<?php echo $date_format_id; ?>" />
  22.             <table border="0">
  23.             <tr>
  24.                 <td>
  25.                 <table border="0">
  26.                 <tr>
  27.                     <td>PHP:</td>
  28.                     <td><input type="text" class="textbox" name="php_format" value="<?php if (isset($php_format)) echo $php_format; ?>" style="width: 300px;" /></td>
  29.                 </tr>
  30.                 <tr>
  31.                     <td><?php echo $strDescription; ?>:</td>
  32.                     <td><input type="text" class="textbox" name="go_format" value="<?php if (isset($go_format)) echo $go_format; ?>" style="width: 300px;" /></td>
  33.                 </tr>
  34.                 <tr>
  35.                     <td colspan="2">
  36.                     <?php
  37.                     $button = new button($cmdOk, 'javascript:document.forms[0].submit();');
  38.                     echo '  ';
  39.                     $button = new button($cmdCancel, 'javascript:cancel_date_format();');
  40.                     ?>
  41.                     </td>
  42.                 </tr>
  43.                 </table>
  44.                 </td>
  45.             </tr>
  46.             </table>
  47.             <?php
  48.         break;
  49.  
  50.         default:
  51.             ?>
  52.             <input type="hidden" value="delete_date_format" name="task" />
  53.             <input type="hidden" name="date_format_id" />
  54.             <a class="normal" href="javascript:date_format(0);"><?php echo $cmdAdd; ?></a>
  55.             <br /><br />
  56.             <table border="0" cellpadding="4">
  57.             <tr>
  58.                 <td>
  59.                 <?php
  60.                 if (isset($feedback)) echo $feedback;
  61.                 echo $admin_date_formats_text;
  62.     
  63.                 $date_formats = $xpath->match('/date_formats/date_format');
  64.                 if (count($date_formats) > 0)
  65.                 {
  66.                     echo '<br /><br /><table border="0"><tr><td><h3>'.$strDescription.'</h3></td><td><h3>PHP</h3></td><td></td><td></td></tr>';
  67.     
  68.                     while($date_format = array_shift($date_formats))
  69.                     {
  70.                         $date_format = $xpath->getAttributes($date_format);
  71.     
  72.                         echo '<tr><td>'.$date_format['go_format'].'</td><td>'.$date_format['php_format'].'</td>';
  73.                         echo '<td><a href=\'javascript:date_format('.$date_format['id'].')\' title="'.$strEdit.' \''.$date_format['go_format'].'\'"><img src="'.$GO_THEME->images['edit'].'" border="0" /></a></td>';
  74.                         echo '<td><a href=\'javascript:delete_date_format('.$date_format['id'].', "'.$date_format['go_format'].'")\' title="'.$strDeleteItem.' \''.$date_format['go_format'].'\'"><img src="'.$GO_THEME->images['delete'].'" border="0" /></a></td></tr>';
  75.                     }
  76.     
  77.                     echo '</table>';
  78.                 }
  79.     
  80.                 ?>
  81.                 </td>
  82.             </tr>
  83.             </table>
  84.     
  85.             <?php
  86.         break;
  87.     }
  88.     ?>
  89.     </td>
  90. </tr>
  91. </table>
  92.  
  93. <script type="text/javascript">
  94. function delete_date_format(date_format_id, date_format_name)
  95. {
  96.     if (confirm("<?php echo $strDeletePrefix; ?>'"+date_format_name+"'<?php echo $strDeleteSuffix; ?>"))
  97.     {
  98.         document.forms[0].date_format_id.value = date_format_id;
  99.         document.forms[0].submit();
  100.     }
  101. }
  102.  
  103. function date_format(date_format_id)
  104. {
  105.     document.forms[0].date_format_id.value = date_format_id;
  106.     document.forms[0].task.value='date_format';
  107.     document.forms[0].submit();
  108. }
  109.  
  110. function cancel_date_format()
  111. {
  112.     document.forms[0].task.value='date_formats';
  113.     document.forms[0].submit();
  114.  
  115. }
  116. </script>