From da45d04dd0688664febda81f453cd4dab01fea98 Mon Sep 17 00:00:00 2001
From: Basil Suter
Date: Mon, 27 Nov 2017 13:32:51 +0100
Subject: [PATCH] remove generic and boostrap3 blocks #1572
---
.../cms/src/frontend/blocks/AudioBlock.php | 80 ---------
modules/cms/src/frontend/blocks/DevBlock.php | 69 --------
.../cms/src/frontend/blocks/FileListBlock.php | 79 ---------
modules/cms/src/frontend/blocks/FormBlock.php | 159 ------------------
.../cms/src/frontend/blocks/ImageBlock.php | 141 ----------------
.../src/frontend/blocks/ImageTextBlock.php | 145 ----------------
.../cms/src/frontend/blocks/LayoutBlock.php | 105 ------------
modules/cms/src/frontend/blocks/LineBlock.php | 88 ----------
.../src/frontend/blocks/LinkButtonBlock.php | 92 ----------
modules/cms/src/frontend/blocks/ListBlock.php | 85 ----------
modules/cms/src/frontend/blocks/MapBlock.php | 118 -------------
.../cms/src/frontend/blocks/QuoteBlock.php | 70 --------
.../cms/src/frontend/blocks/SpacingBlock.php | 95 -----------
.../cms/src/frontend/blocks/TableBlock.php | 151 -----------------
modules/cms/src/frontend/blocks/TextBlock.php | 101 -----------
.../cms/src/frontend/blocks/TitleBlock.php | 81 ---------
.../cms/src/frontend/blocks/VideoBlock.php | 152 -----------------
.../cms/src/frontend/blocks/WysiwygBlock.php | 72 --------
.../frontend/commands/UpdaterController.php | 49 +++++-
.../src/frontend/views/blocks/AudioBlock.php | 6 -
.../src/frontend/views/blocks/DevBlock.php | 45 -----
.../frontend/views/blocks/FileListBlock.php | 12 --
.../src/frontend/views/blocks/FormBlock.php | 53 ------
.../src/frontend/views/blocks/ImageBlock.php | 28 ---
.../frontend/views/blocks/ImageTextBlock.php | 29 ----
.../src/frontend/views/blocks/LayoutBlock.php | 13 --
.../src/frontend/views/blocks/LineBlock.php | 6 -
.../frontend/views/blocks/LinkButtonBlock.php | 13 --
.../src/frontend/views/blocks/ListBlock.php | 12 --
.../src/frontend/views/blocks/MapBlock.php | 10 --
.../src/frontend/views/blocks/QuoteBlock.php | 6 -
.../frontend/views/blocks/SpacingBlock.php | 6 -
.../src/frontend/views/blocks/TableBlock.php | 29 ----
.../src/frontend/views/blocks/TextBlock.php | 10 --
.../src/frontend/views/blocks/TitleBlock.php | 10 --
.../src/frontend/views/blocks/VideoBlock.php | 16 --
.../frontend/views/blocks/WysiwygBlock.php | 6 -
.../src/frontend/blocks/AudioBlockTest.php | 21 ---
.../src/frontend/blocks/DevBlockTest.php | 15 --
.../src/frontend/blocks/FileListBlockTest.php | 32 ----
.../src/frontend/blocks/FormBlockTest.php | 26 ---
.../src/frontend/blocks/ImageBlockTest.php | 78 ---------
.../frontend/blocks/ImageTextBlockTest.php | 50 ------
.../src/frontend/blocks/LayoutBlockTest.php | 40 -----
.../src/frontend/blocks/LineBlockTest.php | 27 ---
.../frontend/blocks/LinkButtonBlockTest.php | 43 -----
.../src/frontend/blocks/ListBlockTest.php | 27 ---
.../src/frontend/blocks/MapBlockTest.php | 29 ----
.../src/frontend/blocks/QuoteBlockTest.php | 21 ---
.../src/frontend/blocks/SpacingBlockTest.php | 33 ----
.../src/frontend/blocks/TableBlockTest.php | 63 -------
.../src/frontend/blocks/TextBlockTest.php | 62 -------
.../src/frontend/blocks/TitleBlockTest.php | 36 ----
.../src/frontend/blocks/VideoBlockTest.php | 63 -------
.../src/frontend/blocks/WysiwygBlockTest.php | 21 ---
55 files changed, 42 insertions(+), 2887 deletions(-)
delete mode 100644 modules/cms/src/frontend/blocks/AudioBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/DevBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/FileListBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/FormBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/ImageBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/ImageTextBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/LayoutBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/LineBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/LinkButtonBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/ListBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/MapBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/QuoteBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/SpacingBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/TableBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/TextBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/TitleBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/VideoBlock.php
delete mode 100644 modules/cms/src/frontend/blocks/WysiwygBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/AudioBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/DevBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/FileListBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/FormBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/ImageBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/ImageTextBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/LayoutBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/LineBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/LinkButtonBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/ListBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/MapBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/QuoteBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/SpacingBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/TableBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/TextBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/TitleBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/VideoBlock.php
delete mode 100644 modules/cms/src/frontend/views/blocks/WysiwygBlock.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/AudioBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/DevBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/FileListBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/FormBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/ImageBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/ImageTextBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/LayoutBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/LineBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/LinkButtonBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/ListBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/MapBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/QuoteBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/SpacingBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/TableBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/TextBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/TitleBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/VideoBlockTest.php
delete mode 100644 modules/cms/tests/src/frontend/blocks/WysiwygBlockTest.php
diff --git a/modules/cms/src/frontend/blocks/AudioBlock.php b/modules/cms/src/frontend/blocks/AudioBlock.php
deleted file mode 100644
index 9a8e7ad59..000000000
--- a/modules/cms/src/frontend/blocks/AudioBlock.php
+++ /dev/null
@@ -1,80 +0,0 @@
-
- * @since 1.0.0
- */
-final class AudioBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_audio_name');
- }
-
- /**
- * @inheritdoc
- */
- public function blockGroup()
- {
- return MediaGroup::class;
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'volume_up';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'soundUrl', 'label' => 'Embeded Code', 'type' => 'zaa-text'],
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function getFieldHelp()
- {
- return [
- 'soundUrl' => Module::t('block_audio_help_soundurl'),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return 'Audio Block: {% if vars.soundUrl is empty %}'.Module::t('block_audio_admin_nourl').'{% else %}'.Module::t('block_audio_admin_hasurl').'{% endif %}
';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/DevBlock.php b/modules/cms/src/frontend/blocks/DevBlock.php
deleted file mode 100644
index db35587e4..000000000
--- a/modules/cms/src/frontend/blocks/DevBlock.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
- * @since 1.0.0
- */
-final class DevBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public function blockGroup()
- {
- return DevelopmentGroup::className();
- }
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_dev_name');
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'developer_mode';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '' . Module::t('block_dev_name') . '
';
- }
-
- /**
- * @inheritdoc
- */
- public function getIsDirtyDialogEnabled()
- {
- return false;
- }
-}
diff --git a/modules/cms/src/frontend/blocks/FileListBlock.php b/modules/cms/src/frontend/blocks/FileListBlock.php
deleted file mode 100644
index b0bfd55ad..000000000
--- a/modules/cms/src/frontend/blocks/FileListBlock.php
+++ /dev/null
@@ -1,79 +0,0 @@
-
- * @since 1.0.0
- */
-final class FileListBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_file_list_name');
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'attachment';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'files', 'label' => Module::t("block_file_list_files_label"), 'type' => 'zaa-file-array-upload'],
- ],
- 'cfgs' => [
- ['var' => 'showType', 'label' => Module::t("block_file_list_files_showtype_label"), 'initvalue' => 0, 'type' => 'zaa-select', 'options' => [
- ['value' => '1', 'label' => Module::t("block_file_list_showtype_yes")],
- ['value' => '0', 'label' => Module::t("block_file_list_showtype_no")],
- ],
- ],
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'fileList' => BlockHelper::fileArrayUpload($this->getVarValue('files')),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '{% if extras.fileList is empty %}'.Module::t('block_file_list_admin_empty').'
{% else %}{% endif %}';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/FormBlock.php b/modules/cms/src/frontend/blocks/FormBlock.php
deleted file mode 100644
index c57cb9cc7..000000000
--- a/modules/cms/src/frontend/blocks/FormBlock.php
+++ /dev/null
@@ -1,159 +0,0 @@
-
- * @since 1.0.0
- */
-final class FormBlock extends PhpBlock
-{
- public $module = 'cms';
-
- public $defaultNameLabel = 'Name';
-
- public $defaultNamePlaceholder = 'Vor- und Nachname';
-
- public $defaultNameError = 'Bitte geben Sie einen Namen ein';
-
- public $defaultEmailLabel = 'Email';
-
- public $defaultEmailPlaceholder = 'beispiel@beispiel.ch';
-
- public $defaultEmailError = 'Bitte geben Sie eine Emailadresse ein';
-
- public $defaultMessageLabel = 'Nachricht';
-
- public $defaultMessageError = 'Bitte geben Sie eine Nachricht ein';
-
- public $defaultSendLabel = 'Absenden';
-
- public $defaultSendError = 'Leider ist ein Fehler beim Senden der Nachricht aufgetreten.';
-
- public $defaultSendSuccess = 'Vielen Dank! Wir werden uns mit Ihnen in Verbindung setzen.';
-
- public $defaultMailSubject = 'Kontaktanfrage';
-
- public function name()
- {
- return Module::t("block_form_name");
- }
-
- public function icon()
- {
- return 'email';
- }
-
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'emailAddress', 'label' => 'Email wird an folgende Adresse gesendet', 'type' => 'zaa-text'],
- ['var' => 'headline', 'label' => 'Überschrift', 'type' => 'zaa-text', 'placeholder' => 'Kontakt'],
- ['var' => 'nameLabel', 'label' => 'Text für Feld "Name"', 'type' => 'zaa-text', 'placeholder' => $this->defaultNameLabel],
- ['var' => 'emailLabel', 'label' => 'Text für Feld "Email"', 'type' => 'zaa-text', 'placeholder' => $this->defaultEmailLabel],
- ['var' => 'messageLabel', 'label' => 'Text für Feld "Nachricht"', 'type' => 'zaa-text', 'placeholder' => $this->defaultMessageLabel],
- ['var' => 'sendLabel', 'label' => 'Text auf dem Absendebutton', 'type' => 'zaa-text', 'placeholder' => $this->defaultSendLabel],
- ],
-
- 'cfgs' => [
- ['var' => 'subjectText', 'label' => 'Betreff in der Email', 'type' => 'zaa-text', 'placeholder' => $this->defaultMailSubject],
- ['var' => 'namePlaceholder', 'label' => 'Platzhalter im Feld "Name"', 'type' => 'zaa-text', 'placeholder' => $this->defaultNamePlaceholder],
- ['var' => 'emailPlaceholder', 'label' => 'Platzhalter im Feld "Email"', 'type' => 'zaa-text', 'placeholder' => $this->defaultEmailPlaceholder],
- ['var' => 'nameError', 'label' => 'Fehlermeldung für Feld "Name"', 'type' => 'zaa-text', 'placeholder' => $this->defaultNameError],
- ['var' => 'emailError', 'label' => 'Fehlermeldung für Feld "Email"', 'type' => 'zaa-text', 'placeholder' => $this->defaultEmailError],
- ['var' => 'messageError', 'label' => 'Fehlermeldung für Feld "Nachricht"', 'type' => 'zaa-text', 'placeholder' => $this->defaultMessageError],
- ['var' => 'sendSuccess', 'label' => 'Bestätigungstext nach Absenden des Formulars', 'type' => 'zaa-text', 'placeholder' => $this->defaultSendSuccess],
- ['var' => 'sendError', 'label' => 'Fehlertext nach fehlgeschlagenem Sendeversuch des Formulars', 'type' => 'zaa-text', 'placeholder' => $this->defaultSendError],
- ],
- ];
- }
-
- public function extraVars()
- {
- return [
- 'nameLabel' => $this->getVarValue('nameLabel', $this->defaultNameLabel),
- 'namePlaceholder' => $this->getCfgValue('namePlaceholder', $this->defaultNamePlaceholder),
- 'nameError' => $this->getCfgValue('nameError', $this->defaultNameError),
- 'emailLabel' => $this->getVarValue('emailLabel', $this->defaultEmailLabel),
- 'emailPlaceholder' => $this->getCfgValue('emailPlaceholder', $this->defaultEmailPlaceholder),
- 'emailError' => $this->getCfgValue('emailError', $this->defaultEmailError),
- 'messageLabel' => $this->getVarValue('messageLabel', $this->defaultMessageLabel),
- 'messageError' => $this->getCfgValue('messageError', $this->defaultMessageError),
- 'sendLabel' => $this->getVarValue('sendLabel', $this->defaultSendLabel),
- 'sendError' => $this->getCfgValue('sendError', $this->defaultSendError),
- 'sendSuccess' => $this->getCfgValue('sendSuccess', $this->defaultSendSuccess),
- 'subjectText' => $this->getCfgValue('subjectText', $this->defaultMailSubject),
- 'message' => Yii::$app->request->post('message'),
- 'name' => Yii::$app->request->post('name'),
- 'email' => Yii::$app->request->post('email'),
- 'mailerResponse' => $this->getPostResponse(),
- 'csrf' => Yii::$app->request->csrfToken,
- 'nameErrorFlag' => Yii::$app->request->isPost ? (Yii::$app->request->post('name') ? 1 : 0): 1,
- 'emailErrorFlag' => Yii::$app->request->isPost ? (Yii::$app->request->post('email') ? 1 : 0): 1,
- 'messageErrorFlag' => Yii::$app->request->isPost ? (Yii::$app->request->post('message') ? 1 : 0): 1,
- ];
- }
-
- public function sendMail($message, $email, $name)
- {
- $email = Html::encode($email);
- $name = Html::encode($name);
-
- $html = "You have recieved an E-Mail via Form Block on " . Url::base(true)."
";
- $html.= "From: " . $name." ($email) Time:".date("d.m.Y - H:i"). " ";
- $html.= "Message: " . nl2br(Html::encode($message)) ."
";
-
- $mail = Yii::$app->mail;
- $mail->fromName = $name;
- $mail->from = $email;
- $mail->compose($this->getVarValue('subjectText', $this->defaultMailSubject), $html);
- $mail->address($this->getVarValue('emailAddress'));
-
- if (!$mail->send()) {
- return 'Error: '.$mail->error;
- } else {
- return 'success';
- }
- }
-
- public function getPostResponse()
- {
- $request = Yii::$app->request;
-
- if (Yii::$app->request->isPost) {
- if ($request->post('message') && $request->post('email') && $request->post('name')) {
- return $this->sendMail($request->post('message'), $request->post('email'), $request->post('name'));
- }
- }
- }
-
- public function admin()
- {
- return 'Form Block
{% if vars.emailAddress is not empty %}'.
- '{% if vars.headline is not empty %}{{ vars.headline }} {% endif %}'.
- ''.
- '
{{ extras.nameLabel }} '.
- '
'.
- '
'.
- ''.
- '
{{ extras.emailLabel }} '.
- '
'.
- '
'.
- ''.
- '
{{ extras.messageLabel }} '.
- '
'.
- '
'.
- '{{ extras.sendLabel }} '.
- '{% else %}Es wurde noch keine Emailadresse angegeben. '.
- '{% endif %}';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/ImageBlock.php b/modules/cms/src/frontend/blocks/ImageBlock.php
deleted file mode 100644
index 7d12d9652..000000000
--- a/modules/cms/src/frontend/blocks/ImageBlock.php
+++ /dev/null
@@ -1,141 +0,0 @@
-
- * @since 1.0.0
- */
-final class ImageBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_image_name');
- }
-
- /**
- * @inheritdoc
- */
- public function blockGroup()
- {
- return MediaGroup::class;
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'crop';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'imageId', 'label' => Module::t('block_image_imageid_label'), 'type' => 'zaa-image-upload'],
- ['var' => 'caption', 'label' => Module::t('block_image_caption_label'), 'type' => 'zaa-textarea'],
- ['var' => 'textType', 'label' => Module::t('block_text_texttype_label'), 'initvalue' => 0, 'type' => 'zaa-select', 'options' => [
- ['value' => 0, 'label' => Module::t('block_text_texttype_normal')],
- ['value' => 1, 'label' => Module::t('block_text_texttype_markdown')],
- ],
- ],
- ],
- 'cfgs' => [
- ['var' => 'width', 'label' => Module::t('block_image_fixed_width'), 'type' => 'zaa-text'],
- ['var' => 'height', 'label' => Module::t('block_image_fixed_height'), 'type' => 'zaa-text'],
- ['var' => 'internalLink', 'label' => Module::t('block_image_internallink_label'), 'type' => 'zaa-cms-page'],
- ['var' => 'externalLink', 'label' => Module::t('block_image_externallink_label'), 'type' => 'zaa-text'],
- ['var' => 'cssClass', 'label' => Module::t('block_image_cfg_css_class'), 'type' => 'zaa-text'],
- ['var' => 'divCssClass', 'label' => Module::t('block_cfg_additonal_css_class'), 'type' => self::TYPE_TEXT],
- ],
- ];
- }
-
- /**
- * Get the Text as html or p enclosed if empty null is returned.
- *
- * @return string|null
- */
- public function getText()
- {
- $text = $this->getVarValue('caption');
-
- if ($this->getVarValue('textType') == 1) {
- return TagParser::convertWithMarkdown($text);
- }
-
- return empty($text) ? null : '' . nl2br($text) . '
';
- }
-
- /**
- * Get the Link Object.
- *
- * Linkable resources must implement {{luya\web\LinkInterface}}.
- *
- * @return \luya\web\WebsiteLink|\luya\cms\menu\Item|boolean
- */
- public function getLinkObject()
- {
- if ($this->getCfgValue('externalLink', false)) {
- return new WebsiteLink(['href' => $this->getCfgValue('externalLink', false)]);
- }
-
- if ($this->getCfgValue('internalLink', false)) {
- return Yii::$app->menu->find()->where(['nav_id' => $this->getCfgValue('internalLink')])->one();
- }
-
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'image' => BlockHelper::imageUpload($this->getVarValue('imageId')),
- 'imageAdmin' => BlockHelper::imageUpload($this->getVarValue('imageId', 'medium-thumbnail')),
- 'text' => $this->getText(),
- 'link' => $this->getLinkObject(),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- $image = '{% if extras.imageAdmin.source %}
';
- $image.= '{% else %}' . Module::t('block_image_no_image') . ' {% endif %}';
- $image.= '{% if vars.caption is not empty %}{{extras.text}}{% endif %}';
-
- return $image;
- }
-}
diff --git a/modules/cms/src/frontend/blocks/ImageTextBlock.php b/modules/cms/src/frontend/blocks/ImageTextBlock.php
deleted file mode 100644
index 0da7dfc94..000000000
--- a/modules/cms/src/frontend/blocks/ImageTextBlock.php
+++ /dev/null
@@ -1,145 +0,0 @@
-
- * @since 1.0.0
- */
-final class ImageTextBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_image_text_name');
- }
-
- /**
- * @inheritdoc
- */
- public function blockGroup()
- {
- return MediaGroup::class;
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'recent_actors';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'text', 'label' => Module::t('block_image_text_text_label'), 'type' => 'zaa-textarea'],
- ['var' => 'imageId', 'label' => Module::t('block_image_text_imageid_label'), 'type' => 'zaa-image-upload'],
- ['var' => 'imagePosition', 'label' => Module::t('block_image_text_imageposition_label'), 'type' => 'zaa-select', 'initvalue' => 'left', 'options' => [
- ['value' => 'left', 'label' => Module::t('block_image_text_imageposition_left')],
- ['value' => 'right', 'label' => Module::t('block_image_text_imageposition_right')],
- ],
- ],
- ],
- 'cfgs' => [
- ['var' => 'margin', 'label' => Module::t('block_image_text_margin_label'), 'type' => 'zaa-select', 'initvalue' => '20px', 'options' => [
- ['value' => '5px', 'label' => '0 ' . Module::t('block_image_text_margin_pixel')],
- ['value' => '10px', 'label' => '10 ' . Module::t('block_image_text_margin_pixel')],
- ['value' => '20px', 'label' => '20 ' . Module::t('block_image_text_margin_pixel')],
- ['value' => '30px', 'label' => '30 ' . Module::t('block_image_text_margin_pixel')],
- ['value' => '40px', 'label' => '40 ' . Module::t('block_image_text_margin_pixel')],
- ['value' => '50px', 'label' => '50 ' . Module::t('block_image_text_margin_pixel')],
- ],
- ],
- ['var' => 'textType', 'label' => Module::t('block_image_text_texttype_label'), 'initvalue' => 0, 'type' => 'zaa-select', 'options' => [
- ['value' => '0', 'label' => Module::t('block_image_text_texttype_normal')],
- ['value' => '1', 'label' => Module::t('block_image_text_texttype_markdown')],
- ],
- ],
- ['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' => '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'],
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function getFieldHelp()
- {
- return [
- 'textType' => Module::t('block_image_text_help_texttype'),
- ];
- }
-
- /**
- * Get the image text.
- *
- * @return string
- */
- public function getText()
- {
- $text = $this->getVarValue('text');
-
- if ($this->getCfgValue('textType')) {
- return TagParser::convertWithMarkdown($text);
- }
-
- return empty($text) ? null : '' . nl2br($text) . '
';
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'image' => BlockHelper::imageUpload($this->getVarValue('imageId')),
- 'text' => $this->getText(),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '{% if not extras.image.source %}'.
- '' . Module::t('block_image_text_no_image') . ' '.
- '{% endif %}'.
- '{% if not extras.text %}'.
- '' . Module::t('block_image_text_no_text') . ' '.
- '{% endif %}'.
- '{% if extras.image.source and extras.text %}'.
- ' '.
- '{{ extras.text }}'.
- '{% endif %}';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/LayoutBlock.php b/modules/cms/src/frontend/blocks/LayoutBlock.php
deleted file mode 100644
index 165e94071..000000000
--- a/modules/cms/src/frontend/blocks/LayoutBlock.php
+++ /dev/null
@@ -1,105 +0,0 @@
-
- * @since 1.0.0
- */
-final class LayoutBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $isContainer = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_layout_name');
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'view_column';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'width', 'label' => Module::t('block_layout_width_label'), 'initvalue' => 6, 'type' => 'zaa-select', 'options' => [
- ['value' => 1, 'label' => '1'],
- ['value' => 2, 'label' => '2'],
- ['value' => 3, 'label' => '3'],
- ['value' => 4, 'label' => '4'],
- ['value' => 5, 'label' => '5'],
- ['value' => 6, 'label' => '6'],
- ['value' => 7, 'label' => '7'],
- ['value' => 8, 'label' => '8'],
- ['value' => 9, 'label' => '9'],
- ['value' => 10, 'label' => '10'],
- ['value' => 11, 'label' => '11'],
- ],
- ],
- ],
- 'cfgs' => [
- ['var' => 'leftColumnClasses', 'label' => Module::t('block_layout_left_column_css_class'), 'type' => 'zaa-text'],
- ['var' => 'rightColumnClasses', 'label' => Module::t('block_layout_right_column_css_class'), 'type' => 'zaa-text'],
- ['var' => 'rowDivClass', 'label' => Module::t('block_layout_row_column_css_class'), 'type' => 'zaa-text'],
- ],
- 'placeholders' => [
- [
- ['var' => 'left', 'cols' => $this->getExtraValue('leftWidth'), 'label' => Module::t('block_layout_placeholders_left')],
- ['var' => 'right', 'cols' => $this->getExtraValue('rightWidth'), 'label' => Module::t('block_layout_placeholders_right')],
- ]
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'leftWidth' => $this->getVarValue('width', 6),
- 'rightWidth' => 12 - $this->getVarValue('width', 6),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '';
- }
-
- /**
- * @inheritdoc
- */
- public function blockGroup()
- {
- return LayoutGroup::className();
- }
-}
diff --git a/modules/cms/src/frontend/blocks/LineBlock.php b/modules/cms/src/frontend/blocks/LineBlock.php
deleted file mode 100644
index ca5ed0a65..000000000
--- a/modules/cms/src/frontend/blocks/LineBlock.php
+++ /dev/null
@@ -1,88 +0,0 @@
-
- * @since 1.0.0
- */
-final class LineBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_line_name');
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'remove';
- }
-
- /**
- * @inheritdoc
- */
- public function getIsDirtyDialogEnabled()
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'lineSpace', 'label' => Module::t('block_line_linespace_label'), 'type' => 'zaa-select', 'options' => [
- ['value' => '5px', 'label' => '5px ' . Module::t('block_line_linespace_space')],
- ['value' => '10px', 'label' => '10px ' . Module::t('block_line_linespace_space')],
- ['value' => '20px', 'label' => '20px ' . Module::t('block_line_linespace_space')],
- ['value' => '30px', 'label' => '30px ' . Module::t('block_line_linespace_space')],
- ], 'initvalue' => '5px'],
- ['var' => 'lineStyle', 'label' => Module::t('block_line_linestyle_label'), 'type' => 'zaa-select', 'options' => [
- ['value' => 'dotted', 'label' => Module::t('block_line_linestyle_dotted')],
- ['value' => 'dashed', 'label' => Module::t('block_line_linestyle_dashed')],
- ['value' => 'solid', 'label' => Module::t('block_line_linestyle_solid')],
- ], 'initvalue' => 'solid'],
- ['var' => 'lineWidth', 'label' => Module::t('block_line_linewidth_label'), 'type' => 'zaa-select', 'options' => [
- ['value' => '1px', 'label' => '1px'],
- ['value' => '2px', 'label' => '2px'],
- ['value' => '3px', 'label' => '3px'],
- ], 'initvalue' => '1px'],
- ['var' => 'lineColor', 'label' => Module::t('block_line_linecolor_label'), 'type' => 'zaa-select', 'options' => [
- ['value' => '#ccc', 'label' => Module::t('block_line_linecolor_grey')],
- ['value' => '#000', 'label' => Module::t('block_line_linecolor_black')],
- ], 'initvalue' => '#ccc']
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '
';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/LinkButtonBlock.php b/modules/cms/src/frontend/blocks/LinkButtonBlock.php
deleted file mode 100644
index 77a098aa7..000000000
--- a/modules/cms/src/frontend/blocks/LinkButtonBlock.php
+++ /dev/null
@@ -1,92 +0,0 @@
-
- * @since 1.0.0
- */
-final class LinkButtonBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_link_button_name');
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'link';
- }
-
- /**
- * @inheritdoc
- */
- public function injectors()
- {
- return [
- 'linkData' => new LinkInjector([
- 'varLabel' => Module::t('block_link_button_btnhref_label'),
- ]),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'label', 'label' => Module::t('block_link_button_btnlabel_label'), 'type' => 'zaa-text'],
- ],
- 'cfgs' => [
- [
- 'var' => 'simpleLink',
- 'label' => Module::t('block_link_button_simpleLink_label'),
- 'type' => 'zaa-checkbox'
- ],
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'cssClass' => $this->getCfgValue('simpleLink') ? null : 'btn btn-default',
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '{% if vars.label is empty or vars.linkData is empty %}' . Module::t('block_link_button_name') . ': ' . Module::t('block_link_button_empty') . '{% else %}' .
- '{% if vars.label is not empty %}{{ vars.label }} {% endif %}{% endif %}
';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/ListBlock.php b/modules/cms/src/frontend/blocks/ListBlock.php
deleted file mode 100644
index 6be30735c..000000000
--- a/modules/cms/src/frontend/blocks/ListBlock.php
+++ /dev/null
@@ -1,85 +0,0 @@
-
- * @since 1.0.0
- */
-final class ListBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_list_name');
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'view_list';
- }
-
- /**
- * @inheritdoc
- */
- public function blockGroup()
- {
- return TextGroup::className();
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'elements', 'label' => Module::t('block_list_elements_label'), 'type' => 'zaa-list-array'],
- ['var' => 'listType', 'label' => Module::t('block_list_listtype_label'), 'initvalue' => 'ul', 'type' => 'zaa-select', 'options' => [
- ['value' => 'ul', 'label' => Module::t('block_list_listtype_ul')],
- ['value' => 'ol', 'label' => Module::t('block_list_listtype_ol')],
- ],
- ],
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'listType' => $this->getVarValue('listType', 'ul'),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '{% if vars.elements is empty%}' . Module::t('block_list_no_content') . ' {% else %}<{{ extras.listType }}>{% for row in vars.elements if row.value is not empty %}{{ row.value }} {% endfor %}{{ extras.listType }}>{% endif %}';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/MapBlock.php b/modules/cms/src/frontend/blocks/MapBlock.php
deleted file mode 100644
index 1f983cb32..000000000
--- a/modules/cms/src/frontend/blocks/MapBlock.php
+++ /dev/null
@@ -1,118 +0,0 @@
-
- * @since 1.0.0
- */
-final class MapBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_map_name');
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'map';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- [
- 'var' => 'address',
- 'label' => Module::t('block_map_address_label'),
- 'type' => self::TYPE_TEXT,
- 'placeholder' => 'Zephir Software Design AG, Tramstrasse 66, 4142 Münchenstein'
- ],
- [
- 'var' => 'zoom',
- 'label' => Module::t('block_map_zoom_label'),
- 'type' => self::TYPE_SELECT,
- 'initvalue' => '12',
- 'options' => [
- ['value' => '0', 'label' => Module::t('block_map_zoom_entire')],
- ['value' => '1', 'label' => '4000 km'],
- ['value' => '2', 'label' => '2000 km (' . Module::t('block_map_zoom_world') . ')'],
- ['value' => '3', 'label' => '1000 km'],
- ['value' => '4', 'label' => '400 km (' . Module::t('block_map_zoom_continent') . ')'],
- ['value' => '5', 'label' => '200 km'],
- ['value' => '6', 'label' => '100 km (' . Module::t('block_map_zoom_country') . ')'],
- ['value' => '7', 'label' => '50 km'],
- ['value' => '8', 'label' => '30 km'],
- ['value' => '9', 'label' => '15 km'],
- ['value' => '10', 'label' => '8 km'],
- ['value' => '11', 'label' => '4 km'],
- ['value' => '12', 'label' => '2 km (' . Module::t('block_map_zoom_city') . ')'],
- ['value' => '13', 'label' => '1 km'],
- ['value' => '14', 'label' => '400 m (' . Module::t('block_map_zoom_district') . ')'],
- ['value' => '15', 'label' => '200 m'],
- ['value' => '16', 'label' => '100 m'],
- ['value' => '17', 'label' => '50 m (' . Module::t('block_map_zoom_street') . ')'],
- ['value' => '18', 'label' => '20 m'],
- ['value' => '19', 'label' => '10 m'],
- ['value' => '20', 'label' => '5 m (' . Module::t('block_map_zoom_house') . ')'],
- ['value' => '21', 'label' => '2.5 m'],
- ],
- ],
- [
- 'var' => 'maptype',
- 'label' => Module::t('block_map_maptype_label'),
- 'type' => self::TYPE_SELECT,
- 'options' => [
- ['value' => 'm', 'label' => Module::t('block_map_maptype_roadmap')],
- ['value' => 'k', 'label' => Module::t('block_map_maptype_satellitemap')],
- ['value' => 'h', 'label' => Module::t('block_map_maptype_hybrid')],
- ],
- ],
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'address' => urlencode($this->getVarValue('address', 'Zephir Software Design AG, Tramstrasse 66, Münchenstein')),
- 'zoom' => $this->getVarValue('zoom', 15),
- 'maptype' => $this->getVarValue('maptype', 'h'),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '{% if vars.address is not empty %}
{% else %}' . Module::t('block_map_no_content') . ' {% endif %}';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/QuoteBlock.php b/modules/cms/src/frontend/blocks/QuoteBlock.php
deleted file mode 100644
index b6218210a..000000000
--- a/modules/cms/src/frontend/blocks/QuoteBlock.php
+++ /dev/null
@@ -1,70 +0,0 @@
-
- * @since 1.0.0
- */
-final class QuoteBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_quote_name');
- }
-
- /**
- * @inheritdoc
- */
- public function blockGroup()
- {
- return TextGroup::className();
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'format_quote';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'content', 'label' => Module::t('block_quote_content_label'), 'type' => self::TYPE_TEXT],
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '{% if vars.content is not empty %}{{ vars.content }}
{% else %}' . Module::t('block_quote_no_content') . ' {% endif %}';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/SpacingBlock.php b/modules/cms/src/frontend/blocks/SpacingBlock.php
deleted file mode 100644
index 19cb67cf8..000000000
--- a/modules/cms/src/frontend/blocks/SpacingBlock.php
+++ /dev/null
@@ -1,95 +0,0 @@
-
- * @since 1.0.0
- */
-final class SpacingBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- protected function getSpacings()
- {
- return [
- 1 => Module::t('block_spacing_small_space'),
- 2 => Module::t('block_spacing_medium_space'),
- 3 => Module::t('block_spacing_large_space'),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_spacing_name');
- }
-
- /**
- * @inheritdoc
- */
- public function getIsDirtyDialogEnabled()
- {
- return false;
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'format_line_spacing';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- [
- 'var' => 'spacing',
- 'label' => Module::t('block_spacing_spacing_label'),
- 'initvalue' => 1,
- 'type' => self::TYPE_SELECT,
- 'options' => BlockHelper::selectArrayOption($this->getSpacings()),
- ],
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'spacingLabel' => $this->getSpacings()[$this->getVarValue('spacing', 1)],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '{{ extras.spacingLabel }} ';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/TableBlock.php b/modules/cms/src/frontend/blocks/TableBlock.php
deleted file mode 100644
index 7619d00e0..000000000
--- a/modules/cms/src/frontend/blocks/TableBlock.php
+++ /dev/null
@@ -1,151 +0,0 @@
-
- * @since 1.0.0
- */
-final class TableBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_table_name');
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'border_all';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'table', 'label' => "", 'type' => 'zaa-table'],
- ],
- 'cfgs' => [
- ['var' => 'header', 'label' => Module::t('block_table_header_label'), 'type' => 'zaa-checkbox'],
- ['var' => 'stripe', 'label' => Module::t('block_table_stripe_label'), 'type' => 'zaa-checkbox'],
- ['var' => 'border', 'label' => Module::t('block_table_border_label'), 'type' => 'zaa-checkbox'],
- ['var' => 'equaldistance', 'label' => Module::t('block_table_equaldistance_label'), 'type' => 'zaa-checkbox'],
- ['var' => 'parseMarkdown', 'label' => Module::t('block_table_enable_markdown'), 'type' => 'zaa-checkbox'],
- ['var' => 'divCssClass', 'label' => Module::t('block_cfg_additonal_css_class'), 'type' => self::TYPE_TEXT],
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function getFieldHelp()
- {
- return [
- 'table' => Module::t('block_table_help_table')
- ];
- }
-
- /**
- * Get the table data for the table generator.
- *
- * @return array
- */
- public function getTableData()
- {
- $hasHeader = $this->getCfgValue('header', 0);
- $table = [];
- $i = 0;
- foreach ($this->getVarValue('table', []) as $row) {
- ++$i;
- // whether the header data can be skipped or not
- if ($hasHeader == 1 && $i == 1) {
- continue;
- }
- // parse markdown for ceil value, if disable ensure newlines converts to br tags.
- foreach ($row as $field => $value) {
- $row[$field] = $this->getCfgValue('parseMarkdown', false) ? TagParser::convertWithMarkdown($value) : nl2br($value);
- }
-
- $table[] = $row;
- }
-
- return $table;
- }
-
- /**
- * Return the table header array data.
- *
- * @return array
- */
- public function getHeaderRow()
- {
- $data = $this->getVarValue('table', []);
-
- return (count($data) > 0) ? array_values($data)[0] : [];
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'table' => $this->getTableData(),
- 'headerData' => $this->getHeaderRow(),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '{% if extras.table is empty %}' . Module::t('block_table_no_table') . ' {% else %}'.
- '
' .
- '
'.
- '{% if cfgs.header %}'.
- ''.
- ''.
- '{% for column in extras.headerData %}{{ column }} {% endfor %}'.
- ' '.
- ' '.
- '{% endif %}'.
- ''.
- '{% for row in extras.table %}'.
- ''.
- '{% for column in row %}'.
- '{{ column }} '.
- '{% endfor %}'.
- ' '.
- '{% endfor %}'.
- ' '.
- '
'.
- '
'.
- '{% endif %}';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/TextBlock.php b/modules/cms/src/frontend/blocks/TextBlock.php
deleted file mode 100644
index 2d9252a7d..000000000
--- a/modules/cms/src/frontend/blocks/TextBlock.php
+++ /dev/null
@@ -1,101 +0,0 @@
-
- * @since 1.0.0
- */
-final class TextBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function blockGroup()
- {
- return TextGroup::className();
- }
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_text_name');
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'format_align_left';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'content', 'label' => Module::t('block_text_content_label'), 'type' => 'zaa-textarea'],
- ['var' => 'textType', 'label' => Module::t('block_text_texttype_label'), 'initvalue' => 0, 'type' => 'zaa-select', 'options' => [
- ['value' => 0, 'label' => Module::t('block_text_texttype_normal')],
- ['value' => 1, 'label' => Module::t('block_text_texttype_markdown')],
- ],
- ],
- ],
- 'cfgs' => [
- ['var' => 'cssClass', 'label' => Module::t('block_cfg_additonal_css_class'), 'type' => 'zaa-text'],
- ]
- ];
- }
-
- /**
- * Get the text based on type input.
- */
- public function getText()
- {
- $text = $this->getVarValue('content');
-
- if ($this->getVarValue('textType', 0) == 1) {
- return TagParser::convertWithMarkdown($text);
- }
-
- return nl2br($text);
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'text' => $this->getText(),
- ];
- }
-
- public function admin()
- {
- return '{% if vars.content is empty %}' . Module::t('block_text_no_content') . ' '.
- '{% elseif vars.content is not empty and vars.textType == 1 %}{{ extras.text }}{% elseif vars.content is not empty %}{{ extras.text }}{% endif %}
';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/TitleBlock.php b/modules/cms/src/frontend/blocks/TitleBlock.php
deleted file mode 100644
index ae9256690..000000000
--- a/modules/cms/src/frontend/blocks/TitleBlock.php
+++ /dev/null
@@ -1,81 +0,0 @@
-
- * @since 1.0.0
- */
-final class TitleBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_title_name');
- }
-
- /**
- * @inheritdoc
- */
- public function blockGroup()
- {
- return TextGroup::className();
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'format_size';
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'content', 'label' => Module::t('block_title_content_label'), 'type' => self::TYPE_TEXT],
- ['var' => 'headingType', 'label' => Module::t('block_title_headingtype_label'), 'type' => self::TYPE_SELECT, 'initvalue' => 'h1', 'options' => [
- ['value' => 'h1', 'label' => Module::t('block_title_headingtype_heading') . ' 1'],
- ['value' => 'h2', 'label' => Module::t('block_title_headingtype_heading') . ' 2'],
- ['value' => 'h3', 'label' => Module::t('block_title_headingtype_heading') . ' 3'],
- ['value' => 'h4', 'label' => Module::t('block_title_headingtype_heading') . ' 4'],
- ['value' => 'h5', 'label' => Module::t('block_title_headingtype_heading') . ' 5'],
- ],
- ],
- ],
- 'cfgs' => [
- ['var' => 'cssClass', 'label' => Module::t('block_cfg_additonal_css_class'), 'type' => self::TYPE_TEXT],
- ]
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '{% if vars.content is not empty %}<{{vars.headingType}}>{{ vars.content }}{{vars.headingType}}>{% else %}' . Module::t('block_title_no_content') . ' {% endif %}';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/VideoBlock.php b/modules/cms/src/frontend/blocks/VideoBlock.php
deleted file mode 100644
index 6cb6ea162..000000000
--- a/modules/cms/src/frontend/blocks/VideoBlock.php
+++ /dev/null
@@ -1,152 +0,0 @@
-
- * @since 1.0.0
- */
-final class VideoBlock extends PhpBlock
-{
- const PROVIDER_YOUTUBE = 'youtube';
-
- const PROVIDER_YOUTUBE_EMBED_URL = 'https://www.youtube.com/embed/';
-
- const PROVIDER_VIMEO = 'vimeo';
-
- const PROVIDER_VIMEO_EMBED_URL = 'https://player.vimeo.com/video/';
-
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritdoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritdoc
- */
- public function name()
- {
- return Module::t('block_video_name');
- }
-
- /**
- * @inheritdoc
- */
- public function icon()
- {
- return 'videocam';
- }
-
- /**
- * @inheritdoc
- */
- public function blockGroup()
- {
- return MediaGroup::class;
- }
-
- /**
- * @inheritdoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'url', 'label' => Module::t('block_video_url_label'), 'type' => self::TYPE_TEXT],
- ],
- 'cfgs' => [
- ['var' => 'controls', 'label' => Module::t('block_video_controls_label'), 'type' => self::TYPE_CHECKBOX],
- ['var' => 'width', 'label' => Module::t('block_video_width_label'), 'type' => self::TYPE_NUMBER],
- ],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function getFieldHelp()
- {
- return [
- 'url' => Module::t('block_video_help_url'),
- 'controls' => Module::t('block_video_help_controls'),
- 'width' => Module::t('block_video_help_width'),
- ];
- }
-
- /**
- * Ensure the emebed youtube url based on url var.
- *
- * @return string
- */
- public function embedYoutube()
- {
- parse_str(parse_url($this->getVarValue('url'), PHP_URL_QUERY), $args);
- // ensure if v argument exists
- if (isset($args['v'])) {
- $params['rel'] = 0;
- if ($this->getCfgValue('controls')) {
- $params['controls'] = 0;
- }
- return self::PROVIDER_YOUTUBE_EMBED_URL . $args['v'] . '?' . http_build_query($params);
- }
- }
-
- /**
- * Ensure the emebed vimeo url based on url var.
- *
- * @return string
- */
- public function embedVimeo()
- {
- return self::PROVIDER_VIMEO_EMBED_URL . ltrim(parse_url($this->getVarValue('url'), PHP_URL_PATH), '/');
- }
-
- /**
- * Construct the url based on url input.
- *
- * @return string
- */
- public function constructUrl()
- {
- if ($this->getVarValue('url')) {
- preg_match('/(?:www\.)?([a-z]+)(?:\.[a-z]+)?/', parse_url($this->getVarValue('url'), PHP_URL_HOST), $match);
- if (isset($match[1])) {
- switch ($match[1]) {
- case self::PROVIDER_YOUTUBE: return $this->embedYoutube();
- case self::PROVIDER_VIMEO: return $this->embedVimeo();
- }
- }
- }
-
- return null;
- }
-
- /**
- * @inheritdoc
- */
- public function extraVars()
- {
- return [
- 'url' => $this->constructUrl(),
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function admin()
- {
- return '{% if extras.url is not empty %}
{% else %}' . Module::t('block_video_no_video') . ' {% endif %}';
- }
-}
diff --git a/modules/cms/src/frontend/blocks/WysiwygBlock.php b/modules/cms/src/frontend/blocks/WysiwygBlock.php
deleted file mode 100644
index eb32ecea4..000000000
--- a/modules/cms/src/frontend/blocks/WysiwygBlock.php
+++ /dev/null
@@ -1,72 +0,0 @@
-
- * @since 1.0.0
- */
-final class WysiwygBlock extends PhpBlock
-{
- /**
- * @inheritdoc
- */
- public $module = 'cms';
-
- /**
- * @inheritDoc
- */
- public $cacheEnabled = true;
-
- /**
- * @inheritDoc
- */
- public function name()
- {
- return Module::t('block_wysiwyg_name');
- }
-
- /**
- * @inheritDoc
- */
- public function blockGroup()
- {
- return TextGroup::className();
- }
-
- /**
- * @inheritDoc
- */
- public function icon()
- {
- return 'format_color_text';
- }
-
- /**
- * @inheritDoc
- */
- public function config()
- {
- return [
- 'vars' => [
- ['var' => 'content', 'label' => Module::t('block_wysiwyg_content_label'), 'type' => self::TYPE_WYSIWYG],
- ],
- ];
- }
-
- /**
- * @inheritDoc
- */
- public function admin()
- {
- return '{% if vars.content is empty %}' . Module::t('block_wysiwyg_no_content') . ' {% else %}{{ vars.content }}{% endif %}';
- }
-}
diff --git a/modules/cms/src/frontend/commands/UpdaterController.php b/modules/cms/src/frontend/commands/UpdaterController.php
index 70654cdbf..599a19e76 100644
--- a/modules/cms/src/frontend/commands/UpdaterController.php
+++ b/modules/cms/src/frontend/commands/UpdaterController.php
@@ -27,7 +27,7 @@ public function actionGeneric()
return $this->outputError("Command already executed. System is up-to-date.");
}
- if (!$this->confirm("Warning: Have you made a Database Backup? If something goes wrong, the website content is unrecoverable lost!")) {
+ if (!$this->confirm("Warning: Have you made a database backup? If something goes wrong, the website content is unrecoverable lost!")) {
return $this->outputError("Make a backup first!");
}
@@ -42,24 +42,59 @@ public function actionGeneric()
// check if this application has registered the new generic block package.
$genericExists = false;
+ $bs3Exists = false;
foreach (Yii::$app->packageInstaller->configs as $config) {
if ($config->package['name'] == "luyadev/luya-generic") {
$genericExists = true;
}
+ if ($config->package['name'] == "luyadev/luya-bootstrap3") {
+ $bs3Exists = true;
+ }
}
- if (!$genericExists) {
- return $this->outputError("You have to register the luyadev/luya-generic package in your composer.json first and rerun the updater again afterwards.");
+ if (!$genericExists || !$bs3Exists) {
+ return $this->outputError("You have to register the luyadev/luya-generic and luyadev/luya-bootstrap3 package in your composer.json first and rerun the updater again afterwards.");
}
+ $mappings = [
+ //'AudioBlock.php => DROP
+ //'DevBlock.php => DROP
+ 'FileListBlock' => 'luya\\generic\\blocks',
+ 'FormBlock' => 'luya\\bootstrap3\\blocks',
+ 'HtmlBlock' => 'luya\\cms\\frontend\\blocks',
+ 'ImageBlock' => 'luya\\bootstrap3\\blocks',
+ 'ImageTextBlock' => 'luya\\bootstrap3\\blocks',
+ 'LayoutBlock' => 'luya\\bootstrap3\\blocks',
+ 'LineBlock' => 'luya\\generic\\blocks',
+ 'LinkButtonBlock' => 'luya\\bootstrap3\\blocks',
+ 'ListBlock' => 'luya\\generic\\blocks',
+ 'MapBlock' => 'luya\\bootstrap3\\blocks',
+ 'ModuleBlock' => 'luya\\cms\\frontend\\blocks',
+ 'QuoteBlock' => 'luya\\generic\\blocks',
+ 'SpacingBlock' => 'luya\\bootstrap3\\blocks',
+ 'TableBlock' => 'luya\\bootstrap3\\blocks',
+ 'TextBlock' => 'luya\\generic\\blocks',
+ 'TitleBlock' => 'luya\\generic\\blocks',
+ 'VideoBlock' => 'luya\\bootstrap3\\blocks',
+ 'WysiwygBlock' => 'luya\\generic\\blocks',
+ ];
+
// change namespace from existing cms block to new generic block package.
foreach (Block::find()->where(['like', 'class', '\\luya\\cms'])->all() as $block) {
- $genericClassName = str_replace("luya\\cms\\frontend\\", "luya\\generic\\", $block->class);
+ $originClassName = str_replace("luya\\cms\\frontend\\", "", $block->class);
+
+ if (!array_key_exists($originClassName, $mappings)) {
+ throw new Exception("The class '{$originClassName}' does not exists in the mapping list!");
+ }
+
+ $newClassName = $mappings[$originClassName] . '\\' . $originClassName;
+
+ //$genericClassName = str_replace("luya\\cms\\frontend\\", "luya\\generic\\", $block->class);
- $this->outputInfo("Update from '{$block->class}' to '{$genericClassName}'");
+ $this->outputInfo("Update from '{$block->class}' to '{$newClassName}'");
$block->updateAttributes([
- 'class' => $genericClassName,
+ 'class' => $newClassName,
]);
}
@@ -70,7 +105,7 @@ private function closeMigration($var)
{
Config::set($var, true);
- return $this->outputSuccess("Migration has been applied successfull.");
+ //return $this->outputSuccess("Update migration (code {$var}) has been applied successful.");
}
public function actionVersions()
diff --git a/modules/cms/src/frontend/views/blocks/AudioBlock.php b/modules/cms/src/frontend/views/blocks/AudioBlock.php
deleted file mode 100644
index 455812bda..000000000
--- a/modules/cms/src/frontend/views/blocks/AudioBlock.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
-= $this->varValue('soundUrl', null, '{{soundUrl}}
'); ?>
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/DevBlock.php b/modules/cms/src/frontend/views/blocks/DevBlock.php
deleted file mode 100644
index fdc09ac7f..000000000
--- a/modules/cms/src/frontend/views/blocks/DevBlock.php
+++ /dev/null
@@ -1,45 +0,0 @@
-
-Heading 1
-Heading 2
-Heading 3
-Heading 4
-Heading 5
-Heading 6
-Lorem ipsum dolor sit amet, eum an aliquip noluisse torquatos. At duis liber repudiandae eum, an has vidisse viderer. Ea his impedit probatus, ad nam sonet percipitur honestatis, melius cetero ne mel. Ea qui modo luptatum disputationi. Ut sit agam delectus sapientem, et quis volutpat convenire per. Diam hinc eloquentiam ei qui.
-
Lorem ipsum dolor sit amet, eum an aliquip noluisse torquatos. And link is part of the content.
-
- List 1
- List 2
- List 3
-
-
- Dotted List 1
- Dotted List 2
- Dotted List 3
-
-
- Quote: Lorem ipsum dolor sit amet, eum an aliquip noluisse torquatos. At duis liber repudiandae eum, an has vidisse viderer. Ea his impedit probatus, ad nam sonet percipitur honestatis, melius cetero ne mel. Ea qui modo luptatum disputationi. Ut sit agam delectus sapientem, et quis volutpat convenire per. Diam hinc eloquentiam ei qui.
-
-Strong
-Italic
-Striketrough
-
-
-
- Thead 1
- Thead 2
- Thead 3
-
-
-
-
- TD Content
- TD Content
- TD Content
-
-
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/FileListBlock.php b/modules/cms/src/frontend/views/blocks/FileListBlock.php
deleted file mode 100644
index 6b8072f58..000000000
--- a/modules/cms/src/frontend/views/blocks/FileListBlock.php
+++ /dev/null
@@ -1,12 +0,0 @@
-
-extraValue('fileList'))): ?>
-
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/FormBlock.php b/modules/cms/src/frontend/views/blocks/FormBlock.php
deleted file mode 100644
index 9143efab0..000000000
--- a/modules/cms/src/frontend/views/blocks/FormBlock.php
+++ /dev/null
@@ -1,53 +0,0 @@
-
-varValue('emailAddress')): ?>
-= $this->varValue('headline', null, '{{headline}} '); ?>
-extraValue('name') && $this->extraValue('email') && $this->extraValue('message')): ?>
- extraValue('mailerResponse') == 'success'): $hideForm = true;?>
- = $this->extraValue('sendSuccess'); ?>
-
- = $this->extraValue('sendError'); ?>
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/ImageBlock.php b/modules/cms/src/frontend/views/blocks/ImageBlock.php
deleted file mode 100644
index d6b44057d..000000000
--- a/modules/cms/src/frontend/views/blocks/ImageBlock.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
-extraValue('image')): ?>
-
-
- extraValue('link')): ?>
-
-
- = Html::tag('img', '', [
- 'src' => $this->extraValue('image')['source'],
- 'alt' => $this->varValue('caption', ''),
- 'title' => $this->varValue('caption', null),
- 'width' => $this->cfgValue('width', null),
- 'height' => $this->cfgValue('height', null),
- 'class' => 'img-responsive' . $this->cfgValue('cssClass', null, ' {{cssClass}}'),
- ]); ?>
- extraValue('link')): ?>
-
-
- = $this->extraValue('text', null, '{{text}} ')?>
-
-
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/ImageTextBlock.php b/modules/cms/src/frontend/views/blocks/ImageTextBlock.php
deleted file mode 100644
index ef37e6453..000000000
--- a/modules/cms/src/frontend/views/blocks/ImageTextBlock.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
-extraValue('image') && $this->extraValue('text')): ?>
-
- = Html::img($this->extraValue('image')['source'], [
- 'class' => ($this->varValue('imagePosition', 'left') == 'left') ? 'pull-left img-responsive' : 'pull-right img-responsive',
- 'width' => $this->cfgValue('width', null),
- 'height' => $this->cfgValue('height', null),
- 'style' => (($this->varValue('imagePosition', 'left') == 'left') ? "margin-right:{$this->cfgValue('margin', '20px')}" : "margin-left:{$this->cfgValue('margin', '20px')}") . $this->cfgValue('margin', '20px', ';margin-bottom:{{margin}};max-width:50%;'),
- ])?>
-
- = $this->extraValue('text'); ?>
-
- cfgValue('btnHref') && $this->cfgValue('btnLabel')): ?>
-
- = Html::a($this->cfgValue('btnLabel'), $this->cfgValue('btnHref'), [
- 'class' => 'button',
- 'target' => ($this->cfgValue('targetBlank') == 1) ? '_blank' : null,
- ]); ?>
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/LayoutBlock.php b/modules/cms/src/frontend/views/blocks/LayoutBlock.php
deleted file mode 100644
index c34049c73..000000000
--- a/modules/cms/src/frontend/views/blocks/LayoutBlock.php
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- = $this->placeholderValue('left'); ?>
-
-
- = $this->placeholderValue('right'); ?>
-
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/LineBlock.php b/modules/cms/src/frontend/views/blocks/LineBlock.php
deleted file mode 100644
index dd6c6e225..000000000
--- a/modules/cms/src/frontend/views/blocks/LineBlock.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/LinkButtonBlock.php b/modules/cms/src/frontend/views/blocks/LinkButtonBlock.php
deleted file mode 100644
index d6dd16da9..000000000
--- a/modules/cms/src/frontend/views/blocks/LinkButtonBlock.php
+++ /dev/null
@@ -1,13 +0,0 @@
-
-extraValue('linkData'))): ?>
- = Html::a($this->varValue('label'), $this->extraValue('linkData')->getHref(), [
- 'class' => $this->extraValue('cssClass', null),
- 'target' =>$this->extraValue('linkData')->getTarget(),
- ]); ?>
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/ListBlock.php b/modules/cms/src/frontend/views/blocks/ListBlock.php
deleted file mode 100644
index 5f7bcd24c..000000000
--- a/modules/cms/src/frontend/views/blocks/ListBlock.php
+++ /dev/null
@@ -1,12 +0,0 @@
-
-varValue('elements'))): ?>
-<= $this->extraValue('listType', 'ul'); ?>>
- varValue('elements') as $item): ?>
- = $item['value']; ?>
-
-= $this->extraValue('listType', 'ul'); ?>>
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/MapBlock.php b/modules/cms/src/frontend/views/blocks/MapBlock.php
deleted file mode 100644
index 87d52727c..000000000
--- a/modules/cms/src/frontend/views/blocks/MapBlock.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
-varValue('address'))):?>
-
-
-
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/QuoteBlock.php b/modules/cms/src/frontend/views/blocks/QuoteBlock.php
deleted file mode 100644
index 546e7bc7c..000000000
--- a/modules/cms/src/frontend/views/blocks/QuoteBlock.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
-= $this->varValue('content', null, '{{content}} '); ?>
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/SpacingBlock.php b/modules/cms/src/frontend/views/blocks/SpacingBlock.php
deleted file mode 100644
index ad4f9811b..000000000
--- a/modules/cms/src/frontend/views/blocks/SpacingBlock.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
-varValue('spacing', 1);$i++): ?>
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/TableBlock.php b/modules/cms/src/frontend/views/blocks/TableBlock.php
deleted file mode 100644
index 0b65e2496..000000000
--- a/modules/cms/src/frontend/views/blocks/TableBlock.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
-extraValue('table'))): ?>
-cfgValue('divCssClass', null, ' class="{{divCssClass}}"'); ?>>
-
- cfgValue('header')): ?>
-
-
- extraValue('headerData', []) as $column): ?>
- = $column; ?>
-
-
-
-
-
- extraValue('table', []) as $row): ?>
-
-
- cfgValue('equaldistance')): ?> class="col-md-= round(12/count($row)); ?>">= $column; ?>
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/TextBlock.php b/modules/cms/src/frontend/views/blocks/TextBlock.php
deleted file mode 100644
index ac41a1043..000000000
--- a/modules/cms/src/frontend/views/blocks/TextBlock.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
-varValue('textType') == 0): ?>
-cfgValue('cssClass', null, ' class="{{cssClass}}"'); ?>>= $this->extraValue('text'); ?>
-
-= $this->extraValue('text'); ?>
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/TitleBlock.php b/modules/cms/src/frontend/views/blocks/TitleBlock.php
deleted file mode 100644
index 231f5195a..000000000
--- a/modules/cms/src/frontend/views/blocks/TitleBlock.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
-varValue('content'))): ?>
-<= $this->varValue('headingType', 'h2') . $this->cfgValue('cssClass', null, ' class="{{cssClass}}"'); ?>>
-= $this->varValue('content'); ?>
-= $this->varValue('headingType', 'h2', '{{headingType}}>'); ?>
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/VideoBlock.php b/modules/cms/src/frontend/views/blocks/VideoBlock.php
deleted file mode 100644
index bc889465b..000000000
--- a/modules/cms/src/frontend/views/blocks/VideoBlock.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
-extraValue('url')): ?>
- cfgValue('width')): ?>
-
-
-
-
-
- cfgValue('width')): ?>
-
-
-
\ No newline at end of file
diff --git a/modules/cms/src/frontend/views/blocks/WysiwygBlock.php b/modules/cms/src/frontend/views/blocks/WysiwygBlock.php
deleted file mode 100644
index 56d58c35e..000000000
--- a/modules/cms/src/frontend/views/blocks/WysiwygBlock.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
-= $this->varValue('content'); ?>
\ No newline at end of file
diff --git a/modules/cms/tests/src/frontend/blocks/AudioBlockTest.php b/modules/cms/tests/src/frontend/blocks/AudioBlockTest.php
deleted file mode 100644
index a867f0f34..000000000
--- a/modules/cms/tests/src/frontend/blocks/AudioBlockTest.php
+++ /dev/null
@@ -1,21 +0,0 @@
-assertSame('', $this->block->renderFrontend());
- }
-
- public function testContent()
- {
- $this->block->setVarValues(['soundUrl' => 'embed']);
- $this->assertContains('embed
', $this->block->renderFrontend());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/DevBlockTest.php b/modules/cms/tests/src/frontend/blocks/DevBlockTest.php
deleted file mode 100644
index 499b9d983..000000000
--- a/modules/cms/tests/src/frontend/blocks/DevBlockTest.php
+++ /dev/null
@@ -1,15 +0,0 @@
-assertNotEmpty($this->renderFrontend());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/FileListBlockTest.php b/modules/cms/tests/src/frontend/blocks/FileListBlockTest.php
deleted file mode 100644
index cb73c340e..000000000
--- a/modules/cms/tests/src/frontend/blocks/FileListBlockTest.php
+++ /dev/null
@@ -1,32 +0,0 @@
-assertEmpty($this->renderFrontend());
- }
-
- public function testFiles()
- {
- $this->block->addExtraVar('fileList', [
- ['href' => 'path/to/image.jpg', 'caption' => 'foobar', 'extension' => 'jpg'],
- ]);
- $this->assertContains('', $this->renderFrontendNoSpace());
- }
-
- public function testFilesWithSuffix()
- {
- $this->block->setCfgValues(['showType' => 1]);
- $this->block->addExtraVar('fileList', [
- ['href' => 'path/to/image.jpg', 'caption' => 'foobar', 'extension' => 'jpg'],
- ]);
- $this->assertContains('', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/FormBlockTest.php b/modules/cms/tests/src/frontend/blocks/FormBlockTest.php
deleted file mode 100644
index bbb627202..000000000
--- a/modules/cms/tests/src/frontend/blocks/FormBlockTest.php
+++ /dev/null
@@ -1,26 +0,0 @@
-assertEmpty($this->renderFrontend());
- }
-
- public function testBasicInput()
- {
- $this->block->setVarValues([
- 'headline' => 'My Form',
- 'emailAddress' => 'hello@luya.io',
- ]);
-
- $this->assertContains('My Form ', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/ImageBlockTest.php b/modules/cms/tests/src/frontend/blocks/ImageBlockTest.php
deleted file mode 100644
index 4171b5c2c..000000000
--- a/modules/cms/tests/src/frontend/blocks/ImageBlockTest.php
+++ /dev/null
@@ -1,78 +0,0 @@
-assertSame('', $this->renderFrontend());
- }
-
- public function testImageId()
- {
- $this->block->addExtraVar('image', ['source' => 'luya.jpg']);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testCaption()
- {
- $this->block->setVarValues(['caption' => 'cap']);
- $this->block->addExtraVar('image', ['source' => 'luya.jpg']);
- $this->assertSame('cap
', $this->renderFrontendNoSpace());
- }
-
- public function testNewlineCaption()
- {
- $this->block->setVarValues(['caption' => "cap
- tion"]); // using \n or \r does not work within this context.
- $this->block->addExtraVar('image', ['source' => 'luya.jpg']);
- $this->assertSame('cap tion
', $this->renderFrontendNoSpace());
- }
-
- public function testMarkdownCaption()
- {
- $this->block->setVarValues(['caption' => '##cap', 'textType' => 1]);
- $this->block->addExtraVar('image', ['source' => 'luya.jpg']);
- $this->assertSame('cap ', $this->renderFrontendNoSpace());
- }
-
- public function testWidthHeight()
- {
- $this->block->setCfgValues(['width' => 100, 'height' => 100]);
- $this->block->addExtraVar('image', ['source' => 'luya.jpg']);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testInternalLink()
- {
- $this->block->setCfgValues(['internalLink' => 1]);
- $this->block->addExtraVar('image', ['source' => 'luya.jpg']);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testExternalLink()
- {
- $this->block->setCfgValues(['externalLink' => 'https://luya.io']);
- $this->block->addExtraVar('image', ['source' => 'luya.jpg']);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testLinkPriority()
- {
- $this->block->setCfgValues(['externalLink' => 'https://luya.io', 'internalLink' => 1]);
- $this->block->addExtraVar('image', ['source' => 'luya.jpg']);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testDivClassClass()
- {
- $this->block->setCfgValues(['divCssClass' => 'foobar']);
- $this->block->addExtraVar('image', ['source' => 'luya.jpg']);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/ImageTextBlockTest.php b/modules/cms/tests/src/frontend/blocks/ImageTextBlockTest.php
deleted file mode 100644
index 157536890..000000000
--- a/modules/cms/tests/src/frontend/blocks/ImageTextBlockTest.php
+++ /dev/null
@@ -1,50 +0,0 @@
-assertSame('', $this->renderFrontend());
- }
-
- public function testImagehttpSource()
- {
- $this->block->setVarValues(['text' => 'Text']);
- $this->block->addExtraVar('image', ['source' => 'image.jpg', ]);
-
- $this->assertSame('
', $this->renderFrontendNoSpace());
- }
-
- public function testButton()
- {
- $this->block->setVarValues(['text' => 'Text']);
- $this->block->setCfgValues(['btnHref' => 'https://luya.io', 'btnLabel' => 'Button']);
- $this->block->addExtraVar('image', ['source' => 'image.jpg', ]);
-
- $this->assertSame('
', $this->renderFrontendNoSpace());
- }
-
- public function testButtonTargetBlank()
- {
- $this->block->setVarValues(['text' => 'Text']);
- $this->block->setCfgValues(['btnHref' => 'https://luya.io', 'btnLabel' => 'Button', 'targetBlank' => 1]);
- $this->block->addExtraVar('image', ['source' => 'image.jpg', ]);
-
- $this->assertSame('
', $this->renderFrontendNoSpace());
- }
-
- public function testWidthHeight()
- {
- $this->block->setVarValues(['text' => 'Text']);
- $this->block->setCfgValues(['width' => 100, 'height' => 100]);
- $this->block->addExtraVar('image', ['source' => 'image.jpg', ]);
-
- $this->assertSame('
', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/LayoutBlockTest.php b/modules/cms/tests/src/frontend/blocks/LayoutBlockTest.php
deleted file mode 100644
index 9f9cae9f9..000000000
--- a/modules/cms/tests/src/frontend/blocks/LayoutBlockTest.php
+++ /dev/null
@@ -1,40 +0,0 @@
-assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testWidthCol()
- {
- $this->block->setVarValues(['width' => 8]);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testCssClassInput()
- {
- $this->block->setCfgValues([
- 'leftColumnClasses' => 'leftclass',
- 'rightColumnClasses' => 'rightclass',
- 'rowDivClass' => 'rowclass',
- ]);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testPlaceholderValues()
- {
- $this->block->setPlaceholderValues([
- 'left' => 'left content',
- 'right' => 'right content',
- ]);
- $this->assertSame('left content
right content
', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/LineBlockTest.php b/modules/cms/tests/src/frontend/blocks/LineBlockTest.php
deleted file mode 100644
index d17b00722..000000000
--- a/modules/cms/tests/src/frontend/blocks/LineBlockTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-assertSame(' ', $this->renderFrontendNoSpace());
- }
-
- public function testVars()
- {
- $this->block->setVarValues([
- 'lineSpace' => '10px',
- 'lineStyle' => 'dotted',
- 'lineWidth' => '3px',
- 'lineColor' => '#000',
- ]);
-
- $this->assertSame(' ', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/LinkButtonBlockTest.php b/modules/cms/tests/src/frontend/blocks/LinkButtonBlockTest.php
deleted file mode 100644
index 9e911430f..000000000
--- a/modules/cms/tests/src/frontend/blocks/LinkButtonBlockTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
-assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testLinkLinkSource()
- {
- $this->block->setVarValues([
- 'linkData' => ['type' => 2, 'value' => 'https://luya.io']
- ]);
- $this->assertSame(' ', $this->renderFrontendNoSpace());
- }
-
- public function testLinkLinkSourceWithLabel()
- {
- $this->block->setVarValues(['label' => 'label', 'linkData' => ['type' => 2, 'value' => 'https://luya.io']]);
- $this->assertSame('label ', $this->renderFrontendNoSpace());
- }
-
- public function testLinkLinkSourceWithLabelBlank()
- {
- $this->block->setVarValues(['label' => 'label', 'linkData' => ['type' => 2, 'value' => 'https://luya.io']]);
- $this->block->setCfgValues(['targetBlank' => 1]);
- $this->assertSame('label ', $this->renderFrontendNoSpace());
- }
-
- public function testLinkLinkSourceWithLabelBlankSimpleLink()
- {
- $this->block->setVarValues(['label' => 'label', 'linkData' => ['type' => 2, 'value' => 'https://luya.io']]);
- $this->block->setCfgValues(['targetBlank' => 1, 'simpleLink' => 1]);
- $this->assertSame('label ', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/ListBlockTest.php b/modules/cms/tests/src/frontend/blocks/ListBlockTest.php
deleted file mode 100644
index 9836431b8..000000000
--- a/modules/cms/tests/src/frontend/blocks/ListBlockTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testElements()
- {
- $this->block->setVarValues(['elements' => [['value' => 1], ['value' => 2]]]);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testElementsOl()
- {
- $this->block->setVarValues(['elements' => [['value' => 1], ['value' => 2]], 'listType' => 'ol']);
- $this->assertSame('1 2 ', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/MapBlockTest.php b/modules/cms/tests/src/frontend/blocks/MapBlockTest.php
deleted file mode 100644
index c3f297780..000000000
--- a/modules/cms/tests/src/frontend/blocks/MapBlockTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
-assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testAddress()
- {
- $this->block->setVarValues(['address' => 'Mountain View, California, United States']);
-
- $this->assertContains('', $this->renderFrontendNoSpace());
- }
-
- public function testZoomAndType()
- {
- $this->block->setVarValues(['address' => 'Mountain View, California, United States', 'zoom' => 1, 'maptype' => 'k']);
-
- $this->assertContains('', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/QuoteBlockTest.php b/modules/cms/tests/src/frontend/blocks/QuoteBlockTest.php
deleted file mode 100644
index 3482cda8d..000000000
--- a/modules/cms/tests/src/frontend/blocks/QuoteBlockTest.php
+++ /dev/null
@@ -1,21 +0,0 @@
-assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testcContentRender()
- {
- $this->block->setVarValues(['content' => 'quote text!']);
- $this->assertSame('quote text! ', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/SpacingBlockTest.php b/modules/cms/tests/src/frontend/blocks/SpacingBlockTest.php
deleted file mode 100644
index be802187a..000000000
--- a/modules/cms/tests/src/frontend/blocks/SpacingBlockTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
-assertSame('
', $this->renderFrontendNoSpace());
- }
-
- public function testSetSpace1()
- {
- $this->block->setVarValues(['spacing' => 1]);
- $this->assertSame('
', $this->renderFrontendNoSpace());
- }
-
- public function testSetSpace2()
- {
- $this->block->setVarValues(['spacing' => 2]);
- $this->assertSame('
', $this->renderFrontendNoSpace());
- }
-
- public function testSetSpace3()
- {
- $this->block->setVarValues(['spacing' => 3]);
- $this->assertSame('
', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/TableBlockTest.php b/modules/cms/tests/src/frontend/blocks/TableBlockTest.php
deleted file mode 100644
index 86365ae13..000000000
--- a/modules/cms/tests/src/frontend/blocks/TableBlockTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testTableData()
- {
- $this->block->setVarValues(['table' => [[1,2,3], ['a', 'b', 'c']]]);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testTableDataWithHeader()
- {
- $this->block->setVarValues(['table' => [[1,2,3], ['a', 'b', 'c']]]);
- $this->block->setCfgValues(['header' => 1]);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testTableDataWithMarkdown()
- {
- $this->block->setVarValues(['table' => [[1,2,3], ['*a*', 'b', 'c']]]);
- $this->block->setCfgValues(['parseMarkdown' => 1]);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testWithAllOptions()
- {
- $this->block->setVarValues(['table' => [[1,2,3], ['*a*', 'b', 'c']]]);
- $this->block->setCfgValues([
- 'divCssClass' => 'foo-bar',
- 'equaldistance' => 1,
- 'border' => 1,
- 'stripe' => 1,
- 'header' => 1,
- ]);
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testNewlineInCellMarkdown()
- {
- $this->block->setVarValues(['table' => [['foo
-bar']]]);
- $this->block->setCfgValues(['parseMarkdown' => 1]);
- $this->assertContains('foo bar', $this->renderFrontendNoSpace());
- }
-
- public function testNewlineInCell()
- {
- $this->block->setVarValues(['table' => [['foo
-bar']]]);
- $this->assertContains('foo bar', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/TextBlockTest.php b/modules/cms/tests/src/frontend/blocks/TextBlockTest.php
deleted file mode 100644
index 3042284ce..000000000
--- a/modules/cms/tests/src/frontend/blocks/TextBlockTest.php
+++ /dev/null
@@ -1,62 +0,0 @@
-assertSame('
', $this->renderFrontendNoSpace());
- }
-
- public function testText()
- {
- $this->block->setVarValues(['content' => 'text']);
- $this->assertContains('text
', $this->renderFrontend());
- }
-
- public function testNl2br()
- {
- $this->block->setVarValues(['content' => 'text
-test']);
- $this->assertContains('text
-test
', $this->renderFrontend());
- }
-
- public function testNoMarkdownButMarkup()
- {
- $this->block->setVarValues(['content' => '##text', 'textType' => 0]);
- $this->assertContains('##text
', $this->renderFrontend());
- }
-
- public function testMarkdownRender()
- {
- $this->block->setVarValues(['content' => '##text', 'textType' => 1]);
- $this->assertContains('text ', $this->renderFrontendNoSpace());
- }
-
- public function testCfgValue()
- {
- $this->block->setVarValues(['content' => 'text']);
- $this->block->setCfgValues(['cssClass' => 'test']);
- $this->assertContains('text
', $this->renderFrontend());
- }
-
- public function testCfgWithMarkdown()
- {
- $this->block->setVarValues(['content' => '##text', 'textType' => 0]);
- $this->block->setCfgValues(['cssClass' => 'test']);
- $this->assertContains('##text
', $this->renderFrontend());
- }
-
- public function testCfgWithMarkdownAndClass()
- {
- $this->block->setVarValues(['content' => '##text', 'textType' => 1]);
- $this->block->setCfgValues(['cssClass' => 'test']);
- $this->assertContains('text ', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/TitleBlockTest.php b/modules/cms/tests/src/frontend/blocks/TitleBlockTest.php
deleted file mode 100644
index 5ecc689d4..000000000
--- a/modules/cms/tests/src/frontend/blocks/TitleBlockTest.php
+++ /dev/null
@@ -1,36 +0,0 @@
-assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testContent()
- {
- $this->block->setVarValues(['content' => 'Heading']);
-
- $this->assertSame('Heading ', $this->renderFrontendNoSpace());
- }
-
- public function testContentWithHeading()
- {
- $this->block->setVarValues(['content' => 'Heading', 'headingType' => 'h1']);
-
- $this->assertSame('Heading ', $this->renderFrontendNoSpace());
- }
-
- public function testCssClass()
- {
- $this->block->setVarValues(['content' => 'Heading', 'headingType' => 'h1']);
- $this->block->setCfgValues(['cssClass' => 'foobar']);
- $this->assertSame('Heading ', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/VideoBlockTest.php b/modules/cms/tests/src/frontend/blocks/VideoBlockTest.php
deleted file mode 100644
index c200b7971..000000000
--- a/modules/cms/tests/src/frontend/blocks/VideoBlockTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testYouTubeUrl()
- {
- $this->block->setVarValues(['url' => 'https://www.youtube.com/watch?v=sA2EdjiLSlk']);
- $this->assertSame('https://www.youtube.com/embed/sA2EdjiLSlk?rel=0', $this->block->constructUrl());
-
- $this->block->setVarValues(['url' => 'https://youtube.com/watch?v=sA2EdjiLSlk']);
- $this->assertSame('https://www.youtube.com/embed/sA2EdjiLSlk?rel=0', $this->block->constructUrl());
-
- $this->block->setVarValues(['url' => 'http://www.youtube.com/watch?v=sA2EdjiLSlk']);
- $this->assertSame('https://www.youtube.com/embed/sA2EdjiLSlk?rel=0', $this->block->constructUrl());
-
- $this->block->setVarValues(['url' => 'http://youtube.com/watch?v=sA2EdjiLSlk']);
- $this->assertSame('https://www.youtube.com/embed/sA2EdjiLSlk?rel=0', $this->block->constructUrl());
-
-
- $this->block->setVarValues(['url' => 'http://youtube.com/watch?v=sA2EdjiLSlk']);
- $this->block->setCfgValues(['controls' => 1]);
- $this->assertSame('https://www.youtube.com/embed/sA2EdjiLSlk?rel=0&controls=0', $this->block->constructUrl());
-
- $this->assertSame('VIDEO
', $this->renderFrontendNoSpace());
- }
-
- public function testVimeoUrl()
- {
- $this->block->setVarValues(['url' => 'https://vimeo.com/60735314']);
- $this->assertContains('https://player.vimeo.com/video/60735314', $this->block->constructUrl());
-
- $this->block->setVarValues(['url' => 'http://vimeo.com/60735314']);
- $this->assertContains('https://player.vimeo.com/video/60735314', $this->block->constructUrl());
-
- $this->block->setVarValues(['url' => 'http://vimeo.com/60735314']);
- $this->assertContains('https://player.vimeo.com/video/60735314', $this->block->constructUrl());
-
- $this->block->setVarValues(['url' => 'http://www.vimeo.com/60735314']);
- $this->assertContains('https://player.vimeo.com/video/60735314', $this->block->constructUrl());
-
- $this->assertSame('
', $this->renderFrontendNoSpace());
- }
-
- public function testWidthAndControls()
- {
- $this->block->setVarValues(['url' => 'http://youtube.com/watch?v=sA2EdjiLSlk']);
- $this->block->setCfgValues(['controls' => 1, 'width' => 600]);
- $this->assertSame('https://www.youtube.com/embed/sA2EdjiLSlk?rel=0&controls=0', $this->block->constructUrl());
-
- $this->assertSame('', $this->renderFrontendNoSpace());
- }
-}
diff --git a/modules/cms/tests/src/frontend/blocks/WysiwygBlockTest.php b/modules/cms/tests/src/frontend/blocks/WysiwygBlockTest.php
deleted file mode 100644
index b02c1fa59..000000000
--- a/modules/cms/tests/src/frontend/blocks/WysiwygBlockTest.php
+++ /dev/null
@@ -1,21 +0,0 @@
-assertSame('', $this->renderFrontendNoSpace());
- }
-
- public function testContent()
- {
- $this->block->setVarValues(['content' => 'content']);
- $this->assertSame('content', $this->renderFrontendNoSpace());
- }
-}