mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Added custom caption configuration to News Archive Menu.
This commit is contained in:
@@ -93,6 +93,12 @@ class news_menu
|
|||||||
$fields['caption'] = array('title'=> LAN_CAPTION, 'type'=>'text', 'multilan'=>true, 'writeParms'=>array('size'=>'xxlarge'));
|
$fields['caption'] = array('title'=> LAN_CAPTION, 'type'=>'text', 'multilan'=>true, 'writeParms'=>array('size'=>'xxlarge'));
|
||||||
break;
|
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;
|
return $fields;
|
||||||
|
@@ -24,6 +24,7 @@ foreach($tmp as $id => $val)
|
|||||||
$arr[$year][$month][] = $val;
|
$arr[$year][$month][] = $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$text = "<ul class='news-archive-menu'>";
|
$text = "<ul class='news-archive-menu'>";
|
||||||
|
|
||||||
foreach($arr as $year=>$val)
|
foreach($arr as $year=>$val)
|
||||||
@@ -50,8 +51,16 @@ foreach($arr as $year=>$val)
|
|||||||
|
|
||||||
$idm = "news-archive-".$month;
|
$idm = "news-archive-".$month;
|
||||||
|
|
||||||
$text .= "<li >";
|
$text .= "<li>";
|
||||||
$text .= "<a class='e-expandit' href='#".$idm."'>".$monthLabels[$month]."</a>";
|
$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'>";
|
$text .= "<ul id='".$idm."' class='news-archive-menu-items' style='display:none'>";
|
||||||
|
|
||||||
foreach($items as $row)
|
foreach($items as $row)
|
||||||
@@ -70,9 +79,13 @@ foreach($arr as $year=>$val)
|
|||||||
}
|
}
|
||||||
$text .= "</ul>";
|
$text .= "</ul>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$caption = !empty($parm['caption'][e_LANGUAGE]) ? $parm['caption'][e_LANGUAGE] : LAN_NEWSARCHIVE_MENU_TITLE;
|
||||||
|
|
||||||
e107::plugLan('news');
|
e107::plugLan('news');
|
||||||
|
|
||||||
e107::getRender()->tablerender(LAN_NEWSARCHIVE_MENU_TITLE, $text);
|
e107::getRender()->tablerender($caption, $text);
|
||||||
|
|
||||||
//e107::getDebug()->log($arr);
|
//e107::getDebug()->log($arr);
|
||||||
|
|
||||||
|
@@ -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();
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user