print_controller_html

  1. drupal
    1. 6 print.pages.inc function
    2. 7 print.pages.inc function
Drupal 7 print_controller_html()

Generate an HTML version of the printer-friendly page

See also

print_controller()

1 string reference to 'print_controller_html'

File

sites/all/modules/print/print.pages.inc, line 21
Contains the functions to generate Printer-friendly pages.

Code

function print_controller_html() {
  $args = func_get_args();
  $path = filter_xss(implode('/', $args));
  $cid = isset($_GET['comment']) ? (int) $_GET['comment'] : NULL;

  $print = print_controller($path, $cid, PRINT_HTML_FORMAT);
  if ($print !== FALSE) {
    $node = $print['node'];
    $html = theme('print', array('print' => $print, 'type' => PRINT_HTML_FORMAT, 'node' => $node));
    drupal_send_headers();
    print $html;

    $nodepath = (isset($node->path) && is_string($node->path)) ? drupal_get_normal_path($node->path) : 'node/' . $path;
    db_merge('print_page_counter')
      ->key(array('path' => $nodepath))
      ->fields(array(
      'totalcount' => 1, 
      'timestamp' => REQUEST_TIME,
    ))
      ->expression('totalcount', 'totalcount + 1')
      ->execute();
  }
}