Skip to content
Snippets Groups Projects
Commit 373232b6 authored by Ben Hall's avatar Ben Hall
Browse files

Issue 2432295 by specky_rum,GuilleW: Adds option to specify alternative...

Issue 2432295 by specky_rum,GuilleW: Adds option to specify alternative wording in feedback message fields.
parent 3b303c72
No related branches found
No related merge requests found
......@@ -260,6 +260,45 @@ function feedback_admin_settings_form($form, &$form_state) {
'#default_value' => variable_get('feedback_excluded_paths', 'admin/reports/feedback'),
'#description' => t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')),
);
$form['fieldset_labels'] = array(
'#type' => 'fieldset',
'#title' => t('Feedback labels'),
'#description' => t('You can edit labels and titles for default fields.'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['fieldset_labels']['feedback_title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#size' => 40,
'#maxlength' => 128,
'#default_value' => variable_get('feedback_title', 'Feedback'),
'#description' => t("Specify the title that will appear on the feedback form. Defaults to 'Feedback'"),
);
$form['fieldset_labels']['feedback_help'] = array(
'#type' => 'textfield',
'#title' => t('Help'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => variable_get('feedback_help', 'If you experience a bug or would like to see an addition on the current page, feel free to leave us a message.'),
'#description' => t("Feedback submission guidelines. Defaults to 'If you experience a bug or would like to see an addition on the current page, feel free to leave us a message.'"),
);
$form['fieldset_labels']['feedback_message'] = array(
'#type' => 'textfield',
'#title' => t('Message'),
'#size' => 40,
'#maxlength' => 128,
'#default_value' => variable_get('feedback_message', 'Message'),
'#description' => t("Specify the label that will appear over the feedback message text field. Defaults to 'Message'"),
);
$form['fieldset_labels']['feedback_submit'] = array(
'#type' => 'textfield',
'#title' => t('Submit button'),
'#size' => 40,
'#maxlength' => 128,
'#default_value' => variable_get('feedback_submit', 'Send feedback'),
'#description' => t("Specify the label that will appear on the feedback submit button. Defaults to 'Send feedback'"),
);
return system_settings_form($form);
}
......
......@@ -289,9 +289,10 @@ function feedback_menu() {
*/
function feedback_page_build(&$page) {
if (user_access('access feedback form') && !feedback_match_path(variable_get('feedback_excluded_paths', 'admin/reports/feedback'))) {
$title = variable_get('feedback_title', 'Feedback');
$page['page_bottom']['feedback'] = array(
'#theme' => 'feedback_form_display',
'#title' => t('Feedback'),
'#title' => t($title),
'#content' => drupal_get_form('feedback_form'),
);
$path = drupal_get_path('module', 'feedback');
......@@ -344,9 +345,10 @@ function feedback_form($form, &$form_state) {
'#value' => $form_state['inline']['location'],
);
$help = variable_get('feedback_help', 'If you experience a bug or would like to see an addition on the current page, feel free to leave us a message.');
$form['help'] = array(
'#prefix' => '<div class="feedback-help">',
'#markup' => t('If you experience a bug or would like to see an addition on the current page, feel free to leave us a message.'),
'#markup' => t($help),
'#suffix' => '</div>',
);
if (user_access('view feedback messages')) {
......@@ -384,11 +386,12 @@ function feedback_form($form, &$form_state) {
}
}
}
$message = variable_get('feedback_message', 'Message');
$form['message'] = array(
'#type' => 'textarea',
'#attributes' => array('class' => array('feedback-message')),
'#cols' => 20,
'#title' => t('Message'),
'#title' => t($message),
'#required' => TRUE,
'#wysiwyg' => FALSE,
);
......@@ -402,9 +405,10 @@ function feedback_form($form, &$form_state) {
// @todo Patch #type actions in core?
'#attributes' => array('class' => array('clearfix')),
);
$submit = variable_get('feedback_submit', 'Send feedback');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Send feedback'),
'#value' => t($submit),
'#id' => 'feedback-submit',
'#ajax' => array(
'wrapper' => 'feedback-form',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment