Module: WhurlEngine::ApplicationHelper

Defined in:
app/helpers/whurl_engine/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#authorized?(*args) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'app/helpers/whurl_engine/application_helper.rb', line 3

def authorized?(*args)
  @authorization_adapter.nil? || @authorization_adapter.authorized?(*args)
end

#clippy(text, bgcolor = '#FFFFFF') ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/helpers/whurl_engine/application_helper.rb', line 7

def clippy(text, bgcolor='#FFFFFF')
swf_path = asset_path('whurl_engine/clippy.swf')
  html = <<-EOF
  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
          width="16"
          height="16"
          id="clippy" >
  <param name="movie" value="#{swf_path}"/>
  <param name="allowScriptAccess" value="always" />
  <param name="quality" value="high" />
  <param name="scale" value="noscale" />
  <param NAME="FlashVars" value="text=#{text}">
  <param name="bgcolor" value="#{bgcolor}">
  <embed src="#{swf_path}"
         width="16"
         height="16"
         name="clippy"
         quality="high"
         allowScriptAccess="always"
         type="application/x-shockwave-flash"
         pluginspage="http://www.macromedia.com/go/getflashplayer"
         FlashVars="text=#{text}"
         bgcolor="#{bgcolor}"
  />
  </object>
  EOF
  html.html_safe
end