Removed all (I hope so ;-) ) hardcoded strings
authorslubek <slubek>
Thu, 20 Feb 2003 23:17:05 +0000 (23:17 +0000)
committerslubek <slubek>
Thu, 20 Feb 2003 23:17:05 +0000 (23:17 +0000)
database.php
functions.php
reports.php
tblproperties.php
types.php
views.php

index 9080320ef37ccafe20ebe150fa15d84bb8eb4a90..521719378f75556636c7826572eb43e3f548a635 100755 (executable)
@@ -3,7 +3,7 @@
        /**
         * Manage schemas within a database
         *
-        * $Id: database.php,v 1.4 2003/02/09 10:22:38 chriskl Exp $
+        * $Id: database.php,v 1.5 2003/02/20 23:17:05 slubek Exp $
         */
 
        // Include application functions
@@ -18,7 +18,7 @@
         */
        function doSQL() {
                global $PHP_SELF, $localData, $misc;
-               global $strSQL, $strEnterSQL, $strGo;
+               global $strSQL, $strEnterSQL, $strGo, $strReset;
 
                if (!isset($_POST['query'])) $_POST['query'] = '';
 
@@ -35,7 +35,7 @@
                echo "<input type=\"hidden\" name=\"return_url\" value=\"database.php?database=", 
                        urlencode($_REQUEST['database']), "&action=sql\">\n";
                echo "<input type=\"hidden\" name=\"return_desc\" value=\"Back\">\n";
-               echo "<input type=submit value=\"{$strGo}\"> <input type=reset>\n";
+               echo "<input type=submit value=\"{$strGo}\"> <input type=reset value=\"{$strReset}\">\n";
                echo "</form>\n";
 
        }
