bludit/bl-plugins/html-code/plugin.php

97 lines
2.6 KiB
PHP
Raw Permalink Normal View History

2018-01-07 12:17:03 +01:00
<?php
class pluginHTMLCode extends Plugin {
public function init()
{
$this->dbFields = array(
2018-01-07 12:45:47 +01:00
'head'=>'',
2018-01-07 12:17:03 +01:00
'header'=>'',
'footer'=>'',
'adminHead'=>'',
'adminHeader'=>'',
'adminFooter'=>''
2018-01-07 12:17:03 +01:00
);
}
public function form()
{
global $L;
2018-01-07 12:45:47 +01:00
2018-07-02 00:24:53 +02:00
$html = '<div class="alert alert-primary" role="alert">';
$html .= $this->description();
$html .= '</div>';
$html .= '<h2>'.$L->g('Website').'</h2>';
2018-07-02 00:24:53 +02:00
$html .= '<div>';
$html .= '<label>Head</label>';
2018-01-07 12:45:47 +01:00
$html .= '<textarea name="head" id="jshead">'.$this->getValue('head').'</textarea>';
$html .= '<span class="tip">'.$L->get('insert-code-in-the-theme-inside-the-tag-head').'</span>';
2018-01-07 12:45:47 +01:00
$html .= '</div>';
$html .= '<div>';
$html .= '<label>Header</label>';
2018-01-07 12:17:03 +01:00
$html .= '<textarea name="header" id="jsheader">'.$this->getValue('header').'</textarea>';
$html .= '<span class="tip">'.$L->get('insert-code-in-the-theme-at-the-top').'</span>';
2018-01-07 12:17:03 +01:00
$html .= '</div>';
$html .= '<div>';
$html .= '<label>Footer</label>';
2018-01-07 12:17:03 +01:00
$html .= '<textarea name="footer" id="jsfooter">'.$this->getValue('footer').'</textarea>';
$html .= '<span class="tip">'.$L->get('insert-code-in-the-theme-at-the-bottom').'</span>';
2018-01-07 12:17:03 +01:00
$html .= '</div>';
$html .= '<h2 class="mt-4">'.$L->g('Admin area').'</h2>';
$html .= '<div>';
$html .= '<label>Head</label>';
$html .= '<textarea name="adminHead">'.$this->getValue('adminHead').'</textarea>';
$html .= '<span class="tip">'.$L->get('insert-code-in-the-theme-inside-the-tag-head').'</span>';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>Header</label>';
$html .= '<textarea name="adminHeader">'.$this->getValue('adminHeader').'</textarea>';
$html .= '<span class="tip">'.$L->get('insert-code-in-the-theme-at-the-top').'</span>';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>Footer</label>';
$html .= '<textarea name="adminFooter">'.$this->getValue('adminFooter').'</textarea>';
$html .= '<span class="tip">'.$L->get('insert-code-in-the-theme-at-the-bottom').'</span>';
$html .= '</div>';
2018-01-07 12:17:03 +01:00
return $html;
}
public function siteHead()
2018-01-07 12:45:47 +01:00
{
return html_entity_decode($this->getValue('head'));
}
public function siteBodyBegin()
2018-01-07 12:17:03 +01:00
{
return html_entity_decode($this->getValue('header'));
}
public function siteBodyEnd()
{
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'));
}
2018-01-07 12:17:03 +01:00
}