aboutsummaryrefslogtreecommitdiff
path: root/lib/models/resources/ResourcePropertyDefinition.class.php
diff options
context:
space:
mode:
authorMichaela Brückner <brueckner@data-quest.de>2023-05-25 14:05:36 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2023-05-25 14:05:36 +0000
commit04ad36e3a9845a401d95d35880deda5ea390e9dd (patch)
treea7db552eb2883ec973575ffb535f9b99deb1cf73 /lib/models/resources/ResourcePropertyDefinition.class.php
parent6254b44ac006c19bc571d3c411784fef6829a9aa (diff)
closes #1327biest-1310
Closes #1327 Merge request studip/studip!1147
Diffstat (limited to 'lib/models/resources/ResourcePropertyDefinition.class.php')
-rw-r--r--lib/models/resources/ResourcePropertyDefinition.class.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/models/resources/ResourcePropertyDefinition.class.php b/lib/models/resources/ResourcePropertyDefinition.class.php
index 37fa89b..c3a84d6 100644
--- a/lib/models/resources/ResourcePropertyDefinition.class.php
+++ b/lib/models/resources/ResourcePropertyDefinition.class.php
@@ -140,7 +140,8 @@ class ResourcePropertyDefinition extends SimpleORMap
$value = '',
$special_name = '',
$with_label = false,
- $allow_boolean_false = true
+ $allow_boolean_false = true,
+ $disabled = false
)
{
$label_html_classes = '';
@@ -155,16 +156,18 @@ class ResourcePropertyDefinition extends SimpleORMap
//whether a false state shall be selectable or not.
if ($allow_boolean_false) {
$input_html = sprintf(
- '<input type="hidden" name="%1$s" value="0" %2$s>'
+ '<input type="hidden" name="%1$s" value="0" %2$s %3$s>'
. '<input type="checkbox" name="%1$s" value="1" %2$s>',
htmlReady($input_name),
- $value ? 'checked="checked"' : ''
+ $value ? 'checked' : '',
+ $disabled ? 'disabled' : ''
);
} else {
$input_html = sprintf(
- '<input type="checkbox" name="%1$s" value="1" %2$s>',
+ '<input type="checkbox" name="%1$s" value="1" %2$s %3$s>',
htmlReady($input_name),
- $value ? 'checked="checked"' : ''
+ $value ? 'checked' : '',
+ $disabled ? 'disabled' : ''
);
}
if ($with_label) {
@@ -254,7 +257,7 @@ class ResourcePropertyDefinition extends SimpleORMap
}
if ($with_label) {
return sprintf(
- '<label %1$s>%5$s<input type="%2$s" name="%3$s" value="%4$s"></label>',
+ '<label %1$s>%5$s<input type="%2$s" name="%3$s" value="%4$s" %5$s></label>',
(
$label_html_classes
? 'class="' . htmlReady($label_html_classes) . '"'
@@ -263,14 +266,16 @@ class ResourcePropertyDefinition extends SimpleORMap
$input_type,
htmlReady($input_name),
$value,
- htmlReady($this->__toString())
+ htmlReady($this->__toString()),
+ $disabled ? 'disabled' : ''
);
} else {
return sprintf(
- '<input type="%1$s" name="%2$s" value="%3$s">',
+ '<input type="%1$s" name="%2$s" value="%3$s" %4$s>',
$input_type,
htmlReady($input_name),
- $value
+ $value,
+ $disabled ? 'disabled' : ''
);
}
}