Class: ODDB::View::WelcomeHead

Inherits:
HtmlGrid::Composite show all
Includes:
Personal, SponsorDisplay
Defined in:
src/view/welcomehead.rb

Direct Known Subclasses

Doctors::WelcomeHeadDoctors, Hospitals::WelcomeHeadHospitals, Migel::WelcomeHeadMigel

Constant Summary

CSS_CLASS =
'composite'
CSS_MAP =
{
  [0,0] =>  'logo',
  [1,0] =>  'welcome',
}
COMPONENTS =
{
  [0,0]   => View::,
  [1,0,0] =>  :sponsor,
  [1,0,1] =>  "break",
  [1,0,2] =>  :home_welcome,
  [1,0,3] =>  :welcome,
}

Constants included from SponsorDisplay

CSS_CLASS, GOOGLE_CHANNEL, GOOGLE_FORMAT, GOOGLE_HEIGHT, GOOGLE_WIDTH

Instance Method Summary (collapse)

Methods included from SponsorDisplay

#sponsor

Methods included from GoogleAdSenseMethods

#active_sponsor?, #ad_sense

Methods included from Personal

#welcome

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'src/view/welcomehead.rb', line 27

def (model, session=@session) 
  if(@lookandfeel.enabled?(:epatents)) #, false))
    %q{<A HREF="http://petition.eurolinux.org"><img src="http://aful.org/images/patent_banner.gif" alt="Petition against e-patents"></A><BR>}
  elsif(@lookandfeel.enabled?(:banner))
    #banner = @lookandfeel.resource(:banner)
    dest = @lookandfeel.lookup(:banner_destination)
    href = @lookandfeel._event_url(:passthru, {"destination"=>dest})
=begin
    case banner
    when /\.swf/
      fls = HtmlGrid::FlashComponent.new(:banner, model, session, self)
      fls.set_attribute('width', '468')
      fls.set_attribute('height', '62')
      fls.set_attribute('href', href)
      fls
    else
=end


      link = HtmlGrid::Link.new(:banner, model, session, self)
      link.set_attribute('target', '_blank')
      link.value = HtmlGrid::Image.new(:banner, model, session, self)
      link.set_attribute('href', href)
      link
    #end
  end
end

- (Object) home_welcome(model, session = @session)



52
53
54
55
56
57
58
59
60
61
62
63
# File 'src/view/welcomehead.rb', line 52

def home_welcome(model, session=@session)
  parts = []
  if(@lookandfeel.enabled?(:screencast))
    link = HtmlGrid::Link.new(:home_welcome, model, @session, self)
    link.href = @lookandfeel.lookup(:screencast_url)
    link.css_class = 'welcome'
    parts.push(link)
  else
    parts.push @lookandfeel.lookup(:home_welcome)
  end
  parts.push '<br>', @lookandfeel.lookup(:home_welcome_data)
end