function css_injector_admin in CSS Injector 7
Implements hook_admin().
1 string reference to 'css_injector_admin'
- css_injector_menu in ./
css_injector.module - Implements hook_menu(). Defines menu callbacks for CSS Injector's configuration pages.
File
- ./
css_injector.module, line 154 - Allows administrators to inject CSS into the page output based on configurable rules. Useful for adding simple CSS tweaks without modifying a site's official theme.
Code
function css_injector_admin() {
$form = array();
$themes = _css_injector_get_themes();
$default_theme = variable_get('theme_default');
$rule_themes = variable_get('css_injector_default_theme', $default_theme);
$form['css_injector_default_theme'] = array(
'#type' => 'select',
'#title' => t('CSS injector default themes'),
'#options' => $themes,
'#default_value' => $rule_themes,
'#description' => t('Select themes css will be applied to. @theme theme is selected by default.', array(
'@theme' => $themes[$default_theme],
)),
'#multiple' => TRUE,
);
if (!module_exists('ace_editor')) {
$form['css_injector_use_ace'] = array(
'#type' => 'checkbox',
'#title' => t('Use Ace syntex highlighter'),
'#default_value' => variable_get('css_injector_use_ace', 1),
'#description' => t("Check if you want to enhance your editing experience with Ace syntex highlighter. If checked, Ace will be loaded via CDN."),
);
}
else {
$form['css_injector_use_ace_error'] = array(
'#type' => 'markup',
'#markup' => t('You already have Ace highlighter module installed. Please enable it to enhance your editing experience with Ace syntex highlighter.'),
);
}
$form['css_injector_import'] = array(
'#type' => 'markup',
'#markup' => '<br>' . t('If you want to import your css injector files from dev site to production, you can use !this sandox module. </br> Be aware, sandbox modules are not supported and you are using it on your own risk.', array(
'!this' => l('CSS Injector import', 'https://www.drupal.org/sandbox/stillfinder/2597592'),
)) . '</br>',
);
return system_settings_form($form);
}