original_string: public function render($config, $allowed = true, $render_controls = true)
      {
          if (is_array($config) && isset($config[0])) {
              $gen_config = $config[0];
              $config = $config[1];
          } else {
              $gen_config = $config;
          }
  
          $this->config = $config;
          $this->genConfig = $gen_config;
          $this->prepareGenerator($gen_config);
  
          $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def);
          $all = array();
          foreach ($allowed as $key) {
              list($ns, $directive) = $key;
              $all[$ns][$directive] = $config->get($ns . '.' . $directive);
          }
  
          $ret = '';
          $ret .= $this->start('table', array('class' => 'hp-config'));
          $ret .= $this->start('thead');
          $ret .= $this->start('tr');
          $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive'));
          $ret .= $this->element('th', 'Value', array('class' => 'hp-value'));
          $ret .= $this->end('tr');
          $ret .= $this->end('thead');
          foreach ($all as $ns => $directives) {
              $ret .= $this->renderNamespace($ns, $directives);
          }
          if ($render_controls) {
              $ret .= $this->start('tbody');
              $ret .= $this->start('tr');
              $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls'));
              $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit'));
              $ret .= '[<a href="?">Reset</a>]';
              $ret .= $this->end('td');
              $ret .= $this->end('tr');
              $ret .= $this->end('tbody');
          }
          $ret .= $this->end('table');
          return $ret;
      }
code: public function render($config, $allowed = true, $render_controls = true)
      {
          if (is_array($config) && isset($config[0])) {
              $gen_config = $config[0];
              $config = $config[1];
          } else {
              $gen_config = $config;
          }
  
          $this->config = $config;
          $this->genConfig = $gen_config;
          $this->prepareGenerator($gen_config);
  
          $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def);
          $all = array();
          foreach ($allowed as $key) {
              list($ns, $directive) = $key;
              $all[$ns][$directive] = $config->get($ns . '.' . $directive);
          }
  
          $ret = '';
          $ret .= $this->start('table', array('class' => 'hp-config'));
          $ret .= $this->start('thead');
          $ret .= $this->start('tr');
          $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive'));
          $ret .= $this->element('th', 'Value', array('class' => 'hp-value'));
          $ret .= $this->end('tr');
          $ret .= $this->end('thead');
          foreach ($all as $ns => $directives) {
              $ret .= $this->renderNamespace($ns, $directives);
          }
          if ($render_controls) {
              $ret .= $this->start('tbody');
              $ret .= $this->start('tr');
              $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls'));
              $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit'));
              $ret .= '[<a href="?">Reset</a>]';
              $ret .= $this->end('td');
              $ret .= $this->end('tr');
              $ret .= $this->end('tbody');
          }
          $ret .= $this->end('table');
          return $ret;
      }
code_tokens: public function render ( $ config , $ allowed = true , $ render_controls = true ) { if ( is_array ( $ config ) && isset ( $ config [ 0 ] ) ) { $ gen_config = $ config [ 0 ] ; $ config = $ config [ 1 ] ; } else { $ gen_config = $ config ; } $ this -> config = $ config ; $ this -> genConfig = $ gen_config ; $ this -> prepareGenerator ( $ gen_config ) ; $ allowed = HTMLPurifier_Config :: getAllowedDirectivesForForm ( $ allowed , $ config -> def ) ; $ all = array ( ) ; foreach ( $ allowed as $ key ) { list ( $ ns , $ directive ) = $ key ; $ all [ $ ns ] [ $ directive ] = $ config -> get ( $ ns . '.' . $ directive ) ; } $ ret = '' ; $ ret .= $ this -> start ( 'table' , array ( 'class' => 'hp-config' ) ) ; $ ret .= $ this -> start ( 'thead' ) ; $ ret .= $ this -> start ( 'tr' ) ; $ ret .= $ this -> element ( 'th' , 'Directive' , array ( 'class' => 'hp-directive' ) ) ; $ ret .= $ this -> element ( 'th' , 'Value' , array ( 'class' => 'hp-value' ) ) ; $ ret .= $ this -> end ( 'tr' ) ; $ ret .= $ this -> end ( 'thead' ) ; foreach ( $ all as $ ns => $ directives ) { $ ret .= $ this -> renderNamespace ( $ ns , $ directives ) ; } if ( $ render_controls ) { $ ret .= $ this -> start ( 'tbody' ) ; $ ret .= $ this -> start ( 'tr' ) ; $ ret .= $ this -> start ( 'td' , array ( 'colspan' => 2 , 'class' => 'controls' ) ) ; $ ret .= $ this -> elementEmpty ( 'input' , array ( 'type' => 'submit' , 'value' => 'Submit' ) ) ; $ ret .= '[<a href="?">Reset</a>]' ; $ ret .= $ this -> end ( 'td' ) ; $ ret .= $ this -> end ( 'tr' ) ; $ ret .= $ this -> end ( 'tbody' ) ; } $ ret .= $ this -> end ( 'table' ) ; return $ ret ; }
docstring: Returns HTML output for a configuration form
  @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array
  where [0] has an HTML namespace and [1] is being rendered.
  @param array|bool $allowed Optional namespace(s) and directives to restrict form to.
  @param bool $render_controls
  @return string
docstring_tokens: Returns HTML output for a configuration form