1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-29 10:38:08 +01:00

Added custom caption configuration to News Archive Menu.

This commit is contained in:
Cameron 2017-10-20 12:10:01 -07:00
parent 8d95e4e176
commit 9ac287a4a3
3 changed files with 29 additions and 4 deletions

View File

@ -93,6 +93,12 @@ class news_menu
$fields['caption'] = array('title'=> LAN_CAPTION, 'type'=>'text', 'multilan'=>true, 'writeParms'=>array('size'=>'xxlarge'));
break;
case "news_archive":
$fields['caption'] = array('title'=> LAN_CAPTION, 'type'=>'text', 'multilan'=>true, 'writeParms'=>array('size'=>'xxlarge'));
// $fields['badges'] = array('title'=> "Display Badges", 'type'=>'boolean');
break;
}
return $fields;

View File

@ -24,6 +24,7 @@ foreach($tmp as $id => $val)
$arr[$year][$month][] = $val;
}
$text = "<ul class='news-archive-menu'>";
foreach($arr as $year=>$val)
@ -50,8 +51,16 @@ foreach($arr as $year=>$val)
$idm = "news-archive-".$month;
$text .= "<li >";
$text .= "<a class='e-expandit' href='#".$idm."'>".$monthLabels[$month]."</a>";
$text .= "<li>";
$text .= "<a class='e-expandit' href='#".$idm."'>".$monthLabels[$month];
if(!empty($parm['badges'])) // param only (no menu-manager config. To be replaced by template.
{
$num = count($items);
$text .= "<span class='badge'>".$num."</span>";
}
$text .= "</a>";
$text .= "<ul id='".$idm."' class='news-archive-menu-items' style='display:none'>";
foreach($items as $row)
@ -70,9 +79,13 @@ foreach($arr as $year=>$val)
}
$text .= "</ul>";
$caption = !empty($parm['caption'][e_LANGUAGE]) ? $parm['caption'][e_LANGUAGE] : LAN_NEWSARCHIVE_MENU_TITLE;
e107::plugLan('news');
e107::getRender()->tablerender(LAN_NEWSARCHIVE_MENU_TITLE, $text);
e107::getRender()->tablerender($caption, $text);
//e107::getDebug()->log($arr);

View File

@ -126,4 +126,10 @@ $NEWS_MENU_TEMPLATE['carousel']['item'] = '<!-- Start Item -->
$NEWS_MENU_TEMPLATE['carousel']['nav'] = '<li data-target="#news-carousel" data-slide-to="{COUNT}" class="{ACTIVE}"><a href="#">{NEWS_SUMMARY}</a></li>';
$NEWS_MENU_TEMPLATE['carousel']['nav'] = '<li data-target="#news-carousel" data-slide-to="{COUNT}" class="{ACTIVE}"><a href="#">{NEWS_SUMMARY}</a></li>';
// TODO
$NEWS_MENU_TEMPLATE['archive'] = array();