@@ -45,7 +45,7 @@
         */
        function doDrop($confirm) {
                global $PHP_SELF, $data, $localData;
-               global $strDrop, $strConfDropSchema, $strSchemaDropped, $strSchemaDroppedBad;
+               global $strDrop, $strConfDropSchema, $strSchemaDropped, $strSchemaDroppedBad, $strYes, $strNo;
 
                if ($confirm) {
                        echo "<h2>", htmlspecialchars($_REQUEST['database']), ": ",
@@ -57,7 +57,7 @@
                        echo "<input type=\"hidden\" name=\"action\" value=\"drop\">\n";
                        echo "<input type=\"hidden\" name=\"database\" value=\"", htmlspecialchars($_REQUEST['database']), "\">\n";
                        echo "<input type=\"hidden\" name=\"schema\" value=\"", htmlspecialchars($_REQUEST['schema']), "\">\n";
-                       echo "<input type=\"submit\" name=\"choice\" value=\"Yes\"> <input type=\"submit\" name=\"choice\" value=\"No\">\n";
+                       echo "<input type=\"submit\" name=\"choice\" value=\"{$strYes}\"> <input type=\"submit\" name=\"choice\" value=\"{$strNo}\">\n";
                        echo "</form>\n";
                }
                else {
@@ -75,7 +75,7 @@
         */
        function doCreate($msg = '') {
                global $data, $misc;
-               global $PHP_SELF, $strName, $strOwner, $strCreateSchema, $strShowAllSchemas;
+               global $PHP_SELF, $strName, $strOwner, $strCreateSchema, $strShowAllSchemas, $strSave, $strReset;
 
                if (!isset($_POST['formName'])) $_POST['formName'] = '';
                if (!isset($_POST['formAuth'])) $_POST['formAuth'] = $_SESSION['webdbUsername'];
                echo "<p>\n";
                echo "<input type=\"hidden\" name=\"action\" value=\"save_create\">\n";
                echo "<input type=\"hidden\" name=\"database\" value=\"", htmlspecialchars($_REQUEST['database']), "\">\n";
-               echo "<input type=\"submit\" value=\"Save\"> <input type=\"reset\">\n";
+               echo "<input type=\"submit\" value=\"{$strSave}\"> <input type=\"reset\" value=\"{$strReset}\">\n";
                echo "</p>\n";
                echo "</form>\n";
                
                        doCreate();
                        break;
                case 'drop':
-                       if ($_POST['choice'] == 'Yes') doDrop(false);
+                       if ($_POST['choice'] == "{$strYes}") doDrop(false);
                        else doDefault();
                        break;
                case 'confirm_drop':
index 8fbd5a23ec93f6397565bcb23de42aa0eb51cc7d..b7300856cafedf115594ef2dd17fef9f9811614f 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage functions in a database
         *
-        * $Id: functions.php,v 1.3 2003/02/09 10:22:38 chriskl Exp $
+        * $Id: functions.php,v 1.4 2003/02/20 23:17:05 slubek Exp $
         */
 
        // Include application functions
         * Function to save after editing a function
         */
        function doSaveEdit() {
-               global $localData;
+               global $localData, $strFunctionUpdated, $strFunctionUpdatedBad;
                
                $status = $localData->setFunction($_POST['original_function'], $_POST['original_arguments'] , $_POST['original_returns'] , $_POST['formDefinition'] , $_POST['original_lang'],0,true);
                if ($status == 0)
-                       doProperties('Function updated.');
+                       doProperties($strFunctionUpdated);
                else
-                       doEdit('Function update failed.');
+                       doEdit($strFunctionUpdatedBad);
        }
        
        /**
@@ -32,8 +32,9 @@
        function doEdit($msg = '') {
                global $data, $localData, $misc;
                global $PHP_SELF, $strFunction, $strArguments, $strReturns, $strActions, $strNoFunctions, $strDefinition, $strLanguage;
+               global $strSave, $strReset, $strNoData, $strFunctions, $strEdit, $strProperties, $strShowAllFunctions;
                
-               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": Functions: ", htmlspecialchars($_REQUEST['function']), ": Edit</h2>\n";
+               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strFunctions}: ", htmlspecialchars($_REQUEST['function']), ": {$strEdit}</h2>\n";
                $misc->printMsg($msg);
 
                $fndata = &$localData->getFunction($_REQUEST['function_oid']);
                        echo "<input type=hidden name=function value=\"", htmlspecialchars($_REQUEST['function']), "\">\n";
                        echo "<input type=hidden name=function_oid value=\"", htmlspecialchars($_REQUEST['function_oid']), "\">\n";
                        echo $misc->form;
-                       echo "<input type=submit value=Save> <input type=reset>\n";
+                       echo "<input type=submit value=\"{$strSave}\"> <input type=reset value=\"{$strReset}\">\n";
                        echo "</form>\n";
                }
-               else echo "<p>No data.</p>\n";
+               else echo "<p>{$strNoData}</p>\n";
                
-               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">Show All Functions</a> |\n";
+               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">{$strShowAllFunctions}</a> |\n";
                echo "<a class=navlink href=\"$PHP_SELF?action=properties&{$misc->href}&function=", 
-                       urlencode($_REQUEST['function']), "&function_oid=", urlencode($_REQUEST['function_oid']), "\">Properties</a></p>\n";
+                       urlencode($_REQUEST['function']), "&function_oid=", urlencode($_REQUEST['function_oid']), "\">{$strProperties}</a></p>\n";
        }
 
        /**
@@ -90,8 +91,9 @@
        function doProperties($msg = '') {
                global $data, $localData, $misc;
                global $PHP_SELF, $strFunctions, $strArguments, $strReturns, $strActions, $strNoFunctions, $strDefinition, $strLanguage;
+               global $strFunctions, $strProperties, $strNoData, $ShowAllFunctions, $strEdit;
        
-               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": Functions: ", htmlspecialchars($_REQUEST['function']), ": Properties</h2>\n";
+               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strFunctions}: ", htmlspecialchars($_REQUEST['function']), ": {$strProperties}</h2>\n";
                $misc->printMsg($msg);
                
                $funcdata = &$localData->getFunction($_REQUEST['function_oid']);
                        echo "<tr><td class=data1 colspan=4>", nl2br(htmlspecialchars($funcdata->f[$data->fnFields['fndef']])), "</td></tr>\n";
                        echo "</table>\n";
                }
-               else echo "<p>No data.</p>\n";
+               else echo "<p>{$strNoData}</p>\n";
                
-               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">Show All Functions</a> |\n";
+               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">{$strShowAllFunctions}</a> |\n";
                echo "<a class=navlink href=\"$PHP_SELF?action=edit&{$misc->href}&function=", 
-                       urlencode($_REQUEST['function']), "&function_oid=", urlencode($_REQUEST['function_oid']), "\">Edit</a></p>\n";
+                       urlencode($_REQUEST['function']), "&function_oid=", urlencode($_REQUEST['function_oid']), "\">{$strEdit}</a></p>\n";
        }
        
        /**
         */
        function doDrop($confirm) {
                global $localData, $database, $misc;
-               global $PHP_SELF;
+               global $PHP_SELF, $strFunctions, $strDrop, $strConfDropFunction, $strYes, $strNo, $strFunctionDropped, $strFunctionDroppedBad;
 
                if ($confirm) { 
-                       echo "<h2>", htmlspecialchars($_REQUEST['database']), ": Functions: ", htmlspecialchars($_REQUEST['function']), ": Drop</h2>\n";
-                       
-                       echo "<p>Are you sure you want to drop the function \"", htmlspecialchars($_REQUEST['function']), "\"?</p>\n";
+                       echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strFunctions}: ", htmlspecialchars($_REQUEST['function']), ": {$strDrop}</h2>\n";
                        
+                       echo "<p>", sprintf($strConfDropFunction, htmlspecialchars($_REQUEST['function'])), "</p>\n";   
                        echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
                        echo "<input type=hidden name=action value=drop>\n";
                        echo "<input type=hidden name=function value=\"", htmlspecialchars($_REQUEST['function']), "\">\n";
                        echo $misc->form;
-                       echo "<input type=submit name=choice value=\"Yes\"> <input type=submit name=choice value=\"No\">\n";
+                       echo "<input type=submit name=choice value=\"{$strYes}\"> <input type=submit name=choice value=\"{$strNo}\">\n";
                        echo "</form>\n";
                }
                else {
                        $status = $localData->dropFunction($_POST['function']);
                        if ($status == 0)
-                               doDefault('Function dropped.');
+                               doDefault($strFunctionDropped);
                        else
-                               doDefault('Function drop failed.');
+                               doDefault($strFunctionDroppedBad);
                }
                
        }
        function doCreate($msg = '') {
                global $data, $localData, $misc;
                global $PHP_SELF, $strName, $strArguments, $strReturns, $strDefinition, $strLanguage;
+               global $strFunctions, $strCreateFunction, $strSave, $strReset, $strShowAllFunctions;
                
                if (!isset($_POST['formFunction'])) $_POST['formFunction'] = '';
                if (!isset($_POST['formArguments'])) $_POST['formArguments'] = '';
                $types = &$localData->getTypes(true);
                $langs = &$localData->getLanguages();
 
-               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": Functions: Create Function</h2>\n";
+               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strFunctions}: {$strCreateFunction}</h2>\n";
                $misc->printMsg($msg);
                
                echo "<form action=\"$PHP_SELF\" method=post>\n";
                echo "</table>\n";
                echo "<input type=hidden name=action value=save_create>\n";
                echo $misc->form;
-               echo "<input type=submit value=Save> <input type=reset>\n";
+               echo "<input type=submit value=\"{$strSave}\"> <input type=reset value=\"{$strReset}\">\n";
                echo "</form>\n";
                
-               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">Show All Functions</a></p>\n";
+               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">{$strShowAllFunctions}</a></p>\n";
        }
        
        /**
         */
        function doSaveCreate() {
                global $localData, $strFunctionNeedsName, $strFunctionNeedsDef;
+               global $strFunctionCreated, $strFunctionCreatedBad;
                
                // Check that they've given a name and a definition
                if ($_POST['formFunction'] == '') doCreate($strFunctionNeedsName);
                else {           
                        $status = $localData->createFunction($_POST['formFunction'], $_POST['formArguments'] , $_POST['formReturns'] , $_POST['formDefinition'] , $_POST['formLanguage'],0);
                        if ($status == 0)
-                               doDefault('Function created.');
+                               doDefault($strFunctionCreated);
                        else
-                               doCreate('Function creation failed.');
+                               doCreate($strFunctionCreatedBad);
                }
        }       
 
                global $PHP_SELF, $strFunctions, $strArguments, $strReturns, $strActions, $strNoFunctions;
                global $strCreateFunction, $strProperties, $strEdit, $strDrop, $strPrivileges;
                
-               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": Functions</h2>\n";
+               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strFunctions}</h2>\n";
                $misc->printMsg($msg);
                
                $funcs = &$localData->getFunctions();
                        doCreate();
                        break;
                case 'drop':
