Commit 465a6e2a authored by Nigel McNie's avatar Nigel McNie
Browse files

Move installing view column widths into its own function, so it can be called...

Move installing view column widths into its own function, so it can be called by the 0.8 - 0.9 migration.
parent bb456414
......@@ -668,31 +668,8 @@ function core_install_firstcoredata_defaults() {
}
// install the view column widths
$layouts = array(
2 => array(
'50,50',
'67,33',
'33,67',
),
3 => array(
'33,33,33',
'25,50,25',
'15,70,15',
),
4 => array(
'25,25,25,25',
'20,30,30,20',
),
);
install_view_column_widths();
$layout = new StdClass;
foreach ($layouts as $column => $widths) {
foreach ($widths as $width) {
$layout->columns = $column;
$layout->widths = $width;
insert_record('view_layout', $layout);
}
}
db_commit();
}
......@@ -850,4 +827,38 @@ function install_blocktype_categories() {
}
}
/**
* Installs all the allowed column widths for views. Used when installing core
* defaults, and also when upgrading from 0.8 to 0.9
*/
function install_view_column_widths() {
db_begin();
$layouts = array(
2 => array(
'50,50',
'67,33',
'33,67',
),
3 => array(
'33,33,33',
'25,50,25',
'15,70,15',
),
4 => array(
'25,25,25,25',
'20,30,30,20',
),
);
$layout = new StdClass;
foreach ($layouts as $column => $widths) {
foreach ($widths as $width) {
$layout->columns = $column;
$layout->widths = $width;
insert_record('view_layout', $layout);
}
}
db_commit();
}
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment