[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/admin/ -> listgroups.php (source)

   1  <?php
   2  #CMS - CMS Made Simple
   3  #(c)2004 by Ted Kulp (wishy@users.sf.net)
   4  #This project's homepage is: http://cmsmadesimple.sf.net
   5  #
   6  #This program is free software; you can redistribute it and/or modify
   7  #it under the terms of the GNU General Public License as published by
   8  #the Free Software Foundation; either version 2 of the License, or
   9  #(at your option) any later version.
  10  #
  11  #This program is distributed in the hope that it will be useful,
  12  #but WITHOUT ANY WARRANTY; without even the implied warranty of
  13  #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14  #GNU General Public License for more details.
  15  #You should have received a copy of the GNU General Public License
  16  #along with this program; if not, write to the Free Software
  17  #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18  #
  19  #$Id: listgroups.php 3360 2006-08-22 01:39:33Z wishy $
  20  
  21  $CMS_ADMIN_PAGE=1;
  22  
  23  require_once ("../include.php");
  24  require_once ("../lib/classes/class.group.inc.php");
  25  
  26  check_login();
  27  
  28  include_once ("header.php");
  29  
  30  ?>
  31  
  32  <div class="pagecontainer">
  33      <div class="pageoverflow">
  34  
  35  <?php
  36  
  37      $userid = get_userid();
  38      $perm = check_permission($userid, 'Modify Permissions');
  39      $assign = check_permission($userid, 'Modify Group Assignments');
  40      $edit = check_permission($userid, 'Modify Groups');
  41      $remove = check_permission($userid, 'Remove Groups');
  42  
  43      #$query = "SELECT group_id, group_name, active FROM ".cms_db_prefix()."groups ORDER BY group_id";
  44      #$result = $db->Execute($query);
  45  
  46      global $gCms;
  47      $groupops =& $gCms->GetGroupOperations();
  48      $grouplist = $groupops->LoadGroups();
  49  
  50      $page = 1;
  51      if (isset($_GET['page'])) $page = $_GET['page'];
  52      $limit = 20;
  53      if (count($grouplist) > $limit)
  54      {
  55          echo "<p class=\"pageshowrows\">".pagination($page, count($grouplist), $limit)."</p>";
  56      }
  57      echo $themeObject->ShowHeader('currentgroups').'</div>';
  58      if (count($grouplist) > 0) {
  59  
  60          echo "<table cellspacing=\"0\" class=\"pagetable\">\n";
  61          echo '<thead>';
  62          echo "<tr>\n";
  63          echo "<th class=\"pagew60\">".lang('name')."</th>\n";
  64          echo "<th class=\"pagepos\">".lang('active')."</th>\n";
  65          if ($perm)
  66              echo "<th class=\"pageicon\">&nbsp;</th>\n";
  67          if ($assign)
  68              echo "<th class=\"pageicon\">&nbsp;</th>\n";
  69          if ($edit)
  70              echo "<th class=\"pageicon\">&nbsp;</th>\n";
  71          if ($remove)
  72              echo "<th class=\"pageicon\">&nbsp;</th>\n";
  73          echo "</tr>\n";
  74          echo '</thead>';
  75          echo '<tbody>';
  76  
  77          $currow = "row1";
  78  
  79          // construct true/false button images
  80          $image_true = $themeObject->DisplayImage('icons/system/true.gif', lang('true'),'','','systemicon');
  81          $image_false = $themeObject->DisplayImage('icons/system/false.gif', lang('false'),'','','systemicon');
  82          $image_groupassign = $themeObject->DisplayImage('icons/system/groupassign.gif', lang('assignments'),'','','systemicon');
  83          $image_permissions = $themeObject->DisplayImage('icons/system/permissions.gif', lang('permissions'),'','','systemicon');
  84  
  85          $counter=0;
  86          foreach ($grouplist as $onegroup){
  87              if ($counter < $page*$limit && $counter >= ($page*$limit)-$limit) {
  88                  echo "<tr class=\"$currow\" onmouseover=\"this.className='".$currow.'hover'."';\" onmouseout=\"this.className='".$currow."';\">\n";
  89                  echo "<td><a href=\"editgroup.php?group_id=".$onegroup->id."\">".$onegroup->name."</a></td>\n";
  90                  echo "<td class=\"pagepos\">".($onegroup->active == 1?$image_true:$image_false)."</td>\n";
  91                  if ($perm)
  92                      echo "<td class=\"pagepos icons_wide\"><a href=\"changegroupperm.php?group_id=".$onegroup->id."\">".$image_permissions."</a></td>\n";
  93                  if ($assign)
  94                      echo "<td class=\"pagepos icons_wide\"><a href=\"changegroupassign.php?group_id=".$onegroup->id."\">".$image_groupassign."</a></td>\n";
  95                  if ($edit)
  96                      {
  97                      echo "<td class=\"icons_wide\"><a href=\"editgroup.php?group_id=".$onegroup->id."\">";
  98                      echo $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'),'','','systemicon');
  99                      echo "</a></td>\n";
 100                      }
 101                  if ($remove)
 102                      {
 103                      echo "<td class=\"icons_wide\"><a href=\"deletegroup.php?group_id=".$onegroup->id."\" onclick=\"return confirm('".lang('deleteconfirm')."');\">";
 104                      echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'),'','','systemicon');
 105                      echo "</a></td>\n";
 106                      }
 107                  echo "</tr>\n";
 108  
 109                  ($currow == "row1"?$currow="row2":$currow="row1");
 110              }
 111              $counter++;
 112          }
 113  
 114          echo '</tbody>';
 115          echo "</table>\n";
 116  
 117      }
 118  
 119  if (check_permission($userid, 'Add Groups')) {
 120  ?>
 121      <div class="pageoptions">
 122          <p class="pageoptions">
 123              <a href="addgroup.php">
 124                  <?php 
 125                      echo $themeObject->DisplayImage('icons/system/newobject.gif', lang('addgroup'),'','','systemicon').'</a>';
 126                      echo ' <a class="pageoptions" href="addgroup.php">'.lang("addgroup");
 127                  ?>
 128              </a>
 129          </p>
 130      </div>
 131  </div>
 132  
 133  <p class="pageback"><a class="pageback" href="<?php echo $themeObject->BackUrl(); ?>">&#171; <?php echo lang('back')?></a></p>
 134  
 135  <?php
 136  }
 137  
 138  include_once ("footer.php");
 139  
 140  # vim:ts=4 sw=4 noet
 141  ?>


Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7