Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $form['cid']['#weight'] = 0.003;
- $form['subject']['#weight'] = 0.004;
- [subject] => Array
- (
- [#type] => textfield
- [#title] => Subject
- [#maxlength] => 255
- [#required] => 1
- [#post] => Array
- (
- )
- [#programmed] =>
- [#tree] =>
- [#parents] => Array
- (
- [0] => subject
- )
- [#array_parents] => Array
- (
- [0] => subject
- )
- [#weight] => 0.004
- [#processed] => 1
- [#description] =>
- [#attributes] => Array
- (
- )
- [#input] => 1
- [#size] => 60
- [#autocomplete_path] =>
- [#process] => Array
- (
- [0] => form_expand_ahah
- )
- [#name] => subject
- [#id] => edit-subject
- [#value] =>
- [#defaults_loaded] => 1
- [#sorted] => 1
- )
- [cid] => Array
- (
- [#type] => select
- [#title] => Category
- [#default_value] => 1
- [#options] => Array
- (
- [1] => General Enquiries
- [2] => Support
- )
- [#required] => 1
- [#post] => Array
- (
- )
- [#programmed] =>
- [#tree] =>
- [#parents] => Array
- (
- [0] => cid
- )
- [#array_parents] => Array
- (
- [0] => cid
- )
- [#weight] => 0.003
- [#processed] => 1
- [#description] =>
- [#attributes] => Array
- (
- )
- [#input] => 1
- [#size] => 0
- [#multiple] =>
- [#process] => Array
- (
- [0] => form_expand_ahah
- )
- [#name] => cid
- [#id] => edit-cid
- [#value] => 1
- [#defaults_loaded] => 1
- [#sorted] => 1
- )
- function mymodule_form_alter(&$form, &$form_state, $form_id) {
- $form['#pre_render'][] = 'mymodule_form_alter_weight';
- }
- function mymodule_form_alter_weight($elements) {
- $elements['cid']['#weight'] = 0.003;
- $elements['subject']['#weight'] = 0.004;
- return $elements;
- }
- function mymodule_content_extra_fields() {
- $extras['mymodule'] = array( // Name of field
- 'label' => t('Mymodule'),
- 'description' => t('Mymodule field'),
- 'weight' => 10, // The default weight, can be overriden on Manage Fields
- );
- return $extras;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement