From ee3f0581df140a314246ebb99be04881d5b0885e Mon Sep 17 00:00:00 2001 From: Christian Barkowsky Date: Thu, 11 Dec 2014 14:18:18 +0100 Subject: [PATCH] Bugfix --- forms/FormCheckBoxExtended.php | 35 ++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/forms/FormCheckBoxExtended.php b/forms/FormCheckBoxExtended.php index 080dfdb..bf1bd35 100644 --- a/forms/FormCheckBoxExtended.php +++ b/forms/FormCheckBoxExtended.php @@ -19,8 +19,10 @@ class FormCheckBoxExtended extends \Widget protected $blnSubmitInput = true; + protected $strTemplate = 'form_widget'; + protected $arrOptions = array(); @@ -128,7 +130,7 @@ public function generate() { $evp_link_target = LINK_NEW_WINDOW_BLUR; } - + // Embeded link $evp_link_embed = explode('%s', $this->checkbox_extended_embed); @@ -147,7 +149,16 @@ public function generate() { $href = $this->checkbox_extended_url; } - + + if (!strlen($this->checkbox_extended_url) && !strlen($this->checkbox_extended_singleSRC)) + { + $strCheckboxLink = sprintf('%s%s%s', $evp_link_embed[0], $this->checkbox_extended_title, $evp_link_embed[1]); + } + else + { + $strCheckboxLink = sprintf('%s%s%s', $evp_link_embed[0], $href, $this->checkbox_extended_title, $evp_link_target, $this->checkbox_extended_title, $evp_link_embed[1]); + } + $strOptions = sprintf(' ', $this->strName, $this->strId . '_0', @@ -156,18 +167,9 @@ public function generate() $this->getAttributes(), $this->strId . '_0', $this->strId . '_0', - sprintf('%s%s%s', - $evp_link_embed[0], - $href, - $this->checkbox_extended_title, - $evp_link_target, - $this->checkbox_extended_title, - $evp_link_embed[1])) . $this->addSubmit(); - - return sprintf('
%s
', - $this->strId, - (strlen($this->strClass) ? ' ' . $this->strClass : ''), - $strOptions) . $this->addSubmit(); + $strCheckboxLink) . $this->addSubmit(); + + return sprintf('
%s
', $this->strId, (strlen($this->strClass) ? ' ' . $this->strClass : ''), $strOptions) . $this->addSubmit(); } @@ -176,6 +178,11 @@ public function generate() */ private function buildDownload($singleSRC) { + if (!strlen($singleSRC)) + { + return ''; + } + $objFile = \FilesModel::findByUuid($singleSRC); if ($objFile === null)