Included Modules

Class Index

Quicksearch

Ziya::HtmlHelpers::Charts

Generates necessary html flash tag to support ZiYa

TODO — Rewrite to use content tag block instead...

Author: Fernand Galiana

Public Instance Methods

_ziya_chart( url, swf_path, swf_file, options ) click to toggle source

generated the object and embed tag necessary for the flash movie

     # File lib/ziya/html_helpers/charts.rb, line 152
152:   def _ziya_chart( url, swf_path, swf_file, options )
153:     # Setup options for opaque mode
154:     setup_wmode( options )      
155:     
156:     # setup width and height
157:     setup_movie_size( options )
158:     
159:     color_param  = tag( 'param', {:name => 'bgcolor', :value => options[:bgcolor]}, true )
160:     color_param += tag( 'param', {:name  => "wmode", :value => options[:wmode]}, true )
161: 
162:     xml_swf_path = gen_swf_path( swf_path, options[:swf_path], url )
163:     xml_swf_path << "&amp;timestamp=#{Time.now.to_i}" if options[:cache] == false
164:     xml_swf_path << "&amp;timeout=#{options[:timeout]}" if options[:timeout]
165:     xml_swf_path << "&amp;stage_width=#{options[:width]}&amp;stage_height=#{options[:height]}" if options[:use_stage] == true 
166:     
167:     tags = "<object codebase=\"\#{codebase}\" classid=\"\#{class_id}\" id=\"\#{options[:id]}\" height=\"\#{options[:height]}\" width=\"\#{options[:width]}\">\n<param name=\"scale\"             value=\"noscale\"/>\n<param name=\"salign\"            value=\"\#{options[:salign]}\"/>\n<param name=\"bgcolor\"           value=\"\#{options[:bgcolor]}\"/>\n<param name=\"wmode\"             value=\"\#{options[:wmode]}\"/>\n<param name=\"movie\"             value=\"\#{options[:asset_url]}/\#{swf_file}\"/>\n<param name=\"Flashvars\"         value=\"\#{xml_swf_path}&amp;chart_id=\#{options[:id]}\"/>\n<param name=\"menu\"              value=\"true\"/>\n<param name=\"allowFullScreen\"   value=\"true\"/>\n<param name=\"allowScriptAccess\" value=\"\#{options[:script_access]}\"/>\n<param name=\"quality\"           value=\"high\"/>\n<param name=\"play\"              value=\"true\"/>\n<param name=\"devicefont\"        value=\"false\"/>\n<embed scale=\"noscale\"\nallowfullscreen   = \"true\"\nallowscriptaccess = \"\#{options[:script_access]}\"\nbgcolor           = \"\#{options[:bgcolor]}\"\ndevicefont        = \"false\"\nflashvars         = \"\#{xml_swf_path}&amp;chart_id=\#{options[:id]}\"\nmenu              = \"true\"\nname              = \"\#{options[:id]}\"\nplay              = \"true\"\npluginspage       = \"\#{plugin_url}\"\nquality           = \"high\"\nsalign            = \"\#{options[:salign]}\"\nsrc               = \"\#{options[:asset_url]}/\#{swf_file}\"\ntype              = \"\#{mime}\"\nwmode             = \"\#{options[:wmode]}\"\nalign             = \"\#{options[:align]}\"\nheight            = \"\#{options[:height]}\"\nwidth             = \"\#{options[:width]}\"/>\n</object>\n"
168:   end
chart_path() click to toggle source

(Not documented)

     # File lib/ziya/html_helpers/charts.rb, line 142
142:   def chart_path()         "/charts"; end
charts_swf() click to toggle source

(Not documented)

     # File lib/ziya/html_helpers/charts.rb, line 141
141:   def charts_swf()         "#{charts_swf_base}&xml_source=%s"; end
charts_swf_base() click to toggle source

(Not documented)

     # File lib/ziya/html_helpers/charts.rb, line 140
140:   def charts_swf_base()    "library_path=%s/charts_library"; end
class_id() click to toggle source

