<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<TITLE>TDSB RTE Content Manager</TITLE>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>
<%@ language="VBScript"%>
<%
'if Request.Form("pageToEdit")<>"" then
Response.Write("<Body OnLoad=""initialiseWebWizRTE();"">")
'else
'Response.Write("<Body>")
'end if
Dim oConn, oCmd, oRS, sql
Set oConn = Server.CreateObject("ADODB.Connection")
'oConn.Open 'username and password hidden
oConn.Open 'username and password hidden
Set oCmd = Server.CreateObject("ADODB.Command")
oCmd.ActiveConnection = oConn
Set oRS = Server.CreateObject("ADODB.Recordset")
if Request.Form("RTE")<>"" then
dim content
content=Request.Form("RTE")
if content<>"" then
content=replace(content, "'", "|")
end if
sql="Select PageContents From Web_Pages Where PageName='" & Request.form("pageEdited") &"'"
'Response.Write(sql&"<BR>")
oRS.Open sql, oConn, 2, 2
ors("pageContents")=content
oRS.Update
end if
sql = "SELECT PageName FROM Web_Pages"
Set oRS = oConn.Execute(sql)
%>
Please select a page to edit: <BR>
<form method=post id=form1 name=form1>
<select name="pageToEdit">
<Option value="">Select a page to edit</Option>
<%
do until oRS.EOF
Response.Write("<Option value="""&oRS("pageName")&""">"&oRS("PageName")&"</option>")
oRS.MoveNext
loop
%>
</select>
<input type="submit" Name="Action" value="Edit >>">
</form>
<%
if Request.Form("pageToEdit")<>"" then
sql = "SELECT PageContents FROM Web_Pages Where pageName='"&Request.Form("PageToEdit")&"'"
Set oRS = oConn.Execute(sql)
dim contents
contents=orS("PageContents")
if contents<>"" then
contents=replace(contents, "|", "'")
end if
'ID tag name of the HTML form the textarea is within
strFormName = "editPage"
'ID tag name of HTML textarea being replaced
strTextAreaName = "RTE"
%>
<!-- include the Web Wiz Rich Text Editor -->
<!--#include file="RTE_editor_inc.asp" -->
<Form method=post ID="editPage">
<input name="pageEdited" type="hidden" value="<%Response.Write(Request.Form("pageToEdit"))%>">
<textarea rows=30 cols=80 name="RTE" ID="RTE"><%Response.write(contents)%></textarea><BR>
<input type="submit" Name="Action" value="Save >>">
</Form>
<%
end if
Set oRS = Nothing
if ucase(TypeName(dbConn)) = "CONNECTION" then
oConn.Close
Set oConn = Nothing
end if
%>
</body>