Index: openacs-4/packages/xowiki/tcl/link-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v diff -u -r1.90.2.1 -r1.90.2.2 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 17 Sep 2013 17:49:24 -0000 1.90.2.1 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 13 Mar 2014 13:00:01 -0000 1.90.2.2 @@ -1,11 +1,11 @@ ::xo::library doc { - XoWiki - definition of link types and their renderers + XoWiki - definition of link types and their renderers - @creation-date 2006-04-15 - @author Gustaf Neumann - @cvs-id $Id$ + @creation-date 2006-04-15 + @author Gustaf Neumann + @cvs-id $Id$ } - + namespace eval ::xowiki { # # generic links @@ -214,7 +214,7 @@ # # image links # - + Class create ::xowiki::Link::image -superclass ::xowiki::Link \ -parameter { href @@ -239,10 +239,10 @@ set last_page_id [$page set item_id] set object_type ::xowiki::File set link [$package_id make_link $package_id edit-new object_type \ - [list parent_id [my parent_id]] \ - [list title $label] \ - [list return_url [::xo::cc url]] \ - autoname name last_page_id] + [list parent_id [my parent_id]] \ + [list title $label] \ + [list return_url [::xo::cc url]] \ + autoname name last_page_id] set html [my render_not_found $link $label] return $html } @@ -279,7 +279,7 @@ # # localimage link # - + Class create ::xowiki::Link::localimage -superclass ::xowiki::Link::image ::xowiki::Link::localimage instproc render {} { my render_found [my href] [my label] @@ -300,13 +300,13 @@ autostart loop volume controls controller mastersound starttime endtime } { if {[my exists $f]} { - append embed_options "$f = '[my set $f]' " + append embed_options "$f = '[my set $f]' " } } if {[my exists extra_query_parameter]} { set pairs {} foreach {pair} [my extra_query_parameter] { - lappend pairs [lindex $pair 0]=[ns_urlencode [lindex $pair 1]] + lappend pairs [lindex $pair 0]=[ns_urlencode [lindex $pair 1]] } append internal_href ?[string map [list ' "'"] [join $pairs &]] if {[my exists revision_id]} {append internal_href &revision_id=[my revision_id]} @@ -378,93 +378,93 @@ # # plugin link # -# Class create ::xowiki::Link::plugin -superclass ::xowiki::Link::file -parameter { -# classid width height autostart params -# } + # Class create ::xowiki::Link::plugin -superclass ::xowiki::Link::file -parameter { + # classid width height autostart params + # } -# ::xowiki::Link::plugin instproc render_found {href label} { -# my instvar package_id name + # ::xowiki::Link::plugin instproc render_found {href label} { + # my instvar package_id name -# foreach {width height autostart} {320 240 true} break -# foreach a {classid width height autostart} {if {[my exists $a]} {set $a [my set $a]}} -# set arguments [list width height autostart] - -# set object_params "" -# if {[my exists params]} { -# set paramlist [split [my set params] ,] -# foreach p $paramlist { -# set pair [split $p =] -# set param([lindex $pair 0]) [lindex $pair 1] -# } -# } + # foreach {width height autostart} {320 240 true} break + # foreach a {classid width height autostart} {if {[my exists $a]} {set $a [my set $a]}} + # set arguments [list width height autostart] + + # set object_params "" + # if {[my exists params]} { + # set paramlist [split [my set params] ,] + # foreach p $paramlist { + # set pair [split $p =] + # set param([lindex $pair 0]) [lindex $pair 1] + # } + # } -# #my msg [my name]-guess-type=[::xowiki::guesstype [my name]] -# set mime [::xowiki::guesstype [my name]] + # #my msg [my name]-guess-type=[::xowiki::guesstype [my name]] + # set mime [::xowiki::guesstype [my name]] -# switch $mime { -# video/x-ms-wmv { -# # TODO: using classid will stop firefox loading plugin, -# # without classid IE asks user to allow addon -# # also possible: application/x-mplayer2 -# if {![my exists classid]} {set classid "CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"} -# foreach f $arguments {if {[info exists $f]} {append object_params ""}} -# set objectElement \ -# "\n\ -# \n$object_params\n\ -# " -# } -# video/quicktime { -# if {![my exists classid]} {set classid "CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"} -# foreach f $arguments {if {[info exists $f]} {append object_params ""}} -# set objectElement \ -# " \n\ -# \n\ -# \n\ -# $object_params \n\ -# \n\n" -# } -# application/x-shockwave-flash { -# if {![my exists classid]} {set classid "CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000"} -# set embed_options "" -# set app_params "?" -# foreach f $arguments {if {[info exists $f]} { append embed_options "$f = '[set $f]' " }} -# foreach {att value} [array get param] {append app_params "$att=$value&"} ;# replace with export_vars -# set objectElement \ -# " \n\ -# \n\ -# \n\ -# \n" -# } -# application/java { -# if {![my exists classid]} {set classid "clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"} -# if {![info exists param(code)]} {set param(code) [my stripped_name]} -# if {![info exists codebase]} {set codebase [$package_id pretty_link -lang [my lang] -download true ""]} + # switch $mime { + # video/x-ms-wmv { + # # TODO: using classid will stop firefox loading plugin, + # # without classid IE asks user to allow addon + # # also possible: application/x-mplayer2 + # if {![my exists classid]} {set classid "CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"} + # foreach f $arguments {if {[info exists $f]} {append object_params ""}} + # set objectElement \ + # "\n\ + # \n$object_params\n\ + # " + # } + # video/quicktime { + # if {![my exists classid]} {set classid "CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"} + # foreach f $arguments {if {[info exists $f]} {append object_params ""}} + # set objectElement \ + # " \n\ + # \n\ + # \n\ + # $object_params \n\ + # \n\n" + # } + # application/x-shockwave-flash { + # if {![my exists classid]} {set classid "CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000"} + # set embed_options "" + # set app_params "?" + # foreach f $arguments {if {[info exists $f]} { append embed_options "$f = '[set $f]' " }} + # foreach {att value} [array get param] {append app_params "$att=$value&"} ;# replace with export_vars + # set objectElement \ + # " \n\ + # \n\ + # \n\ + # \n" + # } + # application/java { + # if {![my exists classid]} {set classid "clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"} + # if {![info exists param(code)]} {set param(code) [my stripped_name]} + # if {![info exists codebase]} {set codebase [$package_id pretty_link -lang [my lang] -download true ""]} -# foreach {att value} [array get param] {append object_params "\n"} -# set objectElement \ -# "\n\ -# \n\ -# $object_params \n\ -# No Java Support. \n\ -# \n\ -# $object_params \n\ -# \n" -# } -# default { -# my msg "unknown mime type '$mime' for plugin" -# #set mime "application/x-oleobject" -# } -# } + # foreach {att value} [array get param] {append object_params "\n"} + # set objectElement \ + # "\n\ + # \n\ + # $object_params \n\ + # No Java Support. \n\ + # \n\ + # $object_params \n\ + # \n" + # } + # default { + # my msg "unknown mime type '$mime' for plugin" + # #set mime "application/x-oleobject" + # } + # } -# return "$objectElement -#
$label ([my name])
-# " -# } + # return "$objectElement + #
$label ([my name])
+ # " + # } @@ -502,24 +502,30 @@ # link cache # -# Class LinkCache -# LinkCache instproc resolve {} { -# set key link-[my type]-[my name]-[my parent_id] -# while {1} { -# array set r [ns_cache eval xowiki_cache $key { -# set id [next] -# if {$id == 0 || $id eq ""} break ;# don't cache -# return [list item_id $id package_id [my package_id]] -# }] -# break -# } -# if {![info exists r(item_id)]} {return 0} -# # we have a valid item. Set the the package_id and return the item_id -# my package_id $r(package_id) -# return $r(item_id) -# } + # Class LinkCache + # LinkCache instproc resolve {} { + # set key link-[my type]-[my name]-[my parent_id] + # while {1} { + # array set r [ns_cache eval xowiki_cache $key { + # set id [next] + # if {$id == 0 || $id eq ""} break ;# don't cache + # return [list item_id $id package_id [my package_id]] + # }] + # break + # } + # if {![info exists r(item_id)]} {return 0} + # # we have a valid item. Set the the package_id and return the item_id + # my package_id $r(package_id) + # return $r(item_id) + # } -# Link instmixin add LinkCache + # Link instmixin add LinkCache } ::xo::library source_dependent +# +# Local variables: +# mode: tcl +# tcl-indent-level: 2 +# indent-tabs-mode: nil +# End: