Index: openacs-4/packages/wiki/wiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wiki/wiki.info,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wiki/wiki.info 4 Jan 2005 18:01:18 -0000 1.1 +++ openacs-4/packages/wiki/wiki.info 22 Feb 2005 16:15:13 -0000 1.2 @@ -11,11 +11,11 @@ Dave Bauer Wiki Wiki implementation on the CR - 0 + Index: openacs-4/packages/wiki/lib/footer.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wiki/lib/footer.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wiki/lib/footer.adp 5 Jan 2005 21:18:34 -0000 1.2 +++ openacs-4/packages/wiki/lib/footer.adp 22 Feb 2005 16:15:13 -0000 1.3 @@ -1,5 +1,5 @@
Help - | Edit -
\ No newline at end of file + | Edit + Index: openacs-4/packages/wiki/lib/footer.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wiki/lib/footer.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wiki/lib/footer.tcl 4 Jan 2005 18:01:18 -0000 1.1 +++ openacs-4/packages/wiki/lib/footer.tcl 22 Feb 2005 16:15:13 -0000 1.2 @@ -1,4 +1,7 @@ # footer for wiki pages shows edit, recent changes, search etc... # show last modified +if {![exists_and_not_null edit_link_p]} { + set edit_link_p "f" +} Index: openacs-4/packages/wiki/lib/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wiki/lib/new.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wiki/lib/new.tcl 6 Jan 2005 23:38:47 -0000 1.2 +++ openacs-4/packages/wiki/lib/new.tcl 22 Feb 2005 16:15:13 -0000 1.3 @@ -42,9 +42,6 @@ -storage_type "text" \ -mime_type "text/x-openacs-wiki" - # do something clever with internal refs - set stream [Wikit::Format::TextToStream $content] - set refs [Wikit::Format::StreamToRefs $stream "wiki::info"] } -edit_data { @@ -59,18 +56,17 @@ } -after_submit { # do something clever with internal refs set stream [Wikit::Format::TextToStream $content] - set refs [Wikit::Format::StreamToRefs $stream "wiki::info"] + set refs [Wikit::Format::StreamToRefs $stream "wiki::get_info"] if {![llength $refs]} { set refs [list ""] } - db_foreach get_ids "select ci.item_id as ref_item_id from cr_items ci left join cr_item_rels cr on (cr.item_id=:item_id or cr.related_object_id=:item_id) where ci.parent_id=:folder_id and ci.name in ([template::util:::tcl_to_sql_list $refs]) and cr.rel_id is null" { + db_foreach get_ids "select ci.item_id as ref_item_id from cr_items ci left join cr_item_rels cr on (cr.related_object_id=:item_id) where ci.parent_id=:folder_id and ci.name in ([template::util:::tcl_to_sql_list $refs]) and cr.rel_id is null" { content::item::relate \ -item_id $item_id \ -object_id $ref_item_id \ -relation_tag "wiki_reference" } - ad_returnredirect "./$name" } Index: openacs-4/packages/wiki/lib/page.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wiki/lib/page.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wiki/lib/page.adp 23 Jan 2005 22:51:24 -0000 1.2 +++ openacs-4/packages/wiki/lib/page.adp 22 Feb 2005 16:15:13 -0000 1.3 @@ -12,4 +12,4 @@

