Passed
Push — 1.10.x ( 6bd950...f9cbcd )
by Yannick
619:37 queued 578:35
created
main/inc/lib/event_email_template.class.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
     /**
13 13
      * Constructor
14 14
      */
15
-	public function __construct()
15
+    public function __construct()
16 16
     {
17 17
         $this->table =  Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE);
18
-	}
18
+    }
19 19
 
20 20
     public function get_all($where_conditions = array())
21 21
     {
@@ -29,19 +29,19 @@  discard block
 block discarded – undo
29 29
     /**
30 30
      * Displays the title + grid
31 31
      */
32
-	public function display()
32
+    public function display()
33 33
     {
34
-		// action links
35
-		$content = Display::actions(array(
34
+        // action links
35
+        $content = Display::actions(array(
36 36
                 array(
37 37
                     'url' => 'event_type.php' ,
38 38
                     'content' => Display::return_icon('new_document.png', get_lang('Add'), array(), ICON_SIZE_MEDIUM)
39
-                 )
39
+                    )
40 40
             )
41 41
         );
42 42
         $content .= Display::grid_html('event_email_template');
43 43
         return $content;
44
-	}
44
+    }
45 45
 
46 46
     public function get_status_list()
47 47
     {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 'Height' => '250',
83 83
             )
84 84
         );
85
-	    $status_list = $this->get_status_list();
85
+        $status_list = $this->get_status_list();
86 86
         $form->addElement('select', 'status', get_lang('Status'), $status_list);
87 87
         if ($action == 'edit') {
88 88
             $form->addElement('text', 'created_at', get_lang('CreatedAt'));
@@ -99,17 +99,17 @@  discard block
 block discarded – undo
99 99
         $defaults = $this->get($id);
100 100
 
101 101
         if (!empty($defaults['created_at'])) {
102
-        	$defaults['created_at'] = api_convert_and_format_date($defaults['created_at']);
102
+            $defaults['created_at'] = api_convert_and_format_date($defaults['created_at']);
103 103
         }
104 104
         if (!empty($defaults['updated_at'])) {
105
-        	$defaults['updated_at'] = api_convert_and_format_date($defaults['updated_at']);
105
+            $defaults['updated_at'] = api_convert_and_format_date($defaults['updated_at']);
106 106
         }
107 107
         $form->setDefaults($defaults);
108 108
 
109 109
         // Setting the rules
110 110
         $form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
111 111
 
112
-		return $form;
112
+        return $form;
113 113
     }
114 114
 
115 115
     public function get_count()
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/dompdf_config.inc.php 1 patch
Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -1,53 +1,53 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * DOMPDF - PHP5 HTML to PDF renderer
4
- *
5
- * File: $RCSfile: dompdf_config.inc.php,v $
6
- * Created on: 2004-08-04
7
- *
8
- * Copyright (c) 2004 - Benj Carson <[email protected]>
9
- *
10
- * This library is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU Lesser General Public
12
- * License as published by the Free Software Foundation; either
13
- * version 2.1 of the License, or (at your option) any later version.
14
- *
15
- * This library is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
- * Lesser General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU Lesser General Public License
21
- * along with this library in the file LICENSE.LGPL; if not, write to the
22
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23
- * 02111-1307 USA
24
- *
25
- * Alternatively, you may distribute this software under the terms of the
26
- * PHP License, version 3.0 or later.  A copy of this license should have
27
- * been distributed with this file in the file LICENSE.PHP .  If this is not
28
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
29
- *
30
- * The latest version of DOMPDF might be available at:
31
- * http://www.dompdf.com/
32
- *
33
- * @link http://www.dompdf.com/
34
- * @copyright 2004 Benj Carson
35
- * @author Benj Carson <[email protected]>
36
- * @contributor Helmut Tischer <[email protected]>
37
- * @package dompdf
38
- *
39
- * Changes
40
- * @contributor Helmut Tischer <[email protected]>
41
- * @version 0.5.1.htischer.20090507
42
- * - Allow overriding of configuration settings by calling php script.
43
- *   This allows replacing of dompdf by a new version in an application
44
- *   without any modification,
45
- * - Optionally separate font cache folder from font folder.
46
- *   This allows write protecting the entire installation
47
- * - Add settings to enable/disable additional debug output categories
48
- * - Change some defaults to more practical values
49
- * - Add comments about configuration parameter implications
50
- */
3
+     * DOMPDF - PHP5 HTML to PDF renderer
4
+     *
5
+     * File: $RCSfile: dompdf_config.inc.php,v $
6
+     * Created on: 2004-08-04
7
+     *
8
+     * Copyright (c) 2004 - Benj Carson <[email protected]>
9
+     *
10
+     * This library is free software; you can redistribute it and/or
11
+     * modify it under the terms of the GNU Lesser General Public
12
+     * License as published by the Free Software Foundation; either
13
+     * version 2.1 of the License, or (at your option) any later version.
14
+     *
15
+     * This library is distributed in the hope that it will be useful,
16
+     * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
+     * Lesser General Public License for more details.
19
+     *
20
+     * You should have received a copy of the GNU Lesser General Public License
21
+     * along with this library in the file LICENSE.LGPL; if not, write to the
22
+     * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23
+     * 02111-1307 USA
24
+     *
25
+     * Alternatively, you may distribute this software under the terms of the
26
+     * PHP License, version 3.0 or later.  A copy of this license should have
27
+     * been distributed with this file in the file LICENSE.PHP .  If this is not
28
+     * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
29
+     *
30
+     * The latest version of DOMPDF might be available at:
31
+     * http://www.dompdf.com/
32
+     *
33
+     * @link http://www.dompdf.com/
34
+     * @copyright 2004 Benj Carson
35
+     * @author Benj Carson <[email protected]>
36
+     * @contributor Helmut Tischer <[email protected]>
37
+     * @package dompdf
38
+     *
39
+     * Changes
40
+     * @contributor Helmut Tischer <[email protected]>
41
+     * @version 0.5.1.htischer.20090507
42
+     * - Allow overriding of configuration settings by calling php script.
43
+     *   This allows replacing of dompdf by a new version in an application
44
+     *   without any modification,
45
+     * - Optionally separate font cache folder from font folder.
46
+     *   This allows write protecting the entire installation
47
+     * - Add settings to enable/disable additional debug output categories
48
+     * - Change some defaults to more practical values
49
+     * - Add comments about configuration parameter implications
50
+     */
51 51
 
52 52
 /* $Id: dompdf_config.inc.php 216 2010-03-11 22:49:18Z ryan.masten $ */
53 53
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
  */
114 114
 
115 115
 if (!defined("DOMPDF_FONT_CACHE")) {
116
-  define("DOMPDF_FONT_CACHE", DOMPDF_FONT_DIR);
116
+    define("DOMPDF_FONT_CACHE", DOMPDF_FONT_DIR);
117 117
 }
118 118
 
119 119
 /**
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
  * using the PFDLib back end.
125 125
  */
126 126
 if (!defined('DOMPDF_TEMP_DIR')) {
127
-  define("DOMPDF_TEMP_DIR", sys_get_temp_dir());
127
+    define("DOMPDF_TEMP_DIR", sys_get_temp_dir());
128 128
 }
129 129
 
130 130
 /**
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
  * $dompdf = new DOMPDF();	$dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
141 141
  */
142 142
 if (!defined("DOMPDF_CHROOT")) {
143
-  define("DOMPDF_CHROOT", realpath(DOMPDF_DIR));
143
+    define("DOMPDF_CHROOT", realpath(DOMPDF_DIR));
144 144
 }
145 145
 
146 146
 /**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
  *
158 158
  */
159 159
 if (!defined("DOMPDF_UNICODE_ENABLED")) {
160
-  define("DOMPDF_UNICODE_ENABLED", false);
160
+    define("DOMPDF_UNICODE_ENABLED", false);
161 161
 }
162 162
 
163 163
 /**
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
  * @link http://ttf2pt1.sourceforge.net/
173 173
  */
174 174
 if (!defined("TTF2AFM")) {
175
-  define("TTF2AFM", DOMPDF_LIB_DIR ."/ttf2ufm/ttf2ufm-src/ttf2pt1");
176
-  //define("TTF2AFM", "/usr/bin/ttf2pt1");
175
+    define("TTF2AFM", DOMPDF_LIB_DIR ."/ttf2ufm/ttf2ufm-src/ttf2pt1");
176
+    //define("TTF2AFM", "/usr/bin/ttf2pt1");
177 177
 }
178 178
 
179 179
 /**
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
  * @link http://www.php.net/image
206 206
  */
207 207
 if (!defined("DOMPDF_PDF_BACKEND")) {
208
-  define("DOMPDF_PDF_BACKEND", "CPDF");
208
+    define("DOMPDF_PDF_BACKEND", "CPDF");
209 209
 }
