5 class Table extends \Rsi\Fred\Controller\View\Html\Builder{
7 public function build($ids){
10 foreach($this->
expand($ids) as $id)
if(is_array($id)){
11 $first_caption = $widgets =
false;
15 if($caption ===
false) $hidden .= $widget;
17 if($first_caption ===
false) $first_caption = $caption;
18 else $widgets .= $caption;
22 if($first_caption || $widgets) $table .= $html->tr(
23 $html->th($first_caption,null,
'row') . $html->td($widgets),[
'class' =>
'fred-multi ids-' . implode(
'-',$id)]
29 if($caption ===
false) $hidden .= $widget;
30 elseif(in_array(substr($id,0,1),[self::RENDER_BOTH,self::RENDER_WIDGET])){
31 if($caption) $table .= $html->tr($html->th($caption,[
'colspan' => 2]));
32 $table .= $html->tr($html->td($widget,[
'colspan' => 2]));
34 else $table .= $html->tr($html->th($caption,null,
'row') . $html->td($widget),[
'class' =>
'fred-row id-' . $id]);
36 return $hidden . $html->table($table,[
'role' =>
'presentation']);