コード例 #1
0
ファイル: allocation.php プロジェクト: Gavinthisisit/Moodle
 * @package    mod_teamwork
 * @copyright  2009 David Mudrak <*****@*****.**>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once dirname(__FILE__) . '/locallib.php';
require_once dirname(__FILE__) . '/allocation/lib.php';
$cmid = required_param('cmid', PARAM_INT);
// course module
$method = optional_param('method', 'manual', PARAM_ALPHA);
// method to use
$cm = get_coursemodule_from_id('teamwork', $cmid, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$teamwork = $DB->get_record('teamwork', array('id' => $cm->instance), '*', MUST_EXIST);
$teamwork = new teamwork($teamwork, $cm, $course);
$PAGE->set_url($teamwork->allocation_url($method));
require_login($course, false, $cm);
$context = $PAGE->context;
require_capability('mod/teamwork:allocate', $context);
$PAGE->set_title($teamwork->name);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add(get_string('allocation', 'teamwork'));
$allocator = $teamwork->allocator_instance($method);
$initresult = $allocator->init();
//
// Output starts here
//
$output = $PAGE->get_renderer('mod_teamwork');
echo $output->header();
echo $OUTPUT->heading(format_string($teamwork->name));
$allocators = teamwork::installed_allocators();