-                       if ($_POST['choice'] == 'Yes') doDrop(false);
+                       if ($_POST['choice'] == "{$strYes}") doDrop(false);
                        else doDefault();
                        break;
                case 'confirm_drop':
index aeefac64ff602fc1ea117472062cd6f37780e665..6263557a84f87ada83177d05b73152c5ca690f0a 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * List reports in a database
         *
-        * $Id: reports.php,v 1.1 2003/02/16 05:30:53 chriskl Exp $
+        * $Id: reports.php,v 1.2 2003/02/20 23:17:05 slubek Exp $
         */
 
        // Include application functions
@@ -22,7 +22,7 @@
        function doCreate($msg = '') {
                global $reportsdb, $misc;
                global $PHP_SELF, $strName, $strDatabase, $strComment, $strSQL;
-               global $strCreateReport, $strReports;
+               global $strCreateReport, $strReports, $strSave, $strReset, $strShowAllViews;
 
                if (!isset($_POST['report_name'])) $_POST['report_name'] = '';
                if (!isset($_POST['db_name'])) $_POST['db_name'] = '';
                echo "</table>\n";
                echo "<input type=\"hidden\" name=\"action\" value=\"save_create\">\n";
                echo $misc->form;
-               echo "<input type=submit value=Save> <input type=reset>\n";
+               echo "<input type=submit value=\"{$strSave}\"> <input type=\"{$strReset}\">\n";
                echo "</form>\n";
                
-               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">Show All Views</a></p>\n";
+               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">{$strShowAllViews}</a></p>\n";
        }
        
        /**
         * Actually creates the new view in the database
         */
        function doSaveCreate() {
-               global $localData, $strViewNeedsName, $strViewNeedsDef;
+               global $localData, $strViewNeedsName, $strViewNeedsDef, $strViewCreated, $strViewCreatedBad;
                
                // Check that they've given a name and a definition
                if ($_POST['formView'] == '') doCreate($strViewNeedsName);
@@ -61,9 +61,9 @@
                else {
                        $status = $localData->createView($_POST['formView'], $_POST['formDefinition']);
                        if ($status == 0)
-                               doDefault('View created.');
+                               doDefault($strViewCreated);
                        else
-                               doCreate('View creation failed.');
+                               doCreate($strViewCreatedBad);
                }
        }
 