210 210
 
211 211
 /**
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
  * a real license code must exist!
222 222
  */
223 223
 if (!defined("DOMPDF_PDFLIB_LICENSE")) {
224
-  #define("DOMPDF_PDFLIB_LICENSE", "your license key here");
224
+    #define("DOMPDF_PDFLIB_LICENSE", "your license key here");
225 225
 }
226 226
 
227 227
 /**
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
  * Therefore allow specification of content here.
236 236
  */
237 237
 if (!defined("DOMPDF_DEFAULT_MEDIA_TYPE")) {
238
-  define("DOMPDF_DEFAULT_MEDIA_TYPE", "screen");
238
+    define("DOMPDF_DEFAULT_MEDIA_TYPE", "screen");
239 239
 }
240 240
 
241 241
 /**
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
  * @see CPDF_Adapter::PAPER_SIZES for valid sizes
247 247
  */
248 248
 if (!defined("DOMPDF_DEFAULT_PAPER_SIZE")) {
249
-  define("DOMPDF_DEFAULT_PAPER_SIZE", "letter");
249
+    define("DOMPDF_DEFAULT_PAPER_SIZE", "letter");
250 250
 }
251 251
 
252 252
 
@@ -257,43 +257,43 @@  discard block
 block discarded – undo
257 257
  * @var string
258 258
  */
259 259
 if (!defined("DOMPDF_DEFAULT_FONT")) {
260
-  define("DOMPDF_DEFAULT_FONT", "serif");
260
+    define("DOMPDF_DEFAULT_FONT", "serif");
261 261
 }
262 262
 /**
263
- * Image DPI setting
264
- *
265
- * This setting determines the default DPI setting for images and fonts.  The
266
- * DPI may be overridden for inline images by explictly setting the
267
- * image's width & height style attributes (i.e. if the image's native
268
- * width is 600 pixels and you specify the image's width as 72 points,
269
- * the image will have a DPI of 600 in the rendered PDF.  The DPI of
270
- * background images can not be overridden and is controlled entirely
271
- * via this parameter.
272
- *
273
- * For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI).
274
- * If a size in html is given as px (or without unit as image size),
275
- * this tells the corresponding size in pt.
276
- * This adjusts the relative sizes to be similar to the rendering of the
277
- * html page in a reference browser.
278
- *
279
- * In pdf, always 1 pt = 1/72 inch
280
- *
281
- * Rendering resolution of various browsers in px per inch:
282
- * Windows Firefox and Internet Explorer:
283
- *   SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:?
284
- * Linux Firefox:
285
- *   about:config *resolution: Default:96
286
- *   (xorg screen dimension in mm and Desktop font dpi settings are ignored)
287
- *
288
- * Take care about extra font/image zoom factor of browser.
289
- *
290
- * In images, <img> size in pixel attribute, img css style, are overriding
291
- * the real image dimension in px for rendering.
292
- *
293
- * @var int
294
- */
263
+     * Image DPI setting
264
+     *
265
+     * This setting determines the default DPI setting for images and fonts.  The
266
+     * DPI may be overridden for inline images by explictly setting the
267
+     * image's width & height style attributes (i.e. if the image's native
268
+     * width is 600 pixels and you specify the image's width as 72 points,
269
+     * the image will have a DPI of 600 in the rendered PDF.  The DPI of
270
+     * background images can not be overridden and is controlled entirely
271
+     * via this parameter.
272
+     *
273
+     * For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI).
274
+     * If a size in html is given as px (or without unit as image size),
275
+     * this tells the corresponding size in pt.
276
+     * This adjusts the relative sizes to be similar to the rendering of the
277
+     * html page in a reference browser.
278
+     *
279
+     * In pdf, always 1 pt = 1/72 inch
280
+     *
281
+     * Rendering resolution of various browsers in px per inch:
282
+     * Windows Firefox and Internet Explorer:
283
+     *   SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:?
284
+     * Linux Firefox:
285
+     *   about:config *resolution: Default:96
286
+     *   (xorg screen dimension in mm and Desktop font dpi settings are ignored)
287
+     *
288
+     * Take care about extra font/image zoom factor of browser.
289
+     *
290
+     * In images, <img> size in pixel attribute, img css style, are overriding
291
+     * the real image dimension in px for rendering.
292
+     *
293
+     * @var int
294
+     */
295 295
 if (!defined("DOMPDF_DPI")) {
296
-  define("DOMPDF_DPI", "96");
296
+    define("DOMPDF_DPI", "96");
297 297
 }
298 298
 
299 299
 /**
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
  * @var bool
310 310
  */
311 311
 if (!defined("DOMPDF_ENABLE_PHP")) {
312
-  define("DOMPDF_ENABLE_PHP", true);
312
+    define("DOMPDF_ENABLE_PHP", true);
313 313
 }
314 314
 
315 315
 /**
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
  * @var bool
331 331
  */
332 332
 if (!defined("DOMPDF_ENABLE_REMOTE")) {
333
-  define("DOMPDF_ENABLE_REMOTE", false);
333
+    define("DOMPDF_ENABLE_REMOTE", false);
334 334
 }
335 335
  
336 336
 /**
@@ -344,25 +344,25 @@  discard block
 block discarded – undo
344 344
  * @param string $class
345 345
  */
346 346
 function DOMPDF_autoload($class) {
347
-  $filename = DOMPDF_INC_DIR . "/" . mb_strtolower($class) . ".cls.php";
347
+    $filename = DOMPDF_INC_DIR . "/" . mb_strtolower($class) . ".cls.php";
348 348
   
349
-  if ( is_file($filename) )
349
+    if ( is_file($filename) )
350 350
     require_once($filename);
351 351
 }
352 352
 
353 353
 if ( function_exists("spl_autoload_register") ) {
354 354
 
355
-   spl_autoload_register("DOMPDF_autoload");
355
+    spl_autoload_register("DOMPDF_autoload");
356 356
 
357 357
 } else if ( !function_exists("__autoload") ) {
358
-  /**
359
-   * Default __autoload() function
360
-   *
361
-   * @param string $class
362
-   */
363
-  function __autoload($class) {
358
+    /**
359
+     * Default __autoload() function
360
+     *
361
+     * @param string $class
362
+     */
363
+    function __autoload($class) {
364 364
     DOMPDF_autoload($class);
365
-  }
365
+    }
366 366
 }
367 367
 
368 368
 // ### End of user-configurable options ###
@@ -416,11 +416,11 @@  discard block
 block discarded – undo
416 416
  * the browser cache and the premature output prevents setting of the mime type.
417 417
  */
418 418
 if (!defined('DEBUGPNG')) {
419
-  define('DEBUGPNG',0);
419
+    define('DEBUGPNG',0);
420 420
 }
421 421
 if (!defined('DEBUGKEEPTEMP')) {
422
-  define('DEBUGKEEPTEMP',0);
422
+    define('DEBUGKEEPTEMP',0);
423 423
 }
