Home
The Toolkit for Online Communities
16704 Community Members, 0 members online, 2539 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Q&A : Top Ten Priorities for OpenACS ... what are yours? : One Message

Forum OpenACS Q&A: Re: OACSH

Collapse
59: Re: OACSH (response to 53)
Posted by Jade Rubick on
I took Nis' page and improved it a bit. Here it is, for posterity:

/www/oacsh.adp

@result@

<formtemplate id="add-edit" style="standard-lars"></formtemplate>
/www/oacsh.tcl
ad_page_contract {
    @author Nis Jorgensen
} {
    {script:optional {}}
} -properties {
    result
}

set user_id [ad_maybe_redirect_for_registration]

if {![string equal $user_id 298]} {
    ad_abort_script
}

set result ""

if {[info exists script]} {
    set script [ad_quotehtml $script]
}

ad_form -name add_edit -form {
    {
        script:text(textarea)
        {label {Input tcl_script}}
        {html {cols 80 rows 10}}
    }
} -on_submit {
    if {[catch {set result [uplevel $script]}]} {
        global errorInfo
        set result "ERROR:
$errorInfo
" } } ad_return_template