original_string: function _createElements() {
          $attributes = $this->getAttributes();
          if (is_null($attributes)) {
              $attributes = array();
          }
          if (!isset($attributes['size'])) {
              $attributes['size'] = 3;
          }
          $this->_elements = array();
          // E_STRICT creating elements without forms is nasty because it internally uses $this
          $number = $this->createFormElement('text', 'number', get_string('time', 'form'), $attributes, true);
          $number->set_force_ltr(true);
          $this->_elements[] = $number;
          unset($attributes['size']);
          $this->_elements[] = $this->createFormElement('select', 'timeunit', get_string('timeunit', 'form'), $this->get_units(), $attributes, true);
          // If optional we add a checkbox which the user can use to turn if on
          if($this->_options['optional']) {
              $this->_elements[] = $this->createFormElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true);
          }
          foreach ($this->_elements as $element){
              if (method_exists($element, 'setHiddenLabel')){
                  $element->setHiddenLabel(true);
              }
          }
      }
code: function _createElements() {
          $attributes = $this->getAttributes();
          if (is_null($attributes)) {
              $attributes = array();
          }
          if (!isset($attributes['size'])) {
              $attributes['size'] = 3;
          }
          $this->_elements = array();
          // E_STRICT creating elements without forms is nasty because it internally uses $this
          $number = $this->createFormElement('text', 'number', get_string('time', 'form'), $attributes, true);
          $number->set_force_ltr(true);
          $this->_elements[] = $number;
          unset($attributes['size']);
          $this->_elements[] = $this->createFormElement('select', 'timeunit', get_string('timeunit', 'form'), $this->get_units(), $attributes, true);
          // If optional we add a checkbox which the user can use to turn if on
          if($this->_options['optional']) {
              $this->_elements[] = $this->createFormElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true);
          }
          foreach ($this->_elements as $element){
              if (method_exists($element, 'setHiddenLabel')){
                  $element->setHiddenLabel(true);
              }
          }
      }
code_tokens: function _createElements ( ) { $ attributes = $ this -> getAttributes ( ) ; if ( is_null ( $ attributes ) ) { $ attributes = array ( ) ; } if ( ! isset ( $ attributes [ 'size' ] ) ) { $ attributes [ 'size' ] = 3 ; } $ this -> _elements = array ( ) ; // E_STRICT creating elements without forms is nasty because it internally uses $this $ number = $ this -> createFormElement ( 'text' , 'number' , get_string ( 'time' , 'form' ) , $ attributes , true ) ; $ number -> set_force_ltr ( true ) ; $ this -> _elements [ ] = $ number ; unset ( $ attributes [ 'size' ] ) ; $ this -> _elements [ ] = $ this -> createFormElement ( 'select' , 'timeunit' , get_string ( 'timeunit' , 'form' ) , $ this -> get_units ( ) , $ attributes , true ) ; // If optional we add a checkbox which the user can use to turn if on if ( $ this -> _options [ 'optional' ] ) { $ this -> _elements [ ] = $ this -> createFormElement ( 'checkbox' , 'enabled' , null , get_string ( 'enable' ) , $ this -> getAttributes ( ) , true ) ; } foreach ( $ this -> _elements as $ element ) { if ( method_exists ( $ element , 'setHiddenLabel' ) ) { $ element -> setHiddenLabel ( true ) ; } } }
docstring: Override of standard quickforms method to create this element.
docstring_tokens: Override of standard quickforms method to create this element .