Skip to content

Commit

Permalink
We are using XHTML now and HTML is not an option. The headers config …
Browse files Browse the repository at this point in the history
…has been updated to allow you to choose between Transitional and Strict.

Updates were also applied to correctly identify the frameset in use.
  • Loading branch information
mr-russ committed Apr 18, 2007
1 parent 4e0e1b6 commit f8a7eb1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
32 changes: 15 additions & 17 deletions classes/Misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Class to hold various commonly used functions
*
* $Id: Misc.php,v 1.141 2007/04/13 11:18:11 mr-russ Exp $
* $Id: Misc.php,v 1.142 2007/04/18 14:08:48 mr-russ Exp $
*/

class Misc {
Expand Down Expand Up @@ -352,30 +352,28 @@ function getDatabaseAccessor($database, $server_id = null) {
* @param $title The title of the page
* @param $script script tag
*/
function printHeader($title = '', $script = null) {
function printHeader($title = '', $script = null, $frameset = false) {
global $appName, $lang, $_no_output, $conf;

if (!isset($_no_output)) {
header("Content-Type: text/html; charset=" . $lang['appcharset']);
// Send XHTML headers, or regular HTML headers
if (isset($conf['use_xhtml']) && $conf['use_xhtml']) {
$closeTag = "/";
echo "<?xml version=\"1.0\" encoding=\"", htmlspecialchars($lang['appcharset']), "\"?>\n";
// Send XHTML headers, or regular XHTML strict headers
echo "<?xml version=\"1.0\" encoding=\"", htmlspecialchars($lang['appcharset']), "\"?>\n";
if ($frameset !== null) {
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
} else if (isset($conf['use_xhtml_strict']) && $conf['use_xhtml_strict']) {
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd\">\n";
} else {
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"{$lang['applocale']}\" lang=\"{$lang['applocale']}\"";
if (strcasecmp($lang['applangdir'], 'ltr') != 0) echo " dir=\"", htmlspecialchars($lang['applangdir']), "\"";
echo ">\n";
} else {
$closeTag = "";
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html lang=\"{$lang['applocale']}\"";
if (strcasecmp($lang['applangdir'], 'ltr') != 0) echo " dir=\"", htmlspecialchars($lang['applangdir']), "\"";
echo ">\n";
}
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"{$lang['applocale']}\" lang=\"{$lang['applocale']}\"";
if (strcasecmp($lang['applangdir'], 'ltr') != 0) echo " dir=\"", htmlspecialchars($lang['applangdir']), "\"";
echo ">\n";

echo "<head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$lang['appcharset']}\" {$closeTag}>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$lang['appcharset']}\" />\n";
// Theme
echo "<link rel=\"stylesheet\" href=\"themes/{$conf['theme']}/global.css\" type=\"text/css\" {$closeTag}>\n";
echo "<link rel=\"stylesheet\" href=\"themes/{$conf['theme']}/global.css\" type=\"text/css\" />\n";
echo "<title>", htmlspecialchars($appName);
if ($title != '') echo " - {$title}";
echo "</title>\n";
Expand Down
8 changes: 4 additions & 4 deletions conf/config.inc.php-dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Central phpPgAdmin configuration. As a user you may modify the
* settings here for your particular configuration.
*
* $Id: config.inc.php-dist,v 1.52 2007/04/14 08:00:03 mr-russ Exp $
* $Id: config.inc.php-dist,v 1.53 2007/04/18 14:08:48 mr-russ Exp $
*/

// An example server. Create as many of these as you wish,
Expand Down Expand Up @@ -121,8 +121,8 @@
// Max chars of each field to display by default in browse mode
$conf['max_chars'] = 50;

// Send XHTML headers?
$conf['use_xhtml'] = false;
// Send XHTML strict headers?
$conf['use_xhtml_strict'] = false;

// Base URL for PostgreSQL documentation.
// '%s', if present, will be replaced with the PostgreSQL version
Expand All @@ -133,6 +133,6 @@
* Don't modify anything below this line *
*****************************************/

$conf['version'] = 18;
$conf['version'] = 19;

?>
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
/**
* Main access point to the app.
*
* $Id: index.php,v 1.12 2005/05/02 15:47:23 chriskl Exp $
* $Id: index.php,v 1.13 2007/04/18 14:08:48 mr-russ Exp $
*/

// Include application functions
$_no_db_connection = true;
include_once('./libraries/lib.inc.php');
$misc->printHeader();
$misc->printHeader('', null, true);

$rtl = (strcasecmp($lang['applangdir'], 'rtl') == 0);

Expand Down

0 comments on commit f8a7eb1

Please sign in to comment.