function _print_robots_meta_generator in Printer, email and PDF versions 5
Same name and namespace in other branches
- 5.4 print.pages.inc \_print_robots_meta_generator()
- 5.2 print.module \_print_robots_meta_generator()
- 5.3 print.pages.inc \_print_robots_meta_generator()
- 6 print.pages.inc \_print_robots_meta_generator()
- 7.2 print.pages.inc \_print_robots_meta_generator()
- 7 print.pages.inc \_print_robots_meta_generator()
- 5.x print.pages.inc \_print_robots_meta_generator()
Generates a meta tag to tell robots what they may index based on module settings
Return value
string
1 call to _print_robots_meta_generator()
- print_generate_node in ./
print.module - Outputs a printer friendly page.
File
- ./
print.module, line 271 - Display printer friendly versions of nodes (except books)
Code
function _print_robots_meta_generator() {
$robots_settings = variable_get('print_robot_settings', print_robot_settings_default());
$robots_meta = array();
if (!empty($robots_settings['noindex'])) {
$robots_meta[] = 'noindex';
}
if (!empty($robots_settings['nofollow'])) {
$robots_meta[] = 'nofollow';
}
if (!empty($robots_settings['noarchive'])) {
$robots_meta[] = 'noarchive';
}
if (!empty($robots_settings['nocache'])) {
$robots_meta[] = 'nocache';
}
if (sizeof($robots_meta) > 0) {
$robots_meta = isset($robots_meta[1]) ? implode(', ', $robots_meta) : $robots_meta[0];
$robots_meta = '<meta name="robots" content="' . $robots_meta . "\" />\n";
}
else {
$robots_meta = '';
}
return $robots_meta;
}