dbFields = array(
'label'=>'Latest content',
'homeLink'=>true,
'amountOfItems'=>5
);
}
// Method called on the settings of the plugin on the admin area
public function form()
{
global $Language;
$html = '
';
$html .= '';
$html .= '';
$html .= ''.$Language->get('This title is almost always used in the sidebar of the site').'';
$html .= '
';
$html .= '
';
$html .= '';
$html .= '';
$html .= ''.$Language->get('Show the home link on the sidebar').'';
$html .= '
';
$html .= '
';
$html .= '';
$html .= '';
$html .= '
';
return $html;
}
// Method called on the sidebar of the website
public function siteSidebar()
{
global $Language;
global $Url;
global $Site;
global $dbPages;
global $pagesByParent;
// Amount of pages to show
$amountOfItems = $this->getValue('amountOfItems');
// Page number the first one
$pageNumber = 1;
// Only published pages
$onlyPublished = true;
// Get the list of pages
$pages = $dbPages->getList($pageNumber, $amountOfItems, $onlyPublished, true);
// HTML for sidebar
$html = '
';
$html .= '
'.$this->getValue('label').'
';
$html .= '
';
$html .= '
';
if(ORDER_BY==='position') {
foreach($pagesByParent[PARENT] as $Parent) {
$html .= '
';
}
// Get keys of pages
$keys = array_keys($pages);
foreach($keys as $pageKey) {
// Create the page object from the page key
$page = buildPage($pageKey);
$html .= '