53 lines
1.2 KiB
PHP
53 lines
1.2 KiB
PHP
<?php
|
|
|
|
class pluginArchives extends Plugin
|
|
{
|
|
|
|
public function init()
|
|
{
|
|
$this->dbFields = array(
|
|
'label' => 'Archives',
|
|
'monthly' => false,
|
|
);
|
|
}
|
|
|
|
public function form()
|
|
{
|
|
global $L;
|
|
|
|
$html = '<div>';
|
|
$html .= '<label>' . $L->get('Label') . '</label>';
|
|
$html .= '<input id="jslabel" 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>';
|
|
$html .= '</div>';
|
|
|
|
echo Bootstrap::formCheckbox(array(
|
|
'name' => 'monthly',
|
|
'label' => $L->g('Monthly'),
|
|
'labelForCheckbox' => $L->g('Show archives by months.'),
|
|
'placeholder' => '',
|
|
'checked' => $this->getValue('monthly'),
|
|
'tip' => ""
|
|
));
|
|
|
|
return $html;
|
|
}
|
|
|
|
public function siteSidebar()
|
|
{
|
|
global $L;
|
|
global $archives;
|
|
global $url;
|
|
|
|
$filter = $url->filters('archive');
|
|
|
|
$html = '<div class="plugin plugin-archives">';
|
|
$html .= '<h2 class="plugin-label">' . $this->getValue('label') . '</h2>';
|
|
$html .= '<div class="plugin-content">';
|
|
$html .= MenuHelper::getArchive($this->getValue('monthly'), "flat-list");
|
|
$html .= '</div>';
|
|
$html .= '</div>';
|
|
|
|
return $html;
|
|
}
|
|
}
|