Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/grade/edit/outcome/import_outcomes_form.php
Go to the documentation of this file.
00001 <?php
00002 
00003 // This file is part of Moodle - http://moodle.org/
00004 //
00005 // Moodle is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // Moodle is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00017 
00018 if (!defined('MOODLE_INTERNAL')) {
00019     die('Direct access to this script is forbidden.');    
00020 }
00021 
00022 require_once($CFG->dirroot.'/lib/formslib.php');
00023 
00024 class import_outcomes_form extends moodleform {
00025 
00026     public function definition() {
00027         global $PAGE, $USER;
00028 
00029         $mform =& $this->_form;
00030 
00031         $mform->addElement('hidden', 'action', 'upload');
00032         $mform->setType('action', PARAM_ACTION);
00033         $mform->addElement('hidden', 'courseid', $PAGE->course->id);
00034         $mform->setType('id', PARAM_INT);
00035 
00036         $scope = array();
00037         if (($PAGE->course->id > 1) && has_capability('moodle/grade:manage', get_context_instance(CONTEXT_SYSTEM))) {
00038             $mform->addElement('radio', 'scope', get_string('importcustom', 'grades'), null, 'custom');
00039             $mform->addElement('radio', 'scope', get_string('importstandard', 'grades'), null, 'global');
00040             $mform->setDefault('scope', 'custom');
00041         }
00042 
00043         $mform->addElement('filepicker', 'userfile', get_string('importoutcomes', 'grades'));
00044         $mform->addRule('userfile', get_string('required'), 'required', null, 'server');
00045         $mform->addHelpButton('userfile', 'importoutcomes', 'grades');
00046 
00047         $mform->addElement('submit', 'save', get_string('uploadthisfile'));
00048 
00049     }
00050 }
00051 
00052 
 All Data Structures Namespaces Files Functions Variables Enumerations