index 064197865f4fbf4ff9ac7f7365e05d50ff54f8c0..ec4f3dcd2e0035ad007527e5055fc921cb22fdb3 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * List tables in a database
         *
-        * $Id: tblproperties.php,v 1.2 2003/02/07 17:34:35 xzilla Exp $
+        * $Id: tblproperties.php,v 1.3 2003/02/20 23:17:05 slubek Exp $
         */
 
        // Include application functions
@@ -15,7 +15,7 @@
        function doTriggers($msg = '') {
                global $data, $localData, $misc; 
                global $PHP_SELF;
-               global $strTriggers, $strNoTriggers, $strCreateTrigger, $strActions, $strName, $strPrivileges;
+               global $strTriggers, $strNoTriggers, $strCreateTrigger, $strActions, $strName, $strPrivileges, $strProperties, $strDrop, $strPrivileges;
 
                $misc->printTableNav();
                echo "<h2>", htmlspecialchars($_REQUEST['database']), ": ", htmlspecialchars($_REQUEST['table']), ": {$strTriggers}</h2>\n";
                                $id = ( ($i % 2 ) == 0 ? '1' : '2' );
                                echo "<tr><td class=\"data{$id}\">", htmlspecialchars( $triggers->f[$data->tgFields['tgname']]), "</td>";
                                echo "<td class=\"data{$id}\">";
-                               echo "<a href=\"$PHP_SELF?action=triggerprops&{$misc->href}&trigger=", htmlspecialchars( $triggers->f[$data->tgFields['tgname']]), "\">Properties</td>\n"; 
+                               echo "<a href=\"$PHP_SELF?action=triggerprops&{$misc->href}&trigger=", htmlspecialchars( $triggers->f[$data->tgFields['tgname']]), "\">{$strProperties}</td>\n"; 
                                echo "<td class=\"data{$id}\">";
-                               echo "<a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&trigger=", htmlspecialchars( $triggers->f[$data->tgFields['tgname']]), "\">Drop</td>\n"; 
+                               echo "<a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&trigger=", htmlspecialchars( $triggers->f[$data->tgFields['tgname']]), "\">{$strDrop}</td>\n"; 
                                echo "<td class=\"data{$id}\">";
-                               echo "<a href=\"$PHP_SELF?action=priviledges&{$misc->href}&trigger=", htmlspecialchars( $triggers->f[$data->tgFields['tgname']]), "\">Privileges</td></tr>\n"; 
+                               echo "<a href=\"$PHP_SELF?action=priviledges&{$misc->href}&trigger=", htmlspecialchars( $triggers->f[$data->tgFields['tgname']]), "\">{$strPrivileges}</td></tr>\n"; 
                                
                                $triggers->movenext();
                                $i++;
@@ -93,9 +93,9 @@
                
                switch ($_REQUEST['stage']) {
                        case 1:
-                               global $strField, $strType, $strNotNull, $strDefault, $strAlter;
+                               global $strField, $strType, $strNotNull, $strDefault, $strAlter, $strReset, $strAlterColumn;
 
-                               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strTables}: Alter Column: ",
+                               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strTables}: {$strAlterColumn}: ",
                                        htmlspecialchars($_REQUEST['column']), "</h2>\n";
                                $misc->printMsg($msg);
 
                                echo "<input type=hidden name=table value=\"", htmlspecialchars($_REQUEST['table']), "\">\n";
                                echo "<input type=hidden name=column value=\"", htmlspecialchars($_REQUEST['column']), "\">\n";
                                echo "<input type=hidden name=olddefault value=\"", htmlspecialchars($_REQUEST['olddefault']), "\">\n";
