first phase of context-sensitive online help system
authorchriskl <chriskl>
Sun, 6 Jun 2004 08:50:27 +0000 (08:50 +0000)
committerchriskl <chriskl>
Sun, 6 Jun 2004 08:50:27 +0000 (08:50 +0000)
13 files changed:
BUGS
HISTORY
classes/Misc.php
classes/database/Postgres.php
classes/database/Postgres71.php
classes/database/Postgres72.php
classes/database/Postgres73.php
classes/database/Postgres74.php
classes/database/Postgres75.php
lang/english.php
lang/recoded/english.php
tables.php
themes/default/global.css

diff --git a/BUGS b/BUGS
index 853273430ac8ebcfe2ea757d29767df24d8490d3..6162dbc598742fc7d26285caeeef92c11d55ef1e 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -25,7 +25,6 @@ NEEDS TESTING
 
 * Script execution needs to support error handling - make it pass thru adodb layer
 * COPY should work in normal sql screen and sql popup window
-* Create view wizard is buggy
 * notice on viewing reports page - does this still occur?
 * highlight things on the info stats page
 * advanced stats functions
diff --git a/HISTORY b/HISTORY
index ad922196e2663ad69853faea6c6004afcbc777f2..bc64f59ebcf6ad070b291fc5a5b6d4727ddda149 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -4,6 +4,12 @@ phpPgAdmin History
 Version 3.5-dev
 -----------
 
+Features
+* Context-sensitive online help system
+
+Version 3.4.1
+-------------
+
 Bugs
 * Fix export of mixed case tables pre 7.4
 
index 9ecf4483f7aabc25f20580a3c2c782bec26326a1..c6ed9841cfcb1acf4d0a68811cfb96dd72604994 100644 (file)
@@ -2,7 +2,7 @@
        /**
         * Class to hold various commonly used functions
         *
-        * $Id: Misc.php,v 1.63 2004/05/16 07:31:21 chriskl Exp $
+        * $Id: Misc.php,v 1.64 2004/06/06 08:50:27 chriskl Exp $
         */
         
        class Misc {
                                $var = stripslashes($var);      
                }
                
+               /**
+                * Print out the page heading and help link
+                * @param $arr Array of heading items, already escaped
+                * @param $help (optional) The identifier for the help link
+                */
+               function printTitle($arr, $help = null) {
+                       global $data, $lang;
+
+                       // Don't continue unles we are actually displaying something                    
+                       if (!is_array($arr) || sizeof($arr) == 0) return;
+                       
+                       if ($help !== null && isset($data->help_page[$help])) {
+                               echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n";
+                               echo "<tr><td><h2>";
+                               // Join array with separator character
+                               echo implode($lang['strseparator'], $arr);
+                               echo "</h2></td><td style=\"text-align: right\"><a class=\"navlink help\" href=\"";
+                               // Output URL to help
+                               echo htmlspecialchars($data->help_base . $data->help_page[$help]);
+                               echo "\" target=\"ppa_help\">{$lang['strhelp']}</a></td></tr>\n";
+                               echo "</table>\n";
+                               echo "<br />\n";
+                       }
+                       else {
+                               echo "<h2>";
+                               // Join array with separator character
+                               echo implode($lang['strseparator'], $arr);
+                               echo "</h2>\n";
+                       }
+               }
+               
                /**
                 * Print out a message
                 * @param $msg The message to print
index f01531f6ce13824f0b23a95b06e9eb6938d9c462..9342b39b9f6e5fb1b20e7580cdcfdc15e945f324 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres.php,v 1.220 2004/06/03 06:42:20 chriskl Exp $
+ * $Id: Postgres.php,v 1.221 2004/06/06 08:50:27 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -127,8 +127,17 @@ class Postgres extends BaseDB {
                                                                        '~' => 'i', '!~' => 'i', '~*' => 'i', '!~*' => 'i', 'IS NULL' => 'p', 'IS NOT NULL' => 'p', 
                                                                        'IN' => 'x', 'NOT IN' => 'x');
 
-       //Supported join operations for use with view wizard
+       // Supported join operations for use with view wizard
        var $joinOps = array('INNER JOIN' => 'INNER JOIN');
+       
+       // Default help URL
+       var $help_base = 'http://www.postgresql.org/docs/7/static/';
+
+       // Help sub pages
+       var $help_page = array(
+               'create_table' => 'sql-createtable.htm'
+       );
+       
        /**
         * Constructor
         * @param $conn The database connection
index 18f0576406023f1d731d9866f43ea6e66b822725..59e859076c688a29d26fbc2a13b39f54179589d3 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres71.php,v 1.58 2004/05/26 13:54:42 chriskl Exp $
+ * $Id: Postgres71.php,v 1.59 2004/06/06 08:50:28 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -48,9 +48,21 @@ class Postgres71 extends Postgres {
        var $selectOps = array('=' => 'i', '!=' => 'i', '<' => 'i', '>' => 'i', '<=' => 'i', '>=' => 'i', 'LIKE' => 'i', 'NOT LIKE' => 'i', 
                                                                        'ILIKE' => 'i', 'NOT ILIKE' => 'i', '~' => 'i', '!~' => 'i', '~*' => 'i', '!~*' => 'i', 
                                                                        'IS NULL' => 'p', 'IS NOT NULL' => 'p', 'IN' => 'x', 'NOT IN' => 'x');
-       //Supported join operations for use with view wizard                                                            
+       // Supported join operations for use with view wizard                                                           
        var $joinOps = array('INNER JOIN' => 'INNER JOIN', 'LEFT JOIN' => 'LEFT JOIN', 'RIGHT JOIN' => 'RIGHT JOIN', 'FULL JOIN' => 'FULL JOIN');
 
+       // Default help URL
+       var $help_base = 'http://www.postgresql.org/docs/7.1/static/';
+
+       // Help sub pages (alphabetical order)
+       var $help_page = array(
+               'create_table' => 'sql-createtable.html',
+               'drop_table' => 'sql-droptable.html',
+               'insert' => 'sql-insert.html',
+               'select' => 'sql-select.html',
+               'tables' => 'ddl.html#DDL-BASICS'
+       );
+
        /**
         * Constructor
         * @param $conn The database connection
index 7a50b53c32c908eb264d15d35d5e60b575a34e14..14bd123ea9427a2ed391761ff44bbb3bd7ae0f8b 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres72.php,v 1.68 2004/05/26 14:29:50 chriskl Exp $
+ * $Id: Postgres72.php,v 1.69 2004/06/06 08:50:28 chriskl Exp $
  */
 
 