424 424
 if (!defined('DEBUGCSS')) {
425
-  define('DEBUGCSS',0);
425
+    define('DEBUGCSS',0);
426 426
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/www/examples.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@  discard block
 block discarded – undo
3 3
 require_once("../dompdf_config.inc.php");
4 4
 if ( isset( $_POST["html"] ) ) {
5 5
 
6
-  if ( get_magic_quotes_gpc() )
6
+    if ( get_magic_quotes_gpc() )
7 7
     $_POST["html"] = stripslashes($_POST["html"]);
8 8
   
9
-  $dompdf = new DOMPDF();
10
-  $dompdf->load_html($_POST["html"]);
11
-  $dompdf->set_paper($_POST["paper"], $_POST["orientation"]);
12
-  $dompdf->render();
9
+    $dompdf = new DOMPDF();
10
+    $dompdf->load_html($_POST["html"]);
11
+    $dompdf->set_paper($_POST["paper"], $_POST["orientation"]);
12
+    $dompdf->render();
13 13
 
14
-  $dompdf->stream("dompdf_out.pdf");
14
+    $dompdf->stream("dompdf_out.pdf");
15 15
 
16
-  exit(0);
16
+    exit(0);
17 17
 }
18 18
 
19 19
 ?>
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
 $dompdf = dirname(dirname($_SERVER["PHP_SELF"]));
43 43
 //echo '<li>['.$dompdf.']</li>';
44 44
 if ( $dompdf == '/' || $dompdf == '\\') {
45
-  $dompdf = '';
45
+    $dompdf = '';
46 46
 }
47 47
 //echo '<li>['.$dompdf.']</li>';
48 48
 $dompdf .= "/dompdf.php?base_path=" . rawurlencode("www/test/");
49 49
 //echo '<li>['.$dompdf.']</li>';
50 50
 foreach ( $test_files as $file ) {
51
-  $file = basename($file);
52
-  $arrow = "images/arrow_0" . rand(1, 6) . ".gif";  
53
-  echo "<li style=\"list-style-image: url('$arrow');\">\n";
54
-  echo $file;
55
-  echo " [<a class=\"button\" target=\"blank\" href=\"test/$file\">HTML</a>] [<a class=\"button\" href=\"$dompdf&input_file=" . rawurlencode("$file") .  "\">PDF</a>]\n";
56
-  echo "</li>\n";
51
+    $file = basename($file);
52
+    $arrow = "images/arrow_0" . rand(1, 6) . ".gif";  
53
+    echo "<li style=\"list-style-image: url('$arrow');\">\n";
54
+    echo $file;
55
+    echo " [<a class=\"button\" target=\"blank\" href=\"test/$file\">HTML</a>] [<a class=\"button\" href=\"$dompdf&input_file=" . rawurlencode("$file") .  "\">PDF</a>]\n";
56
+    echo "</li>\n";
57 57
 }
58 58
 ?>
59 59
 </ul>
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 <select name="paper">
70 70
 <?php
71 71
 foreach ( array_keys(CPDF_Adapter::$PAPER_SIZES) as $size )
72
-  echo "<option ". ($size == "letter" ? "selected " : "" ) . "value=\"$size\">$size</option>\n";
72
+    echo "<option ". ($size == "letter" ? "selected " : "" ) . "value=\"$size\">$size</option>\n";
73 73
 ?>
74 74
 </select>
75 75
 <select name="orientation">
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/www/head.inc 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 function li_arrow() {
3
-  return '<li style="list-style-image: url(\'images/arrow_0' . rand(1,6) . '.gif\');">';  
3
+    return '<li style="list-style-image: url(\'images/arrow_0' . rand(1,6) . '.gif\');">';  
4 4
 }
5 5
 function li_star() {
6
-  return '<li style="list-style-image: url(\'images/star_0' . rand(1,5) . '.gif\');">';  
6
+    return '<li style="list-style-image: url(\'images/star_0' . rand(1,5) . '.gif\');">';  
7 7
 }
8 8
 ?>
9 9
 <?php echo '<?' . 'xml version="1.0" encoding="iso-8859-1"?' . '>'; ?>
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/inline_positioner.cls.php 1 patch
Indentation   +40 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,41 +1,40 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * DOMPDF - PHP5 HTML to PDF renderer
4
- *
5
- * File: $RCSfile: inline_positioner.cls.php,v $
6
- * Created on: 2004-06-08
7
- *
8
- * Copyright (c) 2004 - Benj Carson <[email protected]>
9
- *
10
- * This library is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU Lesser General Public
12
- * License as published by the Free Software Foundation; either
13
- * version 2.1 of the License, or (at your option) any later version.
14
- *
15
- * This library is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
- * Lesser General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU Lesser General Public License
21
- * along with this library in the file LICENSE.LGPL; if not, write to the
22
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23
- * 02111-1307 USA
24
- *
25
- * Alternatively, you may distribute this software under the terms of the
26
- * PHP License, version 3.0 or later.  A copy of this license should have
27
- * been distributed with this file in the file LICENSE.PHP .  If this is not
28
- * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
29
- *
30
- * The latest version of DOMPDF might be available at:
31
- * http://www.dompdf.com/
32
- *
33
- * @link http://www.dompdf.com/
34
- * @copyright 2004 Benj Carson
35
- * @author Benj Carson <[email protected]>
36
- * @package dompdf
37
-
38
- */
3
+     * DOMPDF - PHP5 HTML to PDF renderer
4
+     *
5
+     * File: $RCSfile: inline_positioner.cls.php,v $
6
+     * Created on: 2004-06-08
7
+     *
8
+     * Copyright (c) 2004 - Benj Carson <[email protected]>
9
+     *
10
+     * This library is free software; you can redistribute it and/or
11
+     * modify it under the terms of the GNU Lesser General Public
12
+     * License as published by the Free Software Foundation; either
13
+     * version 2.1 of the License, or (at your option) any later version.
14
+     *
15
+     * This library is distributed in the hope that it will be useful,
16
+     * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
+     * Lesser General Public License for more details.
19
+     *
20
+     * You should have received a copy of the GNU Lesser General Public License
21
+     * along with this library in the file LICENSE.LGPL; if not, write to the
22
+     * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23
+     * 02111-1307 USA
24
+     *
25
+     * Alternatively, you may distribute this software under the terms of the
26
+     * PHP License, version 3.0 or later.  A copy of this license should have
27
+     * been distributed with this file in the file LICENSE.PHP .  If this is not
28
+     * the case, you can obtain a copy at http://www.php.net/license/3_0.txt.
29
+     *
30
+     * The latest version of DOMPDF might be available at:
31
+     * http://www.dompdf.com/
32
+     *
33
+     * @link http://www.dompdf.com/
34
+     * @copyright 2004 Benj Carson
35
+     * @author Benj Carson <[email protected]>
36
+     * @package dompdf
37
+     */
39 38
 
40 39
 /* $Id: inline_positioner.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
41 40
 /**
@@ -46,11 +45,11 @@  discard block
 block discarded – undo
46 45
  */
47 46
 class Inline_Positioner extends Positioner {
48 47
 
49
-  function __construct(Frame_Decorator $frame) { parent::__construct($frame); }
48
+    function __construct(Frame_Decorator $frame) { parent::__construct($frame); }
50 49
 
51
-  //........................................................................
50
+    //........................................................................
52 51
 
53
-  function position() {
52
+    function position() {
54 53
     $cb = $this->_frame->get_containing_block();
55 54
 
56 55
     // Find our nearest block level parent and access its lines property.
@@ -65,11 +64,11 @@  discard block
 block discarded – undo
65 64
     // End debugging
66 65
 
67 66
     if ( !$p )
68
-      throw new DOMPDF_Exception("No block-level parent found.  Not good.");
67
+        throw new DOMPDF_Exception("No block-level parent found.  Not good.");
69 68
 
70 69
     $line = $p->get_current_line();
71 70
     
72 71
     $this->_frame->set_position($cb["x"] + $line["w"], $line["y"]);
73 72
 
74
-  }
73
+    }
75 74
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/image_frame_decorator.cls.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -52,28 +52,28 @@  discard block
 block discarded – undo
52 52
  */
53 53
 class Image_Frame_Decorator extends Frame_Decorator {
54 54
 
55
-  /**
56
-   * The path to the image file (note that remote images are
57
-   * downloaded locally to DOMPDF_TEMP_DIR).
58
-   *
59
-   * @var string
60
-   */
61
-  protected $_image_url;
55
+    /**
56
+     * The path to the image file (note that remote images are
57
+     * downloaded locally to DOMPDF_TEMP_DIR).
58
+     *
59
+     * @var string
60
+     */
61
+    protected $_image_url;
62 62
 
63
-  /**
64
-   * The image's file extension (i.e. png, jpeg, gif)
65
-   *
66
-   * @var string
67
-   */
68
-  protected $_image_ext;
63
+    /**
64
+     * The image's file extension (i.e. png, jpeg, gif)
65
+     *
66
+     * @var string
67
+     */
68
+    protected $_image_ext;
69 69
 
70
-  /**
71
-   * Class constructor
72
-   *
73
-   * @param Frame $frame the frame to decorate
74
-   * @param DOMPDF $dompdf the document's dompdf object (required to resolve relative & remote urls)
75
-   */
76
-  function __construct(Frame $frame, DOMPDF $dompdf) {
70
+    /**
71
+     * Class constructor
72
+     *
73
+     * @param Frame $frame the frame to decorate
74
+     * @param DOMPDF $dompdf the document's dompdf object (required to resolve relative & remote urls)
75
+     */
76
+    function __construct(Frame $frame, DOMPDF $dompdf) {
77 77
     global $_dompdf_warnings;
78 78
     
79 79
     parent::__construct($frame, $dompdf);
@@ -83,28 +83,28 @@  discard block
 block discarded – undo
83 83
     if (DEBUGPNG) print '[__construct '.$url.']';
84 84
 
85 85
     list($this->_image_url, $this->_image_ext) = Image_Cache::resolve_url($url,
86
-                                                                          $dompdf->get_protocol(),
87
-                                                                          $dompdf->get_host(),
88
-                                                                          $dompdf->get_base_path());
86
+                                                                            $dompdf->get_protocol(),
87
+                                                                            $dompdf->get_host(),
88
+                                                                            $dompdf->get_base_path());
89 89
     
90
-  }
90
+    }
91 91
 
92
-  /**
93
-   * Return the image's url
94
-   *
95
-   * @return string The url of this image
96
-   */
97
-  function get_image_url() {
92
+    /**
93
+     * Return the image's url
94
+     *
95
+     * @return string The url of this image
96
+     */
97
+    function get_image_url() {
98 98
     return $this->_image_url;
99
-  }
99
+    }
100 100
 
101
-  /**
102
-   * Return the image's file extension
103
-   *
104
-   * @return string The image's file extension
105
-   */
106
-  function get_image_ext() {
101
+    /**
102
+     * Return the image's file extension
103
+     *
104
+     * @return string The image's file extension
105
+     */
106
+    function get_image_ext() {
107 107
     return $this->_image_ext;
108
-  }
108
+    }
109 109
   
110 110
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/frame.cls.php 1 patch
Indentation   +343 added lines, -344 removed lines patch added patch discarded remove patch
@@ -34,7 +34,6 @@  discard block
 block discarded – undo
34 34
  * @copyright 2004 Benj Carson
35 35
  * @author Benj Carson <[email protected]>
36 36
  * @package dompdf
37
-
38 37
  */
39 38
 
40 39
 /* $Id: frame.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
@@ -53,105 +52,105 @@  discard block
 block discarded – undo
53 52
  */
54 53
 class Frame {
55 54
   
56
-  /**
57
-   * The DOMNode object this frame represents
58
-   *
59
-   * @var DOMNode
60
-   */
61
-  protected $_node;
62
-
63
-  /**
64
-   * Unique identifier for this frame.  Used to reference this frame
65
-   * via the node.
66
-   *
67
-   * @var string
68
-   */
69
-  protected $_id;
70
-
71
-  /**
72
-   * Unique id counter
73
-   */
74
-  static protected $ID_COUNTER = 0;
55
+    /**
56
+     * The DOMNode object this frame represents
57
+     *
58
+     * @var DOMNode
59
+     */
60
+    protected $_node;
61
+
62
+    /**
63
+     * Unique identifier for this frame.  Used to reference this frame
64
+     * via the node.
65
+     *
66
+     * @var string
67
+     */
68
+    protected $_id;
69
+
70
+    /**
71
+     * Unique id counter
72
+     */
73
+    static protected $ID_COUNTER = 0;
75 74
   
76
-  /**
77
-   * This frame's calculated style
78
-   *
79
-   * @var Style
80
-   */
81
-  protected $_style;
82
-
83
-  /**
84
-   * This frame's original style.  Needed for cases where frames are
85
-   * split across pages.
86
-   *
87
-   * @var Style
88
-   */
89
-  protected $_original_style;
75
+    /**
76
+     * This frame's calculated style
77
+     *
78
+     * @var Style
79
+     */
80
+    protected $_style;
81
+
82
+    /**
83
+     * This frame's original style.  Needed for cases where frames are
84
+     * split across pages.
85
+     *
86
+     * @var Style
87
+     */
88
+    protected $_original_style;
90 89
   
91
-  /**
92
-   * This frame's parent in the document tree.
93
-   *
94
-   * @var Frame
95
-   */
96
-  protected $_parent;
97
-
98
-  /**
99
-   * This frame's first child.  All children are handled as a
100
-   * doubly-linked list.
101
-   *
102
-   * @var Frame
103
-   */
104
-  protected $_first_child;
105
-
106
-  /**
107
-   * This frame's last child.
108
-   *
109
-   * @var Frame
110
-   */
111
-  protected $_last_child;
112
-
113
-  /**
114
-   * This frame's previous sibling in the document tree.
115
-   *
116
-   * @var Frame
117
-   */
118
-  protected $_prev_sibling;
119
-
120
-  /**
121
-   * This frame's next sibling in the document tree.
122
-   *
123
-   * @var Frame
124
-   */
125
-  protected $_next_sibling;
90
+    /**
91
+     * This frame's parent in the document tree.
92
+     *
93
+     * @var Frame
94
+     */
95
+    protected $_parent;
96
+
97
+    /**
98
+     * This frame's first child.  All children are handled as a
99
+     * doubly-linked list.
100
+     *
101
+     * @var Frame
102
+     */
103
+    protected $_first_child;
104
+
105
+    /**
106
+     * This frame's last child.
107
+     *
108
+     * @var Frame
109
+     */
110
+    protected $_last_child;
111
+
112
+    /**
113
+     * This frame's previous sibling in the document tree.
114
+     *
115
+     * @var Frame
116
+     */
117
+    protected $_prev_sibling;
118
+
119
+    /**
120
+     * This frame's next sibling in the document tree.
121
+     *
122
+     * @var Frame
123
+     */
124
+    protected $_next_sibling;
126 125
   
127
-  /**
128
-   * This frame's containing block (used in layout): array(x, y, w, h)
129
-   *
130
-   * @var array
131
-   */
132
-  protected $_containing_block;
133
-
134
-  /**
135
-   * Position on the page of the top-left corner of the margin box of
136
-   * this frame: array(x,y)
137
-   *
138
-   * @var array
139
-   */
140
-  protected $_position;
141
-
142
-  /**
143
-   * This frame's decorator
144
-   *
145
-   * @var Frame_Decorator
146
-   */
147
-  protected $_decorator;
148
-    
149
-  /**
150
-   * Class constructor
151
-   *
152
-   * @param DOMNode $node the DOMNode this frame represents
153
-   */
154
-  function __construct(DomNode $node) {
126
+    /**
127
+     * This frame's containing block (used in layout): array(x, y, w, h)
128
+     *
129
+     * @var array
130
+     */
131
+    protected $_containing_block;
132
+
133
+    /**
134
+     * Position on the page of the top-left corner of the margin box of
135
+     * this frame: array(x,y)
136
+     *
137
+     * @var array
138
+     */
139
+    protected $_position;
140
+
141
+    /**
142
+     * This frame's decorator
143
+     *
144
+     * @var Frame_Decorator
145
+     */
146
+    protected $_decorator;
147
+    
148
+    /**
149
+     * Class constructor
150
+     *
151
+     * @param DOMNode $node the DOMNode this frame represents
152
+     */
153
+    function __construct(DomNode $node) {
155 154
     $this->_node = $node;
156 155
       
157 156
     $this->_parent = null;
@@ -163,48 +162,48 @@  discard block
 block discarded – undo
163 162
     $this->_original_style = null;
164 163
     
165 164
     $this->_containing_block = array("x" => null,
166
-                                     "y" => null,
167
-                                     "w" => null,
168
-                                     "h" => null);
165
+                                        "y" => null,
166
+                                        "w" => null,
167
+                                        "h" => null);
169 168
     $this->_position = array("x" => null,
170
-                             "y" => null);
169
+                                "y" => null);
171 170
 
172 171
     $this->_decorator = null;
173 172
 
174 173
     $this->set_id( self::$ID_COUNTER++ );
175
-  }
174
+    }
176 175
 
177
-  /**
178
-   * "Destructor": forcibly free all references held by this frame
179
-   *
180
-   * @param bool $recursive if true, call dispose on all children
181
-   */
182
-  function dispose($recursive = false) {
176
+    /**
177
+     * "Destructor": forcibly free all references held by this frame
178
+     *
179
+     * @param bool $recursive if true, call dispose on all children
180
+     */
181
+    function dispose($recursive = false) {
183 182
 
184 183
     if ( $recursive ) {
185
-      while ( $child = $this->_first_child )
184
+        while ( $child = $this->_first_child )
186 185
         $child->dispose(true);
187 186
     }
188 187
 
189 188
     // Remove this frame from the tree
190 189
     if ( $this->_prev_sibling ) {
191
-      $this->_prev_sibling->_next_sibling = $this->_next_sibling;      
190
+        $this->_prev_sibling->_next_sibling = $this->_next_sibling;      
192 191
     }
193 192
 
194 193
     if ( $this->_next_sibling ) {
195
-      $this->_next_sibling->_prev_sibling = $this->_prev_sibling;
194
+        $this->_next_sibling->_prev_sibling = $this->_prev_sibling;
196 195
     }
197 196
 
198 197
     if ( $this->_parent && $this->_parent->_first_child === $this ) {
199
-      $this->_parent->_first_child = $this->_next_sibling;
198
+        $this->_parent->_first_child = $this->_next_sibling;
200 199
     }
201 200
 
202 201
     if ( $this->_parent && $this->_parent->_last_child === $this ) {
203
-      $this->_parent->_last_child = $this->_prev_sibling;
202
+        $this->_parent->_last_child = $this->_prev_sibling;
204 203
     }
205 204
 
206 205
     if ( $this->_parent ) {
207
-      $this->_parent->get_node()->removeChild($this->_node);
206
+        $this->_parent->get_node()->removeChild($this->_node);
208 207
     }
209 208
 
210 209
     $this->_style->dispose();
@@ -212,369 +211,369 @@  discard block
 block discarded – undo
212 211
     $this->_original_style->dispose();
213 212
     unset($this->_original_style);
214 213
     
215
-  }
214
+    }
216 215
 
217
-  // Re-initialize the frame
218
-  function reset() {
216
+    // Re-initialize the frame
217
+    function reset() {
219 218
     $this->_position = array("x" => null,
220
-                             "y" => null);
219
+                                "y" => null);
221 220
     $this->_containing_block = array("x" => null,
222
-                                     "y" => null,
223
-                                     "w" => null,
224
-                                     "h" => null);
221
+                                        "y" => null,
222
+                                        "w" => null,
223
+                                        "h" => null);
225 224
 
226 225
     unset($this->_style);    
227 226
     $this->_style = clone $this->_original_style;
228 227
     
229
-  }
228
+    }
230 229
   