-                               echo "<input type=submit value=\"{$strAlter}\"> <input type=reset>\n";
+                               echo "<input type=submit value=\"{$strAlter}\"> <input type=reset value=\"{$strReset}\">\n";
                                echo "</form>\n";
                                                                
                                break;
                        case 2:
-                               global $localData;
+                               global $localData, $strFieldNeedsName, $strColumnAltered, $strColumnAlteredBad, $strInvalidScriptParam;
 
                                // Check inputs
                                if (trim($_REQUEST['field']) == '') {
                                        $_REQUEST['stage'] = 1;
-                                       doProperties('You must name your field.');
+                                       doProperties($strFieldNeedsName);
                                        return;
                                }
                                
                                $status = $localData->alterColumn($_REQUEST['table'], $_REQUEST['column'], $_REQUEST['field'], 
                                                                isset($_REQUEST['notnull']), $_REQUEST['default'], $_REQUEST['olddefault']);
                                if ($status == 0)
-                                       doDefault('Column altered.');
+                                       doDefault($strColumnAltered);
                                else {
                                        $_REQUEST['stage'] = 1;
-                                       doProperties('Column altering failed.');
+                                       doProperties($strColumnAlteredBad);
                                        return;
                                }
                                break;
                        default:
-                               echo "<p>Invalid script parameter.</p>\n";
+                               echo "<p>{$strInvalidScriptParam}</p>\n";
                }
                                        
                echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">{$strShowAllTables}</a></p>\n";
         */
        function doDrop($confirm) {
                global $localData, $database, $misc;
-               global $PHP_SELF;
+               global $PHP_SELF, $strTables, $strDrop, $strConfDropColumn, $strYes, $strNo, $strColumnDropped, $strColumnDroppedBad;
 
                if ($confirm) {
-                       echo "<h2>", htmlspecialchars($_REQUEST['database']), ": Tables: ", 
-                               htmlspecialchars($_REQUEST['table']), ": " , htmlspecialchars($_REQUEST['column']), ": Drop</h2>\n";
+                       echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strTables}: ", 
+                               htmlspecialchars($_REQUEST['table']), ": " , htmlspecialchars($_REQUEST['column']), ": {$strDrop}</h2>\n";
 
-                       echo "<p>Are you sure you want to drop the column \"", htmlspecialchars($_REQUEST['column']),
-                               "\" from table \"", htmlspecialchars($_REQUEST['table']), "\"?</p>\n";
+                        echo "<p>", sprintf($strConfDropColumn, htmlspecialchars($_REQUEST['column']),
+                                htmlspecialchars($_REQUEST['table'])), "</p>\n";
+                                                               
                        
                        echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
                        echo "<input type=hidden name=action value=drop>\n";
                        echo "<input type=hidden name=table value=\"", htmlspecialchars($_REQUEST['table']), "\">\n";
                        echo "<input type=hidden name=column value=\"", htmlspecialchars($_REQUEST['column']), "\">\n";
                        echo $misc->form;
-                       echo "<input type=submit name=choice value=\"Yes\"> <input type=submit name=choice value=\"No\">\n";
+                       echo "<input type=submit name=choice value=\"{$strYes}\"> <input type=submit name=choice value=\"{$strNo}\">\n";
                        echo "</form>\n";
                }
                else {
                        $status = $localData->dropColumn($_POST['table'], $_POST['column'], 'RESTRICT');
                        if ($status == 0)
-                               doDefault('Column dropped.');
+                               doDefault($strColumnDropped);
                        else
-                               doDefault('Column drop failed.');
+                               doDefault($strColumnDroppedBad);
                }
                
        }
                        doProperties();
                        break;
                case 'drop':