@@ -26,6 +26,9 @@ class Postgres72 extends Postgres71 {
        // Extra "magic" types.  BIGSERIAL was added in PostgreSQL 7.2.
        var $extraTypes = array('SERIAL', 'BIGSERIAL');
 
+       // Default help URL
+       var $help_base = 'http://www.postgresql.org/docs/7.2/static/';
+
        /**
         * Constructor
         * @param $conn The database connection
index cc5c652059555882d8616d4b215cb56b4b4407f0..33467629bd0f3e0cf62d4f515b15167d07c83b9b 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres73.php,v 1.118 2004/06/04 05:26:35 chriskl Exp $
+ * $Id: Postgres73.php,v 1.119 2004/06/06 08:50:28 chriskl Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -49,6 +49,9 @@ class Postgres73 extends Postgres72 {
                                                                        'SIMILAR TO' => 'i', 'NOT SIMILAR TO' => 'i', '~' => 'i', '!~' => 'i', '~*' => 'i', '!~*' => 'i', 'IS NULL' => 'p', 'IS NOT NULL' => 'p',
                                                                        'IN' => 'x', 'NOT IN' => 'x');
 
+       // Default help URL
+       var $help_base = 'http://www.postgresql.org/docs/7.3/static/';
+
        /**
         * Constructor
         * @param $conn The database connection
index edb12bf2b67d5d5d83d94ce665f9d047d28a1c97..4f7830e9854c04d42bbdbbd67f9e4cce8786f330 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres74.php,v 1.32 2004/06/03 07:34:56 chriskl Exp $
+ * $Id: Postgres74.php,v 1.33 2004/06/06 08:50:28 chriskl Exp $
  */
 
 include_once('./classes/database/Postgres73.php');
@@ -17,6 +17,9 @@ class Postgres74 extends Postgres73 {
        // Max object name length
        var $_maxNameLen = 63;
 
+       // Default help URL
+       var $help_base = 'http://www.postgresql.org/docs/7.4/static/';
+       
        /**
         * Constructor
         * @param $conn The database connection
index 55eb3e7000b770810e8c201c7d7a8e2f9293d1cd..f5a620c39c4745e37b1b7d1a77f8edc715d7b119 100755 (executable)
@@ -3,7 +3,7 @@
 /**
  * PostgreSQL 7.5 support
  *
- * $Id: Postgres75.php,v 1.5 2004/05/23 04:10:20 chriskl Exp $
+ * $Id: Postgres75.php,v 1.6 2004/06/06 08:50:28 chriskl Exp $
  */
 
 include_once('./classes/database/Postgres74.php');
@@ -13,6 +13,9 @@ class Postgres75 extends Postgres74 {
        // Last oid assigned to a system object
        var $_lastSystemOID = 17137;
 
+       // Default help URL
+       var $help_base = 'http://developer.postgresql.org/docs/postgres/';
+
        /**
         * Constructor
         * @param $conn The database connection
index 9bfec8435f43039346844dd9d5e668756fa3dedd..b4fe251b5c6fe06b6979fd8d3cc66b08b6c4c2f7 100755 (executable)
@@ -4,7 +4,7 @@
         * English language file for phpPgAdmin.  Use this as a basis
         * for new translations.
         *
-        * $Id: english.php,v 1.145 2004/05/26 11:27:00 soranzo Exp $
+        * $Id: english.php,v 1.146 2004/06/06 08:50:28 chriskl Exp $
         */
 
        // Language and character set
        $lang['strconfirm'] = 'Confirm';
        $lang['strexpression'] = 'Expression';
        $lang['strellipsis'] = '...';
+       $lang['strseparator'] = ': ';
        $lang['strexpand'] = 'Expand';
        $lang['strcollapse'] = 'Collapse';
        $lang['strexplain'] = 'Explain';
index 3799b066ec4226b9672e328376a74c8ddf71593b..f2bffdae7cb41e04be9d43ae9e6877a737969534 100644 (file)
@@ -4,7 +4,7 @@
         * English language file for phpPgAdmin.  Use this as a basis
         * for new translations.
         *
-        * $Id: english.php,v 1.98 2004/05/26 11:27:00 soranzo Exp $
+        * $Id: english.php,v 1.99 2004/06/06 08:50:28 chriskl Exp $
         */
 
        // Language and character set
        $lang['strconfirm'] = 'Confirm';
        $lang['strexpression'] = 'Expression';
        $lang['strellipsis'] = '...';
+       $lang['strseparator'] = ': ';
        $lang['strexpand'] = 'Expand';
        $lang['strcollapse'] = 'Collapse';
        $lang['strexplain'] = 'Explain';
index 888dcc63750ea507b33761e7e2ee2f213a71ae90..34818191097751e4ab644ed0ad184612154ce904 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * List tables in a database
         *
-        * $Id: tables.php,v 1.53 2004/06/03 06:42:20 chriskl Exp $
+        * $Id: tables.php,v 1.54 2004/06/06 08:50:27 chriskl Exp $
         */
 
        // Include application functions
@@ -26,7 +26,7 @@
 
                switch ($_REQUEST['stage']) {
                        case 1:
-                               echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: {$lang['strcreatetable']}</h2>\n";
+                               $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strtables'], $lang['strcreatetable']), 'create_table');
                                $misc->printMsg($msg);
                                
                                echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
@@ -73,7 +73,7 @@
 
                                $types = &$data->getTypes(true);
        
-                               echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: {$lang['strcreatetable']}</h2>\n";
+                               $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strtables'], $lang['strcreatetable']), 'create_table');
                                $misc->printMsg($msg);
 
                                echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
                global $PHP_SELF;
 
                if ($confirm) {
-                       echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$lang['strselect']}</h2>\n";
+                       $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strtables'], $misc->printVal($_REQUEST['table']), $lang['strselect']), 'select');
                        $misc->printMsg($msg);
 
                        $attrs = &$data->getTableAttributes($_REQUEST['table']);
                global $PHP_SELF;
 
                if ($confirm) {
-                       echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$lang['strinsertrow']}</h2>\n";
+                       $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strtables'], $misc->printVal($_REQUEST['table']), $lang['strinsertrow']), 'insert');
                        $misc->printMsg($msg);
 
                        $attrs = &$data->getTableAttributes($_REQUEST['table']);
                global $PHP_SELF;
 
                if ($confirm) {
-                       echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$lang['strempty']}</h2>\n";
+                       $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strtables'], $misc->printVal($_REQUEST['table']), $lang['strempty']));
 
                        echo "<p>", sprintf($lang['strconfemptytable'], $misc->printVal($_REQUEST['table'])), "</p>\n";
 
                global $PHP_SELF;
 
                if ($confirm) {
-                       echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$lang['strdrop']}</h2>\n";
+                       $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strtables'], $misc->printVal($_REQUEST['table']), $lang['strdrop']), 'drop_table');
 
                        echo "<p>", sprintf($lang['strconfdroptable'], $misc->printVal($_REQUEST['table'])), "</p>\n";
 
                global $data, $conf, $misc, $data;
                global $PHP_SELF, $lang;
                
-               echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}</h2>\n";
+               $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strtables']), 'tables');
                        
                $tables = &$data->getTables();
                
index 01d51283ee93eecce71e947a3cf585f7ba491df3..53442e4af91bbea74784c5b2dd689a717c0a3a72 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * Default style sheet
  *
- * $Id: global.css,v 1.16 2003/09/30 09:33:43 soranzo Exp $
+ * $Id: global.css,v 1.17 2004/06/06 08:50:28 chriskl Exp $
  */
 
 /** ELEMENTS */
@@ -210,6 +210,8 @@ a:hover
        text-decoration: none;
 }
 
+a.help { margin-right: 10px }
+
 a.navlink:link, a.toplink:link
 {
        color: #336699;
@@ -241,4 +243,3 @@ a.navlink:active, a.toplink:active
        font-weight: bold;
        text-decoration: none;
 }
-