From 0a1a97893faf68257556dbb5311a2431cda4c3fd Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Fri, 25 Jan 2019 16:26:34 +0100 Subject: [PATCH] Plugin HTML Code added support for admin area --- bl-plugins/html-code/languages/en.json | 9 +++-- bl-plugins/html-code/languages/es.json | 13 +++++++ bl-plugins/html-code/plugin.php | 48 +++++++++++++++++++++++--- 3 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 bl-plugins/html-code/languages/es.json diff --git a/bl-plugins/html-code/languages/en.json b/bl-plugins/html-code/languages/en.json index 2dc89042..9c5e69d7 100644 --- a/bl-plugins/html-code/languages/en.json +++ b/bl-plugins/html-code/languages/en.json @@ -2,9 +2,12 @@ "plugin-data": { "name": "HTML Code", - "description": "Add HTML, CSS or Javascript code in the head metadata, 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": "Insert code in the theme at the bottom." -} + "insert-code-in-the-theme-at-the-bottom": "Insert code in the theme at the bottom.", + "insert-code-in-the-admin-area-inside-the-tag-head": "Insert code in the admin area inside the tag <head> </head>", + "insert-code-in-the-admin-area-at-the-top": "Insert code in the admin area at the top.", + "insert-code-in-the-admin-area-at-the-bottom": "Insert code in the admin area at the bottom." +} \ No newline at end of file diff --git a/bl-plugins/html-code/languages/es.json b/bl-plugins/html-code/languages/es.json new file mode 100644 index 00000000..f69f5ad7 --- /dev/null +++ b/bl-plugins/html-code/languages/es.json @@ -0,0 +1,13 @@ +{ + "plugin-data": + { + "name": "HTML Code", + "description": "Añada código HTML, CSS o JavaScript en los metadatos de cabecera, encabezado o pie de página de su sitio." + }, + "insert-code-in-the-theme-inside-the-tag-head": "Inserte código en el tema dentro de la etiqueta <head> </head>", + "insert-code-in-the-theme-at-the-top": "Inserte código en el tema en el encabezado.", + "insert-code-in-the-theme-at-the-bottom": "Inserte código en el tema en el pie de página.", + "insert-code-in-the-admin-area-inside-the-tag-head": "Inserte código en el area de administración dentro de la etiqueta <head> </head>", + "insert-code-in-the-admin-area-at-the-top": "Inserte código en el area de administración en el encabezado.", + "insert-code-in-the-admin-area-at-the-bottom": "Inserte código en el area de administración en el pie de página." +} \ No newline at end of file diff --git a/bl-plugins/html-code/plugin.php b/bl-plugins/html-code/plugin.php index 8fdf809f..b476f04e 100644 --- a/bl-plugins/html-code/plugin.php +++ b/bl-plugins/html-code/plugin.php @@ -7,7 +7,10 @@ class pluginHTMLCode extends Plugin { $this->dbFields = array( 'head'=>'', 'header'=>'', - 'footer'=>'' + 'footer'=>'', + 'adminHead'=>'', + 'adminHeader'=>'', + 'adminFooter'=>'' ); } @@ -19,24 +22,46 @@ class pluginHTMLCode extends Plugin { $html .= $this->description(); $html .= ''; + $html .= '

'.$L->g('Website').'

'; + $html .= '
'; - $html .= ''; + $html .= ''; $html .= ''; $html .= ''.$L->get('insert-code-in-the-theme-inside-the-tag-head').''; $html .= '
'; $html .= '
'; - $html .= ''; + $html .= ''; $html .= ''; $html .= ''.$L->get('insert-code-in-the-theme-at-the-top').''; $html .= '
'; $html .= '
'; - $html .= ''; + $html .= ''; $html .= ''; $html .= ''.$L->get('insert-code-in-the-theme-at-the-bottom').''; $html .= '
'; + $html .= '

'.$L->g('Admin area').'

'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('insert-code-in-the-theme-inside-the-tag-head').''; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('insert-code-in-the-theme-at-the-top').''; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('insert-code-in-the-theme-at-the-bottom').''; + $html .= '
'; + return $html; } @@ -54,4 +79,19 @@ class pluginHTMLCode extends Plugin { { return html_entity_decode($this->getValue('footer')); } + + public function adminHead() + { + return html_entity_decode($this->getValue('adminHead')); + } + + public function adminBodyBegin() + { + return html_entity_decode($this->getValue('adminHeader')); + } + + public function adminBodyEnd() + { + return html_entity_decode($this->getValue('adminFooter')); + } } \ No newline at end of file