-                       if ($_POST['choice'] == 'Yes') doDrop(false);
+                       if ($_POST['choice'] == "{$strYes}") doDrop(false);
                        else doDefault();
                        break;
                case 'confirm_drop':
index 64724fb16a2ef13b3dba024cdb905e0309fb5e00..748f5ad093947311c1f865418a3e5ddbc57ced6a 100644 (file)
--- a/types.php
+++ b/types.php
@@ -3,7 +3,7 @@
        /**
         * Manage types in a database
         *
-        * $Id: types.php,v 1.2 2003/02/07 17:34:35 xzilla Exp $
+        * $Id: types.php,v 1.3 2003/02/20 23:17:05 slubek Exp $
         */
 
        // Include application functions
@@ -86,7 +86,7 @@
                global $data, $localData, $misc;
                global $PHP_SELF, $strName, $strTypes, $strCreateType, $strShowAllTypes;
                global $strInputFn, $strOutputFn, $strLength, $strDefault;
-               global $strElement, $strDelimiter, $strPassByVal, $strAlignment, $strStorage;
+               global $strElement, $strDelimiter, $strPassByVal, $strAlignment, $strStorage, $strSave, $strReset;
 
                if (!isset($_POST['typname'])) $_POST['typname'] = '';
                if (!isset($_POST['typin'])) $_POST['typin'] = '';
                echo "</table>\n";
                echo "<input type=hidden name=action value=save_create>\n";
                echo $misc->form;
-               echo "<input type=submit value=Save> <input type=reset>\n";
+               echo "<input type=submit value=\"{$strSave}\"> <input type=reset value=\"{$strReset}\">\n";
                echo "</form>\n";
                
                echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">{$strShowAllTypes}</a></p>\n";
                        doCreate();
                        break;
                case 'drop':
