009, Ryan Djurovich * @copyright 2009-2011, Website Baker Org. e.V. * @link http://www.websitebaker2.org/ * @license http://www.gnu.org/licenses/gpl.html * @platform WebsiteBaker 2.8.x * @requirements PHP 5.2.2 and higher * @version $Id: index.php 1493 2011-08-11 14:56:05Z Luisehahne $ * @filesource $HeadURL: http://svn.websitebaker2.org/branches/2.8.x/wb/admin/groups/index.php $ * @lastmodified $Date: 2011-08-11 16:56:05 +0200 (Do, 11. Aug 2011) $ * */ // Print admin header require('../../config.php'); require_once(WB_PATH.'/framework/class.admin.php'); $admin = new admin('Access', 'groups'); $ftan = $admin->getFTAN(); // Create new template object for the modify/remove menu $template = new Template(THEME_PATH.'/templates'); $template->set_file('page', 'groups.htt'); $template->set_block('page', 'main_block', 'main'); $template->set_block('main_block', 'manage_users_block', 'users'); // insert urls $template->set_var(array( 'ADMIN_URL' => ADMIN_URL, 'WB_URL' => WB_URL, 'THEME_URL' => THEME_URL, 'FTAN' => $ftan ) ); // Get existing value from database // $database = new database(); $query = "SELECT group_id,name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'"; $results = $database->query($query); if($database->is_error()) { $admin->print_error($database->get_error(), 'index.php'); } // Insert values into the modify/remove menu $template->set_block('main_block', 'list_block', 'list'); if($results->numRows() > 0) { // Insert first value to say please select $template->set_var('VALUE', ''); $template->set_var('NAME', $TEXT['PLEASE_SELECT'].'...'); $template->parse('list', 'list_block', true); // Loop through groups while($group = $results->fetchRow()) { $template->set_var('VALUE',$admin->getIDKEY($group['group_id'])); $template->set_var('NAME', $group['name']); $template->parse('list', 'list_block', true); } } else { // Insert single value to say no groups were found $template->set_var('NAME', $TEXT['NONE_FOUND']); $template->parse('list', 'list_block', true); } // Insert permissions values if($admin->get_permission('groups_add') != true) { $template->set_var('DISPLAY_ADD', 'hide'); } if($admin->get_permission('groups_modify') != true) { $template->set_var('DISPLAY_MODIFY', 'hide'); } if($admin->get_permission('groups_delete') != true) { $template->set_var('DISPLAY_DELETE', 'hide'); } // Insert language headings $template->set_var(array( 'HEADING_MODIFY_DELETE_GROUP' => $HEADING['MODIFY_DELETE_GROUP'], 'HEADING_ADD_GROUP' => $HEADING['ADD_GROUP'] ) ); // Insert language text and messages $template->set_var(array( 'TEXT_MODIFY' => $TEXT['MODIFY'], 'Thp page_footer(); ?>