231
-  //........................................................................
232
-
233
-  // Accessor methods
234
-  function get_node() { return $this->_node; }
235
-  function get_id() { return $this->_id; }
236
-  function get_style() { return $this->_style; }
237
-  function get_original_style() { return $this->_original_style; }
238
-  function get_parent() { return $this->_parent; }
239
-  function get_decorator() { return $this->_decorator; }
240
-  function get_first_child() { return $this->_first_child; }
241
-  function get_last_child() { return $this->_last_child; }
242
-  function get_prev_sibling() { return $this->_prev_sibling; }
243
-  function get_next_sibling() { return $this->_next_sibling; }
244
-
245
-  function get_children() { return new FrameList($this); }
230
+    //........................................................................
231
+
232
+    // Accessor methods
233
+    function get_node() { return $this->_node; }
234
+    function get_id() { return $this->_id; }
235
+    function get_style() { return $this->_style; }
236
+    function get_original_style() { return $this->_original_style; }
237
+    function get_parent() { return $this->_parent; }
238
+    function get_decorator() { return $this->_decorator; }
239
+    function get_first_child() { return $this->_first_child; }
240
+    function get_last_child() { return $this->_last_child; }
241
+    function get_prev_sibling() { return $this->_prev_sibling; }
242
+    function get_next_sibling() { return $this->_next_sibling; }
243
+
244
+    function get_children() { return new FrameList($this); }
246 245
   
