koblog/bl-plugins/about/plugin.php

48 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2015-11-10 23:47:21 +01:00
<?php
class pluginAbout extends Plugin
{
2015-11-10 23:47:21 +01:00
public function init()
{
$this->dbFields = array(
'label' => 'About',
'text' => ''
2015-11-10 23:47:21 +01:00
);
}
public function form()
{
global $L;
2015-11-10 23:47:21 +01:00
2018-07-02 00:24:53 +02:00
$html = '<div class="alert alert-primary" role="alert">';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Label') . '</label>';
$html .= '<input name="label" type="text" dir="auto" value="' . $this->getValue('label') . '">';
$html .= '<span class="tip">' . $L->get('This title is almost always used in the sidebar of the site') . '</span>';
2015-11-10 23:47:21 +01:00
$html .= '</div>';
2015-11-10 23:47:21 +01:00
$html .= '<div>';
$html .= '<label>' . $L->get('About') . '</label>';
$html .= '<textarea name="text" id="jstext">' . $this->getValue('text') . '</textarea>';
2015-11-10 23:47:21 +01:00
$html .= '</div>';
return $html;
}
public function siteSidebar()
{
$html = '<div class="plugin plugin-about">';
$html .= '<h2 class="plugin-label">' . $this->getValue('label') . '</h2>';
2015-11-10 23:47:21 +01:00
$html .= '<div class="plugin-content">';
$html .= html_entity_decode(nl2br($this->getValue('text')));
$html .= '</div>';
$html .= '</div>';
2015-11-10 23:47:21 +01:00
return $html;
}
}