function panels_flexible_panels in Panels 5.2
Same name and namespace in other branches
- 6.3 plugins/layouts/flexible/flexible.inc \panels_flexible_panels()
- 6.2 layouts/flexible/flexible.inc \panels_flexible_panels()
- 7.3 plugins/layouts/flexible/flexible.inc \panels_flexible_panels()
Define the actual list of columns and rows for this flexible panel.
1 string reference to 'panels_flexible_panels'
- panels_flexible_panels_layouts in layouts/
flexible.inc - implementation of hook_panels_layouts
File
- layouts/
flexible.inc, line 250
Code
function panels_flexible_panels($display, $settings) {
$panels = array();
if (empty($settings)) {
$settings = panels_flexible_default_panels();
}
if (!empty($settings['sidebars']['left'])) {
$panels['sidebar_left'] = t('Left sidebar');
}
if (!empty($settings['sidebars']['right'])) {
$panels['sidebar_right'] = t('Right sidebar');
}
for ($row = 1; $row <= intval($settings['rows']); $row++) {
for ($col = 1; $col <= intval($settings["row_{$row}"]['columns']); $col++) {
if (!empty($settings["row_{$row}"]['names'][$col - 1])) {
$panels["row_{$row}_{$col}"] = $settings["row_{$row}"]['names'][$col - 1];
}
else {
$panels["row_{$row}_{$col}"] = t("Row @row, Column @col", array(
'@row' => $row,
'@col' => $col,
));
}
}
}
return $panels;
}