Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -N -r1.173 -r1.174 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 10 Jun 2010 11:44:59 -0000 1.173 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 11 Jun 2010 11:46:27 -0000 1.174 @@ -1471,10 +1471,78 @@ ########################################################### # + # ::xowiki::formfield::candidate_box_select + # + ########################################################### + Class create candidate_box_select -superclass select -parameter { + {as_box false} + {dnd true} + } + candidate_box_select set abstract 1 + candidate_box_select instproc render_input {} { + my msg "mul=[my multiple]" + # makes only sense currently for multiple selects + if {[my multiple] && [my dnd] && !([my exists disabled] && [my disabled])} { + + # utilities.js aggregates "yahoo, dom, event, connection, animation, dragdrop" + set ajaxhelper 0 + ::xowiki::Includelet require_YUI_JS -ajaxhelper $ajaxhelper "utilities/utilities.js" + ::xowiki::Includelet require_YUI_JS -ajaxhelper $ajaxhelper "selector/selector-min.js" + ::xo::Page requireJS "/resources/xowiki/yui-selection-area.js" + + set js "" + foreach o [my options] { + foreach {label rep} $o break + set js_label [::xowiki::Includelet js_encode $label] + set js_rep [::xowiki::Includelet js_encode $rep] + append js "YAHOO.xo_sel_area.DDApp.values\['$js_label'\] = '$js_rep';\n" + append js "YAHOO.xo_sel_area.DDApp.dict\['$js_rep'\] = '$js_label';\n" + } + + ::html::div -class workarea { + ::html::h3 { ::html::t "Selection"} + set values "" + foreach v [my value] { + append values $v \n + set __values($v) 1 + } + my CSSclass selection + my set cols 30 + set atts [my get_attributes id name disabled {CSSclass class}] + + # TODO what todo with DISABLED? + ::html::textarea [my get_attributes id name cols rows style {CSSclass class} disabled] { + ::html::t $values + } + } + ::html::div -class workarea { + ::html::h3 { ::html::t "Candidates"} + ::html::ul -id [my id]_candidates -class region { + #my msg [my options] + foreach o [my options] { + foreach {label rep} $o break + # Don't show current values under candidates + if {[info exists __values($rep)]} continue + ::html::li -class candidates {::html::t $rep} + } + } + } + ::html::div -class visual-clear { + ;# maybe some comment + } + ::html::script { html::t $js } + } else { + next + } + } + + ########################################################### + # # ::xowiki::formfield::abstract_page # ########################################################### - Class abstract_page -superclass select -parameter { + + Class abstract_page -superclass candidate_box_select -parameter { {as_box false} } abstract_page set abstract 1 @@ -1544,56 +1612,7 @@ abstract_page instproc render_input {} { my compute_options - if {[my multiple]} { - # utilities.js aggregates "yahoo, dom, event, connection, animation, dragdrop" - set ajaxhelper 0 - ::xowiki::Includelet require_YUI_JS -ajaxhelper $ajaxhelper "utilities/utilities.js" - ::xowiki::Includelet require_YUI_JS -ajaxhelper $ajaxhelper "selector/selector-min.js" - ::xo::Page requireJS "/resources/xowiki/yui-selection-area.js" - - set js "" - foreach o [my options] { - foreach {label rep} $o break - set js_label [::xowiki::Includelet js_encode $label] - set js_rep [::xowiki::Includelet js_encode $rep] - append js "YAHOO.xo_sel_area.DDApp.values\['$js_label'\] = '$js_rep';\n" - append js "YAHOO.xo_sel_area.DDApp.dict\['$js_rep'\] = '$js_label';\n" - } - - ::html::div -class workarea { - ::html::h3 { ::html::t "Selection"} - set values "" - foreach v [my value] { - append values $v \n - set __values($v) 1 - } - my CSSclass selection - my set cols 30 - set atts [my get_attributes id name disabled {CSSclass class}] - # TODO what todo with DISABLED? - ::html::textarea [my get_attributes id name cols rows style {CSSclass class} disabled] { - ::html::t $values - } - } - ::html::div -class workarea { - ::html::h3 { ::html::t "Candidates"} - ::html::ul -id [my id]_candidates -class region { - #my msg [my options] - foreach o [my options] { - foreach {label rep} $o break - # Don't show current values under candidates - if {[info exists __values($rep)]} continue - ::html::li -class candidates {::html::t $rep} - } - } - } - ::html::div -class visual-clear { - ;# maybe some comment - } - ::html::script { html::t $js } - } else { - next - } + next } ########################################################### @@ -1646,7 +1665,7 @@ # # If the form_page has a different package_id, prepend the # package_url to the name. TODO: We assume here, that the form_pages - # have not special parent_id. + # have no special parent_id. # set object_package_id [$i package_id] if {$package_id != $object_package_id} { Index: openacs-4/packages/xowiki/tcl/includelet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/includelet-procs.tcl,v diff -u -N -r1.148 -r1.149 --- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 10 Jun 2010 11:44:59 -0000 1.148 +++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 11 Jun 2010 11:46:27 -0000 1.149 @@ -3107,8 +3107,11 @@ } form-menu-button instproc render {} { - my instvar package_id base form method return_url label_suffix link parent_id + my instvar package_id base form method return_url label_suffix link if {![info exists link]} { + if {[my parent_id] != [$package_id folder_id]} { + set parent_id [my parent_id] + } #my msg "[my info class] check-link-package_id=$package_id" set link [$package_id make_link -link $base $form $method return_url parent_id] } Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -N -r1.216 -r1.217 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 9 Jun 2010 07:20:53 -0000 1.216 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 11 Jun 2010 11:46:27 -0000 1.217 @@ -341,6 +341,8 @@ if {$page eq ""} { my log "Error: Could not resolve parameter page '$pp' of package [my id]." } + #my msg pp=$pp,page=$page-att=$attribute + if {$page ne "" && [$page exists instance_attributes]} { array set __ia [$page set instance_attributes] if {[info exists __ia($attribute)]} { @@ -602,7 +604,7 @@ if {$form_id ne ""} { if {$parent_id eq ""} {unset parent_id} ::xo::db::CrClass get_instance_from_db -item_id $form_id - set form_link [my pretty_link -parent_id [$form_id parent_id] $form] + set form_link [my pretty_link -parent_id [$form_id parent_id] [$form_id name]] return [my make_link -with_entities 0 -link $form_link $form_id \ create-new return_url title parent_id name nls_language] } @@ -1073,10 +1075,13 @@ # # @return page object or empty (""). # - if {$allow_cross_package_item_refs} { + if {$allow_cross_package_item_refs && [string match //* $link]} { set referenced_package_id [my resolve_package_path $link rest_link] + my log "get_page_from_item_ref recursive $rest_link in $referenced_package_id" if {$referenced_package_id != 0 && $referenced_package_id != [my id]} { - #my log "get_page_from_item_ref recursive $rest_link in $referenced_package_id" + # TODO: we have still to check, whether or not we want + # site-wide-pages etc. in cross package links, and if, under + # which parent should pages be created return [$referenced_package_id get_page_from_item_ref \ -allow_cross_package_item_refs false \ -use_package_path $use_package_path \ @@ -1085,16 +1090,22 @@ -default_lang $default_lang \ -parent_id $parent_id \ $rest_link] + } else { + # it is a link to the same package, we start search for page at top. + set link $rest_link + set search_parent_id "" } + } else { + set search_parent_id $parent_id } - if {$parent_id eq ""} { - set parent_id [my folder_id] + if {$search_parent_id eq ""} { + set search_parent_id [my folder_id] } array set "" [my item_ref -normalize_name false \ -use_package_path $use_package_path \ -default_lang $default_lang \ - -parent_id $parent_id \ + -parent_id $search_parent_id \ $link] #my msg "item-ref for '$link' returns [array get {}]" if {!$(item_id) && $use_site_wide_pages} { Index: openacs-4/packages/xowiki/tcl/weblog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/weblog-procs.tcl,v diff -u -N -r1.49 -r1.50 --- openacs-4/packages/xowiki/tcl/weblog-procs.tcl 1 Jun 2010 13:22:12 -0000 1.49 +++ openacs-4/packages/xowiki/tcl/weblog-procs.tcl 11 Jun 2010 11:46:27 -0000 1.50 @@ -36,12 +36,13 @@ set folder_id [::$package_id folder_id] set form_item_ids [list] foreach t [split $forms |] { + #my log "getting $t" set page [$package_id get_page_from_item_ref \ -use_prototype_pages true \ -use_package_path true \ -parent_id $parent_id \ $t] - #my ds "weblog form $t => $page" + my log "weblog form $t => $page" if {$page ne ""} { lappend form_item_ids [$page item_id] } Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -N -r1.268 -r1.269 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 1 Jun 2010 13:22:12 -0000 1.268 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 11 Jun 2010 11:46:27 -0000 1.269 @@ -208,7 +208,7 @@ # # The following block should not be here, but in the templates # - set left_side "
\n + set left_side "
\n [my include {folders -style folders}]\n
" @@ -219,7 +219,7 @@ #set content [$mb render-yui]$content append top_includelets \n "
" [$mb render-yui] - set content "$left_side\n
$content
" + set content "$left_side\n
$content
" } if {[$context_package_id get_parameter "with_user_tracking" 1]} { Index: openacs-4/packages/xowiki/www/resources/xowiki.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/xowiki.css,v diff -u -N -r1.50 -r1.51 --- openacs-4/packages/xowiki/www/resources/xowiki.css 8 Jun 2010 12:07:58 -0000 1.50 +++ openacs-4/packages/xowiki/www/resources/xowiki.css 11 Jun 2010 11:46:27 -0000 1.51 @@ -427,11 +427,27 @@ } - div.xowiki-content .margin-form fieldset .form-item-wrapper { padding: 0px 0px 0px 0px; } +/* folder menu placement */ + +div.xowiki-content div.folders { + float:left; width: 200px; + font-size: 90%; +} +div.xowiki-content .content-with-folders { + float: left; width: 70%; +} +div.xowiki-content .content-with-folders div.form-label { + width: 9em; +} +div.xowiki-content .content-with-folders div.form-widget { + margin-left: 10em; +} + + /* mc stuff */ div.xowiki-content table.mchoice td.selection { width: 25px;