247
-  // Layout property accessors
248
-  function get_containing_block($i = null) {
246
+    // Layout property accessors
247
+    function get_containing_block($i = null) {
249 248
     if ( isset($i) )
250
-      return $this->_containing_block[$i];    
249
+        return $this->_containing_block[$i];    
251 250
     return $this->_containing_block;
252
-  }
251
+    }
253 252
   
254
-  function get_position($i = null) {
253
+    function get_position($i = null) {
255 254
     if ( isset($i) )
256
-      return $this->_position[$i];
255
+        return $this->_position[$i];
257 256
     return array($this->_position["x"],
258
-                 $this->_position["y"],
259
-                 "x"=>$this->_position["x"],
260
-                 "y"=>$this->_position["y"]);
261
-  }
257
+                    $this->_position["y"],
258
+                    "x"=>$this->_position["x"],
259
+                    "y"=>$this->_position["y"]);
260
+    }
262 261
     
263
-  //........................................................................
262
+    //........................................................................
264 263
 
265
-  // Return the height of the margin box of the frame, in pt.  Meaningless
266
-  // unless the height has been calculated properly.
267
-  function get_margin_height() {      
264
+    // Return the height of the margin box of the frame, in pt.  Meaningless
265
+    // unless the height has been calculated properly.
266
+    function get_margin_height() {      
268 267
     return $this->_style->length_in_pt(array($this->_style->height,
269
-                                             $this->_style->margin_top,
270
-                                             $this->_style->margin_bottom,
271
-                                             $this->_style->border_top_width,
272
-                                             $this->_style->border_bottom_width,
273
-                                             $this->_style->padding_top,
274
-                                             $this->_style->padding_bottom),
275
-                                       $this->_containing_block["w"]);
276
-  }
277
-
278
-  // Return the width of the margin box of the frame, in pt.  Meaningless
279
-  // unless the width has been calculted properly.
280
-  function get_margin_width() {
268
+                                                $this->_style->margin_top,
269
+                                                $this->_style->margin_bottom,
270
+                                                $this->_style->border_top_width,
271
+                                                $this->_style->border_bottom_width,
272
+                                                $this->_style->padding_top,
273
+                                                $this->_style->padding_bottom),
274
+                                        $this->_containing_block["w"]);
275
+    }
276
+
277
+    // Return the width of the margin box of the frame, in pt.  Meaningless
278
+    // unless the width has been calculted properly.
279
+    function get_margin_width() {
281 280
     return $this->_style->length_in_pt(array($this->_style->width,
282
-                                     $this->_style->margin_left,
283
-                                     $this->_style->margin_right,
284
-                                     $this->_style->border_left_width,
285
-                                     $this->_style->border_right_width,
286
-                                     $this->_style->padding_left,
287
-                                     $this->_style->padding_right),
288
-                               $this->_containing_block["w"]);
289
-  }
290
-
291
-  // Return the padding box (x,y,w,h) of the frame
292
-  function get_padding_box() {
281
+                                        $this->_style->margin_left,
282
+                                        $this->_style->margin_right,
283
+                                        $this->_style->border_left_width,
284
+                                        $this->_style->border_right_width,
285
+                                        $this->_style->padding_left,
286
+                                        $this->_style->padding_right),
287
+                                $this->_containing_block["w"]);
288
+    }
289
+
290
+    // Return the padding box (x,y,w,h) of the frame
291
+    function get_padding_box() {
293 292
     $x = $this->_position["x"] +
294 293
       $this->_style->length_in_pt(array($this->_style->margin_left,
295 294
                                         $this->_style->border_left_width),
296
-                                  $this->_containing_block["w"]);
295
+                                    $this->_containing_block["w"]);
297 296
     $y = $this->_position["y"] +
298 297
       $this->_style->length_in_pt(array($this->_style->margin_top,
299 298
                                 $this->_style->border_top_width),
300
-                          $this->_containing_block["w"]);
299
+                            $this->_containing_block["w"]);
301 300
     
302 301
     $w = $this->_style->length_in_pt(array($this->_style->padding_left,
303
-                                   $this->_style->width,
304
-                                   $this->_style->padding_right),
305
-                             $this->_containing_block["w"]);
302
+                                    $this->_style->width,
303
+                                    $this->_style->padding_right),
304
+                                $this->_containing_block["w"]);
306 305
 
307 306
     $h = $this->_style->length_in_pt(array($this->_style->padding_top,
308
-                                   $this->_style->height,
309
-                                   $this->_style->padding_bottom),
310
-                             $this->_containing_block["w"]);
307
+                                    $this->_style->height,
308
+                                    $this->_style->padding_bottom),
309
+                                $this->_containing_block["w"]);
311 310
 
312 311
     return array(0 => $x, "x" => $x,
313
-                 1 => $y, "y" => $y,
314
-                 2 => $w, "w" => $w,
315
-                 3 => $h, "h" => $h);
316
-  }
312
+                    1 => $y, "y" => $y,
313
+                    2 => $w, "w" => $w,
314
+                    3 => $h, "h" => $h);
315
+    }
317 316
 
318
-  // Return the border box of the frame
319
-  function get_border_box() {
317
+    // Return the border box of the frame
318
+    function get_border_box() {
320 319
     $x = $this->_position["x"] +
321 320
       $this->_style->length_in_pt($this->_style->margin_left,
322
-                          $this->_containing_block["w"]);
321
+                            $this->_containing_block["w"]);
323 322
     $y = $this->_position["y"] +
324 323
       $this->_style->length_in_pt($this->_style->margin_top,
325
-                          $this->_containing_block["w"]);
324
+                            $this->_containing_block["w"]);
326 325
 
327 326
     $w = $this->_style->length_in_pt(array($this->_style->border_left_width,
328
-                                   $this->_style->padding_left,
329
-                                   $this->_style->width,
330
-                                   $this->_style->padding_right,
331
-                                   $this->_style->border_right_width),
332
-                             $this->_containing_block["w"]);
327
+                                    $this->_style->padding_left,
328
+                                    $this->_style->width,
329
+                                    $this->_style->padding_right,
330
+                                    $this->_style->border_right_width),
331
+                                $this->_containing_block["w"]);
333 332
 
