function sweaver_install in Sweaver 6
Same name and namespace in other branches
- 7 sweaver.install \sweaver_install()
Implementation of hook_install().
File
- ./
sweaver.install, line 57 - Sweaver install file.
Code
function sweaver_install() {
drupal_install_schema('sweaver');
// Alter the module weight to make sure we are the last one.
db_query("UPDATE {system} SET weight = 99 WHERE name = 'sweaver'");
// Set default editor configuration.
$editor_form_configuration = array(
'one' => array(
'title' => 'Font',
'properties' => array(
0 => 'font-family',
1 => 'font-style',
2 => 'font-weight',
3 => 'font-size-wrapper',
4 => 'color',
5 => 'text-align',
6 => 'text-decoration',
7 => 'vertical-align',
),
),
'two' => array(
'title' => 'Background',
'properties' => array(
0 => 'background-color',
1 => 'background-image',
2 => 'background-repeat',
3 => 'background-position',
4 => 'background-attachment',
),
),
'three' => array(
'title' => 'Spacing',
'properties' => array(
0 => 'padding',
1 => 'margin',
2 => 'border',
3 => 'border-style',
4 => 'border-color',
5 => 'border-collapse',
6 => 'border-spacing',
),
),
'four' => array(
'title' => 'Other',
'properties' => array(
0 => 'height',
1 => 'width',
),
),
);
variable_set('sweaver_editor_form_configuration', $editor_form_configuration);
// Selector order.
$sweaver_selector_order = array(
'body' => -100,
'h1' => -99,
'h2' => -98,
'h3' => -97,
'li' => -96,
'link' => -95,
'ol' => -94,
'p' => -93,
'ul' => -92,
'form' => -91,
'label' => -90,
'input' => -89,
'textarea' => -88,
'submit' => -87,
'allids' => -86,
'allclasses' => -85,
'alltags' => -84,
'span' => -83,
'div' => -82,
);
variable_set('sweaver_selector_order', $sweaver_selector_order);
// Weights for plugins.
$plugins_weight = array(
'sweaver_plugin' => -51,
'sweaver_plugin_editor' => -49,
'sweaver_plugin_styles' => -48,
'sweaver_plugin_customcss' => -47,
'sweaver_plugin_palettes' => -46,
'sweaver_plugin_images' => -45,
'sweaver_plugin_themeswitch' => -44,
'sweaver_plugin_themesettings' => -43,
'sweaver_plugin_themeclasses' => -42,
'sweaver_plugin_fontface' => -41,
'sweaver_plugin_ds' => -40,
'sweaver_plugin_kb' => -39,
);
variable_set('sweaver_plugins_weight', $plugins_weight);
// Enable some plugins by default.
variable_set('sweaver_plugin_status_sweaver_plugin', TRUE);
variable_set('sweaver_plugin_status_sweaver_plugin_editor', TRUE);
variable_set('sweaver_plugin_status_sweaver_plugin_styles', TRUE);
variable_set('sweaver_plugin_status_sweaver_plugin_images', TRUE);
// Let images be handled by the images plugin.
variable_set('sweaver_plugin_handle_images', 'sweaver_plugin_images');
}