From b7785846fe92977ea6d1bc50b31354742858db6a Mon Sep 17 00:00:00 2001 From: Jonas Ryser Date: Mon, 3 Aug 2020 20:54:54 +0200 Subject: [PATCH 1/3] Get license key from params-local.php --- src/FroalaEditorWidget.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/FroalaEditorWidget.php b/src/FroalaEditorWidget.php index 1bfa14f..81293db 100644 --- a/src/FroalaEditorWidget.php +++ b/src/FroalaEditorWidget.php @@ -92,6 +92,11 @@ public function registerClientScript() if ($langType != 'es_gb') { $view->registerJsFile("{$asset->baseUrl}/js/languages/{$langType}.js", ['depends' => '\froala\froalaeditor\FroalaEditorAsset']); } + + // license key + if(isset(Yii::$app->params['froala_license'])){ + $this->clientOptions['key'] = Yii::$app->params['froala_license']; + } $id = $this->options['id']; if (empty($this->clientPlugins)) { From 1ce17135798d56b3896acdd333e6ce334b0951e7 Mon Sep 17 00:00:00 2001 From: Jonas Ryser Date: Mon, 3 Aug 2020 21:14:00 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 2e13e75..3e4bd0e 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,13 @@ add Font-awesome cdn for font-awesome plugin ``` +To add the license key for the whole yii2-project add this to params-local.php: +```php +return [ + 'froala_license' => 'my-froala-license', +]; +``` + ## Upload example Using the basic Yii template make a new folder under /web/ called uploads. From c2747238065eab265b7d8a4d77a2920ee83572fa Mon Sep 17 00:00:00 2001 From: Jonas Ryser Date: Mon, 3 Aug 2020 21:30:20 +0200 Subject: [PATCH 3/3] Add attribution false --- src/FroalaEditorWidget.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FroalaEditorWidget.php b/src/FroalaEditorWidget.php index 81293db..cc57474 100644 --- a/src/FroalaEditorWidget.php +++ b/src/FroalaEditorWidget.php @@ -95,7 +95,8 @@ public function registerClientScript() // license key if(isset(Yii::$app->params['froala_license'])){ - $this->clientOptions['key'] = Yii::$app->params['froala_license']; + $this->clientOptions['key'] = Yii::$app->params['froala_license']; + $this->clientOptions['attribution'] = false; } $id = $this->options['id'];