Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

Value Checkbox mit CSS Klasse #343

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion classes/value/class.xform.checkbox.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function enterObject()

function getDescription()
{
return 'checkbox -> Beispiel: checkbox|name|label|Values(0,1)|default clicked (0/1)|[no_db]';
return 'checkbox -> Beispiel: checkbox|name|label|Values(0,1)|default clicked (0/1)|[no_db]|cssclassname';
}

function getDefinitions()
Expand All @@ -68,6 +68,7 @@ function getDefinitions()
'values' => array( 'type' => 'text', 'label' => 'Werte (0,1) (nicht angeklickt,angeklickt)', 'default' => '0,1'),
'default' => array( 'type' => 'boolean', 'label' => 'Defaultstatus', 'default' => 0),
'no_db' => array( 'type' => 'no_db', 'label' => 'Datenbank', 'default' => 0),
'css_class' => array('type' => 'text', 'label' => 'cssclassname'),
),
'description' => 'Eine Checkbox mit fester Definition.',
'dbtype' => 'varchar(255)',
Expand Down
2 changes: 1 addition & 1 deletion templates/default/value.checkbox.tpl.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php $value = isset($value) ? $value : 1 ?>
<p class="formcheckbox formlabel-<?php echo $this->getName() ?>" id="<?php echo $this->getHTMLId() ?>">
<input type="checkbox" class="checkbox<?php echo $this->getWarningClass() ?>" name="<?php echo $this->getFieldName() ?>" id="<?php echo $this->getFieldId() ?>" value="<?php echo $value ?>"<?php echo $this->getValue() == $value ? ' checked="checked"' : '' ?> />
<input type="checkbox" class="checkbox<?php echo $this->getWarningClass(),' ', $this->getElement("css_class") ?>" name="<?php echo $this->getFieldName() ?>" id="<?php echo $this->getFieldId() ?>" value="<?php echo $value ?>"<?php echo $this->getValue() == $value ? ' checked="checked"' : '' ?> />
<label class="checkbox <?php echo $this->getWarningClass() ?>" for="<?php echo $this->getFieldId() ?>" ><?php echo $this->getLabel() ?></label>
</p>