var $filterArray = array('reverse' =IMG_FILTER_NEG ATE,
'edge highlight' =IMG_FILTER_EDG EDETECT,
'emboss' =IMG_FILTER_EMB OSS,
'gaussian blur' =IMG_FILTER_GAU SSIAN_BLUR,
'blur' =IMG_FILTER_SEL ECTIVE_BLUR,
'sketchy' =IMG_FILTER_MEA N_REMOVAL);
[/PHP]
I am trying to generate an HTML dropdown from this array, however, when
I do, the value that should go in the OPTION tag literally becomes
this:
<option value="IMG_FILT ER_EMBOSS">embo ss</OPTION>Which is completely wrong; I want the actual constant IMG_FILTER_EMBO SS
instead, which should display as an integer within the OPTION tag.
How do I do this?
Code:
[PHP]
/**
* Generate a filter technique dropdown HTML with any additional
features to the array before display
*
* *NOTE* This method will be called outside of the $this->image
property having existence and thus will have to be used as a
placeholder to self-instantiate using $this->self
*
* @access public
* @param array $newFilterArray (optional)
* @return mixed HTML
*/
function &generateFilter Dropdown($newFi lterArray = '') { // STATIC
HTML STRING METHOD
if (!is_object($th is) || @!is_a($this,
'ImageFilterTec hniqueGenerator ')) {
$self =& new ImageFilterTech niqueGenerator( 'placeholder');
} else {
$self =& $this; // MAKE A LOCAL REFERENCE POINTER TO KEEP
CODE CONSISTENT
}
if (is_array($newF ilterArray) && @sizeof($newFil terArray) 0)
$self->setFilterArray ($newFilterArra y);
$filterArray = $self->getFilterArray ();
if (is_array($filt erArray) && @sizeof($filter Array) 0) {
$html = "<select multiple name=\"filter_t ech[]\" size=\"";
$html .= (sizeof($filter Array) 5) ? 5 : sizeof($filterA rray);
$html .= "\">\n";
foreach ($filterArray as $display =$filter) {
print_r("filter = $filter = ${$filter}<P>") ; // THIS PRODUCES
"filter = IMG_FILTER_EMBO SS =
$html .= " <option value=\"${$filt er}\"" .
$self->disp->preSelect(${$f ilter},
@array_search(a rray_values($fi lterArray), ${$filter})) . '>' .
str_replace('<' , '<', str_replace('\\ ', '',
$display)) . "</option>\n";
}
$html .= "</select>\n";
}
return $html;
}
[/PHP]
Thanx
Phil