334 333
     $h = $this->_style->length_in_pt(array($this->_style->border_top_width,
335
-                                   $this->_style->padding_top,
336
-                                   $this->_style->height,
337
-                                   $this->_style->padding_bottom,
338
-                                   $this->_style->border_bottom_width),
339
-                             $this->_containing_block["w"]);
334
+                                    $this->_style->padding_top,
335
+                                    $this->_style->height,
336
+                                    $this->_style->padding_bottom,
337
+                                    $this->_style->border_bottom_width),
338
+                                $this->_containing_block["w"]);
340 339
 
341 340
     return array(0 => $x, "x" => $x,
342
-                 1 => $y, "y" => $y,
343
-                 2 => $w, "w" => $w,
344
-                 3 => $h, "h" => $h);
341
+                    1 => $y, "y" => $y,
342
+                    2 => $w, "w" => $w,
343
+                    3 => $h, "h" => $h);
345 344
     
346
-  }
345
+    }
347 346
   
348
-  //........................................................................
347
+    //........................................................................
349 348
 
350
-  // Set methods
351
-  function set_id($id) {
349
+    // Set methods
350
+    function set_id($id) {
352 351
     $this->_id = $id;
353 352
 
354 353
     // We can only set attributes of DOMElement objects (nodeType == 1).
355 354
     // Since these are the only objects that we can assign CSS rules to,
356 355
     // this shortcoming is okay.
357 356
     if ( $this->_node->nodeType == 1)
358
-      $this->_node->setAttribute("frame_id", $id);
359
-  }
357
+        $this->_node->setAttribute("frame_id", $id);
358
+    }
360 359
 
361
-  function set_style(Style $style) {
360
+    function set_style(Style $style) {
362 361
     if ( is_null($this->_style) )
363
-      $this->_original_style = clone $style;
362
+        $this->_original_style = clone $style;
364 363
     
365 364
     $this->_style = $style;
366
-  }
365
+    }
367 366
   
368
-  function set_decorator(Frame_Decorator $decorator) {
367
+    function set_decorator(Frame_Decorator $decorator) {
369 368
     $this->_decorator = $decorator;
370
-  }
369
+    }
371 370
   
372
-  function set_containing_block($x = null, $y = null, $w = null, $h = null) {
371
+    function set_containing_block($x = null, $y = null, $w = null, $h = null) {
373 372
     if ( is_array($x) ){
374
-  		foreach($x AS $key => $val){
375
-			$$key = $val;
376
-		}
373
+            foreach($x AS $key => $val){
374
+            $$key = $val;
375
+        }
377 376
     }
378 377
     
379 378
     if (is_numeric($x)) {
380
-      $this->_containing_block[0] = $x;
381
-      $this->_containing_block["x"] = $x;
379
+        $this->_containing_block[0] = $x;
380
+        $this->_containing_block["x"] = $x;
382 381
     }
383 382
     
384 383
     if (is_numeric($y)) {
385
-      $this->_containing_block[1] = $y;
386
-      $this->_containing_block["y"] = $y;
384
+        $this->_containing_block[1] = $y;
385
+        $this->_containing_block["y"] = $y;
387 386
     }
388 387
     
389 388
     if (is_numeric($w)) {
390
-      $this->_containing_block[2] = $w;
391
-      $this->_containing_block["w"] = $w;
389
+        $this->_containing_block[2] = $w;
390
+        $this->_containing_block["w"] = $w;
392 391
     }
393 392
     
394 393
     if (is_numeric($h)) {
395
-      $this->_containing_block[3] = $h;
396
-      $this->_containing_block["h"] = $h;
394
+        $this->_containing_block[3] = $h;
395
+        $this->_containing_block["h"] = $h;
397 396
     }
398 397
     
399
-  }
398
+    }
400 399
 
401
-  function set_position($x = null, $y = null) {
400
+    function set_position($x = null, $y = null) {
402 401
     if ( is_array($x) )
403
-      extract($x);
402
+        extract($x);
404 403
     
405 404
     if ( is_numeric($x) ) {
406
-      $this->_position[0] = $x;
407
-      $this->_position["x"] = $x;
405
+        $this->_position[0] = $x;
406
+        $this->_position["x"] = $x;
408 407
     }
409 408
 
410 409
     if ( is_numeric($y) ) {
411
-      $this->_position[1] = $y;
412
-      $this->_position["y"] = $y;
410
+        $this->_position[1] = $y;
411
+        $this->_position["y"] = $y;
412
+    }
413 413
     }
414
-  }
415 414
 
416
-  //........................................................................
415
+    //........................................................................
417 416
 
418
-  function prepend_child(Frame $child, $update_node = true) {
417
+    function prepend_child(Frame $child, $update_node = true) {
419 418
 
420 419
     if ( $update_node ) 
421
-      $this->_node->insertBefore($child->_node, $this->_first_child ? $this->_first_child->_node : null);
420
+        $this->_node->insertBefore($child->_node, $this->_first_child ? $this->_first_child->_node : null);
422 421
 
423 422
     // Remove the child from its parent
424 423
     if ( $child->_parent )
425
-      $child->_parent->remove_child($child, false);
424
+        $child->_parent->remove_child($child, false);
426 425
     
427 426
     $child->_parent = $this;
428 427
     $child->_prev_sibling = null;
429 428
     
430 429
     // Handle the first child
431 430
     if ( !$this->_first_child ) {
432
-      $this->_first_child = $child;
433
-      $this->_last_child = $child;
434
-      $child->_next_sibling = null;
431
+        $this->_first_child = $child;
432
+        $this->_last_child = $child;
433
+        $child->_next_sibling = null;
435 434
       
436 435
     } else {
437 436
 
438
-      $this->_first_child->_prev_sibling = $child;
439
-      $child->_next_sibling = $this->_first_child;      
440
-      $this->_first_child = $child;
437
+        $this->_first_child->_prev_sibling = $child;
438
+        $child->_next_sibling = $this->_first_child;      
439
+        $this->_first_child = $child;
441 440
       
442 441
     }
443
-  }
442
+    }
444 443
   
445
-  function append_child(Frame $child, $update_node = true) {
444
+    function append_child(Frame $child, $update_node = true) {
446 445
 
447 446
     if ( $update_node ) 
448
-      $this->_node->appendChild($child->_node);
447
+        $this->_node->appendChild($child->_node);
449 448
 
450 449
     // Remove the child from its parent
451 450
     if ( $child->_parent )
452
-      $child->_parent->remove_child($child, false);
451
+        $child->_parent->remove_child($child, false);
453 452
 
454 453
     $child->_parent = $this;
455 454
     $child->_next_sibling = null;
456 455
     
457 456
     // Handle the first child
458 457
     if ( !$this->_last_child ) {
459
-      $this->_first_child = $child;
460
-      $this->_last_child = $child;
461
-      $child->_prev_sibling = null;
458
+        $this->_first_child = $child;
459
+        $this->_last_child = $child;
460
+        $child->_prev_sibling = null;
462 461
       
463 462
     } else {
464 463
 
465
-      $this->_last_child->_next_sibling = $child;
466
-      $child->_prev_sibling = $this->_last_child;
467
-      $this->_last_child = $child;
464
+        $this->_last_child->_next_sibling = $child;
465
+        $child->_prev_sibling = $this->_last_child;
466
+        $this->_last_child = $child;
468 467
 
469 468
     }
470
-  }  
469
+    }  
471 470
 
472
-  // Inserts a new child immediately before the specified frame
473
-  function insert_child_before(Frame $new_child, Frame $ref, $update_node = true) {
471
+    // Inserts a new child immediately before the specified frame
472
+    function insert_child_before(Frame $new_child, Frame $ref, $update_node = true) {
474 473
 
475 474
     if ( $ref === $this->_first_child ) {
476
-      $this->prepend_child($new_child, $update_node);
477
-      return;
475
+        $this->prepend_child($new_child, $update_node);
476
+        return;
478 477
     }
479 478
 
480 479
     if ( is_null($ref) ) {
481
-      $this->append_child($new_child, $update_node);
482
-      return;
480
+        $this->append_child($new_child, $update_node);
481
+        return;
483 482
     }
484 483
     
485 484
     if ( $ref->_parent !== $this )
486
-      throw new DOMPDF_Exception("Reference child is not a child of this node.");
485
+        throw new DOMPDF_Exception("Reference child is not a child of this node.");
487 486
 
488 487
     // Update the node    
489 488
     if ( $update_node )
490
-      $this->_node->insertBefore($new_child->_node, $ref->_node);
489
+        $this->_node->insertBefore($new_child->_node, $ref->_node);
491 490
 
492 491
     // Remove the child from its parent
493 492
     if ( $new_child->_parent )
494
-      $new_child->_parent->remove_child($new_child, false);
493
+        $new_child->_parent->remove_child($new_child, false);
495 494
     
496 495
     $new_child->_parent = $this;
497 496
     $new_child->_next_sibling = $ref;
498 497
     $new_child->_prev_sibling = $ref->_prev_sibling;
499 498
 
500 499
     if ( $ref->_prev_sibling )
501
-      $ref->_prev_sibling->_next_sibling = $new_child;
500
+        $ref->_prev_sibling->_next_sibling = $new_child;
502 501
     
503 502
     $ref->_prev_sibling = $new_child;
504
-  }
503
+    }
505 504
   
