function live_css_admin in Live CSS 7.2
Same name and namespace in other branches
- 6.2 live_css.module \live_css_admin()
- 7 live_css.module \live_css_admin()
Implements hook_settings().
1 string reference to 'live_css_admin'
- live_css_menu in ./
live_css.module - Implements hook_menu().
File
- ./
live_css.module, line 99 - Allows editing and a live view of all changes in real-time in the browser.
Code
function live_css_admin() {
$form = array();
$form['live_css_switchsave'] = array(
'#type' => 'checkbox',
'#title' => t('Switch/Save <strong>[NEW]</strong>'),
'#default_value' => variable_get('live_css_switchsave', 0),
'#description' => t('Choose to save your work automatically upon switching between multiple files.'),
);
$form['live_css_less'] = array(
'#type' => 'checkbox',
'#title' => t('Enable LESS Support'),
'#default_value' => variable_get('live_css_less', 0),
'#description' => t('Allows the live editing and display of LESS files on the site, by simply embedding stylesheets with a "less" extension instead of "css". The Less is parsed on each page load, even for anonymous users. In production you may wish to disable this feature and use the LESS module instead.'),
);
$form['live_css_flush'] = array(
'#type' => 'checkbox',
'#title' => t('CSS and JS cache flush'),
'#default_value' => variable_get('live_css_flush', 1),
'#description' => t('Flush CSS and Javascript cache on every save.'),
);
$form['live_css_hideadmin'] = array(
'#type' => 'checkbox',
'#title' => t('Hide Admin Menu'),
'#default_value' => variable_get('live_css_hideadmin', 1),
'#description' => t('Automatically hides the administration menu when editing CSS.'),
);
$form['live_css_hidemodules'] = array(
'#type' => 'checkbox',
'#title' => t('Only show theme CSS'),
'#default_value' => variable_get('live_css_hidemodules', 1),
'#description' => t('Removes module and other styles from the CSS list.'),
);
$form['live_css_storage'] = array(
'#type' => 'checkbox',
'#title' => t('Consistent Editor State'),
'#default_value' => variable_get('live_css_storage', 1),
'#description' => t('Remembers the current file and file position to maintain this between page loads.'),
);
$form['live_css_theme'] = array(
'#type' => 'select',
'#title' => t('Editor Theme'),
'#default_value' => variable_get('live_css_theme', 'twilight'),
'#options' => live_css_list_themes(),
);
$form['live_css_fontsize'] = array(
'#type' => 'select',
'#title' => t('Font Size'),
'#default_value' => variable_get('live_css_fontsize', '12px'),
'#options' => array(
'8px' => '8px',
'10px' => '10px',
'11px' => '11px',
'12px' => '12px',
'14px' => '14px',
'16px' => '16px',
'18px' => '18px',
),
);
$form['live_css_softtabs'] = array(
'#type' => 'checkbox',
'#title' => t('Soft Tabs'),
'#default_value' => variable_get('live_css_softtabs', 1),
'#description' => t('Use spaces instead of a tab character.'),
);
$form['live_css_tabsize'] = array(
'#type' => 'select',
'#title' => t('Tab Size'),
'#default_value' => variable_get('live_css_tabsize', 2),
'#description' => t('When using soft tabs, specify how many spaces to insert for the tab character.<p><em>HINT: Drupal CSS coding standards dictate 2 spaces in lieu of traditional tabs</em></p>'),
'#options' => array(
1 => '1',
2 => '2',
3 => '3',
4 => '4',
),
);
$form['live_css_path_to_files'] = array(
'#type' => 'textfield',
'#attributes' => array(
'placeholder' => t('Example: sites\\/[sitename]\\/themes\\/myTheme'),
),
'#title' => t('Limit access to CSS files <strong>[NEW]</strong>'),
'#default_value' => variable_get('live_css_path_to_files', ''),
'#description' => t('Show only the CSS files found in this regular expression (RegEx) - <em>Trailing slash following path should be removed.</em><p><strong>Overrides "Only show theme CSS" setting for limited user.</strong></p>'),
);
return system_settings_form($form);
}