Pdf Schema Class: Reduce global variables + added attributes in Export Relation Schema
This commit is contained in:
@@ -9,8 +9,9 @@
|
||||
/**
|
||||
* This class is inherited by all schema classes
|
||||
* It contains those methods which are common in them
|
||||
* it works like factory pattern
|
||||
*
|
||||
* @name
|
||||
* @name Export Relation Schema
|
||||
* @author Muhammad Adnan <hiddenpearls@gmail.com>
|
||||
* @copyright
|
||||
* @license
|
||||
@@ -18,52 +19,95 @@
|
||||
|
||||
class PMA_Export_Relation_Schema
|
||||
{
|
||||
private $_pageTitle; // Title of the page
|
||||
private $_autoLayoutType; // Internal or Foreign Key Relations;
|
||||
protected $same_wide;
|
||||
private $_pageTitle; // Title of the page
|
||||
//protected $sameWide;
|
||||
public $showGrid;
|
||||
public $showColor;
|
||||
public $tableDimension;
|
||||
public $sameWide;
|
||||
public $withDoc;
|
||||
public $showKeys;
|
||||
public $orientation;
|
||||
public $paper;
|
||||
public $pageNumber;
|
||||
|
||||
public function setPageTitle($title)
|
||||
{
|
||||
$this->_pageTitle=$title;
|
||||
}
|
||||
|
||||
public function setExportType($type)
|
||||
{
|
||||
$this->_pageTitle=$title;
|
||||
}
|
||||
|
||||
public function setSameWidthTables($width)
|
||||
{
|
||||
$this->same_wide=$width;
|
||||
}
|
||||
|
||||
public function getAllTables($db,$page_number)
|
||||
{
|
||||
global $cfgRelation;
|
||||
// Get All tables
|
||||
public function setPageNumber($value)
|
||||
{
|
||||
$this->pageNumber = isset($value) ? $value : 1;
|
||||
}
|
||||
|
||||
public function setShowGrid($value)
|
||||
{
|
||||
$this->showGrid = (isset($value) && $value == 'on') ? 1 : 0;
|
||||
}
|
||||
|
||||
public function setShowColor($value)
|
||||
{
|
||||
$this->showColor = (isset($value) && $value == 'on') ? 1 : 0;
|
||||
}
|
||||
|
||||
public function setTableDimension($value)
|
||||
{
|
||||
$this->tableDimension = (isset($value) && $value == 'on') ? 1 : 0;
|
||||
}
|
||||
|
||||
public function setAllTableSameWidth($value)
|
||||
{
|
||||
$this->sameWide = (isset($value) && $value == 'on') ? 1 : 0;
|
||||
}
|
||||
|
||||
public function setWithDataDictionary($value)
|
||||
{
|
||||
$this->withDoc = (isset($value) && $value == 'on') ? 1 : 0;
|
||||
}
|
||||
|
||||
public function setShowKeys($value)
|
||||
{
|
||||
$this->showKeys = (isset($value) && $value == 'on') ? 1 : 0;
|
||||
}
|
||||
|
||||
public function setOrientation($value)
|
||||
{
|
||||
$this->orientation = (isset($value) && $value == 'P') ? 'P' : 'L';
|
||||
}
|
||||
|
||||
public function setPaper($value)
|
||||
{
|
||||
$this->paper = isset($value) ? $value : 'A4';
|
||||
}
|
||||
|
||||
public function setPageTitle($title)
|
||||
{
|
||||
$this->_pageTitle=$title;
|
||||
}
|
||||
|
||||
public function setExportType($value)
|
||||
{
|
||||
$this->exportType=$value;
|
||||
}
|
||||
|
||||
public function getAllTables($db,$pageNumber)
|
||||
{
|
||||
global $cfgRelation;
|
||||
// Get All tables
|
||||
$tab_sql = 'SELECT table_name FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords'])
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND pdf_page_number = ' . $page_number;
|
||||
// echo $tab_sql;
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND pdf_page_number = ' . $pageNumber;
|
||||
// echo $tab_sql;
|
||||
$tab_rs = PMA_query_as_controluser($tab_sql, null, PMA_DBI_QUERY_STORE);
|
||||
if (!$tab_rs || !PMA_DBI_num_rows($tab_rs) > 0) {
|
||||
$this->_die('',__('No tables'));
|
||||
} while ($curr_table = @PMA_DBI_fetch_assoc($tab_rs)) {
|
||||
}
|
||||
while ($curr_table = @PMA_DBI_fetch_assoc($tab_rs)) {
|
||||
$alltables[] = PMA_sqlAddslashes($curr_table['table_name']);
|
||||
}
|
||||
return $alltables;
|
||||
}
|
||||
|
||||
public function initTable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
return $alltables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays an error message
|
||||
*/
|
||||
function _die($type = '',$error_message = '')
|
||||
function dieSchema($type = '',$error_message = '')
|
||||
{
|
||||
global $db;
|
||||
|
||||
@@ -82,6 +126,6 @@ class PMA_Export_Relation_Schema
|
||||
echo "\n";
|
||||
|
||||
require_once './libraries/footer.inc.php';
|
||||
} // end of the "PMA_PDF_die()" function
|
||||
}
|
||||
}
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user