vendor/gems/ziya-2.1.7/lib/ziya/html_helpers/charts.rb
# generates necessary object and embed tags to display a flash movie on various 
# browsers using javascript
generates necessary object and embed tags to display a flash movie on various
browsers using javascript
generates necessary object and embed tags to display a flash movie on various browsers using javascript
def ziya_chart_js( url, chart_options={} )
    options = default_chart_options.merge( chart_options )
    setup_wmode( options )      
    setup_movie_size( options )
    flash_vars   = url ? charts_swf : charts_swf_base
    xml_swf_path = flash_vars % [options[:swf_path], escape_url(url)]
    xml_swf_path << "&chart_id=#{options[:id]}"
    xml_swf_path << "&timestamp=#{Time.now.to_i}" if options[:cache] == false
    xml_swf_path << "&timeout=#{options[:timeout]}&retry=#{options[:retry]}" if options[:timeout]
    xml_swf_path << "&stage_width=#{options[:width]}&stage_height=#{options[:height]}" if options[:use_stage] == true 
    js = <<-JS
      <script language="javascript" type="text/javascript">
      if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
        alert( "This page requires AC_RunActiveContent.js." );
      } 
      else {
        var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
        if( hasRightVersion ) { 
          AC_FL_RunContent(
            'codebase'         , 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0',
            'width'            , '#{options[:width]}',
            'height'           , '#{options[:height]}',
            'scale'            , '#{options[:scale]}',
            'salign'           , '#{options[:salign]}',
            'bgcolor'          , '#{options[:bgcolor]}',
            'wmode'            , '#{options[:wmode]}',
            'movie'            , '#{options[:swf_path]}/charts',
            'src'              , '#{options[:swf_path]}/charts',
            'FlashVars'        , '#{xml_swf_path}', 
            'id'               , '#{options[:id]}',
            'name'             , '#{options[:id]}',
            'menu'             , '#{options[:menu]}',
            'allowFullScreen'  , '#{options[:full_screen]}',
            'allowScriptAccess','sameDomain',
            'quality'          , 'high',
            'align'            , '#{options[:align]}',
            'pluginspage'      , 'http://www.macromedia.com/go/getflashplayer',
            'play'             , 'true',
            'devicefont'       , 'false'
          ); 
        } 
        else { 
          var alternateContent = 'This content requires the Adobe Flash Player. '
          + '<u><a href=http://www.macromedia.com/go/getflash/>Get Flash</a></u>.';
          document.write(alternateContent); 
        }
      }
      </script>
    JS
  end
def ziya_chart_js ( url , chart_options = { } ) options = default_chart_options . merge ( chart_options ) setup_wmode ( options ) setup_movie_size ( options ) flash_vars = url ? charts_swf : charts_swf_base xml_swf_path = flash_vars % [ options [ :swf_path ] , escape_url ( url ) ] xml_swf_path << "&chart_id=#{options[:id]}" xml_swf_path << "&timestamp=#{Time.now.to_i}" if options [ :cache ] == false xml_swf_path << "&timeout=#{options[:timeout]}&retry=#{options[:retry]}" if options [ :timeout ] xml_swf_path << "&stage_width=#{options[:width]}&stage_height=#{options[:height]}" if options [ :use_stage ] == true js = <<-JS 
      <script language="javascript" type="text/javascript">
      if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
        alert( "This page requires AC_RunActiveContent.js." );
      } 
      else {
        var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
        if( hasRightVersion ) { 
          AC_FL_RunContent(
            'codebase'         , 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0',
            'width'            , ' #{ options [ :width ] } ',
            'height'           , ' #{ options [ :height ] } ',
            'scale'            , ' #{ options [ :scale ] } ',
            'salign'           , ' #{ options [ :salign ] } ',
            'bgcolor'          , ' #{ options [ :bgcolor ] } ',
            'wmode'            , ' #{ options [ :wmode ] } ',
            'movie'            , ' #{ options [ :swf_path ] } /charts',
            'src'              , ' #{ options [ :swf_path ] } /charts',
            'FlashVars'        , ' #{ xml_swf_path } ', 
            'id'               , ' #{ options [ :id ] } ',
            'name'             , ' #{ options [ :id ] } ',
            'menu'             , ' #{ options [ :menu ] } ',
            'allowFullScreen'  , ' #{ options [ :full_screen ] } ',
            'allowScriptAccess','sameDomain',
            'quality'          , 'high',
            'align'            , ' #{ options [ :align ] } ',
            'pluginspage'      , 'http://www.macromedia.com/go/getflashplayer',
            'play'             , 'true',
            'devicefont'       , 'false'
          ); 
        } 
        else { 
          var alternateContent = 'This content requires the Adobe Flash Player. '
          + '<u><a href=http://www.macromedia.com/go/getflash/>Get Flash</a></u>.';
          document.write(alternateContent); 
        }
      }
      </script>
     JS end
generates necessary object and embed tags to display a flash movie on various
browsers using javascript
generates necessary object and embed tags to display a flash movie on various browsers using javascript
# Setup options for opaque mode # setup width and height
url
chart_options