* get the content from database */ $content = $extjsPortalStateObj->getContent(); foreach ($content as $item => $itemDetails) { /** * retrieve layout type & columns configuration & columns size; columns configuration & columns size is used on the bottom * those are retrieved for the all items in $extjsPortalStateObj->content, because type is ExtJsPortalStatePeer::TYPE_TABBED */ $portalTitle = $extjsPortalStateObj->getPortalTitle($item); $portalLayoutType = $extjsPortalStateObj->getPortalLayoutType($item); $portalColumns = $extjsPortalStateObj->getColumns($item); $portalColumnsSize = $extjsPortalStateObj->getColumnsSize($item); /** * start new tab for each item */ ${'tab' . $item} = $layout->startTab(array('title' => $portalTitle, 'portalLayoutType' => $portalLayoutType, 'portalWidgets' => array(array('title' => 'Some widgets', 'widgets' => array('/loganalysis/logSearch', '/appliance_system/editEmail'))))); /** * associations are only to be used in this example * in real life example, just use the idxml from the added widget */ $associations = array('interface/somepanel' => $panel, 'interface/someform' => $form, 'interface/somegrid' => $grid); foreach ($portalColumns as $k => $widgets) { //instanciate a column ${'column' . $k} = ${'tab' . $item}->startColumn(array('columnWidth' => $portalColumnsSize[$k] / 100)); foreach ($widgets as $widget) { ${'column' . $k}->addItem($associations[$widget->idxml]); } //end the instanciation of a column ${'tab' . $item}->endColumn(${'column' . $k}); } $layout->endTab(${'tab' . $item});