| 1 |
<?php
|
| 2 |
/**
|
| 3 |
* @file node_edit_protection.module
|
| 4 |
*/
|
| 5 |
|
| 6 |
function node_edit_protection_form_alter(&$form, $form_state, $form_id) {
|
| 7 |
if (_nep_is_node_edit($form, $form_id)) {
|
| 8 |
drupal_add_js(drupal_get_path('module', 'node_edit_protection') . '/node-edit-protection.js');
|
| 9 |
}
|
| 10 |
}
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Is this a node edit form?
|
| 14 |
*/
|
| 15 |
function _nep_is_node_edit($form, $form_id) {
|
| 16 |
return isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id;
|
| 17 |
}
|
| 18 |
|
| 19 |
|
| 20 |
|