(Not documented)

     # File lib/ziya/html_helpers/charts.rb, line 143
143:   def class_id()           "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" end
codebase() click to toggle source

(Not documented)

     # File lib/ziya/html_helpers/charts.rb, line 144
144:   def codebase()           "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0"; end
composite_base_url() click to toggle source

Const accessors...

     # File lib/ziya/html_helpers/charts.rb, line 138
138:   def composite_base_url() "%s/charts.swf?library_path=%s/charts_library" end
composite_url() click to toggle source

(Not documented)

     # File lib/ziya/html_helpers/charts.rb, line 139
139:   def composite_url()      "#{composite_base_url}&xml_source=%s" end
default_chart_options() click to toggle source

(Not documented)

    # File lib/ziya/html_helpers/charts.rb, line 33
33:   def default_chart_options
34:     { 
35:       :width          => "400",
36:       :height         => "300",
37:       :bgcolor        => "ffffff",
38:       :wmode          => "opaque",
39:       :menu           => true,
40:       :full_screen    => true,
41:       :align          => "l",
42:       :salign         => "tl",
43:       :scale          => "noscale",
44:       :use_cache      => false,
45:       :timeout        => nil,
46:       :retry          => 2,
47:       :use_stage      => false,                  
48:       :id             => "ziya_chart",
49:       :swf_path       => chart_path,
50:       :asset_url      => chart_path
51:     }
52:   end
gen_composite_path( swf_chart_dir, url, chart_id=null ) click to toggle source

genereates composite chart urls

     # File lib/ziya/html_helpers/charts.rb, line 123
123:   def gen_composite_path( swf_chart_dir, url, chart_id=null )
124:     buff = ""
125:     if url
126:       buff = composite_url % [swf_chart_dir, swf_chart_dir, escape_url( url )] 
127:     else
128:       buff = composite_base_url % [swf_chart_dir, "/charts" ]
129:     end
130:     buff << "&chart_id=#{chart_id}" if chart_id
131:     buff
132:   end
gen_swf_path( path_directive, swf_dir, url ) click to toggle source

generates swf path

     # File lib/ziya/html_helpers/charts.rb, line 147
147:   def gen_swf_path( path_directive, swf_dir, url )
148:     path_directive % [swf_dir, escape_url( url )]        
149:   end
ziya_chart( url, chart_options = {} ) click to toggle source

generates neccessary html tags to display a chart.

     # File lib/ziya/html_helpers/charts.rb, line 115
115:   def ziya_chart( url, chart_options = {} )
116:     options = default_chart_options.merge( chart_options )
117:   
118:     flash_vars = url ? charts_swf : charts_swf_base
119:     _ziya_chart( url, flash_vars, "charts.swf", options )
120:   end
ziya_chart_js( url, chart_options={} ) click to toggle source

generates necessary object and embed tags to display a flash movie on various browsers using javascript

    # File lib/ziya/html_helpers/charts.rb, line 56
