| 148 |
// Remove the "**ALL**" option if it exists: |
// Remove the "**ALL**" option if it exists: |
| 149 |
if (isset($these_options['**ALL**'])) unset($these_options['**ALL**']); |
if (isset($these_options['**ALL**'])) unset($these_options['**ALL**']); |
| 150 |
|
|
| 151 |
// Taxonomy options will be an array of objects handled here: |
// Additional processing needed for taxonomy terms - they are an array of objects so need to be converted... |
| 152 |
// To do: Make sure everything works for multi-language and multi-level taxonomy lists too |
// NB: $these_options[0] can be '- None -' with 'optional' taxonomy terms, so we test [0] and [1] |
| 153 |
if (is_object($these_options[0])) { |
if (is_object($these_options[1]) || is_object($these_options[0])) { |
|
// This will recreate them as a typical form option array... |
|
| 154 |
$newoptions = array(); |
$newoptions = array(); |
| 155 |
foreach ($these_options as $option_id => $option_obj) { |
foreach ($these_options as $option_id => $option_obj) { |
|
// $option_obj example: stdClass Object ( [option] => Array ( [60] => English ) |
|
| 156 |
foreach ($option_obj->option as $num => $val) { |
foreach ($option_obj->option as $num => $val) { |
| 157 |
$newoptions[$num] = $val; |
$newoptions[$num] = $val; |
| 158 |
} |
} |