]> git.joonet.de Git - adminer.git/commitdiff
Move <h1> to $adminer->navigation
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Sat, 19 Sep 2009 20:16:15 +0000 (20:16 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Sat, 19 Sep 2009 20:16:15 +0000 (20:16 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1118 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/adminer.inc.php
adminer/include/design.inc.php
editor/editing.js
editor/include/adminer.inc.php

index 4cb09aca78d4aa8bb1283a4aeefd957b4cc983f1..793fc770efc26aa4309234298cd67c4d58551dac 100644 (file)
@@ -414,7 +414,18 @@ class Adminer {
        * @return null
        */
        function navigation($missing) {
-               global $dbh;
+               global $VERSION;
+               ?>
+<h1>
+<a href="http://www.adminer.org/" id="h1"><?php echo $this->name(); ?></a>
+<span class="version"><?php echo $VERSION; ?></span>
+<a href="http://www.adminer.org/#download" id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
+</h1>
+<script type="text/javascript">
+body_load();
+<?php echo (isset($_COOKIE["adminer_version"]) ? "" : "verify_version();"); ?>
+</script>
+<?php
                if ($missing != "auth") {
                        $databases = get_databases();
                        ?>
@@ -442,19 +453,28 @@ class Adminer {
 </p>
 </form>
 <?php
-                       if ($missing != "db" && strlen(DB) && $dbh->select_db(DB)) {
-                               $result = $dbh->query("SHOW TABLES");
-                               if (!$result->num_rows) {
-                                       echo "<p class='message'>" . lang('No tables.') . "\n";
-                               } else {
-                                       echo "<p id='tables'>\n";
-                                       while ($row = $result->fetch_row()) {
-                                               echo '<a href="' . h(ME) . 'select=' . urlencode($row[0]) . '">' . lang('select') . '</a> ';
-                                               echo '<a href="' . h(ME) . 'table=' . urlencode($row[0]) . '">' . $this->tableName(array("Name" => $row[0])) . "</a><br>\n"; //! Adminer::tableName may work with full table status
-                                       }
+                       $this->printTables($missing);
+               }
+       }
+       
+       /** Prints table list in menu
+       * @param string can be "db" if there is no database selected
+       * @return null
+       */
+       function printTables($missing) {
+               global $dbh;
+               if ($missing != "db" && strlen(DB) && $dbh->select_db(DB)) {
+                       $result = $dbh->query("SHOW TABLES");
+                       if (!$result->num_rows) {
+                               echo "<p class='message'>" . lang('No tables.') . "\n";
+                       } else {
+                               echo "<p id='tables'>\n";
+                               while ($row = $result->fetch_row()) {
+                                       echo '<a href="' . h(ME) . 'select=' . urlencode($row[0]) . '">' . lang('select') . '</a> ';
+                                       echo '<a href="' . h(ME) . 'table=' . urlencode($row[0]) . '">' . $this->tableName(array("Name" => $row[0])) . "</a><br>\n"; //! Adminer::tableName may work with full table status
                                }
-                               echo '<p><a href="' . h(ME) . 'create=">' . lang('Create new table') . "</a>\n";
                        }
+                       echo '<p><a href="' . h(ME) . 'create=">' . lang('Create new table') . "</a>\n";
                }
        }
        
index e02b58521291389e5082313250b73ba99f2e8420..43661de44ab4e468c33ff89b83625ba1d3f8635b 100644 (file)
@@ -15,7 +15,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
 <link rel="stylesheet" type="text/css" href="adminer.css">
 <?php } ?>
 
-<body onload="body_load();<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verify_version();"); ?>">
+<body>
 <script type="text/javascript" src="../adminer/functions.js"></script>
 <script type="text/javascript" src="editing.js"></script>
 
@@ -56,17 +56,12 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
 }
 
 function page_footer($missing = false) {
-       global $VERSION, $adminer;
+       global $adminer;
        ?>
 </div>
 
 <?php switch_lang(); ?>
 <div id="menu">
-<h1>
-<a href="http://www.adminer.org/" id="h1"><?php echo $adminer->name(); ?></a>
-<span class="version"><?php echo $VERSION; ?></span>
-<a href="http://www.adminer.org/#download" id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
-</h1>
 <?php $adminer->navigation($missing); ?>
 </div>
 <?php
index 6cf5307084df7713b2db5a160046e05143fbd490..fc73e71bc756a2d8d2138240dcfe0503c31236d0 100644 (file)
@@ -1,4 +1,2 @@
 // Editor specific functions
 
-function body_load() {
-}
index 0634241d21be18bb8565b45465c251d9b6f2a0a6..5b45a3157d8e1d8598f5ed24d5673ab7d191eafd 100644 (file)
@@ -348,6 +348,15 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
        }
        
        function navigation($missing) {
+               global $VERSION;
+               ?>
+<h1>
+<a href="http://www.adminer.org/" id="h1"><?php echo $this->name(); ?></a>
+<span class="version"><?php echo $VERSION; ?></span>
+<a href="http://www.adminer.org/editor/#download" id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
+</h1>
+<?php
+               echo (isset($_COOKIE["adminer_version"]) ? "" : "<script type='text/javascript'>verify_version();</script>\n");
                if ($missing != "auth") {
                        ?>
 <form action="" method="post">
@@ -357,17 +366,21 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
 </p>
 </form>
 <?php
-                       if ($missing != "db") {
-                               $table_status = table_status();
-                               if (!$table_status) {
-                                       echo "<p class='message'>" . lang('No tables.') . "\n";
-                               } else {
-                                       echo "<p id='tables'>\n";
-                                       foreach ($table_status as $row) {
-                                               $name = $this->tableName($row);
-                                               if (isset($row["Engine"]) && strlen($name)) { // ignore views and tables without name
-                                                       echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'>$name</a><br>\n";
-                                               }
+                       $this->printTables($missing);
+               }
+       }
+       
+       function printTables($missing) {
+               if ($missing != "db") {
+                       $table_status = table_status();
+                       if (!$table_status) {
+                               echo "<p class='message'>" . lang('No tables.') . "\n";
+                       } else {
+                               echo "<p id='tables'>\n";
+                               foreach ($table_status as $row) {
+                                       $name = $this->tableName($row);
+                                       if (isset($row["Engine"]) && strlen($name)) { // ignore views and tables without name
+                                               echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'>$name</a><br>\n";
                                        }
                                }
                        }