Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / schema / Dia_Relation_Schema.class.php
blob6be71fd0ce454b617b226ec59a0a4bde24ed3366
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin
6 */
7 if (! defined('PHPMYADMIN')) {
8 exit;
11 require_once 'Export_Relation_Schema.class.php';
13 /**
14 * This Class inherits the XMLwriter class and
15 * helps in developing structure of DIA Schema Export
17 * @access public
18 * @see http://php.net/manual/en/book.xmlwriter.php
20 class PMA_DIA extends XMLWriter
22 public $title;
23 public $author;
24 public $font;
25 public $fontSize;
27 /**
28 * The "PMA_DIA" constructor
30 * Upon instantiation This starts writing the Dia XML document
32 * @return void
33 * @see XMLWriter::openMemory(),XMLWriter::setIndent(),XMLWriter::startDocument()
35 function __construct()
37 $this->openMemory();
39 * Set indenting using three spaces,
40 * so output is formatted
43 $this->setIndent(true);
44 $this->setIndentString(' ');
46 * Create the XML document
49 $this->startDocument('1.0', 'UTF-8');
52 /**
53 * Starts Dia Document
55 * dia document starts by first initializing dia:diagram tag
56 * then dia:diagramdata contains all the attributes that needed
57 * to define the document, then finally a Layer starts which
58 * holds all the objects.
60 * @param string $paper the size of the paper/document
61 * @param float $topMargin top margin of the paper/document in cm
62 * @param float $bottomMargin bottom margin of the paper/document in cm
63 * @param float $leftMargin left margin of the paper/document in cm
64 * @param float $rightMargin right margin of the paper/document in cm
65 * @param string $portrait document will be portrait or landscape
67 * @return void
69 * @access public
70 * @see XMLWriter::startElement(),XMLWriter::writeAttribute(),
71 * XMLWriter::writeRaw()
73 function startDiaDoc($paper, $topMargin, $bottomMargin, $leftMargin,
74 $rightMargin, $portrait
75 ) {
76 if ($portrait == 'P') {
77 $isPortrait='true';
78 } else {
79 $isPortrait='false';
81 $this->startElement('dia:diagram');
82 $this->writeAttribute('xmlns:dia', 'http://www.lysator.liu.se/~alla/dia/');
83 $this->startElement('dia:diagramdata');
84 $this->writeRaw(
85 '<dia:attribute name="background">
86 <dia:color val="#ffffff"/>
87 </dia:attribute>
88 <dia:attribute name="pagebreak">
89 <dia:color val="#000099"/>
90 </dia:attribute>
91 <dia:attribute name="paper">
92 <dia:composite type="paper">
93 <dia:attribute name="name">
94 <dia:string>#' . $paper . '#</dia:string>
95 </dia:attribute>
96 <dia:attribute name="tmargin">
97 <dia:real val="' . $topMargin . '"/>
98 </dia:attribute>
99 <dia:attribute name="bmargin">
100 <dia:real val="' . $bottomMargin . '"/>
101 </dia:attribute>
102 <dia:attribute name="lmargin">
103 <dia:real val="' . $leftMargin . '"/>
104 </dia:attribute>
105 <dia:attribute name="rmargin">
106 <dia:real val="' . $rightMargin . '"/>
107 </dia:attribute>
108 <dia:attribute name="is_portrait">
109 <dia:boolean val="' . $isPortrait . '"/>
110 </dia:attribute>
111 <dia:attribute name="scaling">
112 <dia:real val="1"/>
113 </dia:attribute>
114 <dia:attribute name="fitto">
115 <dia:boolean val="false"/>
116 </dia:attribute>
117 </dia:composite>
118 </dia:attribute>
119 <dia:attribute name="grid">
120 <dia:composite type="grid">
121 <dia:attribute name="width_x">
122 <dia:real val="1"/>
123 </dia:attribute>
124 <dia:attribute name="width_y">
125 <dia:real val="1"/>
126 </dia:attribute>
127 <dia:attribute name="visible_x">
128 <dia:int val="1"/>
129 </dia:attribute>
130 <dia:attribute name="visible_y">
131 <dia:int val="1"/>
132 </dia:attribute>
133 <dia:composite type="color"/>
134 </dia:composite>
135 </dia:attribute>
136 <dia:attribute name="color">
137 <dia:color val="#d8e5e5"/>
138 </dia:attribute>
139 <dia:attribute name="guides">
140 <dia:composite type="guides">
141 <dia:attribute name="hguides"/>
142 <dia:attribute name="vguides"/>
143 </dia:composite>
144 </dia:attribute>'
146 $this->endElement();
147 $this->startElement('dia:layer');
148 $this->writeAttribute('name', 'Background');
149 $this->writeAttribute('visible', 'true');
150 $this->writeAttribute('active', 'true');
154 * Ends Dia Document
156 * @return void
157 * @access public
158 * @see XMLWriter::endElement(),XMLWriter::endDocument()
160 function endDiaDoc()
162 $this->endElement();
163 $this->endDocument();
167 * Output Dia Document for download
169 * @param string $fileName name of the dia document
171 * @return void
172 * @access public
173 * @see XMLWriter::flush()
175 function showOutput($fileName)
177 if (ob_get_clean()) {
178 ob_end_clean();
180 $output = $this->flush();
181 PMA_Response::getInstance()->disable();
182 PMA_downloadHeader(
183 $fileName . '.dia', 'application/x-dia-diagram', strlen($output)
185 print $output;
190 * Table preferences/statistics
192 * This class preserves the table co-ordinates,fields
193 * and helps in drawing/generating the Tables in dia XML document.
195 * @name Table_Stats
196 * @see PMA_DIA
198 class Table_Stats
201 * Defines properties
203 public $tableName;
204 public $fields = array();
205 public $x, $y;
206 public $primary = array();
207 public $tableId;
208 public $tableColor;
211 * The "Table_Stats" constructor
213 * @param string $tableName The table name
214 * @param integer $pageNumber The current page number (from the
215 * $cfg['Servers'][$i]['table_coords'] table)
216 * @param boolean $showKeys Whether to display ONLY keys or not
218 * @return void
220 * @global object The current dia document
221 * @global array The relations settings
222 * @global string The current db name
224 * @see PMA_DIA
226 function __construct($tableName, $pageNumber, $showKeys = false)
228 global $dia, $cfgRelation, $db;
230 $this->tableName = $tableName;
231 $sql = 'DESCRIBE ' . PMA_Util::backquote($tableName);
232 $result = PMA_DBI_try_query($sql, null, PMA_DBI_QUERY_STORE);
233 if (!$result || !PMA_DBI_num_rows($result)) {
234 $dia->dieSchema(
235 $pageNumber, "DIA",
236 sprintf(__('The %s table doesn\'t exist!'), $tableName)
240 * load fields
241 * check to see if it will load all fields or only the foreign keys
243 if ($showKeys) {
244 $indexes = PMA_Index::getFromTable($this->tableName, $db);
245 $all_columns = array();
246 foreach ($indexes as $index) {
247 $all_columns = array_merge(
248 $all_columns,
249 array_flip(array_keys($index->getColumns()))
252 $this->fields = array_keys($all_columns);
253 } else {
254 while ($row = PMA_DBI_fetch_row($result)) {
255 $this->fields[] = $row[0];
259 $sql = 'SELECT x, y FROM '
260 . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . '.'
261 . PMA_Util::backquote($cfgRelation['table_coords'])
262 . ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\''
263 . ' AND table_name = \''
264 . PMA_Util::sqlAddSlashes($tableName) . '\''
265 . ' AND pdf_page_number = ' . $pageNumber;
266 $result = PMA_queryAsControlUser($sql, false, PMA_DBI_QUERY_STORE);
267 if (! $result || ! PMA_DBI_num_rows($result)) {
268 $dia->dieSchema(
269 $pageNumber,
270 "DIA",
271 sprintf(
272 __('Please configure the coordinates for table %s'),
273 $tableName
277 list($this->x, $this->y) = PMA_DBI_fetch_row($result);
278 $this->x = (double) $this->x;
279 $this->y = (double) $this->y;
281 * displayfield
283 $this->displayfield = PMA_getDisplayField($db, $tableName);
285 * index
287 $result = PMA_DBI_query(
288 'SHOW INDEX FROM ' . PMA_Util::backquote($tableName) . ';',
289 null,
290 PMA_DBI_QUERY_STORE
292 if (PMA_DBI_num_rows($result) > 0) {
293 while ($row = PMA_DBI_fetch_assoc($result)) {
294 if ($row['Key_name'] == 'PRIMARY') {
295 $this->primary[] = $row['Column_name'];
300 * Every object in Dia document needs an ID to identify
301 * so, we used a static variable to keep the things unique
303 PMA_Dia_Relation_Schema::$objectId += 1;
304 $this->tableId = PMA_Dia_Relation_Schema::$objectId;
308 * Do draw the table
310 * Tables are generated using object type Database - Table
311 * primary fields are underlined in tables. Dia object
312 * is used to generate the XML of Dia Document. Database Table
313 * Object and their attributes are involved in the combination
314 * of displaing Database - Table on Dia Document.
316 * @param boolean $changeColor Whether to show color for tables text or not
317 * if changeColor is true then an array of $listOfColors will be used to choose
318 * the random colors for tables text we can change/add more colors to this array
320 * @return void
322 * @global object The current Dia document
324 * @access public
325 * @see PMA_DIA
327 public function tableDraw($changeColor)
329 global $dia;
331 if ($changeColor) {
332 $listOfColors = array(
333 'FF0000',
334 '000099',
335 '00FF00'
337 shuffle($listOfColors);
338 $this->tableColor = '#' . $listOfColors[0] . '';
339 } else {
340 $this->tableColor = '#000000';
343 $factor = 0.1;
345 $dia->startElement('dia:object');
346 $dia->writeAttribute('type', 'Database - Table');
347 $dia->writeAttribute('version', '0');
348 $dia->writeAttribute('id', '' . $this->tableId . '');
349 $dia->writeRaw(
350 '<dia:attribute name="obj_pos">
351 <dia:point val="'
352 . ($this->x * $factor) . ',' . ($this->y * $factor) . '"/>
353 </dia:attribute>
354 <dia:attribute name="obj_bb">
355 <dia:rectangle val="'
356 .($this->x * $factor) . ',' . ($this->y * $factor) . ';9.97,9.2"/>
357 </dia:attribute>
358 <dia:attribute name="meta">
359 <dia:composite type="dict"/>
360 </dia:attribute>
361 <dia:attribute name="elem_corner">
362 <dia:point val="'
363 . ($this->x * $factor) . ',' . ($this->y * $factor) . '"/>
364 </dia:attribute>
365 <dia:attribute name="elem_width">
366 <dia:real val="5.9199999999999999"/>
367 </dia:attribute>
368 <dia:attribute name="elem_height">
369 <dia:real val="3.5"/>
370 </dia:attribute>
371 <dia:attribute name="text_colour">
372 <dia:color val="' . $this->tableColor . '"/>
373 </dia:attribute>
374 <dia:attribute name="line_colour">
375 <dia:color val="#000000"/>
376 </dia:attribute>
377 <dia:attribute name="fill_colour">
378 <dia:color val="#ffffff"/>
379 </dia:attribute>
380 <dia:attribute name="line_width">
381 <dia:real val="0.10000000000000001"/>
382 </dia:attribute>
383 <dia:attribute name="name">
384 <dia:string>#' . $this->tableName . '#</dia:string>
385 </dia:attribute>
386 <dia:attribute name="comment">
387 <dia:string>##</dia:string>
388 </dia:attribute>
389 <dia:attribute name="visible_comment">
390 <dia:boolean val="false"/>
391 </dia:attribute>
392 <dia:attribute name="tagging_comment">
393 <dia:boolean val="false"/>
394 </dia:attribute>
395 <dia:attribute name="underline_primary_key">
396 <dia:boolean val="true"/>
397 </dia:attribute>
398 <dia:attribute name="bold_primary_keys">
399 <dia:boolean val="true"/>
400 </dia:attribute>
401 <dia:attribute name="normal_font">
402 <dia:font family="monospace" style="0" name="Courier"/>
403 </dia:attribute>
404 <dia:attribute name="name_font">
405 <dia:font family="sans" style="80" name="Helvetica-Bold"/>
406 </dia:attribute>
407 <dia:attribute name="comment_font">
408 <dia:font family="sans" style="0" name="Helvetica"/>
409 </dia:attribute>
410 <dia:attribute name="normal_font_height">
411 <dia:real val="0.80000000000000004"/>
412 </dia:attribute>
413 <dia:attribute name="name_font_height">
414 <dia:real val="0.69999999999999996"/>
415 </dia:attribute>
416 <dia:attribute name="comment_font_height">
417 <dia:real val="0.69999999999999996"/>
418 </dia:attribute>'
421 $dia->startElement('dia:attribute');
422 $dia->writeAttribute('name', 'attributes');
424 foreach ($this->fields as $field) {
425 $dia->writeRaw(
426 '<dia:composite type="table_attribute">
427 <dia:attribute name="name">
428 <dia:string>#' . $field . '#</dia:string>
429 </dia:attribute>
430 <dia:attribute name="type">
431 <dia:string>##</dia:string>
432 </dia:attribute>
433 <dia:attribute name="comment">
434 <dia:string>##</dia:string>
435 </dia:attribute>'
437 unset($pm);
438 $pm = 'false';
439 if (in_array($field, $this->primary)) {
440 $pm = 'true';
442 if ($field == $this->displayfield) {
443 $pm = 'false';
445 $dia->writeRaw(
446 '<dia:attribute name="primary_key">
447 <dia:boolean val="' . $pm . '"/>
448 </dia:attribute>
449 <dia:attribute name="nullable">
450 <dia:boolean val="false"/>
451 </dia:attribute>
452 <dia:attribute name="unique">
453 <dia:boolean val="' . $pm . '"/>
454 </dia:attribute>
455 </dia:composite>'
458 $dia->endElement();
459 $dia->endElement();
464 * Relation preferences/statistics
466 * This class fetches the table master and foreign fields positions
467 * and helps in generating the Table references and then connects
468 * master table's master field to foreign table's foreign key
469 * in dia XML document.
471 * @name Relation_Stats
472 * @see PMA_DIA
474 class Relation_Stats
477 * Defines properties
479 public $srcConnPointsRight;
480 public $srcConnPointsLeft;
481 public $destConnPointsRight;
482 public $destConnPointsLeft;
483 public $masterTableId;
484 public $foreignTableId;
485 public $masterTablePos;
486 public $foreignTablePos;
487 public $referenceColor;
490 * The "Relation_Stats" constructor
492 * @param string $master_table The master table name
493 * @param string $master_field The relation field in the master table
494 * @param string $foreign_table The foreign table name
495 * @param string $foreign_field The relation field in the foreign table
497 * @return void
499 * @see Relation_Stats::_getXy
501 function __construct($master_table, $master_field, $foreign_table,
502 $foreign_field
504 $src_pos = $this->_getXy($master_table, $master_field);
505 $dest_pos = $this->_getXy($foreign_table, $foreign_field);
506 $this->srcConnPointsLeft = $src_pos[0];
507 $this->srcConnPointsRight = $src_pos[1];
508 $this->destConnPointsLeft = $dest_pos[0];
509 $this->destConnPointsRight = $dest_pos[1];
510 $this->masterTablePos = $src_pos[2];
511 $this->foreignTablePos = $dest_pos[2];
512 $this->masterTableId = $master_table->tableId;
513 $this->foreignTableId = $foreign_table->tableId;
517 * Each Table object have connection points
518 * which is used to connect to other objects in Dia
519 * we detect the position of key in fields and
520 * then determines its left and right connection
521 * points.
523 * @param string $table The current table name
524 * @param string $column The relation column name
526 * @return array Table right,left connection points and key position
528 * @access private
530 private function _getXy($table, $column)
532 $pos = array_search($column, $table->fields);
533 // left, right, position
534 $value = 12;
535 if ($pos != 0) {
536 return array($pos + $value + $pos, $pos + $value + $pos + 1, $pos);
538 return array($pos + $value , $pos + $value + 1, $pos);
542 * Draws relation references
544 * connects master table's master field to foreign table's
545 * forein field using Dia object type Database - Reference
546 * Dia object is used to generate the XML of Dia Document.
547 * Database reference Object and their attributes are involved
548 * in the combination of displaing Database - reference on Dia Document.
550 * @param boolean $changeColor Whether to use one color per relation or not
551 * if changeColor is true then an array of $listOfColors will be used to choose
552 * the random colors for references lines. we can change/add more colors to this
554 * @return void
556 * @global object The current Dia document
558 * @access public
559 * @see PMA_PDF
561 public function relationDraw($changeColor)
563 global $dia;
565 PMA_Dia_Relation_Schema::$objectId += 1;
567 * if source connection points and destination connection
568 * points are same then return it false and don't draw that
569 * relation
571 if ( $this->srcConnPointsRight == $this->destConnPointsRight) {
572 if ( $this->srcConnPointsLeft == $this->destConnPointsLeft) {
573 return false;
577 if ($changeColor) {
578 $listOfColors = array(
579 'FF0000',
580 '000099',
581 '00FF00'
583 shuffle($listOfColors);
584 $this->referenceColor = '#' . $listOfColors[0] . '';
585 } else {
586 $this->referenceColor = '#000000';
589 $dia->writeRaw(
590 '<dia:object type="Database - Reference" version="0" id="'
591 . PMA_Dia_Relation_Schema::$objectId . '">
592 <dia:attribute name="obj_pos">
593 <dia:point val="3.27,18.9198"/>
594 </dia:attribute>
595 <dia:attribute name="obj_bb">
596 <dia:rectangle val="2.27,8.7175;17.7679,18.9198"/>
597 </dia:attribute>
598 <dia:attribute name="meta">
599 <dia:composite type="dict"/>
600 </dia:attribute>
601 <dia:attribute name="orth_points">
602 <dia:point val="3.27,18.9198"/>
603 <dia:point val="2.27,18.9198"/>
604 <dia:point val="2.27,14.1286"/>
605 <dia:point val="17.7679,14.1286"/>
606 <dia:point val="17.7679,9.3375"/>
607 <dia:point val="16.7679,9.3375"/>
608 </dia:attribute>
609 <dia:attribute name="orth_orient">
610 <dia:enum val="0"/>
611 <dia:enum val="1"/>
612 <dia:enum val="0"/>
613 <dia:enum val="1"/>
614 <dia:enum val="0"/>
615 </dia:attribute>
616 <dia:attribute name="orth_autoroute">
617 <dia:boolean val="true"/>
618 </dia:attribute>
619 <dia:attribute name="text_colour">
620 <dia:color val="#000000"/>
621 </dia:attribute>
622 <dia:attribute name="line_colour">
623 <dia:color val="' . $this->referenceColor . '"/>
624 </dia:attribute>
625 <dia:attribute name="line_width">
626 <dia:real val="0.10000000000000001"/>
627 </dia:attribute>
628 <dia:attribute name="line_style">
629 <dia:enum val="0"/>
630 <dia:real val="1"/>
631 </dia:attribute>
632 <dia:attribute name="corner_radius">
633 <dia:real val="0"/>
634 </dia:attribute>
635 <dia:attribute name="end_arrow">
636 <dia:enum val="22"/>
637 </dia:attribute>
638 <dia:attribute name="end_arrow_length">
639 <dia:real val="0.5"/>
640 </dia:attribute>
641 <dia:attribute name="end_arrow_width">
642 <dia:real val="0.5"/>
643 </dia:attribute>
644 <dia:attribute name="start_point_desc">
645 <dia:string>#1#</dia:string>
646 </dia:attribute>
647 <dia:attribute name="end_point_desc">
648 <dia:string>#n#</dia:string>
649 </dia:attribute>
650 <dia:attribute name="normal_font">
651 <dia:font family="monospace" style="0" name="Courier"/>
652 </dia:attribute>
653 <dia:attribute name="normal_font_height">
654 <dia:real val="0.59999999999999998"/>
655 </dia:attribute>
656 <dia:connections>
657 <dia:connection handle="0" to="'
658 . $this->masterTableId . '" connection="'
659 . $this->srcConnPointsRight . '"/>
660 <dia:connection handle="1" to="'
661 . $this->foreignTableId . '" connection="'
662 . $this->destConnPointsRight . '"/>
663 </dia:connections>
664 </dia:object>'
670 * Dia Relation Schema Class
672 * Purpose of this class is to generate the Dia XML Document
673 * which is used for representing the database diagrams in Dia IDE
674 * This class uses Database Table and Reference Objects of Dia and with
675 * the combination of these objects actually helps in preparing Dia XML.
677 * Dia XML is generated by using XMLWriter php extension and this class
678 * inherits Export_Relation_Schema class has common functionality added
679 * to this class
681 * @name Dia_Relation_Schema
683 class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema
686 * Defines properties
688 private $_tables = array();
689 private $_relations = array();
690 private $_topMargin = 2.8222000598907471;
691 private $_bottomMargin = 2.8222000598907471;
692 private $_leftMargin = 2.8222000598907471;
693 private $_rightMargin = 2.8222000598907471;
694 public static $objectId = 0;
697 * The "PMA_Dia_Relation_Schema" constructor
699 * Upon instantiation This outputs the Dia XML document
700 * that user can download
702 * @return void
703 * @see PMA_DIA,Table_Stats,Relation_Stats
705 function __construct()
707 global $dia,$db;
709 $this->setPageNumber($_POST['pdf_page_number']);
710 $this->setShowGrid(isset($_POST['show_grid']));
711 $this->setShowColor($_POST['show_color']);
712 $this->setShowKeys(isset($_POST['show_keys']));
713 $this->setOrientation(isset($_POST['orientation']));
714 $this->setPaper($_POST['paper']);
715 $this->setExportType($_POST['export_type']);
717 $dia = new PMA_DIA();
718 $dia->startDiaDoc(
719 $this->paper, $this->_topMargin, $this->_bottomMargin,
720 $this->_leftMargin, $this->_rightMargin, $this->orientation
722 $alltables = $this->getAllTables($db, $this->pageNumber);
723 foreach ($alltables as $table) {
724 if (! isset($this->tables[$table])) {
725 $this->_tables[$table] = new Table_Stats(
726 $table, $this->pageNumber, $this->showKeys
731 $seen_a_relation = false;
732 foreach ($alltables as $one_table) {
733 $exist_rel = PMA_getForeigners($db, $one_table, '', 'both');
734 if ($exist_rel) {
735 $seen_a_relation = true;
736 foreach ($exist_rel as $master_field => $rel) {
737 /* put the foreign table on the schema only if selected
738 * by the user
739 * (do not use array_search() because we would have to
740 * to do a === false and this is not PHP3 compatible)
742 if (in_array($rel['foreign_table'], $alltables)) {
743 $this->_addRelation(
744 $one_table, $master_field, $rel['foreign_table'],
745 $rel['foreign_field'], $this->showKeys
751 $this->_drawTables($this->showColor);
753 if ($seen_a_relation) {
754 $this->_drawRelations($this->showColor);
756 $dia->endDiaDoc();
757 $dia->showOutput($db . '-' . $this->pageNumber);
758 exit();
762 * Defines relation objects
764 * @param string $masterTable The master table name
765 * @param string $masterField The relation field in the master table
766 * @param string $foreignTable The foreign table name
767 * @param string $foreignField The relation field in the foreign table
768 * @param bool $showKeys Whether to display ONLY keys or not
770 * @return void
772 * @access private
773 * @see Table_Stats::__construct(),Relation_Stats::__construct()
775 private function _addRelation($masterTable, $masterField, $foreignTable,
776 $foreignField, $showKeys
778 if (! isset($this->_tables[$masterTable])) {
779 $this->_tables[$masterTable] = new Table_Stats(
780 $masterTable, $this->pageNumber, $showKeys
783 if (! isset($this->_tables[$foreignTable])) {
784 $this->_tables[$foreignTable] = new Table_Stats(
785 $foreignTable, $this->pageNumber, $showKeys
788 $this->_relations[] = new Relation_Stats(
789 $this->_tables[$masterTable], $masterField,
790 $this->_tables[$foreignTable], $foreignField
795 * Draws relation references
797 * connects master table's master field to
798 * foreign table's forein field using Dia object
799 * type Database - Reference
801 * @param boolean $changeColor Whether to use one color per relation or not
803 * @return void
805 * @access private
806 * @see Relation_Stats::relationDraw()
808 private function _drawRelations($changeColor)
810 foreach ($this->_relations as $relation) {
811 $relation->relationDraw($changeColor);
816 * Draws tables
818 * Tables are generated using Dia object type Database - Table
819 * primary fields are underlined and bold in tables
821 * @param boolean $changeColor Whether to show color for tables text or not
823 * @return void
825 * @access private
826 * @see Table_Stats::tableDraw()
828 private function _drawTables($changeColor)
830 foreach ($this->_tables as $table) {
831 $table->tableDraw($changeColor);