-                       if ($_POST['choice'] == 'Yes') doDrop(false);
+                       if ($_POST['choice'] == "{$strYes}") doDrop(false);
                        else doDefault();
                        break;
                case 'confirm_drop':
index 20f9461c7234c34f589ccf0f0b056ba13f734529..4b4ebbebacda7ab088dec0b34f47c18a74db395d 100644 (file)
--- a/views.php
+++ b/views.php
@@ -3,7 +3,7 @@
        /**
         * Manage views in a database
         *
-        * $Id: views.php,v 1.3 2003/02/09 10:22:38 chriskl Exp $
+        * $Id: views.php,v 1.4 2003/02/20 23:17:05 slubek Exp $
         */
 
        // Include application functions
         * Function to save after editing a view
         */
        function doSaveEdit() {
-               global $localData;
+               global $localData, $strViewUpdated, $strViewUpdatedBad;
                
                $status = $localData->setView($_POST['view'], $_POST['formDefinition']);
                if ($status == 0)
-                       doProperties('View updated.');
+                       doProperties($strViewUpdated);
                else
-                       doEdit('View update failed.');
+                       doEdit($strViewUpdatedBad);
        }
        
        /**
@@ -31,9 +31,9 @@
         */
        function doEdit($msg = '') {
                global $data, $localData, $misc;
-               global $PHP_SELF, $strName, $strDefinition, $strViews ;
+               global $PHP_SELF, $strName, $strDefinition, $strViews, $strEdit, $strSave, $strReset, $strNoData, $strShowAllViews, $strProperties ;
                
-               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strViews}: ", htmlspecialchars($_REQUEST['view']), ": Edit</h2>\n";
+               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strViews}: ", htmlspecialchars($_REQUEST['view']), ": {$strEdit}</h2>\n";
                $misc->printMsg($msg);
                
                $viewdata = &$localData->getView($_REQUEST['view']);
                        echo "<input type=hidden name=action value=save_edit>\n";
                        echo "<input type=hidden name=view value=\"", htmlspecialchars($_REQUEST['view']), "\">\n";
                        echo $misc->form;
-                       echo "<input type=submit value=Save> <input type=reset>\n";
+                       echo "<input type=submit value=\"{$strSave}\"> <input type=reset value=\"{$strReset}\">\n";
                        echo "</form>\n";
                }
-               else echo "<p>No data.</p>\n";
+               else echo "<p>{$strNoData}</p>\n";
                
-               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">Show All Views</a> |\n";
+               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">{$strShowAllViews}</a> |\n";
                echo "<a class=navlink href=\"$PHP_SELF?action=properties&{$misc->href}&view=", 
-                       urlencode($_REQUEST['view']), "\">Properties</a></p>\n";
+                       urlencode($_REQUEST['view']), "\">{$strProperties}</a></p>\n";
        }
        
        /**
@@ -65,9 +65,9 @@
         */
        function doProperties($msg = '') {
                global $data, $localData, $misc;
-               global $PHP_SELF, $strName, $strDefinition, $strViews;
+               global $PHP_SELF, $strName, $strDefinition, $strViews, $strShowAllViews, $strEdit, $strProperties, $strNoData;
        
-               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strViews}: ", htmlspecialchars($_REQUEST['view']), ": Properties</h2>\n";
+               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strViews}: ", htmlspecialchars($_REQUEST['view']), ": {$strProperties}</h2>\n";
                $misc->printMsg($msg);
                
                $viewdata = &$localData->getView($_REQUEST['view']);
                        echo "<tr><td class=data1>", nl2br(htmlspecialchars($viewdata->f[$data->vwFields['vwdef']])), "</td></tr>\n";
                        echo "</table>\n";
                }
-               else echo "<p>No data.</p>\n";
+               else echo "<p>{$strNoData}</p>\n";
                
-               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">Show All Views</a> |\n";
+               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">{$strShowAllViews}</a> |\n";
                echo "<a class=navlink href=\"$PHP_SELF?action=edit&{$misc->href}&view=", 
