security updates
have to check views and entityreference for custom patches
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Menu callback for the Printer-friendly pages module settings form.
|
||||
* Form constructor for the Printer-friendly pages module settings form.
|
||||
*
|
||||
* @ingroup forms
|
||||
*/
|
||||
@@ -168,7 +168,7 @@ function print_main_settings() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate print_main_settings form.
|
||||
* Form validation handler for print_main_settings().
|
||||
*/
|
||||
function _print_main_settings_validate($form, &$form_state) {
|
||||
global $base_root;
|
||||
@@ -188,123 +188,18 @@ function _print_main_settings_validate($form, &$form_state) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu callback for the Printer-friendly pages HTML settings form.
|
||||
* Form constructor for the Printer-friendly pages HTML settings form.
|
||||
*
|
||||
* @ingroup forms
|
||||
*/
|
||||
function print_html_settings() {
|
||||
$link = print_print_link();
|
||||
|
||||
$form['settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Web page options'),
|
||||
);
|
||||
|
||||
$form['settings']['print_html_link_pos'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#title' => t('Printer-friendly page link'),
|
||||
'#default_value' => variable_get('print_html_link_pos', drupal_json_decode(PRINT_HTML_LINK_POS_DEFAULT)),
|
||||
'#options' => array('link' => t('Links area'), 'corner' => t('Content corner'), 'block' => t('Block'), 'help' => t('Help area')),
|
||||
'#description' => t('Choose the location of the link(s) to the printer-friendly page. The Links area is usually below the node content, whereas the Content corner is placed in the upper-right corner of the node content. Unselect all options to disable the link. Even if the link is disabled, you can still view the print version of a node by going to !path/nid where nid is the numeric id of the node.', array('!path' => PRINT_PATH)),
|
||||
);
|
||||
|
||||
$form['settings']['print_html_link_teaser'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Display printer-friendly link in teaser'),
|
||||
'#default_value' => variable_get('print_html_link_teaser', PRINT_HTML_LINK_TEASER_DEFAULT),
|
||||
'#description' => t('Enabling this will display the link in teaser mode.'),
|
||||
);
|
||||
|
||||
$form['settings']['adv_link'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Advanced link options'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
);
|
||||
|
||||
$form['settings']['adv_link']['print_html_show_link'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Link style'),
|
||||
'#default_value' => variable_get('print_html_show_link', PRINT_HTML_SHOW_LINK_DEFAULT),
|
||||
'#options' => array(1 => t('Text only'), 2 => t('Icon only'), 3 => t('Icon and Text')),
|
||||
'#description' => t('Select the visual style of the link.'),
|
||||
);
|
||||
|
||||
$form['settings']['adv_link']['print_html_link_use_alias'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Use URL alias instead of node ID'),
|
||||
'#default_value' => variable_get('print_html_link_use_alias', PRINT_HTML_LINK_USE_ALIAS_DEFAULT),
|
||||
'#description' => t('Enabling this will create the link using the URL alias instead of the node ID.'),
|
||||
);
|
||||
|
||||
$form['settings']['adv_link']['print_html_link_class'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Link class'),
|
||||
'#default_value' => variable_get('print_html_link_class', PRINT_HTML_LINK_CLASS_DEFAULT),
|
||||
'#size' => 60,
|
||||
'#maxlength' => 250,
|
||||
'#description' => t('This can be used by themers to change the link style or by jQuery modules to open in a new window (e.g. greybox or thickbox). Multiple classes can be specified, separated by spaces.'),
|
||||
);
|
||||
|
||||
$form['settings']['adv_link']['print_html_node_link_visibility'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Link visibility'),
|
||||
'#default_value' => variable_get('print_html_node_link_visibility', PRINT_HTML_NODE_LINK_VISIBILITY_DEFAULT),
|
||||
'#options' => array(t('Show on every page except the listed pages.'), t('Show on only the listed pages.')),
|
||||
);
|
||||
|
||||
$form['settings']['adv_link']['print_html_node_link_pages'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#default_value' => variable_get('print_html_node_link_pages', PRINT_HTML_NODE_LINK_PAGES_DEFAULT),
|
||||
'#rows' => 3,
|
||||
'#description' => t("Enter one page per line as Drupal paths. 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>')),
|
||||
);
|
||||
|
||||
if (module_exists('php')) {
|
||||
$access = user_access('use PHP for settings');
|
||||
|
||||
if ($form['settings']['adv_link']['print_html_node_link_visibility']['#default_value'] == 2 && !$access) {
|
||||
$form['settings']['adv_link']['print_html_node_link_visibility'] = array('#type' => 'value', '#value' => 2);
|
||||
$form['settings']['adv_link']['print_html_node_link_pages'] = array('#type' => 'value', '#value' => $form['settings']['adv_link']['print_html_node_link_pages']['#default_value']);
|
||||
}
|
||||
elseif ($access) {
|
||||
$form['settings']['adv_link']['print_html_node_link_visibility']['#options'][] = t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).');
|
||||
$form['settings']['adv_link']['print_html_node_link_pages']['#description'] .= ' ' . t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => '<?php ?>'));
|
||||
}
|
||||
}
|
||||
|
||||
$form['settings']['adv_link']['print_html_sys_link_visibility'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Show link in system (non-content) pages'),
|
||||
'#description' => 'Any page that is not a Drupal node. Usually pages generated by Drupal or a module such as Views or Panels.',
|
||||
'#default_value' => variable_get('print_html_sys_link_visibility', PRINT_HTML_SYS_LINK_VISIBILITY_DEFAULT),
|
||||
'#options' => array(t('Show on every page except the listed pages.'), t('Show on only the listed pages.')),
|
||||
);
|
||||
|
||||
$form['settings']['adv_link']['print_html_sys_link_pages'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#default_value' => variable_get('print_html_sys_link_pages', PRINT_HTML_SYS_LINK_PAGES_DEFAULT),
|
||||
'#rows' => 3,
|
||||
'#description' => t('Setting this option will add a printer-friendly version page link on pages created by Drupal or the enabled modules.') . '<br />' .
|
||||
t("Enter one page per line as Drupal paths. 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>')),
|
||||
);
|
||||
|
||||
if (module_exists('php')) {
|
||||
if ($form['settings']['adv_link']['print_html_sys_link_visibility']['#default_value'] == 2 && !$access) {
|
||||
$form['settings']['adv_link']['print_html_sys_link_visibility'] = array('#type' => 'value', '#value' => 2);
|
||||
$form['settings']['adv_link']['print_html_sys_link_pages'] = array('#type' => 'value', '#value' => $form['settings']['adv_link']['print_html_sys_link_pages']['#default_value']);
|
||||
}
|
||||
elseif ($access) {
|
||||
$form['settings']['adv_link']['print_html_sys_link_visibility']['#options'][] = t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).');
|
||||
$form['settings']['adv_link']['print_html_sys_link_pages']['#description'] .= ' ' . t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => '<?php ?>'));
|
||||
}
|
||||
}
|
||||
|
||||
$form['settings']['adv_link']['print_html_book_link'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Link in book hierarchy nodes'),
|
||||
'#default_value' => variable_get('print_html_book_link', PRINT_HTML_BOOK_LINK_DEFAULT),
|
||||
'#options' => array(t('Book module link not modified'), t('Current page and sub-pages'), t('Current page only')),
|
||||
);
|
||||
|
||||
$form['settings']['print_html_new_window'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Open the printer-friendly version in a new window'),
|
||||
@@ -326,18 +221,18 @@ function print_html_settings() {
|
||||
'#description' => t("When the above options are enabled, this option will close the window after its contents are printed."),
|
||||
);
|
||||
|
||||
$form['settings']['print_display_sys_urllist'] = array(
|
||||
$form['settings']['print_html_display_sys_urllist'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Printer-friendly URLs list in system pages'),
|
||||
'#default_value' => variable_get('print_display_sys_urllist', PRINT_TYPE_SYS_URLLIST_DEFAULT),
|
||||
'#default_value' => variable_get('print_html_display_sys_urllist', PRINT_TYPE_SYS_URLLIST_DEFAULT),
|
||||
'#description' => t('Enabling this option will display a list of printer-friendly destination URLs at the bottom of the page.'),
|
||||
);
|
||||
|
||||
$form['settings']['print_robots_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Robots META tags'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Robots META tags'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => FALSE,
|
||||
);
|
||||
|
||||
$form['settings']['print_robots_settings']['print_robots_noindex'] = array(
|
||||
@@ -361,92 +256,22 @@ function print_html_settings() {
|
||||
'#description' => t('Non-standard tag to instruct search engines to not show a "Cached" link for your printer-friendly pages. Recognized by Googlebot.'),
|
||||
);
|
||||
|
||||
return system_settings_form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Menu callback for the common print module text strings settings form
|
||||
*
|
||||
* @ingroup forms
|
||||
*/
|
||||
function print_main_strings_settings() {
|
||||
drupal_set_message(t("Saving these strings will disable their translation via Drupal's language system. Use the reset button to return them to the original state."), 'warning');
|
||||
|
||||
$form['print_main_text'] = array(
|
||||
$form['settings']['link_text'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Text strings'),
|
||||
'#title' => t('Custom link text'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
);
|
||||
|
||||
$form['print_main_text']['print_text_published'] = array(
|
||||
$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_text_published', t('Published on %site_name')),
|
||||
);
|
||||
$form['print_main_text']['print_text_source_url'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#default_value' => variable_get('print_text_source_url', t('Source URL')),
|
||||
);
|
||||
$form['print_main_text']['print_text_retrieved'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#default_value' => variable_get('print_text_retrieved', t('retrieved on %date')),
|
||||
);
|
||||
$form['print_main_text']['print_text_links'] = array(
|
||||
'#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 version text strings settings form
|
||||
*
|
||||
* @ingroup forms
|
||||
*/
|
||||
function print_html_strings_settings() {
|
||||
drupal_set_message(t("Saving these strings will disable their translation via Drupal's language system. Use the reset button to return them to the original state."), 'warning');
|
||||
|
||||
$form['print_html_text'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Text strings'),
|
||||
);
|
||||
|
||||
$form['print_html_text']['print_html_link_text'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Link text'),
|
||||
'#default_value' => variable_get('print_html_link_text', t('Printer-friendly version')),
|
||||
'#default_value' => variable_get('print_html_link_text', $link['text']),
|
||||
'#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');
|
||||
}
|
||||
|
Reference in New Issue
Block a user