2015-08-29 07:02:09 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class pluginTags extends Plugin {
|
|
|
|
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
$this->dbFields = array(
|
2017-05-30 19:18:18 +02:00
|
|
|
'label'=>'Tags'
|
2015-08-29 07:02:09 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function form()
|
|
|
|
{
|
|
|
|
global $Language;
|
|
|
|
|
2018-07-02 00:24:53 +02:00
|
|
|
$html = '<div class="alert alert-primary" role="alert">';
|
|
|
|
$html .= $this->description();
|
|
|
|
$html .= '</div>';
|
|
|
|
|
|
|
|
$html .= '<div>';
|
2017-05-30 19:18:18 +02:00
|
|
|
$html .= '<label>'.$Language->get('Label').'</label>';
|
|
|
|
$html .= '<input id="jslabel" name="label" type="text" value="'.$this->getValue('label').'">';
|
2017-09-09 00:33:14 +02:00
|
|
|
$html .= '<span class="tip">'.$Language->get('This title is almost always used in the sidebar of the site').'</span>';
|
2016-01-22 18:55:13 +01:00
|
|
|
$html .= '</div>';
|
|
|
|
|
2015-08-29 07:02:09 +02:00
|
|
|
return $html;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function siteSidebar()
|
|
|
|
{
|
|
|
|
global $Language;
|
|
|
|
global $dbTags;
|
2018-07-17 19:13:01 +02:00
|
|
|
global $url;
|
2015-08-29 07:02:09 +02:00
|
|
|
|
2018-07-17 19:13:01 +02:00
|
|
|
$filter = $url->filters('tag');
|
2015-08-30 01:26:46 +02:00
|
|
|
|
2015-08-29 07:02:09 +02:00
|
|
|
$html = '<div class="plugin plugin-tags">';
|
2017-05-30 21:54:09 +02:00
|
|
|
$html .= '<h2 class="plugin-label">'.$this->getDbField('label').'</h2>';
|
2015-08-29 07:02:09 +02:00
|
|
|
$html .= '<div class="plugin-content">';
|
|
|
|
$html .= '<ul>';
|
|
|
|
|
2017-05-30 19:18:18 +02:00
|
|
|
// By default the database of tags are alphanumeric sorted
|
|
|
|
foreach( $dbTags->db as $key=>$fields ) {
|
|
|
|
$html .= '<li>';
|
2017-05-30 21:54:09 +02:00
|
|
|
$html .= '<a href="'.DOMAIN_TAGS.$key.'">';
|
2017-05-30 19:18:18 +02:00
|
|
|
$html .= $fields['name'];
|
|
|
|
$html .= '</a>';
|
|
|
|
$html .= '</li>';
|
2016-01-22 18:55:13 +01:00
|
|
|
}
|
2015-08-29 07:02:09 +02:00
|
|
|
|
|
|
|
$html .= '</ul>';
|
|
|
|
$html .= '</div>';
|
|
|
|
$html .= '</div>';
|
|
|
|
|
|
|
|
return $html;
|
|
|
|
}
|
2016-01-22 20:27:53 +01:00
|
|
|
}
|