openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 2110059b0488b5a69e5cfe81117887023d381f49
parent 2ef5807288ad0b440514573cdd45afc187f85000
Author: Jan Dankert <devnull@localhost>
Date:   Thu, 23 Aug 2018 00:54:05 +0200

Bugfix für Radiobox, Bugfix Anzeige Element-Formate

Diffstat:
modules/cms-core/action/ElementAction.class.php | 15+++------------
modules/configuration/Configuration.class.php | 4++--
modules/template-engine/components/html/radiobox/Radiobox.class.php | 2+-
modules/template-engine/components/html/radiobox/component-radio-box.php | 3++-
4 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/modules/cms-core/action/ElementAction.class.php b/modules/cms-core/action/ElementAction.class.php @@ -376,25 +376,16 @@ class ElementAction extends Action case 'format': - if ( !$this->element->format ) - $format = 'none'; - elseif ( $this->element->wiki && !$this->element->html ) - $format = 'wiki'; - elseif ( !$this->element->wiki && $this->element->html ) - $format = 'html'; - elseif ( $this->element->wiki && $this->element->html ) - $format = 'wiki,html'; - - $this->setTemplateVar('format', $format ); + $this->setTemplateVar('format', $this->element->format ); $formats = Element::getAvailableFormats(); // Für einfache Textelemente gibt es keinen HTML-Editor - if ( $this->element->typeid == ELEMENT_TYPE_LONGTEXT ) + if ( $this->element->typeid != ELEMENT_TYPE_LONGTEXT ) unset( $formats[ ELEMENT_FORMAT_HTML ] ); foreach( $formats as $t=>$v ) - $formats[$t] = array('lang'=>'EL_PROP_'.$v); + $formats[$t] = array('lang'=>'EL_PROP_FORMAT_'.$v); $this->setTemplateVar('formatlist', $formats); break; diff --git a/modules/configuration/Configuration.class.php b/modules/configuration/Configuration.class.php @@ -80,12 +80,12 @@ class Config } - public function is( $name ) + public function is( $name, $default = false ) { if ( isset( $this->config[ $name ] ) ) return (bool) $this->config[$name]; else - return false; + return $default; } diff --git a/modules/template-engine/components/html/radiobox/Radiobox.class.php b/modules/template-engine/components/html/radiobox/Radiobox.class.php @@ -26,7 +26,7 @@ class RadioboxComponent extends Component else $value = '$'.$this->varname($this->name); - echo '<?php component_radio_box('.$this->value($this->name).',$'.$this->varname($this->list).','.$value.') ?>'; + echo '<?php component_radio_box('.$value.',$'.$this->varname($this->list).','.$value.') ?>'; } } diff --git a/modules/template-engine/components/html/radiobox/component-radio-box.php b/modules/template-engine/components/html/radiobox/component-radio-box.php @@ -12,7 +12,8 @@ function component_radio_box($name, $values, $value) { if (is_array($box_value) && isset($box_value['lang'])) { - $box_value = '<?php echo lang(\''.$box_value['lang'].'\') ?>'; + //$box_value = '<?php echo lang(\''.$box_value['lang'].'\') ? >'; + $box_value = lang($box_value['lang']); $box_title = ''; } elseif (is_array($box_value))