diff -Naur webform/components/fieldset.inc webform.altered/components/fieldset.inc --- webform/components/fieldset.inc 2009-03-07 03:16:31.000000000 +0000 +++ webform.altered/components/fieldset.inc 2009-02-20 14:01:23.000000000 +0000 @@ -48,6 +48,31 @@ '#description' => t('Collapsible fieldsets are "open" by default. Select this option to default the fieldset to "closed."'), '#weight' => 3, ); + $edit_fields['extra']['theme'] = array( + '#type' => 'textfield', + '#title' => t('Theming Function'), + '#default_value' => empty($currfield['extra']['theme']) ? '' : $currfield['extra']['theme'], + '#description' => t('Name of the theming function that would render this fieldset.').' '.t('Leave blank to apply default rendering.').'
'.t('Note: If the function you have specified is not a core theming function in drupal, you will have to register it using the hook_theme.'), + '#size' => 40, + '#maxlength' => 50, + '#weight' => 4, + ); + $edit_fields['extra']['header_fields'] = array( + '#type' => 'textarea', + '#title' => t('Header Fields'), + '#default_value' => empty($currfield['extra']['header_fields']) ? '' : $currfield['extra']['header_fields'], + '#description' => t('Fields you want to display as Header.').' '.t('Every field on a separate line.').' '.t('Do not leave blank if you are using a Theming Function.'), + '#cols' => 40, + '#weight' => 5, + ); + $edit_fields['extra']['row_labels'] = array( + '#type' => 'textarea', + '#title' => t('Row Labels'), + '#default_value' => empty($currfield['extra']['row_labels']) ? '' : $currfield['extra']['row_labels'], + '#description' => t('Row Labels to be displayed at beginning of each row.').' '.t('Every field on a separate line.').' '.t('Do not leave blank if you are using a Theming Function.'), + '#cols' => 40, + '#weight' => 6, + ); $edit_fields['advanced']['mandatory'] = array(); return $edit_fields; } @@ -70,7 +95,11 @@ '#collapsed' => $component['extra']['collapsed'], '#attributes' => array('class' => 'webform-component-'. $component['type'], 'id' => 'webform-component-'. $component['form_key']), ); - + if($component['extra']['theme']) { + $form_item['#theme'] = $component['extra']['theme']; + $form_item['#header_fields'] = $component['extra']['header_fields']; + $form_item['#row_labels'] = $component['extra']['row_labels']; + } return $form_item; } diff -Naur webform/components/select.inc webform.altered/components/select.inc --- webform/components/select.inc 2009-03-07 03:16:31.000000000 +0000 +++ webform.altered/components/select.inc 2009-02-20 14:02:34.000000000 +0000 @@ -81,6 +81,43 @@ '#description' => t('Check this option if this component contains an e-mail address that should get a copy of the submission. Emails are sent individually so other emails will not be shown to the recipient.') .' '. t('To use the option with a select component, you must use key-value pairs seperated by pipes. i.e. user@example.com|Sample user.'), ); + /*(II)AHAH enabling the select field. kevin*/ + $edit_fields['extra']['ahah_path'] = array( + '#type' => 'textfield', + '#title' => t('AHAH path'), + '#default_value' => $currfield['extra']['ahah_path'], + '#description' => t('For example: user/autocomplete'), + '#size' => 60, + '#maxlength' => 256, + '#weight' => 1, + ); + $edit_fields['extra']['ahah_event'] = array( + '#type' => 'textfield', + '#title' => t('AHAH event'), + '#default_value' => $currfield['extra']['ahah_event']?$currfield['extra']['ahah_event']:'change', + '#description' => t('Possible values: click, blur, change.'), + '#size' => 60, + '#maxlength' => 256, + '#weight' => 2, + ); + $edit_fields['extra']['ahah_wrapper'] = array( + '#type' => 'textfield', + '#title' => t('AHAH wrapper'), + '#default_value' => $currfield['extra']['ahah_wrapper'], + '#description' => t('This property defines the HTML id attribute of an element on the page will server as the destination for HTML returned by an AHAH request.'), + '#size' => 60, + '#maxlength' => 256, + '#weight' => 3, + ); + $edit_fields['extra']['ahah_method'] = array( + '#type' => 'textfield', + '#title' => t('AHAH method'), + '#default_value' => $currfield['extra']['ahah_method']?$currfield['extra']['ahah_method']:'replace', + '#description' => t('Possible values: replace (default), after, append, before, prepend'), + '#size' => 60, + '#maxlength' => 256, + '#weight' => 4, + ); return $edit_fields; } @@ -191,6 +228,18 @@ $form_item['#type'] = 'radios'; } } + + /*(II)AHAH enabling select field. kevin*/ + if(trim($component['extra']['ahah_path']) && trim($component['extra']['ahah_event']) && trim($component['extra']['ahah_wrapper']) && trim($component['extra']['ahah_method'])) { + $form_item['#ahah'] = array( + 'path' => $component['extra']['ahah_path'], + 'event' => $component['extra']['ahah_event'], + 'wrapper' => $component['extra']['ahah_wrapper'], + 'method' => $component['extra']['ahah_method'], + 'progress' => array('type' => 'throbber', 'message' => t('Please wait...')), + ); + } + return $form_item; } diff -Naur webform/components/textfield.inc webform.altered/components/textfield.inc --- webform/components/textfield.inc 2009-03-07 03:16:31.000000000 +0000 +++ webform.altered/components/textfield.inc 2009-02-24 06:45:42.000000000 +0000 @@ -94,6 +94,72 @@ '#weight' => 3, '#default_value' => $currfield['extra']['disabled'], ); + /*(I) Autocomplete Patch added by kevin on Feb 11,2009*/ + $edit_fields['extra']['autocomplete_path'] = array( + '#type' => 'textfield', + '#title' => t('Autocomplete Path'), + '#default_value' => $currfield['extra']['autocomplete_path'], + '#description' => t('Autocomplete Path for the textfield.') .' '. t('Leaving blank will render it as a normal textfield.'), + '#size' => 40, + '#maxlength' => 200, + '#weight' => 4, + ); + //(III)hack multiple textfields with one time configuration + $edit_fields['extra']['no_of_textfields'] = array( + '#type' => 'textfield', + '#title' => t('No. of Textfields'), + '#default_value' => $currfield['extra']['no_of_textfields'], + '#description' => t('No of textfields of this kind to be generated.') .' '. t('Leaving blank assumes it to be one'), + '#size' => 2, + '#maxlength' => 2, + '#weight' => 5, + ); + //(V)hack texfield to display date using the jQuery plugin + $edit_fields['extra']['date_enabled'] = array( + '#type' => 'checkbox', + '#title' => t('Date Field'), + '#return_value' => 1, + '#description' => t('Make this field a Date Field. Display a jQuery Calendar for this field.'), + '#weight' => 6, + '#default_value' => $currfield['extra']['date_enabled'], + ); + /*(II)AHAH enabling the select field. kevin*/ + $edit_fields['extra']['ahah_path'] = array( + '#type' => 'textfield', + '#title' => t('AHAH path'), + '#default_value' => $currfield['extra']['ahah_path'], + '#description' => t('For example: user/autocomplete'), + '#size' => 60, + '#maxlength' => 256, + '#weight' => 7, + ); + $edit_fields['extra']['ahah_event'] = array( + '#type' => 'textfield', + '#title' => t('AHAH event'), + '#default_value' => $currfield['extra']['ahah_event']?$currfield['extra']['ahah_event']:'change', + '#description' => t('Possible values: click, blur, change.'), + '#size' => 60, + '#maxlength' => 256, + '#weight' => 8, + ); + $edit_fields['extra']['ahah_wrapper'] = array( + '#type' => 'textfield', + '#title' => t('AHAH wrapper'), + '#default_value' => $currfield['extra']['ahah_wrapper'], + '#description' => t('This property defines the HTML id attribute of an element on the page will server as the destination for HTML returned by an AHAH request.'), + '#size' => 60, + '#maxlength' => 256, + '#weight' => 9, + ); + $edit_fields['extra']['ahah_method'] = array( + '#type' => 'textfield', + '#title' => t('AHAH method'), + '#default_value' => $currfield['extra']['ahah_method']?$currfield['extra']['ahah_method']:'replace', + '#description' => t('Possible values: replace (default), after, append, before, prepend'), + '#size' => 60, + '#maxlength' => 256, + '#weight' => 10, + ); return $edit_fields; } @@ -131,8 +197,34 @@ if ($component['extra']['maxlength'] > 0) { $form_item['#maxlength'] = $component['extra']['maxlength']; } - - return $form_item; + /*(I) Autocomplete Patch added by kevin on Feb 11,2009*/ + if(trim($component['extra']['autocomplete_path'])) { + $form_item['#autocomplete_path'] = $component['extra']['autocomplete_path']; + } + //(V)hack by kevin for date field + if ($component['extra']['date_enabled']) { + $form_item['#date_enabled'] = 'enabled'; + } + /*(II)AHAH enabling select field. kevin*/ + if(trim($component['extra']['ahah_path']) && trim($component['extra']['ahah_event']) && trim($component['extra']['ahah_wrapper']) && trim($component['extra']['ahah_method'])) { + $form_item['#ahah'] = array( + 'path' => $component['extra']['ahah_path'], + 'event' => $component['extra']['ahah_event'], + 'wrapper' => $component['extra']['ahah_wrapper'], + 'method' => $component['extra']['ahah_method'], + 'progress' => array('type' => 'throbber', 'message' => t('Please wait...')), + ); + } + //(III)hack by kevin to add multiple textboxes in a single row. + $form_items = array(); + if(is_int(intval($component['extra']['no_of_textfields'])) && intval($component['extra']['no_of_textfields']) > 1) { + for($i = 0;$i < $component['extra']['no_of_textfields'];$i++) { + $form_items[$i] = $form_item; + } + } else { + $form_items[0] = $form_item; + } + return $form_items; } /** @@ -150,12 +242,16 @@ * Textual output formatted for human reading. */ function _webform_submission_display_textfield($data, $component, $enabled = FALSE) { - $form_item = _webform_render_textfield($component); - $form_item['#default_value'] = $data['value']['0']; - if (!$enabled) { - $form_item['#attributes']['readonly'] = 'readonly'; + //hack (III) kevin + $form_items = _webform_render_textfield($component); + for($i = 0;$i < count($form_items);$i++) { + $form_item = &$form_items[$i]; + $form_item['#default_value'] = $data['value'][$i]; + if (!$enabled) { + $form_item['#attributes']['readonly'] = 'readonly'; + } } - return $form_item; + return $form_items; } /**