boom-ck4.tcl

This page enables registered users and the news-admin to enter news releases.

Location:
/packages/acs-subsite/www/boom-ck4.tcl
Author:
stefan@arsdigita.com
Created:
2000-11-14
CVS ID:
$Id: item-create.tcl,v 1.16 2017/11/15 13:26:59 antoniop Exp $

Related Files

[ hide source ] | [ make this the default ]

File Contents

ad_page_contract {

    This page enables registered users and the news-admin 
    to enter news releases.

    @author stefan@arsdigita.com
    @creation-date 2000-11-14
    @cvs-id $Id: item-create.tcl,v 1.16 2017/11/15 13:26:59 antoniop Exp $

} {
    {publish_title {}}
    {publish_lead {}}
    {publish_body:allhtml {}}
    {publish_body.format {}}
    {publish_date_ansi {now}}
    {archive_date_ansi {}}
    {permanent_p:boolean {}}
}

set immediate_approve_p 0
set package_id 0

set title "[_ news.Create_News_Item]"
set context [list $title]

set lc_format [lc_get formbuilder_date_format]

set date_today [clock format [clock seconds] -format %Y-%m-%d]
set active_days 14
set date_proj [clock format [clock scan "$active_days days"] -format %Y-%m-%d]

if { $publish_date_ansi eq "" || $publish_date_ansi eq "now"} {
    set publish_date_ansi $date_today
}
if { $archive_date_ansi eq "" } {
    set archive_date_ansi $date_proj
}

ad_form -name "news" -action "#" -html {enctype "multipart/form-data"} -form {
    {action:text(hidden)
        {value "News Item"}}
    {publish_title:text(text) 
        {label "[_ news.Title]"}
        {html {maxlength 400 size 61}}
        {value $publish_title}}
    {publish_body:text(richtext),optional
        {label "[_ news.Body]"}
        {html {cols 60 rows 20}}
        {htmlarea_p 1}
    {options {editor ckeditor4 JSEditorClass ClassicEditor}}
        {value "[list $publish_body ${publish_body.format}]"}}
}
#        {options {editor ckeditor5 JSEditorClass InlineEditor}}

ad_form -extend -name "news" -form {
    {publish_date:date,optional
    {label "[_ news.Release_Date]"}
    {value "[split $publish_date_ansi -]"}
    {format {$lc_format}}
    }
    {archive_date:date,optional
    {label "[_ news.Archive_Date]"}
    {value "[split $archive_date_ansi -]"}
    {format {$lc_format}}
    }
    {permanent_p:text(checkbox),optional
    {label "[_ news.never]"}
    {options {{"#news.show_it_permanently#" t}}}}
}

# Local variables:
#    mode: tcl
#    tcl-indent-level: 4
#    indent-tabs-mode: nil
# End: