[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/admin/mnet/ -> enr_hosts.php (source)

   1  <?PHP  // $Id: enr_hosts.php,v 1.6.4.1 2007/12/19 17:38:39 skodak Exp $
   2         // enrol_config.php - allows admin to edit all enrollment variables
   3         //                    Yes, enrol is correct English spelling.
   4  
   5      require_once(dirname(__FILE__) . "/../../config.php");
   6      require_once($CFG->libdir.'/adminlib.php');
   7  
   8      admin_externalpage_setup('mnetenrol');
   9      $CFG->pagepath = 'admin/mnet';
  10  
  11  
  12      require_once("$CFG->dirroot/enrol/enrol.class.php");   /// Open the factory class
  13  
  14      $enrolment = enrolment_factory::factory('mnet');
  15  
  16  /// Otherwise fill and print the form.
  17  
  18      /// get language strings
  19  
  20      admin_externalpage_print_header();
  21  
  22      print_box(get_string("remoteenrolhosts_desc", "mnet"));
  23  
  24      echo '<hr />';
  25  
  26      if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') {
  27          print_box(get_string('mnetdisabled','mnet'));
  28      }
  29  
  30      echo '<div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->'
  31             . '<table cellspacing="0" cellpadding="5" id="hosts" class="generaltable generalbox" >'
  32             . '<tr>'
  33             . '<th class="header c0"> '.get_string('host', 'mnet').' </th>'
  34             . '<th class="header c1"> '.get_string('enrolments', 'mnet').' </th>'
  35             . '<th class="header c2"> '.get_string('courses', 'mnet').' </th>'
  36             // . '<th class="header c3"> &nbsp; </th>'
  37             . '</tr>';
  38      $hosts = $enrolment->list_remote_servers();
  39      foreach ($hosts as $host) {
  40          $coursesurl = "$CFG->wwwroot/$CFG->admin/mnet/enr_courses.php?host={$host->id}&amp;sesskey={$USER->sesskey}";
  41          $coursecount = get_field_sql("SELECT count(id) FROM {$CFG->prefix}mnet_enrol_course WHERE hostid={$host->id}");
  42          if (empty($coursecount)) {
  43              $coursecount = '?';
  44          }
  45          $enrolcount = get_field_sql("SELECT count(id) FROM {$CFG->prefix}mnet_enrol_assignments WHERE hostid={$host->id}");
  46  
  47          echo '<tr>'
  48                 . "<td><a href=\"{$coursesurl}\">{$host->name}</a></td>"
  49                 . "<td align=\"center\" >$enrolcount</td>"
  50                 . "<td align=\"center\" >$coursecount - <a href=\"{$coursesurl}\">".get_string('editenrolments', 'mnet')."</a></td>"
  51                 // TODO: teach report/log/index.php to show per-host-logs
  52                 // . '<td align="center" ><a href="$CFG->wwwroot/$CFG->admin/report/log/index.php?course_host={$host->id}">'
  53                 // . get_string('logs', 'mnet').'</a> </td>'
  54                 . '</tr>';
  55      }
  56      echo '</table>'
  57         . '</div>';
  58  
  59      admin_externalpage_print_footer();
  60  
  61  ?>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7