Hooray for stylesheets.

This commit is contained in:
Garvin Hicking
2003-03-10 13:48:10 +00:00
parent 88579ba476
commit 35702c9861
16 changed files with 3530 additions and 3608 deletions

View File

@@ -2,6 +2,8 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
$is_transformation_wrapper = true;
/**
* Get the variables sent or posted to this script and displays the header
*/
@@ -13,73 +15,17 @@ require('./libraries/grab_globals.lib.php3');
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php3');
}
if (!defined('PMA_OB_LIB_INCLUDED')) {
include('./libraries/ob.lib.php3');
}
require('./libraries/relation.lib.php3'); // foreign keys
require('./libraries/transformations.lib.php3'); // Transformations
$cfgRelation = PMA_getRelationsParam();
/**
* Displays the query submitted and its result
*/
if (!empty($message)) {
if (isset($goto)) {
$goto_cpy = $goto;
$goto = 'tbl_properties.php3?'
. PMA_generate_common_url($db, $table)
. '&$show_query=1'
. '&sql_query=' . urlencode($disp_query);
} else {
$show_query = '1';
}
if (isset($sql_query)) {
$sql_query_cpy = $sql_query;
unset($sql_query);
}
if (isset($disp_query)) {
$sql_query = $disp_query;
}
PMA_showMessage($message);
if (isset($goto_cpy)) {
$goto = $goto_cpy;
unset($goto_cpy);
}
if (isset($sql_query_cpy)) {
$sql_query = $sql_query_cpy;
unset($sql_query_cpy);
}
}
/**
* Defines the url to return to in case of error in a sql statement
*/
if (!isset($goto)) {
$goto = 'db_details.php3';
}
if (!ereg('^(db_details|tbl_properties|tbl_select)', $goto)) {
$err_url = $goto . "?" . PMA_generate_common_url($db) . "&sql_query=" . urlencode($sql_query);
} else {
$err_url = $goto . '?'
. PMA_generate_common_url($db)
. ((ereg('^(tbl_properties|tbl_select)', $goto)) ? '&table=' . urlencode($table) : '');
}
/**
* Ensures db and table are valid, else moves to the "parent" script
*/
require('./libraries/db_table_exists.lib.php3');
/**
* Sets parameters for links and displays top menu
*/
$url_query = PMA_generate_common_url($db, $table)
. '&goto=tbl_properties.php3';
/**
* Get the list of the fields of the current table
*/
@@ -89,36 +35,17 @@ if (isset($primary_key)) {
$local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key;
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$row = PMA_mysql_fetch_array($result);
// No row returned
if (!$row) {
unset($row);
unset($primary_key);
$goto_cpy = $goto;
$goto = 'tbl_properties.php3?'
. PMA_generate_common_url($db, $table)
. '&$show_query=1'
. '&sql_query=' . urlencode($local_query);
if (isset($sql_query)) {
$sql_query_cpy = $sql_query;
unset($sql_query);
}
$sql_query = $local_query;
PMA_showMessage($strEmptyResultSet);
$goto = $goto_cpy;
unset($goto_cpy);
if (isset($sql_query_cpy)) {
$sql_query = $sql_query_cpy;
unset($sql_query_cpy);
}
} // end if (no record returned)
}
else
{
} else {
$local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1';
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
unset($row);
$row = PMA_mysql_fetch_array($result);
}
// No row returned
if (!$row) {
exit;
} // end if (no record returned)
$default_ct = 'application/octet-stream';
if ($cfgRelation['commwork'] && $cfgRelation['mimework']) {
@@ -133,27 +60,21 @@ if ($cfgRelation['commwork'] && $cfgRelation['mimework']) {
}
}
/**
* Sends http headers
*/
// Don't use cache (required for Opera)
// garvin: For re-usability, moved http-headers and stylesheets
// to a seperate file. It can now be included by header.inc.php3,
// queryframe.php3, querywindow.php3.
if (!isset($noheader)) {
$GLOBALS['now'] = gmdate('D, d M Y H:i:s') . ' GMT';
header('Expires: ' . $GLOBALS['now']); // rfc2616 - Section 14.21
header('Last-Modified: ' . $GLOBALS['now']);
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
include('./libraries/header_http.inc.php3');
// [MIME]
$content_type = 'Content-Type: ' . (isset($mime_map[urldecode($transform_key)]['mimetype']) ? str_replace("_", "/", $mime_map[urldecode($transform_key)]['mimetype']) : $default_ct) . (isset($mime_options['charset']) ? $mime_options['charset'] : '');
header($content_type);
}
if (!isset($resize)) {
echo $row[urldecode($transform_key)];
} else {
// if image_*__inline.inc.php3 finds that we can resize,
// it sets $resize to jpeg or png
$srcImage = imagecreatefromstring($row[urldecode($transform_key)]);
$srcWidth = ImageSX( $srcImage );
$srcHeight = ImageSY( $srcImage );
@@ -189,7 +110,6 @@ if (!isset($resize)) {
}
ImageDestroy( $srcImage );
ImageDestroy( $destImage );
}
/**