mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
printAttributeEditField() takes a second parameter the attribute
this was the attribute value
This commit is contained in:
parent
444d3a8b01
commit
7d7a21fc9e
|
@ -1018,7 +1018,7 @@ function folderSelected<?php echo $form ?>(id, name) {
|
|||
<?php
|
||||
} /* }}} */
|
||||
|
||||
function printAttributeEditField($attrdef, $objvalue, $fieldname='attributes') { /* {{{ */
|
||||
function printAttributeEditField($attrdef, $attribute, $fieldname='attributes') { /* {{{ */
|
||||
if($valueset = $attrdef->getValueSetAsArray()) {
|
||||
echo "<select name=\"".$fieldname."[".$attrdef->getId()."]";
|
||||
if($attrdef->getMultipleValues()) {
|
||||
|
@ -1030,6 +1030,7 @@ function folderSelected<?php echo $form ?>(id, name) {
|
|||
if(!$attrdef->getMultipleValues()) {
|
||||
echo "<option value=\"\"></option>";
|
||||
}
|
||||
$objvalue = $attribute ? $attribute->getValueAsArray() : array();
|
||||
foreach($valueset as $value) {
|
||||
if($value) {
|
||||
echo "<option value=\"".htmlspecialchars($value)."\"";
|
||||
|
@ -1042,7 +1043,7 @@ function folderSelected<?php echo $form ?>(id, name) {
|
|||
}
|
||||
echo "</select>";
|
||||
} else {
|
||||
echo "<input type=\"text\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".htmlspecialchars($objvalue)."\" />";
|
||||
echo "<input type=\"text\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".($attribute ? htmlspecialchars($attribute->getValue()) : '')."\" />";
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user