- \ No newline at end of file + Index: openacs-4/packages/wiki/lib/page.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wiki/lib/page.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wiki/lib/page.tcl 6 Jan 2005 23:38:47 -0000 1.2 +++ openacs-4/packages/wiki/lib/page.tcl 22 Feb 2005 16:15:13 -0000 1.3 @@ -20,7 +20,13 @@ # the path resolves directly to a site node set name "index" } - +ns_log debug " +DB -------------------------------------------------------------------------------- +DB DAVE debugging /var/lib/aolserver/openacs-5-1/packages/wiki/lib/page.tcl +DB -------------------------------------------------------------------------------- +DB name = '${name}' +DB folder_id = '${folder_id}' +DB --------------------------------------------------------------------------------" set item_id [content::item::get_id -item_path $name -resolve_index "t" -root_folder_id $folder_id] if {[string equal "" $item_id]} { rp_form_put name [ad_conn path_info] @@ -30,15 +36,14 @@ if {[info exists edit]} { set form [rp_getform] - ns_log notice " + ns_log debug " DB -------------------------------------------------------------------------------- DB DAVE debugging /var/lib/aolserver/openacs-5-head-cr-tcl-api/packages/wiki/lib/page.tcl DB -------------------------------------------------------------------------------- DB form = '${form}' DB [ns_set find $form "item_id"] DB --------------------------------------------------------------------------------" if {[ns_set find $form "item_id"] < 0} { - ns_log notice "Adding Item_id" rp_form_put item_id $item_id rp_form_put name $name } @@ -49,15 +54,15 @@ db_1row get_content "select content,title from cr_revisions, cr_items where revision_id=live_revision and cr_items.item_id=:item_id" set stream [Wikit::Format::TextToStream $content] -set refs [Wikit::Format::StreamToRefs $stream "wiki::info"] +set refs [Wikit::Format::StreamToRefs $stream "wiki::get_info"] db_multirow related_items get_related_items "select cr.name, cr.title, cr.description from cr_revisionsx cr, cr_items ci, cr_item_rels cir where cir.related_object_id=:item_id and cir.relation_tag='wiki_reference' and ci.live_revision=cr.revision_id and ci.item_id=cir.item_id" -set content [ad_wiki_text_to_html $content "wiki::info"] +set content [ad_wiki_text_to_html $content "wiki::get_info"] set context [list $title] set focus "" set header_stuff "" -set write_p [permission::permission_p \ +set edit_link_p [permission::permission_p \ -object_id $item_id \ -party_id [ad_conn user_id] \ -privilege "write" Index: openacs-4/packages/wiki/tcl/wiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wiki/tcl/wiki-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wiki/tcl/wiki-procs.tcl 6 Jan 2005 23:38:47 -0000 1.2 +++ openacs-4/packages/wiki/tcl/wiki-procs.tcl 22 Feb 2005 16:15:13 -0000 1.3 @@ -12,7 +12,7 @@ namespace eval wiki:: {} -ad_proc -public wiki::info { +ad_proc -public wiki::get_info { ref } { Tries to resolve a wiki reference to @@ -37,7 +37,7 @@ set package_id [ad_conn package_id] set d [db_string get_lm "select o.last_modified from acs_objects o, cr_items ci, cr_folders cf where cf.package_id=:package_id and ci.parent_id=cf.folder_id and ci.name=:ref and o.object_id=ci.item_id" -default ""] set ret [list "${ref}" "${ref}" "$d"] - ns_log notice " + ns_log debug " DB -------------------------------------------------------------------------------- DB DAVE debugging procedure wiki::info DB -------------------------------------------------------------------------------- @@ -133,13 +133,13 @@ # ref doesn't exist yet set ret [list "${ref}" "${ref}" "1"] - ns_log notice " -DB -------------------------------------------------------------------------------- -DB DAVE debugging procedure wiki::info -DB -------------------------------------------------------------------------------- -DB ref = '${ref}' -DB ret = '${ret}' -DB --------------------------------------------------------------------------------" +# ns_log debug " +#DB -------------------------------------------------------------------------------- +#DB DAVE debugging procedure wiki::info +#DB -------------------------------------------------------------------------------- +#DB ref = '${ref}' +#DB ret = '${ret}' +#DB --------------------------------------------------------------------------------" return $ret } Index: openacs-4/packages/wiki/tcl/wikit-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wiki/tcl/wikit-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wiki/tcl/wikit-procs.tcl 4 Jan 2005 18:01:18 -0000 1.1 +++ openacs-4/packages/wiki/tcl/wikit-procs.tcl 22 Feb 2005 16:15:13 -0000 1.2 @@ -646,7 +646,6 @@ continue } set info [$ip $text] - ns_log notice "info is $info" foreach {id name date} $info break if {$id == ""} { @@ -770,12 +769,11 @@ set info [$ip $text] foreach {id name date} $info break if {$id == ""} {continue} - - regexp {[0-9]+} $id id + #regexp {[0-9]+} $id id set pages($id) "" } - array names pages + } # Output specific conversion. Extracts all external references