-                       urlencode($_REQUEST['view']), "\">Edit</a></p>\n";
+                       urlencode($_REQUEST['view']), "\">{$strEdit}</a></p>\n";
        }
        
        /**
         */
        function doDrop($confirm) {
                global $localData, $misc;
-               global $PHP_SELF, $strViews;
+               global $PHP_SELF, $strViews, $strDrop, $strYes, $strNo, $strConfDropView, $strViewDropped, $strViewDroppedBad;
 
                if ($confirm) { 
-                       echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strViews}: ", htmlspecialchars($_REQUEST['view']), ": Drop</h2>\n";
-                       
-                       echo "<p>Are you sure you want to drop the view \"", htmlspecialchars($_REQUEST['view']), "\"?</p>\n";
+                       echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strViews}: ", htmlspecialchars($_REQUEST['view']), ": {$strDrop}</h2>\n";
                        
+                       echo "<p>", sprintf($strConfDropView, htmlspecialchars($_REQUEST['view'])), "</p>\n";   
                        echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
                        echo "<input type=hidden name=action value=drop>\n";
                        echo "<input type=hidden name=view value=\"", htmlspecialchars($_REQUEST['view']), "\">\n";
                        echo $misc->form;
-                       echo "<input type=submit name=choice value=\"Yes\"> <input type=submit name=choice value=\"No\">\n";
+                       echo "<input type=submit name=choice value=\"{$strYes}\"> <input type=submit name=choice value=\"{$strNo}\">\n";
                        echo "</form>\n";
                }
                else {
                        $status = $localData->dropView($_POST['view']);
                        if ($status == 0)
-                               doDefault('View dropped.');
+                               doDefault($strViewDropped);
                        else
-                               doDefault('View drop failed.');
+                               doDefault($strViewDroppedBad);
                }
                
        }
         */
        function doCreate($msg = '') {
                global $data, $localData, $misc;
-               global $PHP_SELF, $strName, $strDefinition, $strViews;
+               global $PHP_SELF, $strName, $strDefinition, $strViews, $strCreateView, $strSave, $strReset, $strShowAllViews;
                
                if (!isset($_POST['formView'])) $_POST['formView'] = '';
                if (!isset($_POST['formDefinition'])) $_POST['formDefinition'] = '';
                
-               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strViews}: Create View</h2>\n";
+               echo "<h2>", htmlspecialchars($_REQUEST['database']), ": {$strViews}: {$strCreateView}</h2>\n";
                $misc->printMsg($msg);
                
                echo "<form action=\"$PHP_SELF\" method=post>\n";
                echo "</table>\n";
                echo "<input type=hidden name=action value=save_create>\n";
                echo $misc->form;
-               echo "<input type=submit value=Save> <input type=reset>\n";
+               echo "<input type=submit value=\"{$strSave}\"> <input type=reset value=\"{$strReset}\">\n";
                echo "</form>\n";
                
-               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">Show All Views</a></p>\n";
+               echo "<p><a class=navlink href=\"$PHP_SELF?{$misc->href}\">{$strShowAllViews}</a></p>\n";
        }
        
        /**
         * Actually creates the new view in the database
         */
        function doSaveCreate() {
-               global $localData, $strViewNeedsName, $strViewNeedsDef;
+               global $localData, $strViewNeedsName, $strViewNeedsDef, $strViewCreated, $strViewCreatedBad;
                
                // Check that they've given a name and a definition
                if ($_POST['formView'] == '') doCreate($strViewNeedsName);
                else {           
                        $status = $localData->createView($_POST['formView'], $_POST['formDefinition']);
                        if ($status == 0)
-                               doDefault('View created.');
+                               doDefault($strViewCreated);
                        else
-                               doCreate('View creation failed.');
+                               doCreate($strViewCreatedBad);
                }
        }       
 
                        doCreate();
                        break;
                case 'drop':
-                       if ($_POST['choice'] == 'Yes') doDrop(false);
+                       if ($_POST['choice'] == "{$strYes}") doDrop(false);
                        else doDefault();
                        break;
                case 'confirm_drop':