original_string: public function definition() {
  
          $mform = $this->_form;
          $installer = $this->_customdata['installer'];
  
          $mform->addElement('header', 'general', get_string('installfromzip', 'tool_installaddon'));
          $mform->addHelpButton('general', 'installfromzip', 'tool_installaddon');
  
          $mform->addElement('filepicker', 'zipfile', get_string('installfromzipfile', 'tool_installaddon'),
              null, array('accepted_types' => '.zip'));
          $mform->addHelpButton('zipfile', 'installfromzipfile', 'tool_installaddon');
          $mform->addRule('zipfile', null, 'required', null, 'client');
  
          $options = $installer->get_plugin_types_menu();
          $mform->addElement('select', 'plugintype', get_string('installfromziptype', 'tool_installaddon'), $options,
              array('id' => 'tool_installaddon_installfromzip_plugintype'));
          $mform->addHelpButton('plugintype', 'installfromziptype', 'tool_installaddon');
          $mform->setAdvanced('plugintype');
  
          $mform->addElement('static', 'permcheck', '',
              html_writer::span(get_string('permcheck', 'tool_installaddon'), '',
                  array('id' => 'tool_installaddon_installfromzip_permcheck')));
          $mform->setAdvanced('permcheck');
  
          $mform->addElement('text', 'rootdir', get_string('installfromziprootdir', 'tool_installaddon'));
          $mform->addHelpButton('rootdir', 'installfromziprootdir', 'tool_installaddon');
          $mform->setType('rootdir', PARAM_PLUGIN);
          $mform->setAdvanced('rootdir');
  
          $this->add_action_buttons(false, get_string('installfromzipsubmit', 'tool_installaddon'));
      }
code: public function definition() {
  
          $mform = $this->_form;
          $installer = $this->_customdata['installer'];
  
          $mform->addElement('header', 'general', get_string('installfromzip', 'tool_installaddon'));
          $mform->addHelpButton('general', 'installfromzip', 'tool_installaddon');
  
          $mform->addElement('filepicker', 'zipfile', get_string('installfromzipfile', 'tool_installaddon'),
              null, array('accepted_types' => '.zip'));
          $mform->addHelpButton('zipfile', 'installfromzipfile', 'tool_installaddon');
          $mform->addRule('zipfile', null, 'required', null, 'client');
  
          $options = $installer->get_plugin_types_menu();
          $mform->addElement('select', 'plugintype', get_string('installfromziptype', 'tool_installaddon'), $options,
              array('id' => 'tool_installaddon_installfromzip_plugintype'));
          $mform->addHelpButton('plugintype', 'installfromziptype', 'tool_installaddon');
          $mform->setAdvanced('plugintype');
  
          $mform->addElement('static', 'permcheck', '',
              html_writer::span(get_string('permcheck', 'tool_installaddon'), '',
                  array('id' => 'tool_installaddon_installfromzip_permcheck')));
          $mform->setAdvanced('permcheck');
  
          $mform->addElement('text', 'rootdir', get_string('installfromziprootdir', 'tool_installaddon'));
          $mform->addHelpButton('rootdir', 'installfromziprootdir', 'tool_installaddon');
          $mform->setType('rootdir', PARAM_PLUGIN);
          $mform->setAdvanced('rootdir');
  
          $this->add_action_buttons(false, get_string('installfromzipsubmit', 'tool_installaddon'));
      }
code_tokens: public function definition ( ) { $ mform = $ this -> _form ; $ installer = $ this -> _customdata [ 'installer' ] ; $ mform -> addElement ( 'header' , 'general' , get_string ( 'installfromzip' , 'tool_installaddon' ) ) ; $ mform -> addHelpButton ( 'general' , 'installfromzip' , 'tool_installaddon' ) ; $ mform -> addElement ( 'filepicker' , 'zipfile' , get_string ( 'installfromzipfile' , 'tool_installaddon' ) , null , array ( 'accepted_types' => '.zip' ) ) ; $ mform -> addHelpButton ( 'zipfile' , 'installfromzipfile' , 'tool_installaddon' ) ; $ mform -> addRule ( 'zipfile' , null , 'required' , null , 'client' ) ; $ options = $ installer -> get_plugin_types_menu ( ) ; $ mform -> addElement ( 'select' , 'plugintype' , get_string ( 'installfromziptype' , 'tool_installaddon' ) , $ options , array ( 'id' => 'tool_installaddon_installfromzip_plugintype' ) ) ; $ mform -> addHelpButton ( 'plugintype' , 'installfromziptype' , 'tool_installaddon' ) ; $ mform -> setAdvanced ( 'plugintype' ) ; $ mform -> addElement ( 'static' , 'permcheck' , '' , html_writer :: span ( get_string ( 'permcheck' , 'tool_installaddon' ) , '' , array ( 'id' => 'tool_installaddon_installfromzip_permcheck' ) ) ) ; $ mform -> setAdvanced ( 'permcheck' ) ; $ mform -> addElement ( 'text' , 'rootdir' , get_string ( 'installfromziprootdir' , 'tool_installaddon' ) ) ; $ mform -> addHelpButton ( 'rootdir' , 'installfromziprootdir' , 'tool_installaddon' ) ; $ mform -> setType ( 'rootdir' , PARAM_PLUGIN ) ; $ mform -> setAdvanced ( 'rootdir' ) ; $ this -> add_action_buttons ( false , get_string ( 'installfromzipsubmit' , 'tool_installaddon' ) ) ; }
docstring: Defines the form elements
docstring_tokens: Defines the form elements