You are here

function arrange_fields_add_form_css_js in Arrange Fields 6

Same name and namespace in other branches
  1. 7 arrange_fields.module \arrange_fields_add_form_css_js()

This function simply adds the CSS and JS files we need when on the node/edit page. I have to do it this way (and set this function in an #after_build on the form) in order to make sure this still gets called, even if the form fails validation.

This is not used when actually arranging the fields of a form, but when a user is entering data into the form. If they forgot a required field (or whatever) and failed validation, we need to make sure these files get reloaded for them, otherwise the field positions will revert back to the default!

1 string reference to 'arrange_fields_add_form_css_js'
arrange_fields_form_alter in ./arrange_fields.module
Implementation of hook_form_alter().

File

./arrange_fields.module, line 922

Code

function arrange_fields_add_form_css_js($element) {
  drupal_add_css(drupal_get_path("module", "arrange_fields") . "/css/arrange_fields.css");
  drupal_add_js(drupal_get_path("module", "arrange_fields") . "/js/arrange_fields_node_edit.js");
  return $element;
}