]> git.joonet.de Git - adminer.git/commitdiff
Use JUSH only with supported drivers
authorJakub Vrana <jakub@vrana.cz>
Sun, 12 Jan 2014 02:42:13 +0000 (18:42 -0800)
committerJakub Vrana <jakub@vrana.cz>
Sun, 12 Jan 2014 02:45:05 +0000 (18:45 -0800)
adminer/include/adminer.inc.php

index 12df8c50ff0cd99bc7fa63751ace215a477d55a3..63f3ae891146bb8f67cfa1c20380967a4d5eeb34 100644 (file)
@@ -69,13 +69,15 @@ class Adminer {
        */
        function head() {
                global $jush;
-               ?>
+               if (support("sql")) {
+                       ?>
 <link rel="stylesheet" type="text/css" href="../externals/jush/jush.css">
 <script type="text/javascript" src="../externals/jush/modules/jush.js"></script>
 <script type="text/javascript" src="../externals/jush/modules/jush-textarea.js"></script>
 <script type="text/javascript" src="../externals/jush/modules/jush-txt.js"></script>
 <script type="text/javascript" src="../externals/jush/modules/jush-<?php echo $jush; ?>.js"></script>
 <?php
+               }
                return true;
        }
 
@@ -806,17 +808,19 @@ username.form['auth[driver]'].onchange();
                                        echo "<p class='message'>" . lang('No tables.') . "\n";
                                } else {
                                        $this->tablesPrint($tables);
-                                       $links = array();
-                                       foreach ($tables as $table => $type) {
-                                               $links[] = preg_quote($table, '/');
-                                       }
-                                       echo "<script type='text/javascript'>\n";
-                                       echo "var jushLang = '$jush';\n";
-                                       echo "var jushLinks = { $jush: [ '" . js_escape(ME) . (support("table") ? "table=" : "select=") . "\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
-                                       foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
-                                               echo "jushLinks.$val = jushLinks.$jush;\n";
+                                       if (support("sql")) {
+                                               $links = array();
+                                               foreach ($tables as $table => $type) {
+                                                       $links[] = preg_quote($table, '/');
+                                               }
+                                               echo "<script type='text/javascript'>\n";
+                                               echo "var jushLang = '$jush';\n";
+                                               echo "var jushLinks = { $jush: [ '" . js_escape(ME) . (support("table") ? "table=" : "select=") . "\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
+                                               foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
+                                                       echo "jushLinks.$val = jushLinks.$jush;\n";
+                                               }
+                                               echo "</script>\n";
                                        }
-                                       echo "</script>\n";
                                }
                        }
                }