DrupalBin
Submit Code
About
Recent Posts
admin settings not saving
1 hour 9 min
ago
Code
1 hour 53 min
ago
Code
2 hours 8 min
ago
css path
3 hours 53 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for hook form parse error
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
/** * Implementation of hook_form() * TODO: title=hostname ip= file=tar.bz2 description=body disk size=(permissioned) memory size=(permissioned) swap size=(permissioned) */ function xen_node_form(&$node, &$param) { // $type = node_get_types('type', $node); $xen_node = $node->xen_node; $form['title'] = array( '#type' => 'textfield', '#title' => check_plain$type->title_label, '#description' => t('Choose an unique hostname for this host. The hostname can contain alphabetical characters or numbers.'), '#size' => 50, '#maxlength' => 100, '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5, ); $form['body_filter']['body'] = array( '#type' => 'textarea', '#title' => $type->body_label, '#required' => FALSE, '#default_value' => $node->body, '#rows' => 7, ); // $form['xen_node_options'] = array( // '#title' => t('Xen Node Options'), // '#type' => 'fieldset', // '#description' => t('Options for the Xen node type.'), // '#collapsible' => TRUE, // '#collapsed' => FALSE, // '#weight' => 1, // ); $form['disk'] = array( '#type' => 'textfield', '#title' => t('Disk size'), '#default_value' => variable_get('xen_fs_size', '6'), '#field_suffix' => t('GB'), '#size' => 1, '#maxlength' => 3, // '#value' => intval(variable_get('xen_fs_size', '6')), // '#disabled' => TRUE, '#description' => t('Disk size. You can alter this only if you have sufficient privileges.'), '#required' => TRUE, ); $form['memory'] = array( '#type' => 'textfield', '#title' => t('Memory size'), '#default_value' => variable_get('xen_mem_size', '128'), '#field_suffix' => t('MB'), '#size' => 2, '#maxlength' => 4, // '#value' => intval(variable_get('xen_mem_size', '128')), // '#disabled' => TRUE, '#description' => t('RAM size. You can alter this only if you have sufficient privileges.'), '#required' => TRUE, ); $form['swap'] = array( '#type' => 'textfield', '#title' => t('Swap size'), '#default_value' => variable_get('xen_swap_size', '1024'), '#field_suffix' => t('MB'), '#size' => 2, '#maxlength' => 4, // '#value' => intval(variable_get('xen_swap_size', '1024')), // '#disabled' => TRUE, '#description' => t('Swap size. You can alter this only if you have sufficient privileges.'), '#required' => TRUE, ); return $form; }
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.