/** * Renders the contents of the the select tag, option tags being built by * the option handler. Called from with a compiled template render function. * * @return void * @access protected */ function render_contents() { parent::render_contents(); $values = $this->get_value(); if (!is_array($values)) { $values = array(reset($this->choice_list)); } else { $found = false; foreach ($values as $value) { if (array_key_exists($value, $this->choice_list)) { $found = true; break; } } if (!$found) { $values = array(reset($this->choice_list)); } } if (empty($this->option_renderer)) { $this->option_renderer = new option_renderer(); } foreach ($this->choice_list as $key => $contents) { $this->option_renderer->render_attribute($key, $contents, in_array($key, $values)); } }
function _process_name_attribute($value) { return parent :: _process_name_attribute($value) . '[]'; }