New plugin HTML Code

This commit is contained in:
Diego Najar 2018-01-07 12:17:03 +01:00
parent 4baa55c7a0
commit 6fb9dcda85
3 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "HTML Code",
"description": "Add HTML, CSS or Javascript code in the header or footer of your site."
}
}

View File

@ -0,0 +1,10 @@
{
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "2.1",
"releaseDate": "2017-06-15",
"license": "MIT",
"compatible": "2.1",
"notes": ""
}

View File

@ -0,0 +1,37 @@
<?php
class pluginHTMLCode extends Plugin {
public function init()
{
$this->dbFields = array(
'header'=>'',
'footer'=>''
);
}
public function form()
{
$html = '<div>';
$html .= '<label>Header</label>';
$html .= '<textarea name="header" id="jsheader">'.$this->getValue('header').'</textarea>';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>Footer</label>';
$html .= '<textarea name="footer" id="jsfooter">'.$this->getValue('footer').'</textarea>';
$html .= '</div>';
return $html;
}
public function siteHead()
{
return html_entity_decode($this->getValue('header'));
}
public function siteBodyEnd()
{
return html_entity_decode($this->getValue('footer'));
}
}