options = &EL_Options::get_instance(); $this->options->load_options_helptexts(); } public function show_option_form($section) { $out = '
'; ob_start(); settings_fields('el_'.$section); $out .= ob_get_contents(); ob_end_clean(); $out .= $this->show_option_table($section); ob_start(); submit_button(); $out .= ob_get_contents(); ob_end_clean(); $out .='
'; return $out; } public function show_option_table($section) { $out = '
'; foreach($this->options->options as $oname => $o) { if($o['section'] == $section) { $out .= ' '; } } $out .= '
'; if($o['label'] != '') { $out .= ''; } $out .= ' '; switch($o['type']) { case 'checkbox': $out .= $this->show_checkbox($oname, $this->options->get($oname), $o['caption']); break; case 'dropdown': $out .= $this->show_dropdown($oname, $this->options->get($oname), $o['caption']); break; case 'radio': $out .= $this->show_radio($oname, $this->options->get($oname), $o['caption']); break; case 'text': $out .= $this->show_text($oname, $this->options->get($oname)); break; case 'textarea': $out .= $this->show_textarea($oname, $this->options->get($oname)); break; case 'file-upload': $out .= $this->show_file_upload($oname, $o['maxsize']); } $out .= ' '.$o['desc'].'
'; return $out; } public function show_checkbox($name, $value, $caption, $disabled=false) { $out = ' '; return $out; } public function show_dropdown($name, $selected, $value_array, $class_array=null, $disabled=false) { $out = ' '; return $out; } public function show_radio($name, $selected, $value_array, $disabled=false) { $out = '
'; foreach($value_array as $key => $value) { $checked = ($selected === $key) ? 'checked="checked" ' : ''; $out .= '
'; } $out .= '
'; return $out; } public function show_text($name, $value, $disabled=false) { $out = ' get_disabled_text($disabled).' />'; return $out; } public function show_textarea($name, $value, $disabled=false) { $out = ' '; return $out; } public function show_file_upload($name, $max_size, $disabled=false) { $out = ' '; return $out; } public function get_disabled_text($disabled=false) { return $disabled ? ' disabled="disabled"' : ''; } } ?>