Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.153 -r1.154 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 24 Jul 2007 13:21:39 -0000 1.153 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 24 Jul 2007 20:48:33 -0000 1.154 @@ -37,6 +37,8 @@ {lang en} {render_adp 1} {absolute_links 0} + last_modified + creation_user } \ -form ::xowiki::WikiForm @@ -46,7 +48,7 @@ if {![::xotcl::Object isobject ::xowiki::Page::slot]} { ::xotcl::Object create ::xowiki::Page::slot } - foreach parameter {name title description text nls_language} { + foreach parameter {name title description text nls_language publish_date creation_user} { if {![::xotcl::Object isobject ::xowiki::Page::slot::$parameter]} { ::xo::Attribute create ::xowiki::Page::slot::$parameter } @@ -75,6 +77,11 @@ ::xowiki::Page::slot::nls_language set datatype text ::xowiki::Page::slot::nls_language set spec {select,options=[xowiki::locales]} + ::xowiki::Page::slot::last_modified set pretty_name #xowiki.Page-last_modified# + ::xowiki::Page::slot::last_modified set spec date + + ::xowiki::Page::slot::creation_user set spec user_id + ::Generic::CrClass create PlainPage -superclass Page \ -pretty_name "XoWiki Plain Page" -pretty_plural "XoWiki Plain Pages" \ -table_name "xowiki_plain_page" -id_column "ppage_id" \ @@ -137,7 +144,7 @@ -datatype text -sqltype long_text -default "" ::Generic::Attribute new -attribute_name form_constraints \ -datatype text -sqltype long_text -default "" \ - -validator form_constraints + -validator form_constraints -spec "textarea,cols=100,rows=2" } \ -form ::xowiki::FormForm @@ -1071,29 +1078,29 @@ # PageInstance methods # + PageInstance proc get_short_spec_from_form_constraints {-name -form_constraints} { + foreach name_and_spec $form_constraints { + foreach {spec_name short_spec} [split $name_and_spec :] break + if {$spec_name eq $name} { + #my msg "get_short_spec $name returns 1 $short_spec" + return $short_spec + } + } + return "" + } + PageInstance instproc get_short_spec {name} { #my msg "get_short_spec $name" my instvar page_template # in the old-fashioned 2-form page-instance create, page_template # might be non-existant or empty. if {[info exists page_template] && $page_template ne "" && [$page_template exists form_constraints]} { - foreach name_and_spec [$page_template form_constraints] { - foreach {spec_name short_spec} [split $name_and_spec :] break - if {$spec_name eq $name} { - #my msg "get_short_spec $name returns 1 $short_spec" - return $short_spec - } + set short_spec [::xowiki::PageInstance get_short_spec_from_form_constraints \ + -name $name -form_constraints [$page_template form_constraints]] + if {$short_spec ne ""} { + return $short_spec } - # in case not found, look for name prefixed with _, in cases - # we refer to instance variables of the page - #foreach name_and_spec [$page_template form_constraints] { - # foreach {spec_name short_spec} [split $name_and_spec :] break - # if {"_$spec_name" eq $name} { - # my msg "get_short_spec $name returns 2 $short_spec" - # return $short_spec - # } - #} } return "" } @@ -1266,6 +1273,8 @@ # foreach name_and_spec $form_constraints { foreach {spec_name short_spec} [split $name_and_spec :] break + if {$spec_name eq "@table"} continue + #my msg "checking spec '$short_spec' for form field '$spec_name'" if {[catch { set f [my create_form_field \