home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / cms / files.inc < prev    next >
Text File  |  2004-03-08  |  5KB  |  98 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. //add blank task var
  14. echo '<input type="hidden" name="task" />';
  15. echo '<input type="hidden" name="return" value="'.$folder_id.'" />';
  16. echo '<input type="hidden" name="folder_id" value="'.$folder_id.'" />';
  17. echo '<input type="hidden" name="file_id" />';
  18. //builds the full path to this directory with links
  19. function get_path($folder_id)
  20. {
  21.     global $cms;
  22.     $path = '';
  23.  
  24.     while($folder = $cms->get_folder($folder_id))
  25.     {
  26.         $path = '/<a href="'.$_SERVER['PHP_SELF'].'?folder_id='.$folder['id'].'">'.$folder['name'].'</a>'.$path;
  27.         $folder_id = $folder['parent_id'];
  28.     }
  29.     return $path;
  30. }
  31.  
  32. //get current folder information and print path and buttons
  33. $folder = $cms->get_folder($folder_id);
  34. echo '<h2>'.get_path($folder['parent_id']).'/<a href="'.$_SERVER['PHP_SELF'].'?site_id='.$site_id.'&folder_id='.$folder['id'].'">'.$folder['name'].'</a></h2>';
  35. echo '<table border="0" cellpadding="0" cellspacing="0">';
  36. if($folder['parent_id']!=0)
  37. {
  38.     echo '<td class="ModuleIcons">';
  39.     echo '<a class="small" href="'.$_SERVER['PHP_SELF'].'?site_id='.$site_id.'&folder_id='.$folder['parent_id'].'"><img src="'.$GO_THEME->images['uplvl_big'].'" border="0" height="32" width="32" /><br />'.$fbUpLevel .'</a></td>';
  40. }
  41. echo '<td class="ModuleIcons">';
  42. echo '<a class="small" href="'.$_SERVER['PHP_SELF'].'?site_id='.$site_id.'&task=add_folder&folder_id='.$folder_id.'"><img src="'.$GO_THEME->images['new_folder'].'" border="0" height="32" width="32" /><br />'.$fbNewFolder.'</a></td>';
  43. echo '<td class="ModuleIcons">';
  44. echo '<a class="small" href="'.$_SERVER['PHP_SELF'].'?site_id='.$site_id.'&task=upload&folder_id='.$folder_id.'"><img src="'.$GO_THEME->images['upload'].'" border="0" height="32" width="32" /><br />'.$fbUpload.'</a></td>';
  45. echo '<td class="ModuleIcons">';
  46. echo '<a class="small" href="javascript:delete_items()"><img src="'.$GO_THEME->images['delete_big'].'" border="0" height="32" width="32" /><br />'.$fbDelete.'</a></td>';
  47. echo '<td class="ModuleIcons">';
  48. echo '<a class="small" href="edit.php?site_id='.$site_id.'&folder_id='.$folder_id.'"><img src="'.$GO_THEME->images['new_doc'].'" border="0" height="32" width="32" /><br />'.$cms_new_page.'</a></td>';
  49. echo '<td class="ModuleIcons">';
  50. echo '<a class="small" href="javascript:properties()"><img src="'.$GO_THEME->images['properties'].'" border="0" height="32" width="32" /><br />'.$fbProperties.'</a></td>';
  51. echo '<td class="ModuleIcons">';
  52. echo '<a class="small" href="javascript:cut_items()"><img src="'.$GO_THEME->images['cut'].'" border="0" height="32" width="32" /><br />'.$fbCut.'</a></td>';
  53. echo '<td class="ModuleIcons">';
  54. echo '<a class="small" href="javascript:copy_items()"><img src="'.$GO_THEME->images['copy'].'" border="0" height="32" width="32" /><br />'.$fbCopy.'</a></td>';
  55.  
  56. $_SESSION['cut_files'] = isset($_SESSION['cut_files']) ? $_SESSION['cut_files'] : array();
  57. $_SESSION['cut_folders'] = isset($_SESSION['cut_folders']) ? $_SESSION['cut_folders'] : array();
  58. $_SESSION['copy_folders'] = isset($_SESSION['copy_folders']) ? $_SESSION['copy_folders'] : array();
  59. $_SESSION['copy_files'] = isset($_SESSION['copy_files']) ? $_SESSION['copy_files'] : array();
  60.  
  61. if((count($_SESSION['cut_files'] ) + count($_SESSION['cut_folders']) + count($_SESSION['copy_folders']) + count($_SESSION['copy_files'] )) > 0)
  62. {
  63.     echo '<td class="ModuleIcons">';
  64.     echo '<a class="small" href="javascript:paste_items()"><img src="'.$GO_THEME->images['paste'].'" border="0" height="32" width="32" /><br />'.$fbPaste.'</a></td>';
  65. }
  66. echo '<td class="ModuleIcons">';
  67. echo '<a class="small" target="_blank" href="view.php?site_id='.$site['id'].'&folder_id='.$folder_id.'" title="'.$cms_preview.' \''.$site['name'].'\'"><img src="'.$GO_THEME->images['magnifier_big'].'" border="0" /><br />'.$cms_preview.'</a></td>';
  68.  
  69. echo '<td class="ModuleIcons">';
  70. echo '<a class="small" href="site.php?site_id='.$site_id.'&return_to='.rawurlencode($GO_CONFIG->host.$GO_MODULES->path.'browse.php?site_id='.$site_id.'&folder_id='.$folder_id).'"><img src="'.$GO_THEME->images['cms'].'" border="0" height="32" width="32" /><br />'.$cms_settings.'</a></td>';
  71.  
  72. if ($qn_plugin = $GO_MODULES->get_plugin('questionnaires'))
  73. {
  74.     echo '<td class="ModuleIcons">';
  75.     echo '<a class="small" href="'.$qn_plugin['url'].'?site_id='.$site_id.'"><img src="'.$GO_THEME->images['questionmark'].'" border="0" height="32" width="32" /><br />Vragenlijsten</a></td>';
  76. }
  77.  
  78. echo '<td class="ModuleIcons">';
  79. echo '<a class="small" href="index.php"><img src="'.$GO_THEME->images['exit'].'" border="0" height="32" width="32" /><br />'.$cmdClose.'</a></td>';
  80.  
  81. echo '</table>';
  82. ?>
  83.  
  84. <table border="0" cellpadding="10" width="100%">
  85. <tr>
  86.     <td valign="top">
  87.     <?php
  88.     require('treeview.inc');
  89.     ?>
  90.     </td>
  91.     <td valign="top">
  92.     <?php
  93.     require('listview.inc');
  94.     ?>
  95.     </td>
  96. </tr>
  97. </table>
  98.