mirror of
https://github.com/e107inc/e107.git
synced 2025-08-26 15:54:43 +02:00
Issue #1512 News Grid Menu
This commit is contained in:
@@ -26,7 +26,7 @@ class news_menu
|
||||
* Configuration Fields.
|
||||
* @return array
|
||||
*/
|
||||
public function config($menu='')
|
||||
public function config($menu='') //TODO LAN
|
||||
{
|
||||
$fields = array();
|
||||
$categories = array();
|
||||
@@ -47,6 +47,16 @@ class news_menu
|
||||
$fields['category'] = array('title'=> LAN_CATEGORY, 'type'=>'dropdown', 'writeParms'=>array('optArray'=>$categories, 'default'=>'blank'));
|
||||
break;
|
||||
|
||||
case "news_grid":
|
||||
$fields['caption'] = array('title'=> LAN_CAPTION, 'type'=>'text', 'multilan'=>true, 'writeParms'=>array('size'=>'xxlarge'));
|
||||
$fields['category'] = array('title'=> LAN_CATEGORY, 'type'=>'dropdown', 'writeParms'=>array('optArray'=>$categories, 'default'=>'blank'));
|
||||
$fields['layout'] = array('title'=> "Layout", 'type'=>'method', 'writeParms'=>'');
|
||||
$fields['count'] = array('title'=> "Number of Items", 'type'=>'number', 'writeParms'=>array('pattern'=>'[0-9]*', 'default'=>4));
|
||||
$fields['titleLimit'] = array('title'=> "Title Character Limit", 'type'=>'number', 'writeParms'=>'');
|
||||
$fields['summaryLimit'] = array('title'=> "Summary Character Limit", 'type'=>'number', 'writeParms'=>'');
|
||||
// TODO Add a field for 'latest' vs 'sticky' vs 'assigned by news item (news_render_type)'
|
||||
break;
|
||||
|
||||
|
||||
case "news_categories":
|
||||
$fields['caption'] = array('title'=> LAN_CAPTION, 'type'=>'text', 'multilan'=>true, 'writeParms'=>array('size'=>'xxlarge'));
|
||||
@@ -74,3 +84,31 @@ class news_menu
|
||||
|
||||
|
||||
}
|
||||
|
||||
// optional
|
||||
class news_menu_form extends e_form
|
||||
{
|
||||
|
||||
public function layout($curVal)
|
||||
{
|
||||
|
||||
$arr = array(
|
||||
"col-md-6" => "<div class='row'><div class='col-md-6'><div class='alert alert-info'>1/2</div></div><div class='col-md-6'><div class='alert alert-info'>1/2</div></div></div>",
|
||||
"col-md-4" => "<div class='row'><div class='col-md-4'><div class='alert alert-info'>1/3</div></div><div class='col-md-4'><div class='alert alert-info'>1/3</div></div><div class='col-md-4'><div class='alert alert-info'>1/3</div></div></div>",
|
||||
"col-md-3" => "<div class='row'><div class='col-md-3 '><div class='alert alert-info'>1/4</div></div><div class='col-md-3'><div class='alert alert-info'>1/4</div></div><div class='col-md-3'><div class='alert alert-info'>1/4</div></div><div class='col-md-3'><div class='alert alert-info'>1/4</div></div></div>",
|
||||
);
|
||||
|
||||
$text = '<table class="table news-menu-shade">';
|
||||
|
||||
foreach($arr as $k=>$v)
|
||||
{
|
||||
|
||||
$text .= "<tr><td>".$this->radio('layout', $k, $curVal, array('label'=>$k))."</td><td>".$v."</td></tr>";
|
||||
}
|
||||
|
||||
$text .= "</table>";
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user