| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* Implementation of hook_init(). |
* Implementation of hook_init(). |
| 5 |
|
* TODO: change this to an initializing function the developer must add |
| 6 |
|
* in the needed scope so this is not added for every page. |
| 7 |
*/ |
*/ |
| 8 |
function jsv_init() { |
function jsv_init() { |
| 9 |
drupal_add_js(drupal_get_path('module', 'jsv').'/js/validator.js'); |
drupal_add_js(drupal_get_path('module', 'jsv').'/js/validator.js'); |
| 10 |
drupal_add_css(drupal_get_path('module', 'jsv').'/css/validator.css'); |
drupal_add_css(drupal_get_path('module', 'jsv').'/css/validator.css'); |
| 11 |
|
|
| 12 |
|
theme('jsv_settings'); |
| 13 |
|
} |
| 14 |
|
|
| 15 |
|
/** |
| 16 |
|
* Settings. |
| 17 |
|
* TODO: change to drupal_alter hook in D6 |
| 18 |
|
*/ |
| 19 |
|
function theme_jsv_settings(){ |
| 20 |
|
$settings = array('jsv' => array( |
| 21 |
|
// ORIENTATIONS |
| 22 |
|
'orientationValid' => 'before', |
| 23 |
|
'orientationError' => 'before', |
| 24 |
|
// MESSAGES |
| 25 |
|
'validMessages' => TRUE, // should valid messages even display |
| 26 |
|
'errorNumeric' => 'Numbers only.', // numeric error message |
| 27 |
|
'errorEmail' => 'Invalid email.', // email error message |
| 28 |
|
),); |
| 29 |
|
|
| 30 |
|
drupal_add_js($settings, 'setting'); |
| 31 |
} |
} |