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

  1. <input type="hidden" name="task" value="sites" />
  2. <table  border="0" cellspacing="5" cellpadding="0">
  3. <tr>
  4.     <td colspan="2">
  5.     <?php
  6.     if (isset($_REQUEST['delete_site']) && $site = $cms->get_site($_REQUEST['delete_site']))
  7.     {
  8.         if ($GO_SECURITY->user_id == $site['user_id'] || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $site['acl_write']))
  9.         {
  10.             $cms->delete_site($_REQUEST['delete_site']);
  11.         }else
  12.         {
  13.             $feedback = '<p class="Error">'.$strAccessDenied.'</p>';
  14.         }
  15.     }
  16.  
  17.     if(isset($feedback)) echo $feedback;
  18.  
  19.     echo '<br /><table border="0">';
  20.     $cms->get_authorized_sites($GO_SECURITY->user_id);
  21.     $count = 0;
  22.     echo '<tr><td colspan="2" width="32"></td>';
  23.     echo '<td><h3>'.$strName.'</h3></td>';
  24.     echo '<td><h3>'.$strOwner.'</h3></td>';
  25.     echo '<td colspan="3"></td></tr>';
  26.  
  27.     $cms2 = new cms();
  28.     while($cms->next_record())
  29.     {
  30.         $count++;
  31.  
  32.         $check = $cms2->is_subscribed($GO_SECURITY->user_id, $cms->f('id')) ? 'checked' : '';
  33.         echo '<tr><td width="16"><input type="checkbox" name="subscribed[]" value="'.$cms->f('id').'" '.$check.' /></td>';
  34.         echo '<td width="16" height="16"><img src="'.$GO_THEME->images['site'].'" border="0" widht="16" height="16" /></td>';
  35.         echo '<td><a class="normal" href="browse.php?site_id='.$cms->f('id').'">'.$cms->f('name').'</a></td>';
  36.         echo '<td>'.show_profile($cms->f('user_id')).'</td>';
  37.         echo '<td><a target="_blank" href="view.php?site_id='.$cms->f('id').'" title="'.$cms_preview.' \''.$cms->f('name').'\'"><img src="'.$GO_THEME->images['magnifier'].'" border="0" /></a></td>';
  38.         echo '<td><a href="site.php?site_id='.$cms->f('id').'" title="'.$strEdit.' \''.$cms->f('name').'\'"><img src="'.$GO_THEME->images['edit'].'" border="0" /></a></td>';
  39.         echo "<td><a href='javascript:confirm_action(\"".$_SERVER['PHP_SELF']."?delete_site=".$cms->f('id')."\",\"".rawurlencode($strDeletePrefix."'".$cms->f('name')."'".$strDeleteSuffix)."\")' title=\"".$strDeleteItem." '".$cms->f('name')."'\"><img src=\"".$GO_THEME->images['delete']."\" border=\"0\"></a></td></tr>\n";
  40.  
  41.     }
  42.     if ($count > 0)
  43.     {
  44.         echo '<tr><td colspan="99">';
  45.         $button = new button($cms_subscribe, 'document.forms[0].submit();');
  46.         echo '</td></tr>';
  47.     }
  48.  
  49.     echo '<tr><td colspan="99"><i>'.$count.' '.$cms_sites.'</i></td></tr>';
  50.     echo '</table>';
  51.     ?>
  52.     </td>
  53. </tr>
  54. </table>
  55.