From d4bda555213b3a20ddc4a480cd29086603e534c0 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Sun, 7 Jan 2018 12:45:47 +0100 Subject: [PATCH] New plugin HTML Code --- bl-plugins/html-code/languages/en.json | 7 +++++-- bl-plugins/html-code/plugin.php | 22 +++++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/bl-plugins/html-code/languages/en.json b/bl-plugins/html-code/languages/en.json index e3fa43d6..e4e3ab46 100644 --- a/bl-plugins/html-code/languages/en.json +++ b/bl-plugins/html-code/languages/en.json @@ -2,6 +2,9 @@ "plugin-data": { "name": "HTML Code", - "description": "Add HTML, CSS or Javascript code in the header or footer of your site." - } + "description": "Add HTML, CSS or Javascript code in the head metadata, header or footer of your site." + }, + "insert-code-in-the-theme-inside-the-tag-head": "Insert code in the theme inside the tag <head> </head>", + "insert-code-in-the-theme-at-the-top": "Insert code in the theme at the top.", + "insert-code-in-the-theme-at-the-bottom": "IInsert code in the theme at the bottom." } \ No newline at end of file diff --git a/bl-plugins/html-code/plugin.php b/bl-plugins/html-code/plugin.php index 6f68ffa3..94481094 100644 --- a/bl-plugins/html-code/plugin.php +++ b/bl-plugins/html-code/plugin.php @@ -5,6 +5,7 @@ class pluginHTMLCode extends Plugin { public function init() { $this->dbFields = array( + 'head'=>'', 'header'=>'', 'footer'=>'' ); @@ -12,20 +13,35 @@ class pluginHTMLCode extends Plugin { public function form() { + global $Language; + $html = '
'; - $html .= ''; - $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''.$Language->get('insert-code-in-the-theme-inside-the-tag-head').''; $html .= '
'; $html .= '
'; - $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''.$Language->get('insert-code-in-the-theme-at-the-top').''; + $html .= '
'; + + $html .= '
'; + $html .= ''; $html .= ''; + $html .= ''.$Language->get('insert-code-in-the-theme-at-the-bottom').''; $html .= '
'; return $html; } public function siteHead() + { + return html_entity_decode($this->getValue('head')); + } + + public function siteBodyBegin() { return html_entity_decode($this->getValue('header')); }