You are here

function _classy_panel_styles_attach in Classy Panel Styles 7

Attaches our custom css and js to a form.

Parameters

array $form: The Drupal Form API form array.

2 calls to _classy_panel_styles_attach()
classy_panel_styles_form_alter in ./classy_panel_styles.module
Implements hook_form_alter().
classy_panel_styles_form_ctools_export_ui_edit_item_wizard_form_alter in ./classy_panel_styles.module
Implements hook_form_FORM_ID_alter() for ctools_export_ui_edit_item_wizard().

File

./classy_panel_styles.module, line 148
Module file for Classy Panel Styles.

Code

function _classy_panel_styles_attach(array &$form) {

  // Add custom CSS file.
  $css_path = variable_get(CLASSY_PANEL_STYLES_CSS_PATH, FALSE);
  if ($css_path && file_exists($css_path)) {
    $form['#attached']['css'][] = $css_path;
  }

  // Get path to Classy Panel Styles module.
  $module_path = drupal_get_path('module', 'classy_panel_styles');

  // Attach admin CSS file.
  $form['#attached']['css'][] = $module_path . '/admin_styles/css/classy_panel_styles.admin.css';

  // Attach JS file.
  $form['#attached']['js'][] = $module_path . '/js/classy_panel_styles.js';
}