diff --git a/src/blocks/ImageTextBlock.php b/src/blocks/ImageTextBlock.php index a0efdf4..3193888 100644 --- a/src/blocks/ImageTextBlock.php +++ b/src/blocks/ImageTextBlock.php @@ -77,6 +77,7 @@ public function config() ], ['var' => 'btnLabel', 'label' => Module::t('block_image_text_btnlabel_label'), 'type' => 'zaa-text'], ['var' => 'btnHref', 'label' => Module::t('block_image_text_btnhref_label'), 'type' => 'zaa-text'], + ['var' => 'btnClass', 'label' => Module::t('block_image_text_btnclass_label'), 'type' => 'zaa-text'], ['var' => 'targetBlank', 'label' => Module::t('block_image_text_targetblank_label'), 'type' => 'zaa-checkbox'], ['var' => 'width', 'label' => Module::t('block_image_fixed_width'), 'type' => 'zaa-text'], ['var' => 'height', 'label' => Module::t('block_image_fixed_height'), 'type' => 'zaa-text'], @@ -110,6 +111,13 @@ public function getText() return empty($text) ? null : '
' . nl2br($text) . '
'; } + public function getImagePosition() + { + return ($this->getVarValue('imagePosition', 'left') == 'left') + ? "margin-right:{$this->getCfgValue('margin', '20px')}" + : "margin-left:{$this->getCfgValue('margin', '20px')}"; + } + /** * @inheritdoc */ @@ -118,6 +126,7 @@ public function extraVars() return [ 'image' => BlockHelper::imageUpload($this->getVarValue('imageId')), 'text' => $this->getText(), + 'imagePosition' => $this->getImagePosition(), ]; } diff --git a/src/messages/de/bootstrap3.php b/src/messages/de/bootstrap3.php index 2c10412..0c80223 100644 --- a/src/messages/de/bootstrap3.php +++ b/src/messages/de/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'Die iFrame URL von Snazzy Maps, überschreibt jegliche andere Konfiguration und zeigt die Snazzy Map an.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS-Klasse', ]; diff --git a/src/messages/el/bootstrap3.php b/src/messages/el/bootstrap3.php index 094fc27..00a235a 100644 --- a/src/messages/el/bootstrap3.php +++ b/src/messages/el/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'The Snazzy Maps iFrame URL, will overwrite all other setings and display the configured Snazzy Map.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/en/bootstrap3.php b/src/messages/en/bootstrap3.php index ae57397..d9daf63 100644 --- a/src/messages/en/bootstrap3.php +++ b/src/messages/en/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'The Snazzy Maps iFrame URL, will overwrite all other settings and display the configured Snazzy Map.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/es/bootstrap3.php b/src/messages/es/bootstrap3.php index 00be2aa..0c4a832 100644 --- a/src/messages/es/bootstrap3.php +++ b/src/messages/es/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'The Snazzy Maps iFrame URL, will overwrite all other setings and display the configured Snazzy Map.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/fa/bootstrap3.php b/src/messages/fa/bootstrap3.php index 0a04606..f11f33c 100644 --- a/src/messages/fa/bootstrap3.php +++ b/src/messages/fa/bootstrap3.php @@ -101,4 +101,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'The Snazzy Maps iFrame URL, will overwrite all other setings and display the configured Snazzy Map.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/fr/bootstrap3.php b/src/messages/fr/bootstrap3.php index 9549f5c..4992fb4 100644 --- a/src/messages/fr/bootstrap3.php +++ b/src/messages/fr/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'URL de l\'iframe Snazzy Maps', 'block_map_snazzymapsUrl_help' => 'L\'URL de l\'iframe Snazzy Maps écrasera tous les autres paramètres et affichera la Snazzy Map telle que configurée.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/it/bootstrap3.php b/src/messages/it/bootstrap3.php index 0bfca92..907723c 100644 --- a/src/messages/it/bootstrap3.php +++ b/src/messages/it/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'The Snazzy Maps iFrame URL, will overwrite all other setings and display the configured Snazzy Map.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/nl/bootstrap3.php b/src/messages/nl/bootstrap3.php index 16d9d92..ae81f69 100644 --- a/src/messages/nl/bootstrap3.php +++ b/src/messages/nl/bootstrap3.php @@ -100,4 +100,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'De iRoom- URL van Snazzy Maps overschrijft alle andere instellingen en geeft de geconfigureerde Snazzy Map weer.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/pt/bootstrap3.php b/src/messages/pt/bootstrap3.php index ef7a144..b2c8cc6 100644 --- a/src/messages/pt/bootstrap3.php +++ b/src/messages/pt/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'The Snazzy Maps iFrame URL, will overwrite all other setings and display the configured Snazzy Map.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/ru/bootstrap3.php b/src/messages/ru/bootstrap3.php index 2438302..696186c 100644 --- a/src/messages/ru/bootstrap3.php +++ b/src/messages/ru/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'The Snazzy Maps iFrame URL, will overwrite all other setings and display the configured Snazzy Map.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/tr/bootstrap3.php b/src/messages/tr/bootstrap3.php index 708f204..24d6ef3 100644 --- a/src/messages/tr/bootstrap3.php +++ b/src/messages/tr/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Haritaları iFrame URL', 'block_map_snazzymapsUrl_help' => 'Snazzy Haritaları iFrame URL\'si, diğer tüm ayarların üzerine yazacak ve yapılandırılmış Snazzy haritaları görüntüleyecek.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/ua/bootstrap3.php b/src/messages/ua/bootstrap3.php index ea71ee7..c588a0d 100644 --- a/src/messages/ua/bootstrap3.php +++ b/src/messages/ua/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'The Snazzy Maps iFrame URL, will overwrite all other setings and display the configured Snazzy Map.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/messages/vi/bootstrap3.php b/src/messages/vi/bootstrap3.php index 3fa7ea0..27b5a27 100644 --- a/src/messages/vi/bootstrap3.php +++ b/src/messages/vi/bootstrap3.php @@ -102,4 +102,7 @@ // 1.0.2 'block_map_snazzymapsUrl_label' => 'Snazzy Maps iFrame URL', 'block_map_snazzymapsUrl_help' => 'The Snazzy Maps iFrame URL, will overwrite all other setings and display the configured Snazzy Map.', + + // 1.0.4 + 'block_image_text_btnclass_label' => 'Button CSS class', ]; diff --git a/src/views/blocks/ImageTextBlock.php b/src/views/blocks/ImageTextBlock.php index 2a40d20..fe561da 100644 --- a/src/views/blocks/ImageTextBlock.php +++ b/src/views/blocks/ImageTextBlock.php @@ -4,27 +4,34 @@ /** * @var $this \luya\cms\base\PhpBlockView */ + +$image = $this->extraValue('image'); +$text = $this->extraValue('text'); ?> -extraValue('image') && $this->extraValue('text')): $imageCaption = $this->extraValue('image')['caption'];?> -