Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2010-01-25 22:06:13 -06:00
commit 711a98ccfb
3 changed files with 12 additions and 11 deletions

View file

@ -7,8 +7,6 @@ class AbstractUrlGenerator
@controller = controller
end
attr :controller
# Create a link for the given page (or file) name and link text based
# on the render mode in options and whether the page (file) exists
# in the web.
@ -56,6 +54,9 @@ class AbstractUrlGenerator
end
end
def url_for(hash = {})
@controller.url_for hash
end
end
class UrlGenerator < AbstractUrlGenerator

View file

@ -146,7 +146,7 @@ class WikiContent < String
if @options[:engine] == Engines::MarkdownPNG
@options[:png_url] =
@options[:mode] == :export ? 'files/pngs/' :
(@url_generator.controller.url_for :controller => 'file', :web => @web.address,
(@url_generator.url_for :controller => 'file', :web => @web.address,
:action => 'file', :id => 'pngs', :only_path => true) + '/'
end

View file

@ -104,11 +104,11 @@ end
class StubUrlGenerator < AbstractUrlGenerator
def initialize
controller = Object.new
def controller.url_for(options = {})
'../files/pngs'
super(:doesnt_need_controller)
end
super(controller)
def url_for(hash = {})
'../files/pngs'
end
def file_link(mode, name, text, web_name, known_file, description)