Commit 9d21706e authored by Devin Carlson's avatar Devin Carlson Committed by jcnventura

Issue #1707892: use hook_variable_info() for i18n support to the link text custom variable.

parent 7815650f
......@@ -262,13 +262,11 @@ function print_html_settings() {
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['settings']['link_text']['print_html_link_text_enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Enable custom link text'),
'#default_value' => variable_get('print_html_link_text_enabled', PRINT_TYPE_LINK_TEXT_ENABLED_DEFAULT),
);
$form['settings']['link_text']['print_html_link_text'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('print_html_link_text', $link['text']),
......
......@@ -170,6 +170,22 @@ function print_menu() {
return $items;
}
/**
* Implements hook_variable_info().
*/
function print_variable_info($options) {
$link = print_print_link();
$variable['print_html_link_text'] = array(
'title' => t('Printer-friendly version'),
'description' => t('Text used in the link to the printer-friendly version.'),
'type' => 'string',
'default' => t($link['text']),
);
return $variable;
}
/**
* Implements hook_block_info().
*/
......
......@@ -77,13 +77,11 @@ function print_epub_settings() {
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['settings']['link_text']['print_epub_link_text_enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Enable custom link text'),
'#default_value' => variable_get('print_epub_link_text_enabled', PRINT_TYPE_LINK_TEXT_ENABLED_DEFAULT),
);
$form['settings']['link_text']['print_epub_link_text'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('print_epub_link_text', $link['text']),
......
......@@ -74,6 +74,22 @@ function print_epub_menu() {
return $items;
}
/**
* Implements hook_variable_info().
*/
function print_epub_variable_info($options) {
$link = print_epub_print_link();
$variable['print_epub_link_text'] = array(
'title' => t('EPUB version'),
'description' => t('Text used in the link to the EPUB version.'),
'type' => 'string',
'default' => t($link['text']),
);
return $variable;
}
/**
* Implements hook_block_info().
*/
......
......@@ -82,13 +82,11 @@ function print_mail_settings() {
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['settings']['link_text']['print_mail_link_text_enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Enable custom link text'),
'#default_value' => variable_get('print_mail_link_text_enabled', PRINT_TYPE_LINK_TEXT_ENABLED_DEFAULT),
);
$form['settings']['link_text']['print_mail_link_text'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('print_mail_link_text', $link['text']),
......
......@@ -89,6 +89,22 @@ function print_mail_menu() {
return $items;
}
/**
* Implements hook_variable_info().
*/
function print_mail_variable_info($options) {
$link = print_mail_print_link();
$variable['print_mail_link_text'] = array(
'title' => t('Send by email'),
'description' => t('Text used in the link to the send by email form.'),
'type' => 'string',
'default' => t($link['text']),
);
return $variable;
}
/**
* Implements hook_requirements().
*/
......
......@@ -126,6 +126,22 @@ function print_pdf_menu() {
return $items;
}
/**
* Implements hook_variable_info().
*/
function print_pdf_variable_info($options) {
$link = print_pdf_print_link();
$variable['print_pdf_link_text'] = array(
'title' => t('PDF version'),
'description' => t('Text used in the link to the PDF version.'),
'type' => 'string',
'default' => t($link['text']),
);
return $variable;
}
/**
* Implements hook_block_info().
*/
......
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