506
-  // Inserts a new child immediately after the specified frame
507
-  function insert_child_after(Frame $new_child, Frame $ref, $update_node = true) {    
505
+    // Inserts a new child immediately after the specified frame
506
+    function insert_child_after(Frame $new_child, Frame $ref, $update_node = true) {    
508 507
 
509 508
     if ( $ref === $this->_last_child ) {
510
-      $this->append_child($new_child, $update_node);
511
-      return;
509
+        $this->append_child($new_child, $update_node);
510
+        return;
512 511
     }
513 512
 
514 513
     if ( is_null($ref) ) {
515
-      $this->prepend_child($new_child, $update_node);
516
-      return;
514
+        $this->prepend_child($new_child, $update_node);
515
+        return;
517 516
     }
518 517
     
519 518
     if ( $ref->_parent !== $this )
520
-      throw new DOMPDF_Exception("Reference child is not a child of this node.");
519
+        throw new DOMPDF_Exception("Reference child is not a child of this node.");
521 520
 
522 521
     // Update the node
523 522
     if ( $update_node ) {
524
-      if ( $ref->_next_sibling ) {
523
+        if ( $ref->_next_sibling ) {
525 524
         $next_node = $ref->_next_sibling->_node;
526 525
         $this->_node->insertBefore($new_child->_node, $next_node);
527
-      } else {
526
+        } else {
528 527
         $new_child->_node = $this->_node->appendChild($new_child);
529
-      }
528
+        }
530 529
     }
531 530
     
532 531
     // Remove the child from its parent
533 532
     if ( $new_child->_parent)
534
-      $new_child->_parent->remove_child($new_child, false);
533
+        $new_child->_parent->remove_child($new_child, false);
535 534
     
536 535
     $new_child->_parent = $this;
537 536
     $new_child->_prev_sibling = $ref;
538 537
     $new_child->_next_sibling = $ref->_next_sibling;
539 538
 
540 539
     if ( $ref->_next_sibling ) 
541
-      $ref->_next_sibling->_prev_sibling = $new_child;
540
+        $ref->_next_sibling->_prev_sibling = $new_child;
542 541
 
543 542
     $ref->_next_sibling = $new_child;
544
-  }
543
+    }
545 544
 
546 545
 
547
-  function remove_child(Frame $child, $update_node = true) {
546
+    function remove_child(Frame $child, $update_node = true) {
548 547
 
549 548
     if ( $child->_parent !== $this )
550
-      throw new DOMPDF_Exception("Child not found in this frame");
549
+        throw new DOMPDF_Exception("Child not found in this frame");
551 550
 
552 551
     if ( $update_node )
553
-      $this->_node->removeChild($child->_node);
552
+        $this->_node->removeChild($child->_node);
554 553
     
555 554
     if ( $child === $this->_first_child )
556
-      $this->_first_child = $child->_next_sibling;
555
+        $this->_first_child = $child->_next_sibling;
557 556
 
558 557
     if ( $child === $this->_last_child )
559
-      $this->_last_child = $child->_prev_sibling;
558
+        $this->_last_child = $child->_prev_sibling;
560 559
 
561 560
     if ( $child->_prev_sibling )
562
-      $child->_prev_sibling->_next_sibling = $child->_next_sibling;
561
+        $child->_prev_sibling->_next_sibling = $child->_next_sibling;
563 562
 
564 563
     if ( $child->_next_sibling )
565
-      $child->_next_sibling->_prev_sibling = $child->_prev_sibling;    
564
+        $child->_next_sibling->_prev_sibling = $child->_prev_sibling;    
566 565
 
567 566
     $child->_next_sibling = null;
568 567
     $child->_prev_sibling = null;
569 568
     $child->_parent = null;
570 569
     return $child;
571 570
         
572
-  }
571
+    }
573 572
 
574
-  //........................................................................
573
+    //........................................................................
575 574
 
