Commit 333e47ac authored by Dries's avatar Dries
Browse files

- Made sure the selection boxes don't grow too long.  Requisted by kika,
  patch by Marco.
parent 2c77a388
...@@ -513,8 +513,7 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti ...@@ -513,8 +513,7 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti
$select .= "<option value=\"$key\"". (is_array($value) ? (in_array($key, $value) ? " selected=\"selected\"" : "") : ($key == $value ? " selected=\"selected\"" : "")) .">". check_form($choice) ."</option>"; $select .= "<option value=\"$key\"". (is_array($value) ? (in_array($key, $value) ? " selected=\"selected\"" : "") : ($key == $value ? " selected=\"selected\"" : "")) .">". check_form($choice) ."</option>";
} }
// min 8, possibly options/3 (set max too?) $size = min(12, count($options));
$size = max(8, round(count($options)) / 3);
return form_item($title, "<select name=\"edit[$name][]\"". ($multiple ? " multiple size=\"$size\"" : "") . ($extra ? " $extra" : "") .">$select</select>", $description); return form_item($title, "<select name=\"edit[$name][]\"". ($multiple ? " multiple size=\"$size\"" : "") . ($extra ? " $extra" : "") .">$select</select>", $description);
} }
......
...@@ -513,8 +513,7 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti ...@@ -513,8 +513,7 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti
$select .= "<option value=\"$key\"". (is_array($value) ? (in_array($key, $value) ? " selected=\"selected\"" : "") : ($key == $value ? " selected=\"selected\"" : "")) .">". check_form($choice) ."</option>"; $select .= "<option value=\"$key\"". (is_array($value) ? (in_array($key, $value) ? " selected=\"selected\"" : "") : ($key == $value ? " selected=\"selected\"" : "")) .">". check_form($choice) ."</option>";
} }
// min 8, possibly options/3 (set max too?) $size = min(12, count($options));
$size = max(8, round(count($options)) / 3);
return form_item($title, "<select name=\"edit[$name][]\"". ($multiple ? " multiple size=\"$size\"" : "") . ($extra ? " $extra" : "") .">$select</select>", $description); return form_item($title, "<select name=\"edit[$name][]\"". ($multiple ? " multiple size=\"$size\"" : "") . ($extra ? " $extra" : "") .">$select</select>", $description);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment