You are here

function css3pie_admin in css3pie 6

Same name and namespace in other branches
  1. 7.2 css3pie.admin.inc \css3pie_admin()

CSS3PIE Administrative settings form

1 string reference to 'css3pie_admin'
css3pie_menu in ./css3pie.module
Implements hook_menu() admin settings page under themes page

File

./css3pie.admin.inc, line 6

Code

function css3pie_admin() {
  $form = array();
  $form['css3pie_css_selectors'] = array(
    '#type' => 'textarea',
    '#title' => t('CSS Selectors'),
    '#required' => TRUE,
    '#cols' => 40,
    '#rows' => 3,
    '#prefix' => '<div class="css3pie-selector">',
    '#suffix' => '</div>',
    '#default_value' => variable_get('css3pie_css_selectors', ''),
    '#description' => t('Use normal CSS Selectors here .class or #id use new line per selector'),
  );
  if (variable_get('css3pie_css_use_js_mode', FALSE)) {
    $form['css3pie_css_comment'] = array(
      '#type' => 'checkbox',
      '#title' => t('Display namespace as comment in css file'),
      '#description' => t('Renders the used namespace names in to css as comment'),
      '#default_value' => variable_get('css3pie_css_comment', TRUE),
      '#disabled' => TRUE,
    );
    $form['css3pie_css_use_php_wrapper'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use PHP wrapper'),
      '#description' => t("Old server doesn't have the right mime type for .htc files so you can use the php wrapper to simulate it (uses the PIE.php from css3pie package)."),
      '#default_value' => variable_get('css3pie_css_use_php_wrapper', FALSE),
      '#disabled' => TRUE,
    );
  }
  else {
    $form['css3pie_css_comment'] = array(
      '#type' => 'checkbox',
      '#title' => t('Display namespace as comment in css file'),
      '#description' => t('Renders the used namespace names in to css as comment'),
      '#default_value' => variable_get('css3pie_css_comment', TRUE),
    );
    $form['css3pie_css_use_php_wrapper'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use PHP wrapper'),
      '#description' => t("Old server doesn't have the right mime type for .htc files so you can use the php wrapper to simulate it (uses the PIE.php from css3pie package)."),
      '#default_value' => variable_get('css3pie_css_use_php_wrapper', FALSE),
    );
  }
  $form['css3pie_css_use_js_mode'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use PIE JavaScript edition'),
    '#description' => t("Use PIE JavaScript edition instead of .htc file."),
    '#default_value' => variable_get('css3pie_css_use_js_mode', FALSE),
  );
  if (!file_exists(libraries_get_path('PIE') . '/PIE.htc')) {
    drupal_set_message(t('PIE library missing. Download PIE library from http://css3pie.com/ and add it to sites/all/libraries/PIE.'), 'error');
  }
  return system_settings_form($form);
}