Factor application/version editing code out of files and move it into the application and version classes. Add support to HtmlAreaLoaderScript() to be called multiple times on a single page without generating javascript that overwrites the previous html area settings.

This commit is contained in:
Chris Morgan
2005-10-10 02:37:55 +00:00
committed by WineHQ
parent f6f935a36e
commit 49300a8707
8 changed files with 457 additions and 454 deletions

View File

@@ -30,56 +30,41 @@ if(isset($_REQUEST['submit']))
else
// Show the form for editing the Application Family
{
HtmlAreaLoaderScript(array("editor"));
$family = new TableVE("edit");
$result = query_appdb("SELECT * from appFamily WHERE appId = '{$_REQUEST['appId']}'");
$oApp = new Application($_REQUEST['appId']);
if(!mysql_num_rows($result))
if(!$oApp)
{
errorpage('Application does not exist');
}
$ob = mysql_fetch_object($result);
if($_SESSION['current']->showDebuggingInfos()) { echo "<p align=center><b>appName:</b> $ob->appName </p>"; }
if($_SESSION['current']->showDebuggingInfos()) { echo "<p align=center><b>appName:</b> $oApp->sName </p>"; }
apidb_header("Edit Application Family");
echo "<form method=\"post\" action=\"editAppFamily.php\">\n";
echo html_frame_start("Data for Application ID $ob->appId", "90%","",0);
echo html_table_begin("width='100%' border=0 align=left cellpadding=6 cellspacing=0 class='box-body'");
echo '<input type="hidden" name="appId" value="'.$ob->appId.'">';
echo '<tr><td class=color1>Name</td><td class=color0><input size=80% type="text" name="appName" type="text" value="'.$ob->appName.'"></td></tr>',"\n";
echo '<tr><td class=color4>Vendor</td><td class=color0>';
$family->make_option_list("vendorId", $ob->vendorId, "vendor", "vendorId", "vendorName");
echo '</td></tr>',"\n";
echo '<tr><td class=color1>Keywords</td><td class=color0><input size=80% type="text" name="keywords" value="'.$ob->keywords.'"></td></tr>',"\n";
echo '<tr><td class="color4">Description</td><td class="color0">', "\n";
if(trim(strip_tags($ob->description))=="") $ob->description="<p>Enter description here</p>";
echo '<p style="width:700px">', "\n";
echo '<textarea rows="20" cols="80" id="editor" name="description">'.$ob->description.'</textarea></td></tr>',"\n";
echo '</p>';
echo '<tr><td class=color1>Web Page</td><td class=color0><input size=80% type="text" name="webPage" value="'.$ob->webPage.'"></td></tr>',"\n";
echo '<tr><td class=color4>Category</td><td class=color0>';
$family->make_option_list("catId", $ob->catId, "appCategory", "catId", "catName");
echo '</td></tr>',"\n";
echo '<tr><td colspan=2 align=center class=color3><input type="submit" name=submit value="Update Database"></td></tr>',"\n";
echo '<input type="hidden" name="appId" value="'.$oApp->iAppId.'">';
echo html_table_end();
echo html_frame_end();
$oApp->OutputEditor("");
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">', "\n";
echo '<tr><td colspan=2 align=center><input type="submit" name=submit value="Update Database"></td></tr>',"\n";
echo '</table>', "\n";
echo "</form>";
// url edit form
echo "<p>";
// url edit form
echo '<form enctype="multipart/form-data" action="editAppFamily.php" method="post">',"\n";
echo '<input type=hidden name="appId" value='.$ob->appId.'>';
echo '<input type=hidden name="appId" value='.$oApp->iAppId.'>';
echo html_frame_start("Edit URL","90%","",0);
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
$i = 0;
$result = query_appdb("SELECT * FROM appData WHERE appId = $ob->appId AND type = 'url' AND versionId = 0");
$result = query_appdb("SELECT * FROM appData WHERE appId = $oApp->iAppId AND type = 'url' AND versionId = 0");
if($result && mysql_num_rows($result) > 0)
{
echo '<tr><td class=color1><b>Delete</b></td><td class=color1>',"\n";
@@ -110,14 +95,14 @@ else
echo '<tr><td class=color1>New</td><td class=color1><input size=45% type="text" name="url_desc"></td>',"\n";
echo '<td class=color1><input size=45% name="url" type="text"></td></tr>',"\n";
echo '<tr><td colspan=3 align=center class=color3><input type="submit" name=submit value="Update URL"></td></tr>',"\n";
echo '</table>',"\n";
echo html_frame_end();
echo "</form>";
echo html_back_link(1,BASE."appview.php?appId=$ob->appId");
echo html_back_link(1,BASE."appview.php?appId=$ob->appId");
}
apidb_footer();