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

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12.  
  13. if (isset($task) && $task == 'delete')
  14. {
  15.     $cms->delete_template_file($template_file_id);
  16. }
  17. echo '<input type="hidden" name="template_file_id" />';
  18. echo '<input type="hidden" name="task" />';
  19. echo '<br /><a class="normal" href="'.$_SERVER['PHP_SELF'].'?task=upload&template_id='.$template_id.'">'.$fbUpload.'</a>';
  20. echo '<br /><br /><table border="0" cellpadding="3" cellspacing="0"><tr>';
  21. echo '<td width="16"> </td>';
  22. echo '<td width="100" nowrap><h3>'.$strName.'</h3></td>';
  23. echo '<td width="100" nowrap><h3>'.$strType.'</h3></td>';
  24. echo '<td width="100" nowrap><h3>'.$strSize.'</h3></td>';
  25. echo '<td width="100" nowrap><h3>'.$strModified.'</h3></td><td></td></tr>';
  26.  
  27.  
  28. //list the files
  29. $total_size = 0;
  30. $count_files = $cms->get_template_files($template_id);
  31. while ($cms->next_record())
  32. {
  33.     $total_size += $cms->f('size');
  34.     $short_name = cut_string($cms->f('name'), 30);
  35.  
  36.     echo '<tr class="Table1">';
  37.     echo '<td><img width="16" height="16" border="0" src="'.$GO_CONFIG->control_url.'icon.php?extension='.$cms->f('extension').'" /></td>';
  38.     echo '<td nowrap> <a href="javascript:popup(\'template_file.php?template_file_id='.$cms->f('id').'\',\'400\',\'300\')" title="'.$cms->f('name').'">'.$short_name.'</a>  </td>';
  39.     echo '<td nowrap>'.$cms->f('content_type_friendly').'  </td>';
  40.     echo '<td nowrap align="right">'.format_size($cms->f('size')).'  </td>';
  41.     echo '<td nowrap>'.date($_SESSION['GO_SESSION']['date_format'], $cms->f('mtime')).'  </td>';
  42.     echo "<td><a href='javascript:delete_template_item(".$cms->f('id').",\"".rawurlencode($strDeletePrefix."'".$cms->f('name')."'".$strDeleteSuffix)."\")' title=\"".$strDeleteItem." '".$cms->f('name')."'\"><img src=\"".$GO_THEME->image_url."buttons/delete.gif\" border=\"0\"></a></td></tr>\n";
  43. }
  44. echo '<tr><td colspan="99" height="18"> '.$count_files.' '.$cms_items.'</td></tr>';
  45. echo '<tr><td colspan="99"><br />';
  46. $button = new button($cmdClose, "javascript:document.location='index.php?tabindex=2'");
  47. echo '</td></tr></table>';
  48. ?>
  49. <script type="text/javascript">
  50.  
  51. function delete_template_item(template_file_id, question)
  52. {
  53.     if (confirm(question))
  54.     {
  55.         document.forms[0].task.value='delete';
  56.         document.forms[0].template_file_id.value=template_file_id;
  57.         document.forms[0].submit();
  58.     }
  59. }
  60. </script>