[ Index ]

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

title

Body

[close]

/course/ -> editcategory_form.php (source)

   1  <?php 
   2  require_once ($CFG->dirroot.'/course/moodleform_mod.php');
   3  class editcategory_form extends moodleform {
   4  
   5      // form definition
   6      function definition() {
   7          global $CFG;
   8          $mform =& $this->_form;
   9          
  10          // get list of categories to use as parents, with site as the first one
  11          $options = array(get_string('top'));
  12          $parents = array();
  13          make_categories_list($options, $parents);
  14          
  15          $mform->addElement('select', 'parent', get_string('parentcategory'), $options);
  16          $mform->addElement('text', 'name', get_string('categoryname'), array('size'=>'30'));    
  17          $mform->addRule('name', get_string('required'), 'required', null);        
  18          $mform->addElement('htmleditor', 'description', get_string('description'));
  19          $mform->setType('description', PARAM_RAW);
  20          if (!empty($CFG->allowcategorythemes)) {
  21              $themes=array();
  22              $themes[''] = get_string('forceno');
  23              $themes += get_list_of_themes();
  24              $mform->addElement('select', 'theme', get_string('forcetheme'), $themes);
  25          }
  26          $mform->setHelpButton('description', array('writing', 'richtext'), false, 'editorhelpbutton');
  27          
  28          $mform->addElement('hidden', 'id', null);
  29          $mform->addElement('hidden', 'categoryadd', 0);
  30          $mform->setType('id', PARAM_INT);
  31          $this->add_action_buttons(true, get_string('savechanges'));
  32      }
  33  } 
  34  ?>


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