link-submit.tcl

allows a registered user to add an external link if they have "create" privilege

Location:
/packages/edit-this-page/www/link-submit.tcl

Related Files

[ hide source ] | [ make this the default ]

File Contents

ad_page_contract {
    allows a registered user to add an external link
    if they have "create" privilege
        
} {

    item_id:optional
        name:optional
        url:optional
        description:optional
} 

set package_id [ad_conn package_id]
set user_id [ad_conn user_id]
permission::require_permission -object_id $package_id -privilege "create"

ad_form -name add-item -form {
    item_id:key
    {name:text(text) {label "Site Name"} {html {size 40}}}
    {url:text(text) {label "URL"} {html {size 40}}}
    {description:text(textarea) {label "Description"} {html {cols 45 rows 5}}}
} -new_data {
    #insert the item
    db_exec_plsql create_extlink {}
    ad_returnredirect "."
    ad_script_abort
} -edit_data {
    #edit item, only admins can edit or delete stuff
}
set title "Submit Link"
set context_bar [ad_context_bar "Submit Link"]
ad_return_template