Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2024-04-03 09:21:59 +02:00
commit d36636be55
2 changed files with 25 additions and 3 deletions

View File

@ -1323,9 +1323,29 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
case 'input':
default:
switch($value['type']) {
default:
if(!empty($value['type']) && $value['type'] == 'checkbox' && isset($value['default']) && !empty($value['name']))
case 'checkbox':
if(isset($value['default']) && !empty($value['name']))
echo '<input type="hidden" name="'.$value['name'].'" value="'.$value['default'].'" />';
echo '<label class="checkbox"><input'.
(!empty($value['type']) ? ' type="'.$value['type'].'"' : '').
(!empty($value['id']) ? ' id="'.$value['id'].'"' : '').
(!empty($value['name']) ? ' name="'.$value['name'].'"' : '').
(!empty($value['class']) ? ' class="'.$value['class'].'"' : '').
((isset($value['value']) && is_string($value['value'])) || !empty($value['value']) ? ' value="'.$value['value'].'"' : '').
(!empty($value['placeholder']) ? ' placeholder="'.$value['placeholder'].'"' : '').
(!empty($value['autocomplete']) ? ' autocomplete="'.$value['autocomplete'].'"' : '').
(isset($value['min']) ? ' min="'.$value['min'].'"' : '').
(!empty($value['checked']) ? ' checked' : '').
(!empty($value['required']) ? ' required="required"' : '');
if(!empty($value['attributes']) && is_array($value['attributes']))
foreach($value['attributes'] as $a)
echo ' '.$a[0].'="'.$a[1].'"';
echo "/>";
if(!empty($value['label']))
echo $value['label'];
echo "</label>";
break;
default:
if(!empty($value['addon']))
echo "<span class=\"input-append\">";
echo '<input'.
@ -2056,7 +2076,7 @@ $(document).ready(function() {
case SeedDMS_Core_AttributeDefinition::type_boolean:
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
$content .= "<input type=\"hidden\" name=\"".$attr_name."\" value=\"\" />";
$content .= "<input type=\"checkbox\" id=\"".$attr_id."\" name=\"".$attr_name."\" value=\"1\" ".($objvalue ? 'checked' : '')." />";
$content .= "<label class=\"checkbox\"><input type=\"checkbox\" id=\"".$attr_id."\" name=\"".$attr_name."\" value=\"1\" ".($objvalue ? 'checked' : '')." /></label>";
break;
case SeedDMS_Core_AttributeDefinition::type_date:
$objvalue = $attribute ? getReadableDate((is_object($attribute) ? $attribute->getValue() : $attribute)) : '';

View File

@ -1253,6 +1253,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
foreach($value['attributes'] as $a)
echo ' '.$a[0].'="'.$a[1].'"';
echo ">";
echo '<label class="form-check-label" '.($value['id'] ?? 'for="'.$value['id'].'"').'>'.($value['label'] ?? $value['label']).'</label>';
echo "</div>";
break;
default:
@ -2020,6 +2021,7 @@ $(document).ready(function() {
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
$content .= "<input type=\"hidden\" name=\"".$attr_name."\" value=\"\" />";
$content .= "<input type=\"checkbox\" id=\"".$attr_id."\" name=\"".$attr_name."\" value=\"1\" ".($objvalue ? 'checked' : '')." />";
$content .= '<label class="form-check-label" for="'.$attr_id.'"></label>';
break;
case SeedDMS_Core_AttributeDefinition::type_date:
$objvalue = $attribute ? getReadableDate((is_object($attribute) ? $attribute->getValue() : $attribute)) : '';