Project

General

Profile

Revision 011029ce

Added by Assos Assos over 10 years ago

Update views_pdf 1.1 -> 1.3

View differences:

htmltest/sites/all/modules/views_pdf/modules/views_append/views_append.info
7 7
files[] = views_append_handler_append_view.inc
8 8

  
9 9

  
10
; Information added by drupal.org packaging script on 2013-08-03
11
version = "7.x-1.1"
10
; Information added by  packaging script on 2013-11-18
11
version = "7.x-1.3"
12 12
core = "7.x"
13 13
project = "views_pdf"
14
datestamp = "1375559497"
14
datestamp = "1384819110"
15 15

  
htmltest/sites/all/modules/views_pdf/modules/views_view_field/views_view_field.info
7 7
files[] = views_view_field_handler_include_view.inc
8 8

  
9 9

  
10
; Information added by drupal.org packaging script on 2013-08-03
11
version = "7.x-1.1"
10
; Information added by  packaging script on 2013-11-18
11
version = "7.x-1.3"
12 12
core = "7.x"
13 13
project = "views_pdf"
14
datestamp = "1375559497"
14
datestamp = "1384819110"
15 15

  
htmltest/sites/all/modules/views_pdf/views_pdf.info
15 15
files[] = field_plugins/views_pdf_handler_page_number.inc
16 16
files[] = field_plugins/views_pdf_handler_page_break.inc
17 17

  
18
; Information added by drupal.org packaging script on 2013-08-03
19
version = "7.x-1.1"
18
; Information added by  packaging script on 2013-11-18
19
version = "7.x-1.3"
20 20
core = "7.x"
21 21
project = "views_pdf"
22
datestamp = "1375559497"
22
datestamp = "1384819110"
23 23

  
htmltest/sites/all/modules/views_pdf/views_pdf_plugin_display.inc
63 63
  function execute($path_to_store_pdf = '', $destination = 'I') {
64 64

  
65 65
    // Defines external configuration for TCPDF library
66
    $tcpdf_path = drupal_realpath(views_pdf_get_library('tcpdf'));
67
    $cache_path = 'public://views_pdf_cache/';
68
    if(file_prepare_directory($cache_path, FILE_CREATE_DIRECTORY) == TRUE){
66
    if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
67
      $tcpdf_path = drupal_realpath(views_pdf_get_library('tcpdf'));
68
      $cache_path = 'public://views_pdf_cache/';
69
      file_prepare_directory($cache_path, FILE_CREATE_DIRECTORY);
69 70
      global $base_url;
70 71
      define('K_TCPDF_EXTERNAL_CONFIG', TRUE);
71 72
      define('K_PATH_MAIN', dirname($_SERVER['SCRIPT_FILENAME']));
......
79 80
    }
80 81

  
81 82
    if ($this->get_option('default_page_format') == 'custom') {
82
      if (preg_match('/([0-9]+)x([0-9]+)/', $this->get_option('default_page_format_custom'), $result)) {
83
      if (preg_match('~([0-9\.]+)x([0-9\.]+)~', $this->get_option('default_page_format_custom'), $result)) {
83 84
        $format[0] = $result[1]; // width
84 85
        $format[1] = $result[2]; // height
85 86
      }
......
118 119
    }
119 120

  
120 121
    if (empty($path_to_store_pdf)) {
121
      $path_to_store_pdf = $this->view->name;
122
      $path_to_store_pdf = $this->view->get_title();
122 123
    }
123 124

  
124 125
    if (!preg_match('/\.pdf$/', $path_to_store_pdf)) {
htmltest/sites/all/modules/views_pdf/views_pdf_plugin_style_unformatted.inc
44 44
      }
45 45
      // Render as a record set.
46 46
      else {
47
        if (isset($set['group'])) {
47
        if (!empty($set['group'])) {
48 48
          $field_id = $this->options['grouping'][$level]['field'];
49 49
          $options = array();
50 50
          if(isset($this->row_plugin->options['formats'][$field_id])) {
htmltest/sites/all/modules/views_pdf/views_pdf_template.php
245 245
    $options['render'] += array(
246 246
      'eval_before' => '',
247 247
      'eval_after' => '',
248
      'bypass_eval_before' => FALSE,
249
      'bypass_eval_after' => FALSE,
248 250
    );
249 251

  
250 252
    $x = $y = 0;
......
386 388

  
387 389
    }
388 390

  
389
    if ($key !== NULL && $view->field[$key]->theme($row)) {
391
    if ($key !== NULL && $view->field[$key]->theme($row) || !empty($row)) {
390 392
      $this->SetX($x);
391 393
      $this->SetY($y);
392 394
      $this->renderRow($x, $y, $row, $options, $view, $key, $printLabels);
......
409 411
      return;
410 412
    }
411 413

  
412
    if (!empty($view->field[$key]->options['exclude']) || (empty($content) && $view->field[$key]->options['hide_empty'])) {
414
    if (empty($key) || !empty($view->field[$key]->options['exclude']) || (empty($content) && $view->field[$key]->options['hide_empty'])) {
413 415
      return '';
414 416
    }
415 417

  
......
493 495
    $fitcell = FALSE;
494 496

  
495 497
    // Run eval before.
496
    if ($options['render']['bypass_eval_before'] && !empty($options['render']['eval_before'])) {
498
    if (!empty($options['render']['bypass_eval_before']) && !empty($options['render']['eval_before'])) {
497 499
      eval($options['render']['eval_before']);
498 500
    }
499 501
    elseif (!empty($options['render']['eval_before']))  {
......
527 529
    $this->SetFont($this->defaultFontFamily, implode('', $this->defaultFontStyle), $this->defaultFontSize);
528 530

  
529 531
    // Run eval after.
530
    if ($options['render']['bypass_eval_after'] && !empty($options['render']['eval_alter'])) {
532
    if (!empty($options['render']['bypass_eval_after']) && !empty($options['render']['eval_after'])) {
531 533
      eval($options['render']['eval_after']);
532 534
    }
533
    elseif (!empty($options['render']['eval_alter'])) {
535
    elseif (!empty($options['render']['eval_after'])) {
534 536
      $content = php_eval($options['render']['eval_after']);
535 537
    }
536 538

  
......
813 815
  /**
814 816
   * This method adds a new page to the PDF.
815 817
   */
816
  public function addPage($path = NULL, $reset = FALSE, $numbering = 'main') {
818
  public function addPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false, $path = NULL, $reset = FALSE, $numbering = 'main') {
817 819

  
818 820
    // Do not add any new page, if we are writing
819 821
    // in the footer or header.

Also available in: Unified diff