Commit 754ad323 authored by jcnventura's avatar jcnventura

Issue #1201858: add reset buttons to text string forms.

parent 744c7bb4
......@@ -379,10 +379,27 @@ function print_main_strings_settings() {
'#type' => 'textfield',
'#default_value' => variable_get('print_text_links', t('Links')),
);
$form['print_main_text']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset to defaults'),
'#submit' => array('print_main_strings_settings_delete'),
);
return system_settings_form($form);
}
/**
* Reset button callback for text strings settings form
*
* @ingroup forms
*/
function print_main_strings_settings_delete() {
variable_del('print_text_published');
variable_del('print_text_source_url');
variable_del('print_text_retrieved');
variable_del('print_text_links');
}
/**
* Menu callback for the Printer-friendly pages module text strings settings form.
*
......@@ -402,6 +419,20 @@ function print_html_strings_settings() {
'#default_value' => variable_get('print_html_link_text', t('Printer-friendly version')),
'#description' => t('Text used in the link to the printer-friendly version.'),
);
$form['print_html_text']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset to defaults'),
'#submit' => array('print_html_strings_settings_delete'),
);
return system_settings_form($form);
}
/**
* Reset button callback for text strings settings form
*
* @ingroup forms
*/
function print_html_strings_settings_delete() {
variable_del('print_html_link_text');
}
......@@ -228,6 +228,25 @@ function print_mail_strings_settings() {
'#default_value' => variable_get('print_mail_text_confirmation', t('Thank you for spreading the word about !site.')),
'#description' => t('This message will be displayed after the user successfully submits the form.'),
);
$form['print_mail_text']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset to defaults'),
'#submit' => array('print_mail_strings_settings_delete'),
);
return system_settings_form($form);
}
/**
* Reset button callback for text strings settings form
*
* @ingroup forms
*/
function print_mail_strings_settings_delete() {
variable_del('print_mail_link_text');
variable_del('print_mail_text_title');
variable_del('print_mail_text_subject');
variable_del('print_mail_text_message');
variable_del('print_mail_text_content');
variable_del('print_mail_text_confirmation');
}
......@@ -308,6 +308,20 @@ function print_pdf_strings_settings() {
'#default_value' => variable_get('print_pdf_link_text', t('PDF version')),
'#description' => t('Text used in the link to the PDF version.'),
);
$form['print_pdf_text']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset to defaults'),
'#submit' => array('print_pdf_strings_settings_delete'),
);
return system_settings_form($form);
}
/**
* Reset button callback for text strings settings form
*
* @ingroup forms
*/
function print_pdf_strings_settings_delete() {
variable_del('print_pdf_link_text');
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment