]> git.joonet.de Git - adminer.git/commitdiff
Generalize doc_link()
authorJakub Vrana <jakub@vrana.cz>
Tue, 6 Aug 2013 01:55:27 +0000 (18:55 -0700)
committerJakub Vrana <jakub@vrana.cz>
Tue, 6 Aug 2013 02:22:13 +0000 (19:22 -0700)
adminer/database.inc.php
adminer/foreign.inc.php
adminer/include/editing.inc.php
adminer/processlist.inc.php
adminer/user.inc.php

index b0f5db6c847cf59423d1e24d226248cb4ce50499..61b71443f19d5aa2d3c201fcc0c5650006c1f008 100644 (file)
@@ -60,7 +60,10 @@ if ($_POST) {
 echo ($_POST["add_x"] || strpos($name, "\n")
        ? '<textarea id="name" name="name" rows="10" cols="40">' . h($name) . '</textarea><br>'
        : '<input name="name" id="name" value="' . h($name) . '" maxlength="64" autocapitalize="off">'
-) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $row["collation"]) . doc_link("charset-charsets.html") : "");
+) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $row["collation"]) . doc_link(array(
+       'sql' => "charset-charsets.html",
+       'mssql' => "ms187963.aspx",
+)) : "");
 ?>
 <script type='text/javascript'>focus(document.getElementById('name'));</script>
 <input type="submit" value="<?php echo lang('Save'); ?>">
index 307e288e343d0a090b4c83ec5b13c68367297f52..5ddce3a7b501d66b796a2a2474da08e597ac1096 100644 (file)
@@ -69,7 +69,12 @@ foreach ($row["source"] as $key => $val) {
 <p>
 <?php echo lang('ON DELETE'); ?>: <?php echo html_select("on_delete", array(-1 => "") + explode("|", $on_actions), $row["on_delete"]); ?>
  <?php echo lang('ON UPDATE'); ?>: <?php echo html_select("on_update", array(-1 => "") + explode("|", $on_actions), $row["on_update"]); ?>
-<?php echo doc_link("innodb-foreign-key-constraints.html"); ?>
+<?php echo doc_link(array(
+       'sql' => "innodb-foreign-key-constraints.html",
+       'pgsql' => "sql-createtable.html#SQL-CREATETABLE-REFERENCES",
+       'mssql' => "ms174979.aspx",
+       'oracle' => "clauses002.htm#sthref2903",
+)); ?>
 <p>
 <input type="submit" value="<?php echo lang('Save'); ?>">
 <noscript><p><input type="submit" name="add" value="<?php echo lang('Add column'); ?>"></noscript>
index efe90c6979eae504c38c721133fe034784ccdfb2..f18bd1fc302e5229e0a82f39cc1b96c88cf23e65 100644 (file)
@@ -49,7 +49,7 @@ function select($result, $connection2 = null, $orgtables = array()) {
                                }
                                $types[$j] = $field->type;
                                echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . h($name)
-                                       . ($orgtables ? doc_link("explain-output.html#explain_" . strtolower($name)) : "")
+                                       . ($orgtables ? doc_link(array('sql' => "explain-output.html#explain_" . strtolower($name))) : "")
                                ;
                        }
                        echo "</thead>\n";
@@ -452,21 +452,19 @@ function ini_bytes($ini) {
 }
 
 /** Create link to database documentation
-* @param string
+* @param array $jush => $path
 * @return string HTML code
 */
-function doc_link($path) {
+function doc_link($paths) {
        global $jush, $connection;
        $urls = array(
-                'sql' => "http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/",
-                /* not used:
-                'sqlite' => "http://www.sqlite.org/",
-                'pgsql' => "http://www.postgresql.org/docs/" . substr($connection->server_info, 0, 3) . "/static/",
-                'mssql' => "http://msdn.microsoft.com/library/",
-                'oracle' => "http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/",
-                */
+               'sql' => "http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/",
+               'sqlite' => "http://www.sqlite.org/",
+               'pgsql' => "http://www.postgresql.org/docs/" . substr($connection->server_info, 0, 3) . "/static/",
+               'mssql' => "http://msdn.microsoft.com/library/",
+               'oracle' => "http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/",
        );
-       return ($urls[$jush] ? "<a href='$urls[$jush]$path' target='_blank' rel='noreferrer'><sup>?</sup></a>" : "");
+       return ($paths[$jush] ? "<a href='$urls[$jush]$paths[$jush]' target='_blank' rel='noreferrer'><sup>?</sup></a>" : "");
 }
 
 /** Return events to display help on mouse over
index b360fdc6f01f3fe9c13065437da0c1ff07bbca84..d6e660a947b320300d2fc675009347c1b82ef361 100644 (file)
@@ -22,7 +22,11 @@ foreach (process_list() as $i => $row) {
        if (!$i) {
                echo "<thead><tr lang='en'>" . (support("kill") ? "<th>&nbsp;" : "");
                foreach ($row as $key => $val) {
-                       echo "<th>$key" . doc_link("show-processlist.html#processlist_" . strtolower($key));
+                       echo "<th>$key" . doc_link(array(
+                               'sql' => "show-processlist.html#processlist_" . strtolower($key),
+                               'pgsql' => "monitoring-stats.html#PG-STAT-ACTIVITY-VIEW",
+                               'oracle' => "../b14237/dynviews_2088.htm",
+                       ));
                }
                echo "</thead>\n";
        }
index 7657832bf8a9ec18705d5e136aebfdbad5bebd6c..f45078ab5062fc00fb4fcd81413167a274459edd 100644 (file)
@@ -142,7 +142,7 @@ if ($_POST) {
 <?php
 //! MAX_* limits, REQUIRE
 echo "<table cellspacing='0'>\n";
-echo "<thead><tr><th colspan='2'>" . lang('Privileges') . doc_link("grant.html#priv_level");
+echo "<thead><tr><th colspan='2'>" . lang('Privileges') . doc_link(array('sql' => "grant.html#priv_level"));
 $i = 0;
 foreach ($grants as $object => $grant) {
        echo '<th>' . ($object != "*.*" ? "<input name='objects[$i]' value='" . h($object) . "' size='10' autocapitalize='off'>" : "<input type='hidden' name='objects[$i]' value='*.*' size='10'>*.*"); //! separate db, table, columns, PROCEDURE|FUNCTION, routine