function sweaver_install in Sweaver 7
Same name and namespace in other branches
- 6 sweaver.install \sweaver_install()
Implements hook_install().
File
- ./
sweaver.install, line 126 - Sweaver install file.
Code
function sweaver_install() {
// 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' => st('Font'),
'properties' => array(
0 => 'font-family',
1 => 'font-properties-wrapper',
),
),
'two' => array(
'title' => st('Background'),
'properties' => array(
0 => 'background-color',
1 => 'background-image',
2 => 'background-repeat',
3 => 'background-attachment',
4 => 'background-position',
),
),
'three' => array(
'title' => st('Borders & Spacing'),
'properties' => array(
0 => 'position-settings',
1 => 'border-style',
2 => 'border-color',
3 => 'border-collapse',
4 => 'border-spacing',
5 => 'vertical-align',
),
),
'four' => array(
'title' => st('Other'),
'properties' => array(
0 => 'height',
1 => 'width',
2 => 'create-custom-code',
),
),
);
variable_set('sweaver_editor_form_configuration', $editor_form_configuration);
// Weights for plugins.
$plugins_weight = array(
'sweaver_plugin' => -51,
'sweaver_plugin_editor' => -49,
'sweaver_plugin_styles' => -48,
'sweaver_plugin_advanced' => -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_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);
variable_set('sweaver_plugin_status_sweaver_plugin_advanced', TRUE);
// Let images be handled by the images plugin.
variable_set('sweaver_plugin_handle_images', 'sweaver_plugin_images');
}