? .project ? webform.description.patch ? webform_back_next.patch Index: webform.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/webform/webform.install,v retrieving revision 1.14.2.16.2.16 diff -u -r1.14.2.16.2.16 webform.install --- webform.install 2 Apr 2008 06:39:52 -0000 1.14.2.16.2.16 +++ webform.install 2 Apr 2008 20:44:07 -0000 @@ -15,6 +15,8 @@ confirmation text, teaser tinyint not null default '0', submit_text varchar(255) default NULL, + next_text varchar(255) default NULL, + back_text varchar(255) default NULL, submit_limit tinyint not null default '-1', submit_interval int not null default '-1', email varchar(255) default NULL, @@ -72,6 +74,8 @@ confirmation text NOT NULL default '', teaser smallint NOT NULL default '0', submit_text varchar(255) default NULL, + next_text varchar(255) default NULL, + back_text varchar(255) default NULL, submit_limit smallint NOT NULL default '-1', submit_interval integer NOT NULL default '-1', email varchar(255) NOT NULL default '', @@ -672,6 +676,27 @@ } /** + * Add the back and next text. + */ +function webform_update_5221() { + $ret = array(); + + switch ($GLOBALS['db_type']) { + case 'mysqli': + case 'mysql': + $ret[] = update_sql("ALTER TABLE {webform} ADD next_text varchar(255) NULL DEFAULT NULL AFTER submit_text"); + $ret[] = update_sql("ALTER TABLE {webform} ADD back_text varchar(255) NULL DEFAULT NULL AFTER next_text"); + break; + case 'pgsql': + $ret[] = update_sql("ALTER TABLE {webform} ADD next_text varchar(255) NULL DEFAULT NULL"); + $ret[] = update_sql("ALTER TABLE {webform} ADD back_text varchar(255) NULL DEFAULT NULL"); + break; + } + + return $ret; +} + +/** * Recursively delete all files and folders in the specified filepath, then * delete the containing folder. * Index: webform.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/webform/webform.module,v retrieving revision 1.113.2.70.2.35 diff -u -r1.113.2.70.2.35 webform.module --- webform.module 2 Apr 2008 04:05:16 -0000 1.113.2.70.2.35 +++ webform.module 2 Apr 2008 20:43:08 -0000 @@ -314,7 +314,7 @@ include_once(drupal_get_path('module', 'webform') .'/webform_components.inc'); // Insert the Webform. - db_query("INSERT INTO {webform} (nid, confirmation, teaser, submit_text, submit_limit, submit_interval, email, email_from_name, email_from_address, email_subject, additional_validate, additional_submit) VALUES (%d, '%s', %d, '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s')", $node->nid, $node->webform['confirmation'], $node->webform['teaser'], $node->webform['submit_text'], $node->webform['submit_limit'], $node->webform['submit_interval'], $node->webform['email'], $node->webform['email_from_name'], $node->webform['email_from_address'], $node->webform['email_subject'], $node->webform['additional_validate'], $node->webform['additional_submit']); + db_query("INSERT INTO {webform} (nid, confirmation, teaser, submit_text, back_text, next_text, submit_limit, submit_interval, email, email_from_name, email_from_address, email_subject, additional_validate, additional_submit) VALUES (%d, '%s', %d, '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s')", $node->nid, $node->webform['confirmation'], $node->webform['teaser'], $node->webform['submit_text'], $node->webform['back_text'], $node->webform['next_text'], $node->webform['submit_limit'], $node->webform['submit_interval'], $node->webform['email'], $node->webform['email_from_name'], $node->webform['email_from_address'], $node->webform['email_subject'], $node->webform['additional_validate'], $node->webform['additional_submit']); // Insert the components into the database. if (isset($node->webform['components']) && !empty($node->webform['components'])) { @@ -359,6 +359,8 @@ 'confirmation' => '', 'teaser' => 0, 'submit_text' => '', + 'back_text' => '', + 'next_text' => '', 'submit_limit' => -1, 'submit_interval' => -1, 'email' => '', @@ -624,6 +626,18 @@ '#default_value' => $node->webform['submit_text'], '#description' => t('By default the submit button on this form will have the label Submit. Enter a new title here to override the default.'), ); + $form['webform']['advanced']['back_text'] = array( + '#type' => 'textfield', + '#title' => t('Back button text'), + '#default_value' => $node->webform['back_text'], + '#description' => t('By default the back button on this form will have the label < Previous Page. Enter a new title here to override the default.'), + ); + $form['webform']['advanced']['next_text'] = array( + '#type' => 'textfield', + '#title' => t('Next button text'), + '#default_value' => $node->webform['next_text'], + '#description' => t('By default the next button on this form will have the label Next Page >. Enter a new title here to override the default.'), + ); if (user_access('use PHP for additional processing')) { $form['webform']['advanced']['additional_validate'] = array( @@ -1073,8 +1087,8 @@ if ((!$preview && empty($submission)) || ($enabled)) { if ($page_count > 1) { - $next_page = t('Next Page >'); - $prev_page = t('< Previous Page'); + $next_page = empty($node->webform['next_text']) ? t('Next Page >') : $node->webform['next_text']; + $prev_page = empty($node->webform['back_text']) ? t('< Previous Page') : $node->webform['back_text']; if (isset($form_values)) { $page_num = $form_values['details']['page_num']; if ($form_values['op'] == $prev_page && $page_num > 1) {