From a539b0e00dedddfea36d4a96b788e42923056a78 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 5 Sep 2009 15:05:05 +0000 Subject: - Patch by #565496 by dropcube, pwolanin: changed Allow dynamic attaching of other types of stuff to render() structures. --- modules/node/content_types.inc | 4 +++- modules/node/node.pages.inc | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'modules/node') diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc index c6e9d6da2..223609041 100644 --- a/modules/node/content_types.inc +++ b/modules/node/content_types.inc @@ -101,7 +101,9 @@ function node_type_form(&$form_state, $type = NULL) { '#maxlength' => 32, '#required' => TRUE, '#description' => t('The machine-readable name of this content type. This text will be used for constructing the URL of the add new content page for this content type. This name must contain only lowercase letters, numbers, and underscores. Underscores will be converted into hyphens when constructing the URL of the add new content page. This name must be unique.'), - '#attached_js' => array(drupal_get_path('module', 'system') . '/system.js', $js_settings), + '#attached' => array( + 'js' => array(drupal_get_path('module', 'system') . '/system.js', $js_settings), + ), ); } else { diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index af5f2ffd5..60168012b 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -172,7 +172,9 @@ function node_form(&$form_state, $node) { // Collapsed by default when "Create new revision" is unchecked '#collapsed' => !$node->revision, '#group' => 'additional_settings', - '#attached_js' => array(drupal_get_path('module', 'node') . '/node.js'), + '#attached' => array( + 'js' => array(drupal_get_path('module', 'node') . '/node.js'), + ), '#weight' => 20, ); $form['revision_information']['revision'] = array( @@ -198,7 +200,9 @@ function node_form(&$form_state, $node) { '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', - '#attached_js' => array(drupal_get_path('module', 'node') . '/node.js'), + '#attached' => array( + 'js' => array(drupal_get_path('module', 'node') . '/node.js'), + ), '#weight' => 90, ); $form['author']['name'] = array( @@ -229,7 +233,9 @@ function node_form(&$form_state, $node) { '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', - '#attached_js' => array(drupal_get_path('module', 'node') . '/node.js'), + '#attached' => array( + 'js' => array(drupal_get_path('module', 'node') . '/node.js'), + ), '#weight' => 95, ); $form['options']['status'] = array( -- cgit v1.2.3