From 7b06fee1801418f0ee77d4527150b63e51483705 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Mon, 20 Jul 2015 16:34:50 -0500 Subject: [PATCH] search: Fixup placement of description expansions --- include/class.forms.php | 26 +++++++++++++------------- include/class.search.php | 3 ++- include/class.staff.php | 1 - 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/class.forms.php b/include/class.forms.php index d472d3de3..1d3d822e2 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -3249,8 +3249,10 @@ class BoxChoicesWidget extends Widget { $this->value = $this->field->get('default'); $config = $this->field->getConfiguration(); $type = $config['multiple'] ? 'checkbox' : 'radio'; + + $classes = array('checkbox'); if (isset($config['classes'])) - $classes = 'class="'.$config['classes'].'"'; + $classes = array_merge($classes, (array) $config['classes']); foreach ($choices as $k => $v) { if (is_array($v)) { @@ -3260,17 +3262,16 @@ class BoxChoicesWidget extends Widget { } $id = sprintf("%s-%s", $this->id, $uid++); ?> - <label <?php echo $classes; ?> - for="<?php echo $id; ?>" style="display:block;"> - <input id="<?php echo $id; ?>" style="vertical-align:top;" - type="<?php echo $type; ?>" name="<?php echo $this->name; ?>[]" <?php + <label class="<?php echo implode(' ', $classes); ?>" + for="<?php echo $id; ?>"> + <input id="<?php echo $id; ?>" type="<?php echo $type; ?>" + name="<?php echo $this->name; ?>[]" <?php if ($this->value[$k]) echo 'checked="checked"'; ?> value="<?php echo Format::htmlchars($k); ?>"/> <?php - if ($v) { ?> - <em style="display:inline-block;vertical-align:baseline;width:90%;width:calc(100% - 25px);"><?php - echo Format::viewableImages($v); ?></em> -<?php } ?> + if ($v) { + echo Format::viewableImages($v); + } ?> </label> <?php } } @@ -3352,11 +3353,11 @@ class CheckboxWidget extends Widget { $config = $this->field->getConfiguration(); if (!isset($this->value)) $this->value = $this->field->get('default'); + $classes = array('checkbox'); if (isset($config['classes'])) - $classes = 'class="'.$config['classes'].'"'; + $classes = array_merge($classes, (array) $config['classes']); ?> - <div <?php echo implode(' ', array_filter(array($classes))); ?>> - <label class="checkbox"> + <label class="<?php echo implode(' ', $classes); ?>"> <input id="<?php echo $this->id; ?>" type="checkbox" name="<?php echo $this->name; ?>[]" <?php if ($this->value) echo 'checked="checked"'; ?> value="<?php @@ -3366,7 +3367,6 @@ class CheckboxWidget extends Widget { echo Format::viewableImages($config['desc']); } ?> </label> - </div> <?php } diff --git a/include/class.search.php b/include/class.search.php index f1de81937..b0717c477 100644 --- a/include/class.search.php +++ b/include/class.search.php @@ -772,7 +772,8 @@ class SavedSearch extends VerySimpleModel { $pieces["{$name}+search"] = new BooleanField(array( 'id' => $baseId + 50000, 'configuration' => array( - 'desc' => $field->get('label'), + 'desc' => $field->getLocal('label'), + 'classes' => 'inline', ), )); $methods = $field->getSearchMethods(); diff --git a/include/class.staff.php b/include/class.staff.php index e1c8b1469..a40ea046a 100644 --- a/include/class.staff.php +++ b/include/class.staff.php @@ -1182,7 +1182,6 @@ extends AbstractForm { 'widget' => 'TabbedBoxChoicesWidget', 'configuration' => array( 'multiple' => true, - 'classes' => 'vertical-pad', ), )), ); -- GitLab