function live_css_init in Live CSS 7
Same name and namespace in other branches
- 6.2 live_css.module \live_css_init()
- 6 live_css.module \live_css_init()
- 7.2 live_css.module \live_css_init()
Implements hook_init().
File
- ./
live_css.module, line 100
Code
function live_css_init() {
//check permissions
if (user_access('edit css')) {
//set settings
$theme = variable_get('live_css_theme', 'twilight');
$settings = array();
$settings['theme'] = $theme;
$settings['autoload'] = false;
$settings['hideadmin'] = variable_get('live_css_hideadmin', 1);
$settings['hidemodules'] = variable_get('live_css_hidemodules', 0);
drupal_add_js(array(
'live_css' => $settings,
), 'setting');
drupal_add_js(drupal_get_path('module', 'live_css') . '/ace/src/ace.js');
drupal_add_js(drupal_get_path('module', 'live_css') . '/ace/src/mode-css.js');
drupal_add_js(drupal_get_path('module', 'live_css') . '/ace/src/theme-' . $theme . '.js');
drupal_add_js(drupal_get_path('module', 'live_css') . '/plugins.js');
//load the list of stylesheets
drupal_add_css(drupal_get_path('module', 'live_css') . '/css.css', 'module', 'all', FALSE);
drupal_add_js(drupal_get_path('module', 'live_css') . '/css.js');
}
}