56:   def ziya_chart_js( url, chart_options={} )
57:     options = default_chart_options.merge( chart_options )
58: 
59:     # Setup options for opaque mode
60:     setup_wmode( options )      
61:     
62:     # setup width and height
63:     setup_movie_size( options )
64:     
65:     flash_vars   = url ? charts_swf : charts_swf_base
66:     xml_swf_path = flash_vars % [options[:swf_path], escape_url(url)]
67:     xml_swf_path << "&chart_id=#{options[:id]}"
68:     xml_swf_path << "&timestamp=#{Time.now.to_i}" if options[:cache] == false
69:     xml_swf_path << "&timeout=#{options[:timeout]}&retry=#{options[:retry]}" if options[:timeout]
70:     xml_swf_path << "&stage_width=#{options[:width]}&stage_height=#{options[:height]}" if options[:use_stage] == true 
71:     
72:     js = "<script language=\"javascript\" type=\"text/javascript\">\nif (AC_FL_RunContent == 0 || DetectFlashVer == 0) {\nalert( \"This page requires AC_RunActiveContent.js.\" );\n}\nelse {\nvar hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);\nif( hasRightVersion ) {\nAC_FL_RunContent(\n'codebase'         , 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0',\n'width'            , '\#{options[:width]}',\n'height'           , '\#{options[:height]}',\n'scale'            , '\#{options[:scale]}',\n'salign'           , '\#{options[:salign]}',\n'bgcolor'          , '\#{options[:bgcolor]}',\n'wmode'            , '\#{options[:wmode]}',\n'movie'            , '\#{options[:swf_path]}/charts',\n'src'              , '\#{options[:swf_path]}/charts',\n'FlashVars'        , '\#{xml_swf_path}',\n'id'               , '\#{options[:id]}',\n'name'             , '\#{options[:id]}',\n'menu'             , '\#{options[:menu]}',\n'allowFullScreen'  , '\#{options[:full_screen]}',\n'allowScriptAccess','sameDomain',\n'quality'          , 'high',\n'align'            , '\#{options[:align]}',\n'pluginspage'      , 'http://www.macromedia.com/go/getflashplayer',\n'play'             , 'true',\n'devicefont'       , 'false'\n);\n}\nelse {\nvar alternateContent = 'This content requires the Adobe Flash Player. '\n+ '<u><a href=http://www.macromedia.com/go/getflash/>Get Flash</a></u>.';\ndocument.write(alternateContent);\n}\n}\n</script>\n"
73:   end
ziya_javascript_include_tag( opts={} ) click to toggle source

generates a javascript tag to include the js script to create object and embed tags

    # File lib/ziya/html_helpers/charts.rb, line 12
12:   def ziya_javascript_include_tag( opts={} )
13:     options = { :swf_path   => chart_path,
14:                 :major_vers => 9,
15:                 :minor_vers => 0,
16:                 :req_vers   => 45 }.merge!( opts )
17:     
18:     js = "<script language=\"javascript\" type=\"text/javascript\">\nAC_FL_RunContent = 0;\nDetectFlashVer = 0;\n</script>\n<script src=\"\#{options[:swf_path]}/AC_RunActiveContent.js\" language=\"javascript\"></script>\n<script language=\"javascript\" type=\"text/javascript\">\nvar requiredMajorVersion = \#{options[:major_vers]};\nvar requiredMinorVersion = \#{options[:minor_vers]};\nvar requiredRevision = \#{options[:req_vers]};\n</script>\n"
19:   end

secsequence

--- SEC00191

seccomment

--- ""

method_list

