rfe #1962383 [designer] Option to create a PDF page
This commit is contained in:
@@ -60,6 +60,7 @@ danbarry
|
||||
+ [auth] support SweKey hardware authentication
|
||||
see http://store.swekey.com/index.php?promo=pma
|
||||
(todo: Documentation.html, improve code formatting)
|
||||
+ rfe #1962383 [designer] Option to create a PDF page
|
||||
|
||||
2.11.8.0 (not yet released)
|
||||
- patch #1987593 [interface] Table list pagination in navi,
|
||||
|
@@ -1133,4 +1133,30 @@ function PMA_REL_renameField($db, $table, $field, $new_name)
|
||||
} // end if relwork
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a PDF page
|
||||
*
|
||||
* @uses $GLOBALS['strNoDescription']
|
||||
* @uses PMA_backquote()
|
||||
* @uses $GLOBALS['cfgRelation']['db']
|
||||
* @uses PMA_sqlAddslashes()
|
||||
* @uses PMA_query_as_cu()
|
||||
* @uses PMA_DBI_insert_id()
|
||||
* @uses $GLOBALS['controllink']
|
||||
* @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) {
|
||||
if (! isset($newpage) || $newpage == '') {
|
||||
$newpage = $GLOBALS['strNoDescription'];
|
||||
}
|
||||
$ins_query = 'INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages'])
|
||||
. ' (db_name, page_descr)'
|
||||
. ' VALUES (\'' . PMA_sqlAddslashes($db) . '\', \'' . PMA_sqlAddslashes($newpage) . '\')';
|
||||
PMA_query_as_cu($ins_query, FALSE, $query_default_option);
|
||||
return PMA_DBI_insert_id(isset($GLOBALS['controllink']) ? $GLOBALS['controllink'] : '');
|
||||
}
|
||||
?>
|
||||
|
@@ -74,14 +74,7 @@ if ($cfgRelation['pdfwork']) {
|
||||
}
|
||||
break;
|
||||
case 'createpage':
|
||||
if (!isset($newpage) || $newpage == '') {
|
||||
$newpage = $strNoDescription;
|
||||
}
|
||||
$ins_query = 'INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages'])
|
||||
. ' (db_name, page_descr)'
|
||||
. ' VALUES (\'' . PMA_sqlAddslashes($db) . '\', \'' . PMA_sqlAddslashes($newpage) . '\')';
|
||||
PMA_query_as_cu($ins_query, FALSE, $query_default_option);
|
||||
$pdf_page_number = PMA_DBI_insert_id(isset($controllink) ? $controllink : '');
|
||||
$pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option);
|
||||
|
||||
// A u t o m a t i c l a y o u t
|
||||
// ================================
|
||||
|
36
pmd_pdf.php
36
pmd_pdf.php
@@ -16,7 +16,7 @@ if (! isset($scale)) {
|
||||
}
|
||||
require_once './libraries/relation.lib.php';
|
||||
|
||||
if (isset($scale)) {
|
||||
if (isset($scale) && ! isset($createpage)) {
|
||||
if (empty($pdf_page_number)) {
|
||||
die("<script>alert('Pages not found!');history.go(-2);</script>");
|
||||
}
|
||||
@@ -46,21 +46,24 @@ if (isset($scale)) {
|
||||
|
||||
die("<script>alert('$strModifications');history.go(-2);</script>");
|
||||
}
|
||||
if (isset($createpage)) {
|
||||
/*
|
||||
* @see pdf_pages.php
|
||||
*/
|
||||
$query_default_option = PMA_DBI_QUERY_STORE;
|
||||
|
||||
$pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option);
|
||||
}
|
||||
// no need to use pmd/styles
|
||||
require_once './libraries/header_meta_style.inc.php';
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<?php if(0){ ?>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
|
||||
<link rel="stylesheet" type="text/css" href="pmd/styles/default/style1.css">
|
||||
<?php } ?>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
|
||||
<link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css">
|
||||
<title>Designer</title>
|
||||
</head>
|
||||
<body>
|
||||
<br>
|
||||
<div style="text-align:center; font-weight:bold;">
|
||||
<div>
|
||||
<form name="form1" method="post" action="pmd_pdf.php?server=<?php echo $server; ?>&db=<?php echo $db; ?>&token=<?php echo $token; ?>">
|
||||
<div>
|
||||
<fieldset><legend><?php echo $GLOBALS['strExport'] . '/' . $GLOBALS['strImport']; ?></legend>
|
||||
<p><?php echo $strExportImportToScale; ?>:
|
||||
<select name="scale">
|
||||
<option value="1">1:1</option>
|
||||
@@ -84,11 +87,16 @@ if (isset($scale)) {
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<br>
|
||||
<br>
|
||||
<input type="submit" name="exp" value="<?php echo $strExport; ?>">
|
||||
<input type="submit" name="imp" value="<?php echo $strImport; ?>">
|
||||
</p>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div>
|
||||
<fieldset><legend><?php echo $GLOBALS['strCreatePage']; ?></legend>
|
||||
<input type="text" name="newpage" />
|
||||
<input type="submit" name="createpage" value="<?php echo $strGo; ?>">
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user