original_string: protected final function definition() {
          $form = $this->_form;
          $store = $this->_customdata['store'];
          $plugin = $this->_customdata['plugin'];
          $locks = $this->_customdata['locks'];
  
          $form->addElement('hidden', 'plugin', $plugin);
          $form->setType('plugin', PARAM_PLUGIN);
          $form->addElement('hidden', 'editing', !empty($this->_customdata['store']));
          $form->setType('editing', PARAM_BOOL);
  
          if (!$store) {
              $form->addElement('text', 'name', get_string('storename', 'cache'));
              $form->addHelpButton('name', 'storename', 'cache');
              $form->addRule('name', get_string('required'), 'required');
              $form->setType('name', PARAM_NOTAGS);
          } else {
              $form->addElement('hidden', 'name', $store);
              $form->addElement('static', 'name-value', get_string('storename', 'cache'), $store);
              $form->setType('name', PARAM_NOTAGS);
          }
  
          if (is_array($locks)) {
              $form->addElement('select', 'lock', get_string('locking', 'cache'), $locks);
              $form->addHelpButton('lock', 'locking', 'cache');
              $form->setType('lock', PARAM_ALPHANUMEXT);
          } else {
              $form->addElement('hidden', 'lock', '');
              $form->setType('lock', PARAM_ALPHANUMEXT);
              $form->addElement('static', 'lock-value', get_string('locking', 'cache'),
                      '<em>'.get_string('nativelocking', 'cache').'</em>');
          }
  
          if (method_exists($this, 'configuration_definition')) {
              $form->addElement('header', 'storeconfiguration', get_string('storeconfiguration', 'cache'));
              $this->configuration_definition();
          }
  
          $this->add_action_buttons();
      }
code: protected final function definition() {
          $form = $this->_form;
          $store = $this->_customdata['store'];
          $plugin = $this->_customdata['plugin'];
          $locks = $this->_customdata['locks'];
  
          $form->addElement('hidden', 'plugin', $plugin);
          $form->setType('plugin', PARAM_PLUGIN);
          $form->addElement('hidden', 'editing', !empty($this->_customdata['store']));
          $form->setType('editing', PARAM_BOOL);
  
          if (!$store) {
              $form->addElement('text', 'name', get_string('storename', 'cache'));
              $form->addHelpButton('name', 'storename', 'cache');
              $form->addRule('name', get_string('required'), 'required');
              $form->setType('name', PARAM_NOTAGS);
          } else {
              $form->addElement('hidden', 'name', $store);
              $form->addElement('static', 'name-value', get_string('storename', 'cache'), $store);
              $form->setType('name', PARAM_NOTAGS);
          }
  
          if (is_array($locks)) {
              $form->addElement('select', 'lock', get_string('locking', 'cache'), $locks);
              $form->addHelpButton('lock', 'locking', 'cache');
              $form->setType('lock', PARAM_ALPHANUMEXT);
          } else {
              $form->addElement('hidden', 'lock', '');
              $form->setType('lock', PARAM_ALPHANUMEXT);
              $form->addElement('static', 'lock-value', get_string('locking', 'cache'),
                      '<em>'.get_string('nativelocking', 'cache').'</em>');
          }
  
          if (method_exists($this, 'configuration_definition')) {
              $form->addElement('header', 'storeconfiguration', get_string('storeconfiguration', 'cache'));
              $this->configuration_definition();
          }
  
          $this->add_action_buttons();
      }
code_tokens: protected final function definition ( ) { $ form = $ this -> _form ; $ store = $ this -> _customdata [ 'store' ] ; $ plugin = $ this -> _customdata [ 'plugin' ] ; $ locks = $ this -> _customdata [ 'locks' ] ; $ form -> addElement ( 'hidden' , 'plugin' , $ plugin ) ; $ form -> setType ( 'plugin' , PARAM_PLUGIN ) ; $ form -> addElement ( 'hidden' , 'editing' , ! empty ( $ this -> _customdata [ 'store' ] ) ) ; $ form -> setType ( 'editing' , PARAM_BOOL ) ; if ( ! $ store ) { $ form -> addElement ( 'text' , 'name' , get_string ( 'storename' , 'cache' ) ) ; $ form -> addHelpButton ( 'name' , 'storename' , 'cache' ) ; $ form -> addRule ( 'name' , get_string ( 'required' ) , 'required' ) ; $ form -> setType ( 'name' , PARAM_NOTAGS ) ; } else { $ form -> addElement ( 'hidden' , 'name' , $ store ) ; $ form -> addElement ( 'static' , 'name-value' , get_string ( 'storename' , 'cache' ) , $ store ) ; $ form -> setType ( 'name' , PARAM_NOTAGS ) ; } if ( is_array ( $ locks ) ) { $ form -> addElement ( 'select' , 'lock' , get_string ( 'locking' , 'cache' ) , $ locks ) ; $ form -> addHelpButton ( 'lock' , 'locking' , 'cache' ) ; $ form -> setType ( 'lock' , PARAM_ALPHANUMEXT ) ; } else { $ form -> addElement ( 'hidden' , 'lock' , '' ) ; $ form -> setType ( 'lock' , PARAM_ALPHANUMEXT ) ; $ form -> addElement ( 'static' , 'lock-value' , get_string ( 'locking' , 'cache' ) , '<em>' . get_string ( 'nativelocking' , 'cache' ) . '</em>' ) ; } if ( method_exists ( $ this , 'configuration_definition' ) ) { $ form -> addElement ( 'header' , 'storeconfiguration' , get_string ( 'storeconfiguration' , 'cache' ) ) ; $ this -> configuration_definition ( ) ; } $ this -> add_action_buttons ( ) ; }
docstring: The definition of the add instance form
docstring_tokens: The definition of the add instance form