--- 
- methods: 
  - visibility: public
    aref: M000065
    name: _ziya_chart
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 152</span>\n\
      152:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">_ziya_chart</span>( <span class=\"ruby-identifier\">url</span>, <span class=\"ruby-identifier\">swf_path</span>, <span class=\"ruby-identifier\">swf_file</span>, <span class=\"ruby-identifier\">options</span> )\n\
      153:     <span class=\"ruby-comment cmt\"># Setup options for opaque mode</span>\n\
      154:     <span class=\"ruby-identifier\">setup_wmode</span>( <span class=\"ruby-identifier\">options</span> )      \n\
      155:     \n\
      156:     <span class=\"ruby-comment cmt\"># setup width and height</span>\n\
      157:     <span class=\"ruby-identifier\">setup_movie_size</span>( <span class=\"ruby-identifier\">options</span> )\n\
      158:     \n\
      159:     <span class=\"ruby-identifier\">color_param</span>  = <span class=\"ruby-identifier\">tag</span>( <span class=\"ruby-value str\">'param'</span>, {<span class=\"ruby-identifier\">:name</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">'bgcolor'</span>, <span class=\"ruby-identifier\">:value</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:bgcolor</span>]}, <span class=\"ruby-keyword kw\">true</span> )\n\
      160:     <span class=\"ruby-identifier\">color_param</span> <span class=\"ruby-operator\">+=</span> <span class=\"ruby-identifier\">tag</span>( <span class=\"ruby-value str\">'param'</span>, {<span class=\"ruby-identifier\">:name</span>  =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;wmode&quot;</span>, <span class=\"ruby-identifier\">:value</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:wmode</span>]}, <span class=\"ruby-keyword kw\">true</span> )\n\
      161: \n\
      162:     <span class=\"ruby-identifier\">xml_swf_path</span> = <span class=\"ruby-identifier\">gen_swf_path</span>( <span class=\"ruby-identifier\">swf_path</span>, <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:swf_path</span>], <span class=\"ruby-identifier\">url</span> )\n\
      163:     <span class=\"ruby-identifier\">xml_swf_path</span> <span class=\"ruby-operator\">&lt;&lt;</span> <span class=\"ruby-node\">&quot;&amp;amp;timestamp=#{Time.now.to_i}&quot;</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:cache</span>] <span class=\"ruby-operator\">==</span> <span class=\"ruby-keyword kw\">false</span>\n\
      164:     <span class=\"ruby-identifier\">xml_swf_path</span> <span class=\"ruby-operator\">&lt;&lt;</span> <span class=\"ruby-node\">&quot;&amp;amp;timeout=#{options[:timeout]}&quot;</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:timeout</span>]\n\
      165:     <span class=\"ruby-identifier\">xml_swf_path</span> <span class=\"ruby-operator\">&lt;&lt;</span> <span class=\"ruby-node\">&quot;&amp;amp;stage_width=#{options[:width]}&amp;amp;stage_height=#{options[:height]}&quot;</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:use_stage</span>] <span class=\"ruby-operator\">==</span> <span class=\"ruby-keyword kw\">true</span> \n\
      166:     \n\
      167:     <span class=\"ruby-identifier\">tags</span> = <span class=\"ruby-value str\">&quot;&lt;object codebase=\\&quot;\\#{codebase}\\&quot; classid=\\&quot;\\#{class_id}\\&quot; id=\\&quot;\\#{options[:id]}\\&quot; height=\\&quot;\\#{options[:height]}\\&quot; width=\\&quot;\\#{options[:width]}\\&quot;&gt;\\n&lt;param name=\\&quot;scale\\&quot;             value=\\&quot;noscale\\&quot;/&gt;\\n&lt;param name=\\&quot;salign\\&quot;            value=\\&quot;\\#{options[:salign]}\\&quot;/&gt;\\n&lt;param name=\\&quot;bgcolor\\&quot;           value=\\&quot;\\#{options[:bgcolor]}\\&quot;/&gt;\\n&lt;param name=\\&quot;wmode\\&quot;             value=\\&quot;\\#{options[:wmode]}\\&quot;/&gt;\\n&lt;param name=\\&quot;movie\\&quot;             value=\\&quot;\\#{options[:asset_url]}/\\#{swf_file}\\&quot;/&gt;\\n&lt;param name=\\&quot;Flashvars\\&quot;         value=\\&quot;\\#{xml_swf_path}&amp;amp;chart_id=\\#{options[:id]}\\&quot;/&gt;\\n&lt;param name=\\&quot;menu\\&quot;              value=\\&quot;true\\&quot;/&gt;\\n&lt;param name=\\&quot;allowFullScreen\\&quot;   value=\\&quot;true\\&quot;/&gt;\\n&lt;param name=\\&quot;allowScriptAccess\\&quot; value=\\&quot;\\#{options[:script_access]}\\&quot;/&gt;\\n&lt;param name=\\&quot;quality\\&quot;           value=\\&quot;high\\&quot;/&gt;\\n&lt;param name=\\&quot;play\\&quot;              value=\\&quot;true\\&quot;/&gt;\\n&lt;param name=\\&quot;devicefont\\&quot;        value=\\&quot;false\\&quot;/&gt;\\n&lt;embed scale=\\&quot;noscale\\&quot;\\nallowfullscreen   = \\&quot;true\\&quot;\\nallowscriptaccess = \\&quot;\\#{options[:script_access]}\\&quot;\\nbgcolor           = \\&quot;\\#{options[:bgcolor]}\\&quot;\\ndevicefont        = \\&quot;false\\&quot;\\nflashvars         = \\&quot;\\#{xml_swf_path}&amp;amp;chart_id=\\#{options[:id]}\\&quot;\\nmenu              = \\&quot;true\\&quot;\\nname              = \\&quot;\\#{options[:id]}\\&quot;\\nplay              = \\&quot;true\\&quot;\\npluginspage       = \\&quot;\\#{plugin_url}\\&quot;\\nquality           = \\&quot;high\\&quot;\\nsalign            = \\&quot;\\#{options[:salign]}\\&quot;\\nsrc               = \\&quot;\\#{options[:asset_url]}/\\#{swf_file}\\&quot;\\ntype              = \\&quot;\\#{mime}\\&quot;\\nwmode             = \\&quot;\\#{options[:wmode]}\\&quot;\\nalign             = \\&quot;\\#{options[:align]}\\&quot;\\nheight            = \\&quot;\\#{options[:height]}\\&quot;\\nwidth             = \\&quot;\\#{options[:width]}\\&quot;/&gt;\\n&lt;/object&gt;\\n&quot;</span>\n\
      168:   <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      generated the object and embed tag necessary for the flash movie
      </p>
    params: ( url, swf_path, swf_file, options )
  - visibility: public
    aref: M000061
    name: chart_path
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 142</span>\n\
      142:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">chart_path</span>()         <span class=\"ruby-value str\">&quot;/charts&quot;</span>; <span class=\"ruby-keyword kw\">end</span>"
    params: ()
  - visibility: public
    aref: M000060
    name: charts_swf
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 141</span>\n\
      141:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">charts_swf</span>()         <span class=\"ruby-node\">&quot;#{charts_swf_base}&amp;xml_source=%s&quot;</span>; <span class=\"ruby-keyword kw\">end</span>"
    params: ()
  - visibility: public
    aref: M000059
    name: charts_swf_base
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 140</span>\n\
      140:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">charts_swf_base</span>()    <span class=\"ruby-value str\">&quot;library_path=%s/charts_library&quot;</span>; <span class=\"ruby-keyword kw\">end</span>"
    params: ()
  - visibility: public
    aref: M000062
    name: class_id
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 143</span>\n\
      143:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">class_id</span>()           <span class=\"ruby-value str\">&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;</span> <span class=\"ruby-keyword kw\">end</span>"
    params: ()
  - visibility: public
    aref: M000063
    name: codebase
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 144</span>\n\
      144:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">codebase</span>()           <span class=\"ruby-value str\">&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0&quot;</span>; <span class=\"ruby-keyword kw\">end</span>"
    params: ()
  - visibility: public
    aref: M000057
    name: composite_base_url
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 138</span>\n\
      138:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">composite_base_url</span>() <span class=\"ruby-value str\">&quot;%s/charts.swf?library_path=%s/charts_library&quot;</span> <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Const accessors...
      </p>
    params: ()
  - visibility: public
    aref: M000058
    name: composite_url
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 139</span>\n\
      139:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">composite_url</span>()      <span class=\"ruby-node\">&quot;#{composite_base_url}&amp;xml_source=%s&quot;</span> <span class=\"ruby-keyword kw\">end</span>"
    params: ()
  - visibility: public
    aref: M000053
    name: default_chart_options
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 33</span>\n\
      33:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">default_chart_options</span>\n\
      34:     { \n\
      35:       <span class=\"ruby-identifier\">:width</span>          =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;400&quot;</span>,\n\
      36:       <span class=\"ruby-identifier\">:height</span>         =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;300&quot;</span>,\n\
      37:       <span class=\"ruby-identifier\">:bgcolor</span>        =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;ffffff&quot;</span>,\n\
      38:       <span class=\"ruby-identifier\">:wmode</span>          =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;opaque&quot;</span>,\n\
      39:       <span class=\"ruby-identifier\">:menu</span>           =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-keyword kw\">true</span>,\n\
      40:       <span class=\"ruby-identifier\">:full_screen</span>    =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-keyword kw\">true</span>,\n\
      41:       <span class=\"ruby-identifier\">:align</span>          =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;l&quot;</span>,\n\
      42:       <span class=\"ruby-identifier\">:salign</span>         =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;tl&quot;</span>,\n\
      43:       <span class=\"ruby-identifier\">:scale</span>          =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;noscale&quot;</span>,\n\
      44:       <span class=\"ruby-identifier\">:use_cache</span>      =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-keyword kw\">false</span>,\n\
      45:       <span class=\"ruby-identifier\">:timeout</span>        =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-keyword kw\">nil</span>,\n\
      46:       <span class=\"ruby-identifier\">:retry</span>          =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value\">2</span>,\n\
      47:       <span class=\"ruby-identifier\">:use_stage</span>      =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-keyword kw\">false</span>,                  \n\
      48:       <span class=\"ruby-identifier\">:id</span>             =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;ziya_chart&quot;</span>,\n\
      49:       <span class=\"ruby-identifier\">:swf_path</span>       =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">chart_path</span>,\n\
      50:       <span class=\"ruby-identifier\">:asset_url</span>      =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">chart_path</span>\n\
      51:     }\n\
      52:   <span class=\"ruby-keyword kw\">end</span>"
    params: ()
  - visibility: public
    aref: M000056
    name: gen_composite_path
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 123</span>\n\
      123:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">gen_composite_path</span>( <span class=\"ruby-identifier\">swf_chart_dir</span>, <span class=\"ruby-identifier\">url</span>, <span class=\"ruby-identifier\">chart_id</span>=<span class=\"ruby-identifier\">null</span> )\n\
      124:     <span class=\"ruby-identifier\">buff</span> = <span class=\"ruby-value str\">&quot;&quot;</span>\n\
      125:     <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">url</span>\n\
      126:       <span class=\"ruby-identifier\">buff</span> = <span class=\"ruby-identifier\">composite_url</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">swf_chart_dir</span>, <span class=\"ruby-identifier\">swf_chart_dir</span>, <span class=\"ruby-identifier\">escape_url</span>( <span class=\"ruby-identifier\">url</span> )] \n\
      127:     <span class=\"ruby-keyword kw\">else</span>\n\
      128:       <span class=\"ruby-identifier\">buff</span> = <span class=\"ruby-identifier\">composite_base_url</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">swf_chart_dir</span>, <span class=\"ruby-value str\">&quot;/charts&quot;</span> ]\n\
      129:     <span class=\"ruby-keyword kw\">end</span>\n\
      130:     <span class=\"ruby-identifier\">buff</span> <span class=\"ruby-operator\">&lt;&lt;</span> <span class=\"ruby-node\">&quot;&amp;chart_id=#{chart_id}&quot;</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">chart_id</span>\n\
      131:     <span class=\"ruby-identifier\">buff</span>\n\
      132:   <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      genereates composite chart urls
      </p>
    params: ( swf_chart_dir, url, chart_id=null )
  - visibility: public
    aref: M000064
    name: gen_swf_path
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 147</span>\n\
      147:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">gen_swf_path</span>( <span class=\"ruby-identifier\">path_directive</span>, <span class=\"ruby-identifier\">swf_dir</span>, <span class=\"ruby-identifier\">url</span> )\n\
      148:     <span class=\"ruby-identifier\">path_directive</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">swf_dir</span>, <span class=\"ruby-identifier\">escape_url</span>( <span class=\"ruby-identifier\">url</span> )]        \n\
      149:   <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      generates swf path
      </p>
    params: ( path_directive, swf_dir, url )
  - visibility: public
    aref: M000055
    name: ziya_chart
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 115</span>\n\
      115:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">ziya_chart</span>( <span class=\"ruby-identifier\">url</span>, <span class=\"ruby-identifier\">chart_options</span> = {} )\n\
      116:     <span class=\"ruby-identifier\">options</span> = <span class=\"ruby-identifier\">default_chart_options</span>.<span class=\"ruby-identifier\">merge</span>( <span class=\"ruby-identifier\">chart_options</span> )\n\
      117:   \n\
      118:     <span class=\"ruby-identifier\">flash_vars</span> = <span class=\"ruby-identifier\">url</span> <span class=\"ruby-value\">? </span><span class=\"ruby-identifier\">charts_swf</span> <span class=\"ruby-operator\">:</span> <span class=\"ruby-identifier\">charts_swf_base</span>\n\
      119:     <span class=\"ruby-identifier\">_ziya_chart</span>( <span class=\"ruby-identifier\">url</span>, <span class=\"ruby-identifier\">flash_vars</span>, <span class=\"ruby-value str\">&quot;charts.swf&quot;</span>, <span class=\"ruby-identifier\">options</span> )\n\
      120:   <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      generates neccessary html tags to display a chart.
      </p>
    params: ( url, chart_options = {} )
  - visibility: public
    aref: M000054
    name: ziya_chart_js
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 56</span>\n\
      56:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">ziya_chart_js</span>( <span class=\"ruby-identifier\">url</span>, <span class=\"ruby-identifier\">chart_options</span>={} )\n\
      57:     <span class=\"ruby-identifier\">options</span> = <span class=\"ruby-identifier\">default_chart_options</span>.<span class=\"ruby-identifier\">merge</span>( <span class=\"ruby-identifier\">chart_options</span> )\n\
      58: \n\
      59:     <span class=\"ruby-comment cmt\"># Setup options for opaque mode</span>\n\
      60:     <span class=\"ruby-identifier\">setup_wmode</span>( <span class=\"ruby-identifier\">options</span> )      \n\
      61:     \n\
      62:     <span class=\"ruby-comment cmt\"># setup width and height</span>\n\
      63:     <span class=\"ruby-identifier\">setup_movie_size</span>( <span class=\"ruby-identifier\">options</span> )\n\
      64:     \n\
      65:     <span class=\"ruby-identifier\">flash_vars</span>   = <span class=\"ruby-identifier\">url</span> <span class=\"ruby-value\">? </span><span class=\"ruby-identifier\">charts_swf</span> <span class=\"ruby-operator\">:</span> <span class=\"ruby-identifier\">charts_swf_base</span>\n\
      66:     <span class=\"ruby-identifier\">xml_swf_path</span> = <span class=\"ruby-identifier\">flash_vars</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:swf_path</span>], <span class=\"ruby-identifier\">escape_url</span>(<span class=\"ruby-identifier\">url</span>)]\n\
      67:     <span class=\"ruby-identifier\">xml_swf_path</span> <span class=\"ruby-operator\">&lt;&lt;</span> <span class=\"ruby-node\">&quot;&amp;chart_id=#{options[:id]}&quot;</span>\n\
      68:     <span class=\"ruby-identifier\">xml_swf_path</span> <span class=\"ruby-operator\">&lt;&lt;</span> <span class=\"ruby-node\">&quot;&amp;timestamp=#{Time.now.to_i}&quot;</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:cache</span>] <span class=\"ruby-operator\">==</span> <span class=\"ruby-keyword kw\">false</span>\n\
      69:     <span class=\"ruby-identifier\">xml_swf_path</span> <span class=\"ruby-operator\">&lt;&lt;</span> <span class=\"ruby-node\">&quot;&amp;timeout=#{options[:timeout]}&amp;retry=#{options[:retry]}&quot;</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:timeout</span>]\n\
      70:     <span class=\"ruby-identifier\">xml_swf_path</span> <span class=\"ruby-operator\">&lt;&lt;</span> <span class=\"ruby-node\">&quot;&amp;stage_width=#{options[:width]}&amp;stage_height=#{options[:height]}&quot;</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:use_stage</span>] <span class=\"ruby-operator\">==</span> <span class=\"ruby-keyword kw\">true</span> \n\
      71:     \n\
      72:     <span class=\"ruby-identifier\">js</span> = <span class=\"ruby-value str\">&quot;&lt;script language=\\&quot;javascript\\&quot; type=\\&quot;text/javascript\\&quot;&gt;\\nif (AC_FL_RunContent == 0 || DetectFlashVer == 0) {\\nalert( \\&quot;This page requires AC_RunActiveContent.js.\\&quot; );\\n}\\nelse {\\nvar hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);\\nif( hasRightVersion ) {\\nAC_FL_RunContent(\\n'codebase'         , 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0',\\n'width'            , '\\#{options[:width]}',\\n'height'           , '\\#{options[:height]}',\\n'scale'            , '\\#{options[:scale]}',\\n'salign'           , '\\#{options[:salign]}',\\n'bgcolor'          , '\\#{options[:bgcolor]}',\\n'wmode'            , '\\#{options[:wmode]}',\\n'movie'            , '\\#{options[:swf_path]}/charts',\\n'src'              , '\\#{options[:swf_path]}/charts',\\n'FlashVars'        , '\\#{xml_swf_path}',\\n'id'               , '\\#{options[:id]}',\\n'name'             , '\\#{options[:id]}',\\n'menu'             , '\\#{options[:menu]}',\\n'allowFullScreen'  , '\\#{options[:full_screen]}',\\n'allowScriptAccess','sameDomain',\\n'quality'          , 'high',\\n'align'            , '\\#{options[:align]}',\\n'pluginspage'      , 'http://www.macromedia.com/go/getflashplayer',\\n'play'             , 'true',\\n'devicefont'       , 'false'\\n);\\n}\\nelse {\\nvar alternateContent = 'This content requires the Adobe Flash Player. '\\n+ '&lt;u&gt;&lt;a href=http://www.macromedia.com/go/getflash/&gt;Get Flash&lt;/a&gt;&lt;/u&gt;.';\\ndocument.write(alternateContent);\\n}\\n}\\n&lt;/script&gt;\\n&quot;</span>\n\
      73:   <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      generates necessary object and embed tags to display a flash movie on
      various browsers using javascript
      </p>
    params: ( url, chart_options={} )
  - visibility: public
    aref: M000052
    name: ziya_javascript_include_tag
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/ziya/html_helpers/charts.rb, line 12</span>\n\
      12:   <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">ziya_javascript_include_tag</span>( <span class=\"ruby-identifier\">opts</span>={} )\n\
      13:     <span class=\"ruby-identifier\">options</span> = { <span class=\"ruby-identifier\">:swf_path</span>   =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">chart_path</span>,\n\
      14:                 <span class=\"ruby-identifier\">:major_vers</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value\">9</span>,\n\
      15:                 <span class=\"ruby-identifier\">:minor_vers</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value\">0</span>,\n\
      16:                 <span class=\"ruby-identifier\">:req_vers</span>   =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value\">45</span> }.<span class=\"ruby-identifier\">merge!</span>( <span class=\"ruby-identifier\">opts</span> )\n\
      17:     \n\
      18:     <span class=\"ruby-identifier\">js</span> = <span class=\"ruby-value str\">&quot;&lt;script language=\\&quot;javascript\\&quot; type=\\&quot;text/javascript\\&quot;&gt;\\nAC_FL_RunContent = 0;\\nDetectFlashVer = 0;\\n&lt;/script&gt;\\n&lt;script src=\\&quot;\\#{options[:swf_path]}/AC_RunActiveContent.js\\&quot; language=\\&quot;javascript\\&quot;&gt;&lt;/script&gt;\\n&lt;script language=\\&quot;javascript\\&quot; type=\\&quot;text/javascript\\&quot;&gt;\\nvar requiredMajorVersion = \\#{options[:major_vers]};\\nvar requiredMinorVersion = \\#{options[:minor_vers]};\\nvar requiredRevision = \\#{options[:req_vers]};\\n&lt;/script&gt;\\n&quot;</span>\n\
      19:   <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      generates a javascript tag to include the js script to create object and
      embed tags
      </p>
    params: ( opts={} )
  category: Instance
  type: Public

sectitle

--- 

[Validate]

Generated with the Darkfish Rdoc Generator.