24 public static function row($ids,$row,$index = null){
31 if(is_array($id) || !in_array($id,$row)) $result[] = $id;
33 if($index !==
false) $result[] = $row;
37 protected function trim($id){
38 return ltrim($id,self::RENDER_CAPTION . self::RENDER_WIDGET . self::RENDER_BOTH);
41 protected function next($ids){
42 while($id = array_shift($ids)){
43 if(is_array($id)) $id = $this->
next($id);
44 if($id && ($id != self::RENDER_WILD))
return $id;
49 protected function expand($ids,&$done = []){
51 while($id = array_shift($ids))
52 if(is_array($id)) $result[] = $this->
expand($id,$done);
53 elseif($id == self::RENDER_WILD){
54 $todo = array_diff($this->_view->notRenderedWidgetIds(),$done);
55 $next = $this->
trim($this->
next($ids));
56 while(($id = array_shift($todo)) && ($id != $next)) $done[] = $this->
trim($result[] = $id);
58 else $done[] = $this->
trim($result[] = $id);
63 return substr($id,0,1) == self::RENDER_WIDGET ? null : $this->_view->widget($this->
trim($id))->renderCaption();
67 return substr($id,0,1) == self::RENDER_CAPTION ? null : $this->_view->renderWidget($this->
trim($id));
72 foreach($this->
expand($ids) as $id) $content .= is_array($id)
73 ? $this->html->div($this->
build($id),null,
'fred-sub ids-' . implode($id))
79 return $this->_view->component(
'html');
const RENDER_CAPTION
ID prefix indicating to render only the caption.
const RENDER_BOTH
ID prefix indicating to render both caption and widget (explicitly).
const RENDER_WIDGET
ID prefix indicating to render only the widget.
const RENDER_WILD
Render all (between previous and next id).
static row($ids, $row, $index=null)
Add a row.