Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki
This commit is contained in:
commit
711a98ccfb
|
@ -7,8 +7,6 @@ class AbstractUrlGenerator
|
||||||
@controller = controller
|
@controller = controller
|
||||||
end
|
end
|
||||||
|
|
||||||
attr :controller
|
|
||||||
|
|
||||||
# Create a link for the given page (or file) name and link text based
|
# 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
|
# on the render mode in options and whether the page (file) exists
|
||||||
# in the web.
|
# in the web.
|
||||||
|
@ -55,7 +53,10 @@ class AbstractUrlGenerator
|
||||||
raise "Unknown link type: #{link_type}"
|
raise "Unknown link type: #{link_type}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def url_for(hash = {})
|
||||||
|
@controller.url_for hash
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class UrlGenerator < AbstractUrlGenerator
|
class UrlGenerator < AbstractUrlGenerator
|
||||||
|
|
|
@ -146,8 +146,8 @@ class WikiContent < String
|
||||||
if @options[:engine] == Engines::MarkdownPNG
|
if @options[:engine] == Engines::MarkdownPNG
|
||||||
@options[:png_url] =
|
@options[:png_url] =
|
||||||
@options[:mode] == :export ? 'files/pngs/' :
|
@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) + '/'
|
:action => 'file', :id => 'pngs', :only_path => true) + '/'
|
||||||
end
|
end
|
||||||
|
|
||||||
@not_rendered = @pre_rendered = nil
|
@not_rendered = @pre_rendered = nil
|
||||||
|
|
|
@ -104,13 +104,13 @@ end
|
||||||
class StubUrlGenerator < AbstractUrlGenerator
|
class StubUrlGenerator < AbstractUrlGenerator
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
controller = Object.new
|
super(:doesnt_need_controller)
|
||||||
def controller.url_for(options = {})
|
|
||||||
'../files/pngs'
|
|
||||||
end
|
|
||||||
super(controller)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def url_for(hash = {})
|
||||||
|
'../files/pngs'
|
||||||
|
end
|
||||||
|
|
||||||
def file_link(mode, name, text, web_name, known_file, description)
|
def file_link(mode, name, text, web_name, known_file, description)
|
||||||
link = CGI.escape(name)
|
link = CGI.escape(name)
|
||||||
case mode
|
case mode
|
||||||
|
|
Loading…
Reference in a new issue