|
Moodle
2.2.1
http://www.collinsharper.com
|
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 00027 defined('MOODLE_INTERNAL') || die(); 00028 00029 require_once($CFG->libdir . '/formslib.php'); // parent class definition 00030 00040 class workshop_edit_strategy_form extends moodleform { 00041 00043 protected $strategy; 00044 00055 public function definition() { 00056 global $CFG; 00057 00058 $mform = $this->_form; 00059 $this->workshop = $this->_customdata['workshop']; 00060 $this->strategy = $this->_customdata['strategy']; 00061 00062 $mform->addElement('hidden', 'workshopid', $this->workshop->id); // workshopid 00063 $mform->setType('workshopid', PARAM_INT); 00064 00065 $mform->addElement('hidden', 'strategy', $this->workshop->strategy); // strategy name 00066 $mform->setType('strategy', PARAM_PLUGIN); 00067 00068 $this->definition_inner($mform); 00069 00070 // todo - tags support 00071 //if (!empty($CFG->usetags)) { 00072 // $mform->addElement('header', 'tagsheader', get_string('tags')); 00073 // $mform->addElement('tags', 'tags', get_string('tags')); 00074 //} 00075 00076 $buttonarray = array(); 00077 $buttonarray[] = $mform->createElement('submit', 'saveandcontinue', get_string('saveandcontinue', 'workshop')); 00078 $buttonarray[] = $mform->createElement('submit', 'saveandpreview', get_string('saveandpreview', 'workshop')); 00079 $buttonarray[] = $mform->createElement('submit', 'saveandclose', get_string('saveandclose', 'workshop')); 00080 $buttonarray[] = $mform->createElement('cancel'); 00081 $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false); 00082 $mform->closeHeaderBefore('buttonar'); 00083 } 00084 00090 protected function definition_inner(&$mform) { 00091 // By default, do nothing. 00092 } 00093 00094 }