From f64c51778b5d4347da0f2925a7a67e48ae22de47 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 5 Oct 2008 16:56:37 +0000 Subject: [PATCH] "nextmatch filter- or sort-headers can now made to nextmatch-headers (label only), by making them readonly" --- etemplate/inc/class.nextmatch_widget.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etemplate/inc/class.nextmatch_widget.inc.php b/etemplate/inc/class.nextmatch_widget.inc.php index 8a65248b2e..c86b6e85e2 100644 --- a/etemplate/inc/class.nextmatch_widget.inc.php +++ b/etemplate/inc/class.nextmatch_widget.inc.php @@ -189,13 +189,13 @@ class nextmatch_widget case 'nextmatch-sortheader': // Option: default sort: ASC(default) or DESC $extension_data['default_sort'] = $cell['size']&&preg_match('/^(ASC|DESC)/i',$cell['size'],$matches) ? strtoupper($matches[1]) : 'ASC'; - $cell['type'] = 'button'; + $cell['type'] = $cell['readonly'] ? 'label' : 'button'; $cell['onchange'] = True; if (!$cell['help']) { $cell['help'] = 'click to order after that criteria'; } - if (self::last_part($name) == $nm_global['order']) // we're the active column + if (self::last_part($name) == $nm_global['order'] && !$cell['readonly']) // we're the active column { $sorting = $cell; unset($sorting['align']); @@ -531,12 +531,14 @@ class nextmatch_widget 'sel_options' => $field['values'], 'size' => $field['label'], 'no_lang' => True, + 'readonly' => $cell['readonly'], )); } else { $header =& etemplate::empty_cell('nextmatch-sortheader',self::CF_PREFIX.$name,array( 'label' => $field['label'], + 'readonly' => $cell['readonly'], )); } etemplate::add_child($cell,$header);