Now takes notice of editable flag.

git-svn-id: http://svn.automattic.com/wordpress/trunk@209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
mikelittle 2003-06-11 23:19:21 +00:00
parent ebd50d4d9e
commit 5a22dc63d2
1 changed files with 5 additions and 3 deletions

View File

@ -10,6 +10,8 @@ require_once('../b2config.php');
function get_option_widget($option_result, $editable, $between) function get_option_widget($option_result, $editable, $between)
{ {
global $wpdb, $tableoptionvalues; global $wpdb, $tableoptionvalues;
$disabled = $editable ? '' : 'disabled';
switch ($option_result->option_type) switch ($option_result->option_type)
{ {
case 1: // integer case 1: // integer
@ -22,7 +24,7 @@ function get_option_widget($option_result, $editable, $between)
$width = $option_result->option_width; $width = $option_result->option_width;
return <<<TEXTINPUT return <<<TEXTINPUT
<label for="$option_result->option_name">$option_result->option_name</label>$between <label for="$option_result->option_name">$option_result->option_name</label>$between
<input type="text" name="$option_result->option_name" size="$width" value="$option_result->option_value" /> <input type="text" name="$option_result->option_name" size="$width" value="$option_result->option_value" $disabled/>
TEXTINPUT; TEXTINPUT;
//break; //break;
} }
@ -32,7 +34,7 @@ TEXTINPUT;
$false_selected = ($option_result->option_value == 'false') ? 'selected' : ''; $false_selected = ($option_result->option_value == 'false') ? 'selected' : '';
return <<<BOOLSELECT return <<<BOOLSELECT
<label for="$option_result->option_name">$option_result->option_name</label>$between <label for="$option_result->option_name">$option_result->option_name</label>$between
<select name="$option_result->option_name"> <select name="$option_result->option_name" $disabled>
<option $true_selected>true</option> <option $true_selected>true</option>
<option $false_selected>false</option> <option $false_selected>false</option>
</select> </select>
@ -43,7 +45,7 @@ BOOLSELECT;
{ {
$ret = <<<SELECT $ret = <<<SELECT
<label for="$option_result->option_name">$option_result->option_name</label>$between <label for="$option_result->option_name">$option_result->option_name</label>$between
<select name="$option_result->option_name"> <select name="$option_result->option_name" $disabled>
SELECT; SELECT;
$select = $wpdb->get_results("SELECT optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min " $select = $wpdb->get_results("SELECT optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min "