0
@@ -24,132 +24,50 @@ require_once("../include.php");
0
-include_once("header.php");
0
-<div class="pagecontainer">
0
- <div class="pageoverflow">
0
- $userid = get_userid();
0
- $perm = check_permission($userid, 'Modify Permissions');
0
- $assign = check_permission($userid, 'Modify Group Assignments');
0
- $edit = check_permission($userid, 'Modify Groups');
0
- $remove = check_permission($userid, 'Remove Groups');
0
- #$query = "SELECT group_id, group_name, active FROM ".cms_db_prefix()."groups ORDER BY group_id";
0
- #$result = $db->Execute($query);
0
- $grouplist = cms_orm()->cms_group->find_all(array('order' => 'name'));
0
- if (isset($_GET['page'])) $page = $_GET['page'];
0
- if (count($grouplist) > $limit)
0
- echo "<p class=\"pageshowrows\">".pagination($page, count($grouplist), $limit)."</p>";
0
- echo $themeObject->ShowHeader('currentgroups').'</div>';
0
- if (count($grouplist) > 0) {
0
- echo "<table cellspacing=\"0\" class=\"pagetable\">\n";
0
- echo "<th class=\"pagew60\">".lang('name')."</th>\n";
0
- echo "<th class=\"pagepos\">".lang('active')."</th>\n";
0
- echo "<th class=\"pageicon\"> </th>\n";
0
- echo "<th class=\"pageicon\"> </th>\n";
0
- echo "<th class=\"pageicon\"> </th>\n";
0
- echo "<th class=\"pageicon\"> </th>\n";
0
+//$grouplist = cms_orm()->cms_group->find_all(array('order' => 'name'));
0
- // construct true/false button images
0
- $image_true = $themeObject->DisplayImage('icons/system/true.gif', lang('true'),'','','systemicon');
0
- $image_false = $themeObject->DisplayImage('icons/system/false.gif', lang('false'),'','','systemicon');
0
- $image_groupassign = $themeObject->DisplayImage('icons/system/groupassign.gif', lang('assignments'),'','','systemicon');
0
- $image_permissions = $themeObject->DisplayImage('icons/system/permissions.gif', lang('permissions'),'','','systemicon');
0
+// PROCESS Any GET or POST results here
0
+if (isset($_GET['page'])) $page = $_GET['page'];
0
- foreach ($grouplist as $onegroup)
0
- if ($counter < $page*$limit && $counter >= ($page*$limit)-$limit)
0
- echo "<tr class=\"$currow\" onmouseover=\"this.className='".$currow.'hover'."';\" onmouseout=\"this.className='".$currow."';\">\n";
0
- echo "<td><a href=\"editgroup.php?group_id=".$onegroup->id."\">".$onegroup->name."</a></td>\n";
0
- echo "<td class=\"pagepos\">".($onegroup->active == 1?$image_true:$image_false)."</td>\n";
0
- echo "<td class=\"pagepos icons_wide\"><a href=\"changegroupperm.php?group_id=".$onegroup->id."\">".$image_permissions."</a></td>\n";
0
- echo "<td class=\"pagepos icons_wide\"><a href=\"changegroupassign.php?group_id=".$onegroup->id."\">".$image_groupassign."</a></td>\n";
0
- if ($onegroup->name != 'Admin' && $onegroup->name != 'Anonymous')
0
- echo "<td class=\"icons_wide\"><a href=\"editgroup.php?group_id=".$onegroup->id."\">";
0
- echo $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'),'','','systemicon');
0
- echo "<td class=\"icons_wide\"><a href=\"deletegroup.php?group_id=".$onegroup->id."\" onclick=\"return confirm('".lang('deleteconfirm')."');\">";
0
- echo $themeObject->DisplayImage('icons/system/delete.gif', lang('delete'),'','','systemicon');
0
- echo '<td></td><td></td>';
0
- ($currow == "row1"?$currow="row2":$currow="row1");
0
-if (check_permission($userid, 'Add Groups')) {
0
- <div class="pageoptions">
0
- <p class="pageoptions">
0
- <a href="addgroup.php">
0
- echo $themeObject->DisplayImage('icons/system/newobject.gif', lang('addgroup'),'','','systemicon').'</a>';
0
- echo ' <a class="pageoptions" href="addgroup.php">'.lang("addgroup");
0
-<p class="pageback"><a class="pageback" href="<?php echo $themeObject->BackUrl(); ?>">« <?php echo lang('back')?></a></p>
0
+include_once("header.php");
0
+$smarty = cms_smarty();
0
+$smarty->assign('header_name',$themeObject->ShowHeader('currentgroups'));
0
+local_setup_smarty( $themeObject, $page );
0
+//$smarty->assign('group_list',$smarty->fetch('listgroups-list.tpl'));
0
+$smarty->display('listgroups.tpl');
0
+include_once("footer.php");
0
+function local_setup_smarty( &$themeObject, $page )
0
+ $groupops = $gCms->GetGroupOperations();
0
+ $grouplist = $groupops->load_groups();
0
+ $smarty = cms_smarty();
0
+ $userid = get_userid();
0
+ $perm = check_permission($userid, 'Modify Permissions');
0
+ $assign = check_permission($userid, 'Modify Group Assignments');
0
+ $edit = check_permission($userid, 'Modify Groups');
0
+ $remove = check_permission($userid, 'Remove Groups');
0
+ // Set permissions to smarty
0
+ $smarty->assign('modify_permissions',$perm);
0
+ $smarty->assign('modify_group_assignments',$assign);
0
+ $smarty->assign('modify_groups',$edit);
0
+ $smarty->assign('remove_groups',$remove);
0
+ $limit = get_preference($userid,'pagelimit',20);
0
+ $smarty->assign('pagination',$page,count($grouplist),$limit);
0
+ $smarty->assign('pagelimit',$limit);
0
+ $smarty->assign('page',$page);
0
+ $smarty->assign('groups',$grouplist);
0
-include_once("footer.php");