Remove not needed param from PMA_REL_create_page

This commit is contained in:
Michal Čihař 2011-08-15 11:36:13 +02:00
parent bbccd32c81
commit b0a108473e
5 changed files with 19 additions and 40 deletions

View File

@ -1068,10 +1068,9 @@ function PMA_REL_renameField($db, $table, $field, $new_name)
* @param string $newpage
* @param array $cfgRelation
* @param string $db
* @param string $query_default_option
* @return string $pdf_page_number
*/
function PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option)
function PMA_REL_create_page($newpage, $cfgRelation, $db)
{
if (! isset($newpage) || $newpage == '') {
$newpage = __('no description');

View File

@ -64,8 +64,7 @@ class PMA_User_Schema
$this->pageNumber = PMA_REL_create_page(
$_POST['newpage'],
$cfgRelation,
$db,
$query_default_option
$db
);
$this->autoLayoutForeign = isset($_POST['auto_layout_foreign']) ? "1":NULL;
$this->autoLayoutInternal = isset($_POST['auto_layout_internal']) ? "1":NULL;

View File

@ -8,7 +8,7 @@
include_once 'pmd_common.php';
/**
* If called directly from the designer, first save the positions
* If called directly from the designer, first save the positions
*/
if (! isset($scale)) {
$no_die_save_pos = 1;
@ -25,11 +25,7 @@ if (isset($mode)) {
$scale_q = PMA_sqlAddSlashes($scale);
if ('create_export' == $mode) {
/*
* @see pdf_pages.php
*/
$query_default_option = PMA_DBI_QUERY_STORE;
$pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option);
$pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db);
if ($pdf_page_number > 0) {
$message = PMA_Message::success(__('Page has been created'));
$mode = 'export';
@ -57,7 +53,7 @@ if (isset($mode)) {
' . $pmd_table . '.`table_name` = ' . $pma_table . '.`table_name`
AND
' . $pmd_table . '.`db_name`=\''. PMA_sqlAddSlashes($db) .'\'
AND pdf_page_number = ' . $pdf_page_number_q . ';', true, PMA_DBI_QUERY_STORE);
AND pdf_page_number = ' . $pdf_page_number_q . ';', true, PMA_DBI_QUERY_STORE);
}
}
@ -68,20 +64,20 @@ require_once './libraries/header_meta_style.inc.php';
<body>
<br>
<div>
<?php
if (!empty($message)) {
<?php
if (!empty($message)) {
$message->display();
}
?>
<form name="form1" method="post" action="pmd_pdf.php">
<?php
<?php
echo PMA_generate_common_hidden_inputs($db);
echo '<div>';
echo '<fieldset><legend>' . __('Import/Export coordinates for PDF schema') . '</legend>';
$choices = array();
$table_info_result = PMA_query_as_controluser('SELECT * FROM '
$table_info_result = PMA_query_as_controluser('SELECT * FROM '
. PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages'])
. ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\'');

View File

@ -20,19 +20,12 @@ require_once './libraries/db_info.inc.php';
/**
* Includ settings for relation stuff
* get all variables needed for exporting relational schema
* get all variables needed for exporting relational schema
* in $cfgRelation
*/
require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam();
/**
* This is to avoid "Command out of sync" errors. Before switching this to
* a value of 0 (for MYSQLI_USE_RESULT), please check the logic
* to free results wherever needed.
*/
$query_default_option = PMA_DBI_QUERY_STORE;
/**
* Now in ./libraries/relation.lib.php we check for all tables
* that we need, but if we don't find them we are quiet about it
@ -79,14 +72,14 @@ if ($cfgRelation['pdfwork']) {
* and tables which will be exported as Relational schema
* you can set the table positions on the paper via scratchboard
* for table positions, put the x,y co-ordinates
*
*
* @param string $do It tells what the Schema is supposed to do
* create and select a page, generate schema etc
* create and select a page, generate schema etc
*/
if (isset($_REQUEST['do'])) {
$user_schema->setAction($_REQUEST['do']);
$user_schema->processUserChoice();
}
}
/**
* Show some possibility to select a page for the export of relation schema
@ -96,14 +89,14 @@ if ($cfgRelation['pdfwork']) {
$user_schema->selectPage();
/**
* Create a new page where relations will be drawn
* Create a new page where relations will be drawn
*/
$user_schema->showCreatePageDialog($db);
/**
* After selection of page or creating a page
* It will show you the list of tables
* After selection of page or creating a page
* It will show you the list of tables
* A dashboard will also be shown where you can position the tables
*/
@ -114,7 +107,7 @@ if ($cfgRelation['pdfwork']) {
|| ($_REQUEST['do']== 'selectpage' && isset($user_schema->chosenPage) && $user_schema->chosenPage != 0)
|| ($_REQUEST['do'] == 'createpage' && isset($user_schema->chosenPage) && $user_schema->chosenPage != 0))) {
/**
/**
* show Export schema generation options
*/
$user_schema->displaySchemaGenerationOptions();

View File

@ -13,7 +13,7 @@ require './libraries/StorageEngine.class.php';
/**
* Include settings for relation stuff
* get all variables needed for exporting relational schema
* get all variables needed for exporting relational schema
* in $cfgRelation
*/
require_once './libraries/relation.lib.php';
@ -21,14 +21,6 @@ $cfgRelation = PMA_getRelationsParam();
require_once './libraries/transformations.lib.php';
require_once './libraries/Index.class.php';
/**
* This is to avoid "Command out of sync" errors. Before switching this to
* a value of 0 (for MYSQLI_USE_RESULT), please check the logic
* to free results wherever needed.
*/
$query_default_option = PMA_DBI_QUERY_STORE;
include_once("./libraries/schema/Export_Relation_Schema.class.php");
/**
@ -47,4 +39,4 @@ if (!file_exists('./libraries/schema/' . $path . '_Relation_Schema.class.php'))
PMA_Export_Relation_Schema::dieSchema($_POST['chpage'],$export_type,__('File doesn\'t exist'));
}
include("./libraries/schema/".$path."_Relation_Schema.class.php");
$obj_schema = eval("new PMA_".$path."_Relation_Schema();");
$obj_schema = eval("new PMA_".$path."_Relation_Schema();");