/**
* 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
*/
function doSQL() {
global $PHP_SELF, $localData, $misc;
- global $strSQL, $strEnterSQL, $strGo;
+ global $strSQL, $strEnterSQL, $strGo, $strReset;
if (!isset($_POST['query'])) $_POST['query'] = '';
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";
}
*/
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']), ": ",
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 {
*/
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':
/**
* 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);
}
/**
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";
}
/**
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':
/**
* 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
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);
else {
$status = $localData->createView($_POST['formView'], $_POST['formDefinition']);
if ($status == 0)
- doDefault('View created.');
+ doDefault($strViewCreated);
else
- doCreate('View creation failed.');
+ doCreate($strViewCreatedBad);
}
}
/**
* 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
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++;
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':
/**
* 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
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':
/**
* 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);
}
/**
*/
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";
}
/**
*/
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':