dbFields = array(
'label' => 'Archives',
'monthly' => false,
);
}
public function form()
{
global $L;
$html = '
';
$html .= '';
$html .= '';
$html .= '' . $L->get('This title is almost always used in the sidebar of the site') . '';
$html .= '
';
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 = '';
$html .= '
' . $this->getValue('label') . '
';
$html .= '
';
$html .= '
';
// By default the database of tags are alphanumeric sorted
foreach ($archives->db as $key => $fields) {
if (
($this->getValue('monthly') && strlen($key) != 4)
|| (!$this->getValue('monthly') && strlen($key) == 4)
) {
$html .= '- ';
$html .= '';
$html .= $fields['name'];
$html .= '';
$html .= '
';
}
}
$html .= '
';
$html .= '
';
$html .= '
';
return $html;
}
}