576
-  // Debugging function:
577
-  function __toString() {
575
+    // Debugging function:
576
+    function __toString() {
578 577
 
579 578
     // Skip empty text frames
580 579
 //     if ( $this->_node->nodeName === "#text" &&
@@ -588,29 +587,29 @@  discard block
 block discarded – undo
588 587
     $str .= "Class: " .get_class($this) . "<br/>";
589 588
     
590 589
     if ( $this->_node->nodeName === "#text" ) {
591
-      $tmp = htmlspecialchars($this->_node->nodeValue);
592
-      $str .= "<pre>'" .  mb_substr($tmp,0,70) .
590
+        $tmp = htmlspecialchars($this->_node->nodeValue);
591
+        $str .= "<pre>'" .  mb_substr($tmp,0,70) .
593 592
         (mb_strlen($tmp) > 70 ? "..." : "") . "'</pre>";
594 593
     }
595 594
     if ( $this->_parent )
596
-      $str .= "\nParent:" . $this->_parent->_node->nodeName .
595
+        $str .= "\nParent:" . $this->_parent->_node->nodeName .
597 596
         " (" . spl_object_hash($this->_parent->_node) . ") " .
598 597
         "<br/>";
599 598
 
600 599
     if ( $this->_prev_sibling )
601
-      $str .= "Prev: " . $this->_prev_sibling->_node->nodeName .
600
+        $str .= "Prev: " . $this->_prev_sibling->_node->nodeName .
602 601
         " (" . spl_object_hash($this->_prev_sibling->_node) . ") " .
603 602
         "<br/>";
604 603
 
605 604
     if ( $this->_next_sibling )
606
-      $str .= "Next: " . $this->_next_sibling->_node->nodeName .
605
+        $str .= "Next: " . $this->_next_sibling->_node->nodeName .
607 606
         " (" . spl_object_hash($this->_next_sibling->_node) . ") " .
608 607
         "<br/>";
609 608
 
610 609
     $d = $this->get_decorator();
611 610
     while ($d && $d != $d->get_decorator()) {
612
-      $str .= "Decorator: " . get_class($d) . "<br/>";
613
-      $d = $d->get_decorator();
611
+        $str .= "Decorator: " . get_class($d) . "<br/>";
612
+        $d = $d->get_decorator();
614 613
     }
615 614
 
616 615
     $str .= "Position: " . pre_r($this->_position, true);
@@ -621,33 +620,33 @@  discard block
 block discarded – undo
621 620
     $str .= "\nStyle: <pre>". $this->_style->__toString() . "</pre>";
622 621
 
623 622
     if ( $this->_decorator instanceof Block_Frame_Decorator ) {
624
-      $str .= "Lines:<pre>";
625
-      foreach ($this->_decorator->get_lines() as $line) {
623
+        $str .= "Lines:<pre>";
624
+        foreach ($this->_decorator->get_lines() as $line) {
626 625
         foreach ($line["frames"] as $frame) {
627
-          if ($frame instanceof Text_Frame_Decorator) {
626
+            if ($frame instanceof Text_Frame_Decorator) {
628 627
             $str .= "\ntext: ";          
629 628
             $str .= "'". htmlspecialchars($frame->get_text()) ."'";
630
-          } else {
629
+            } else {
631 630
             $str .= "\nBlock: " . $frame->get_node()->nodeName . " (" . spl_object_hash($frame->get_node()) . ")";
632
-          }
631
+            }
633 632
         }
634 633
         
635 634
         $str .=
636
-          //"\ncount => " . $line["count"] . "\n".
637
-          "\ny => " . $line["y"] . "\n" .
638
-          "w => " . $line["w"] . "\n" .
639
-          "h => " . $line["h"] . "\n";
640
-      }
641
-      $str .= "</pre>";
635
+            //"\ncount => " . $line["count"] . "\n".
636
+            "\ny => " . $line["y"] . "\n" .
637
+            "w => " . $line["w"] . "\n" .
638
+            "h => " . $line["h"] . "\n";
639
+        }
640
+        $str .= "</pre>";
642 641
     }
643 642
     $str .= "\n";
644 643
     if ( php_sapi_name() === "cli" )
645
-      $str = strip_tags(str_replace(array("<br/>","<b>","</b>"),
644
+        $str = strip_tags(str_replace(array("<br/>","<b>","</b>"),
646 645
                                     array("\n","",""),
647 646
                                     $str));
648 647
     
649 648
     return $str;
650
-  }
649
+    }
651 650
         
652 651
 }
653 652
 
@@ -660,10 +659,10 @@  discard block
 block discarded – undo
660 659
  * @package dompdf
661 660
  */
662 661
 class FrameList implements IteratorAggregate {
663
-  protected $_frame;
662
+    protected $_frame;
664 663
 
665
-  function __construct($frame) { $this->_frame = $frame; }
666
-  function getIterator() { return new FrameListIterator($this->_frame); }
664
+    function __construct($frame) { $this->_frame = $frame; }
665
+    function getIterator() { return new FrameListIterator($this->_frame); }
667 666
 }
668 667
   
669 668
 /**
@@ -677,37 +676,37 @@  discard block
 block discarded – undo
677 676
  */
678 677
 class FrameListIterator implements Iterator {
679 678
 
680
-  protected $_parent;
681
-  protected $_cur;
682
-  protected $_num;
679
+    protected $_parent;
680
+    protected $_cur;
681
+    protected $_num;
683 682
 
684
-  function __construct(Frame $frame) {
683
+    function __construct(Frame $frame) {
685 684
     $this->_parent = $frame;
686 685
     $this->_cur = $frame->get_first_child();
687 686
     $this->_num = 0;
688
-  }
687
+    }
689 688
 
690
-  function rewind() { 
689
+    function rewind() { 
691 690
     $this->_cur = $this->_parent->get_first_child();
692 691
     $this->_num = 0;
693
-  }
692
+    }
694 693
 
695
-  function valid() {
694
+    function valid() {
696 695
     return isset($this->_cur);// && ($this->_cur->get_prev_sibling() === $this->_prev);
697
-  }
698
-  function key() { return $this->_num; }
699
-  function current() { return $this->_cur; }
696
+    }
697
+    function key() { return $this->_num; }
698
+    function current() { return $this->_cur; }
700 699
 
701
-  function next() {
700
+    function next() {
702 701
 
703 702
     $ret = $this->_cur;
704 703
     if ( !$ret )
705
-      return null;
704
+        return null;
706 705
     
707 706
     $this->_cur = $this->_cur->get_next_sibling();
708 707
     $this->_num++;
709 708
     return $ret;
710
-  }
709
+    }
711 710
 }
712 711
 
713 712
 //------------------------------------------------------------------------
@@ -720,9 +719,9 @@  discard block
 block discarded – undo
720 719
  */
721 720
 class FrameTreeList implements IteratorAggregate {
722 721
 
723
-  protected $_root;
724
-  function __construct(Frame $root) { $this->_root = $root; }
725
-  function getIterator() { return new FrameTreeIterator($this->_root); }
722
+    protected $_root;
723
+    function __construct(Frame $root) { $this->_root = $root; }
724
+    function getIterator() { return new FrameTreeIterator($this->_root); }
726 725
 
727 726
 }
728 727
 
@@ -736,25 +735,25 @@  discard block
 block discarded – undo
736 735
  */
737 736
 class FrameTreeIterator implements Iterator {
738 737
 
739
-  protected $_root;
740
-  protected $_stack = array();
741
-  protected $_num;
738
+    protected $_root;
739
+    protected $_stack = array();
740
+    protected $_num;
742 741
   
743
-  function __construct(Frame $root) {
742
+    function __construct(Frame $root) {
744 743
     $this->_stack[] = $this->_root = $root;
745 744
     $this->_num = 0;
746
-  }
745
+    }
747 746
 
748
-  function rewind() {
747
+    function rewind() {
749 748
     $this->_stack = array($this->_root);
750 749
     $this->_num = 0;
751
-  }
750
+    }
752 751
     
753
-  function valid() { return count($this->_stack) > 0; }
754
-  function key() { return $this->_num; }
755
-  function current() { return end($this->_stack); }
752
+    function valid() { return count($this->_stack) > 0; }
753
+    function key() { return $this->_num; }
754
+    function current() { return end($this->_stack); }
756 755
 
757
-  function next() {
756
+    function next() {
758 757
     $b = end($this->_stack);
759 758
     
760 759
     // Pop last element
@@ -763,10 +762,10 @@  discard block
 block discarded – undo
763 762
     
764 763
     // Push all children onto the stack in reverse order
765 764
     if ( $c = $b->get_last_child() ) {
766
-      $this->_stack[] = $c;
767
-      while ( $c = $c->get_prev_sibling() )
765
+        $this->_stack[] = $c;
766
+        while ( $c = $c->get_prev_sibling() )
768 767
         $this->_stack[] = $c;
769 768
     }
770 769
     return $b;
771
-  }
770
+    }
772 771
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/table_row_positioner.cls.php 1 patch
Indentation   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,7 +34,6 @@  discard block
 block discarded – undo
34 34
  * @copyright 2004 Benj Carson
35 35
  * @author Benj Carson <[email protected]>
36 36
  * @package dompdf
37
-
38 37
  */
39 38
 
40 39
 /* $Id: table_row_positioner.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
@@ -47,22 +46,22 @@  discard block
 block discarded – undo
47 46
  */
48 47
 class Table_Row_Positioner extends Positioner {
49 48
 
50
-  function __construct(Frame_Decorator $frame) { parent::__construct($frame); }
49
+    function __construct(Frame_Decorator $frame) { parent::__construct($frame); }
51 50
   
52
-  //........................................................................
51
+    //........................................................................
53 52
 
54
-  function position() {
53
+    function position() {
55 54
 
56 55
     $cb = $this->_frame->get_containing_block();    
57 56
     $p = $this->_frame->get_prev_sibling();
58 57
 
59 58
     if ( $p ) 
60
-      $y = $p->get_position("y") + $p->get_margin_height();
59
+        $y = $p->get_position("y") + $p->get_margin_height();
61 60
 
62 61
     else
63
-      $y = $cb["y"];
62
+        $y = $cb["y"];
64 63
 
65 64
     $this->_frame->set_position($cb["x"], $y);
66 65
 
67
-  }
66
+    }
68 67
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/pdf/include/inline_frame_reflower.cls.php 1 patch
Indentation   +12 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,7 +34,6 @@  discard block
 block discarded – undo
34 34
  * @copyright 2004 Benj Carson
35 35
  * @author Benj Carson <[email protected]>
36 36
  * @package dompdf
37
-
38 37
  */
39 38
 
40 39
 /* $Id: inline_frame_reflower.cls.php 216 2010-03-11 22:49:18Z ryan.masten $ */
@@ -47,11 +46,11 @@  discard block
 block discarded – undo
47 46
  */
48 47
 class Inline_Frame_Reflower extends Frame_Reflower {
49 48
 
50
-  function __construct(Frame $frame) { parent::__construct($frame); }
49
+    function __construct(Frame $frame) { parent::__construct($frame); }
51 50
   
52
-  //........................................................................
51
+    //........................................................................
53 52
 
54
-  function reflow() {
53
+    function reflow() {
55 54
     $style = $this->_frame->get_style();
56 55
     $this->_frame->position();
57 56
 
@@ -59,23 +58,23 @@  discard block
 block discarded – undo
59 58
 
60 59
     // Add our margin, padding & border to the first and last children
61 60
     if ( ($f = $this->_frame->get_first_child()) && $f instanceof Text_Frame_Decorator ) {
62
-      $f->get_style()->margin_left = $style->margin_left;
63
-      $f->get_style()->padding_left = $style->padding_left;
64
-      $f->get_style()->border_left = $style->border_left;
61
+        $f->get_style()->margin_left = $style->margin_left;
62
+        $f->get_style()->padding_left = $style->padding_left;
63
+        $f->get_style()->border_left = $style->border_left;
65 64
     }
66 65
 
67 66
     if ( ($l = $this->_frame->get_last_child()) && $l instanceof Text_Frame_Decorator ) {
68
-      $f->get_style()->margin_right = $style->margin_right;
69
-      $f->get_style()->padding_right = $style->padding_right;
70
-      $f->get_style()->border_right = $style->border_right;
67
+        $f->get_style()->margin_right = $style->margin_right;
68
+        $f->get_style()->padding_right = $style->padding_right;
69
+        $f->get_style()->border_right = $style->border_right;
71 70
     }
72 71
 
73 72
     // Set the containing blocks and reflow each child.  The containing
74 73
     // block is not changed by line boxes.
75 74
     foreach ( $this->_frame->get_children() as $child ) {
76 75
       
77
-      $child->set_containing_block($cb);
78
-      $child->reflow();
76
+        $child->set_containing_block($cb);
77
+        $child->reflow();
78
+    }
79 79
     }
80
-  }
81 80
 }
Please login to merge, or discard this patch.