dokeos-group
[ class tree: dokeos-group ] [ index: dokeos-group ] [ all elements ]

Source for file group_overview.php

Documentation is available at group_overview.php

  1. <?php
  2. /*
  3. ===============================================================================
  4.     Dokeos - elearning and course management software
  5.  
  6.     Copyright (c) 2004 Dokeos S.A.
  7.     Copyright (c) 2003 Ghent University (UGent)
  8.     Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9.     Copyright (c) Roan Embrechts (Vrije Universiteit Brussel)
  10.     Copyright (c) Bart Mollet
  11.  
  12.     For a full list of contributors, see "credits.txt".
  13.     The full license can be read in "license.txt".
  14.  
  15.     This program is free software; you can redistribute it and/or
  16.     modify it under the terms of the GNU General Public License
  17.     as published by the Free Software Foundation; either version 2
  18.     of the License, or (at your option) any later version.
  19.  
  20.     See the GNU General Public License for more details.
  21.  
  22.     Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  23. ===============================================================================
  24. */
  25. /**
  26. ============================================================================== 
  27. *    Main page for the group module.
  28. *    This script displays the general group settings,
  29. *    and a list of groups with buttons to view, edit...
  30. *    
  31. *    @author Thomas Depraetere, Hugues Peeters, Christophe Gesche: initial versions
  32. *    @author Bert Vanderkimpen, improved self-unsubscribe for cvs
  33. *    @author Patrick Cool, show group comment under the group name
  34. *    @author Roan Embrechts, initial self-unsubscribe code, code cleaning, virtual course support
  35. *    @author Bart Mollet, code cleaning, use of Display-library, list of courseAdmin-tools, use of GroupManager
  36. *    @package dokeos.group
  37. ============================================================================== 
  38. */
  39. /*
  40. ============================================================================== 
  41.         INIT SECTION
  42. ============================================================================== 
  43. */
  44. // name of the language file that needs to be included 
  45. $language_file "group";
  46. include ('../inc/global.inc.php');
  47. $this_section=SECTION_COURSES;
  48.  
  49. $nameTools get_lang("GroupOverview");
  50.  
  51. /*
  52. -----------------------------------------------------------
  53.     Libraries
  54. -----------------------------------------------------------
  55. */
  56. include_once (api_get_path(LIBRARY_PATH).'course.lib.php')//necessary
  57. include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
  58. include_once (api_get_path(LIBRARY_PATH).'export.lib.inc.php');
  59. include_once (api_get_path(LIBRARY_PATH).'events.lib.inc.php')//necessary for statistics
  60.  
  61. ifisset($_GET['action']))
  62. {
  63.     switch($_GET['action'])
  64.     {
  65.         case 'export':
  66.             $groups GroupManager::get_group_list();
  67.             $data array();
  68.             foreach($groups as $index => $group)
  69.             {
  70.                 $users GroupManager::get_users($group['id']);
  71.                 foreach($users as $index => $user)
  72.                 {
  73.                     $row array();
  74.                     $user api_get_user_info($user);
  75.                     $row[$group['name'];
  76.                     $row[$user['official_code'];
  77.                     $row[$user['lastName'];
  78.                     $row[$user['firstName'];
  79.                     $data[$row;
  80.                 }    
  81.             }
  82.             switch($_GET['type'])
  83.             {
  84.                 case 'csv':
  85.                     Export::export_table_csv($data);
  86.                 case 'xls':
  87.                     Export::export_table_xls($data);    
  88.             }    
  89.             break;
  90.     }    
  91. }
  92.  
  93. /*
  94. -----------------------------------------------------------
  95.     Header
  96. -----------------------------------------------------------
  97. */
  98. $interbreadcrumb[]=array("url" => "group.php","name" => get_lang('GroupManagement'));
  99. if (!isset ($_GET['origin']|| $_GET['origin'!= 'learnpath')
  100. //so we are not in learnpath tool
  101.     if ($is_allowed_in_courseapi_not_allowed(true);
  102.     else Display::display_header($nameTools,"Group");
  103. }
  104. else
  105. {
  106. ?> <link rel="stylesheet" type="text/css" href="<?php echo api_get_path(WEB_CODE_PATH)?>css/default.css" /> <?php
  107. }
  108. echo '<a href="group_overview.php?'.api_get_cidreq().'&action=export&type=csv">'.get_lang('ExportAsCSV').'</a>';
  109. echo ' | <a href="group_overview.php?'.api_get_cidreq().'&action=export&type=xls">'.get_lang('ExportAsXLS').'</a>';
  110. $categories GroupManager::get_categories();
  111. foreach($categories as $index => $category)
  112. {
  113.     ifapi_get_setting('allow_group_categories'== 'true')
  114.     {
  115.         echo '<h3>'.$category['title'].'</h3>';
  116.     }    
  117.     $groups GroupManager::get_group_list($category['id']);
  118.     echo '<ul>';
  119.     foreach($groups as $index => $group)
  120.     {
  121.         echo '<li>';
  122.         echo stripslashes($group['name']);
  123.         echo '<ul>';
  124.         $users GroupManager::get_users($group['id']);
  125.         foreach($users as $index => $user)
  126.         {
  127.             $user_info api_get_user_info($user);
  128.             echo '<li>'.$user_info['firstName'].' '.$user_info['lastName'].'</li>';
  129.         }
  130.         echo '</ul>';
  131.         echo '</li>';    
  132.     }
  133.     echo '</ul>';
  134. }
  135. /*
  136. ============================================================================== 
  137.         FOOTER 
  138. ============================================================================== 
  139. */
  140. if (!isset ($_GET['origin']|| $_GET['origin'!= 'learnpath')
  141. {
  142. }
  143. ?>

Documentation generated on Thu, 12 Jun 2008 13:38:10 -0500 by phpDocumentor 1.4.1