diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-31 20:44:22 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-31 20:44:22 +0000 |
commit | fbe690c624c1de7bd556591f67bf38c70a5327a0 (patch) | |
tree | 6a0d80d8e858429967516e0982a86ae8a6b38c97 /modules/taxonomy/taxonomy.admin.inc | |
parent | 12df73d2cf42ec33ff7c95c24769fc31350c5154 (diff) | |
download | brdo-fbe690c624c1de7bd556591f67bf38c70a5327a0.tar.gz brdo-fbe690c624c1de7bd556591f67bf38c70a5327a0.tar.bz2 |
#471018 follow-up by sun: Apply generic pattern/js for hiding machine readable names to taxonomy vocabularies.
Diffstat (limited to 'modules/taxonomy/taxonomy.admin.inc')
-rw-r--r-- | modules/taxonomy/taxonomy.admin.inc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index 18f6534fc..a95409e3c 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -103,7 +103,6 @@ function theme_taxonomy_overview_vocabularies($form) { * @see taxonomy_form_vocabulary_submit() */ function taxonomy_form_vocabulary(&$form_state, $edit = array()) { - drupal_add_js(drupal_get_path('module', 'taxonomy') . '/vocabulary.js'); if (!is_array($edit)) { $edit = (array)$edit; } @@ -130,7 +129,20 @@ function taxonomy_form_vocabulary(&$form_state, $edit = array()) { '#default_value' => $edit['name'], '#maxlength' => 255, '#required' => TRUE, - '#field_suffix' => ' <small id="vocabulary-name-suffix"> </small>', + '#field_suffix' => ' <small id="edit-name-suffix"> </small>', + ); + $js_settings = array( + 'type' => 'setting', + 'data' => array( + 'machineReadableValue' => array( + 'name' => array( + 'text' => t('Machine name'), + 'target' => 'machine-name', + 'searchPattern' => '[^a-z0-9]+', + 'replaceToken' => '_', + ), + ), + ), ); $form['machine_name'] = array( '#type' => 'textfield', @@ -139,6 +151,7 @@ function taxonomy_form_vocabulary(&$form_state, $edit = array()) { '#maxlength' => 255, '#description' => t('The unique machine readable name for this vocabulary, used for theme templates, can only contain lowercase letters, numbers and underscores.'), '#required' => TRUE, + '#attached_js' => array(drupal_get_path('module', 'system') . '/system.js', $js_settings), ); $form['help'] = array( '#type' => 'textfield', |