Class: ODDB::View::PayPal::ReturnDownloads

Inherits:
HtmlGrid::List show all
Defined in:
src/view/paypal/return.rb

Constant Summary

COMPONENTS =
{
  [0,0] =>  :download_link,
  [1,0] =>  :additional_download_link,
}
CSS_MAP =
{
  [0,0,2] =>  'list',
}
DEFAULT_HEAD_CLASS =
'subheading'
LEGACY_INTERFACE =
false
OMIT_HEADER =
false
STRIPED_BG =
false
SORT_HEADER =
false

Constants inherited from HtmlGrid::List

BACKGROUND_SUFFIX

Instance Method Summary (collapse)

Instance Method Details



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'src/view/paypal/return.rb', line 23

def additional_download_link(model)
  protocol = DOWNLOAD_PROTOCOLS.find do |prt| %r{#{prt}}.match(model.text) end
  if protocol && !model.expired?
    data = {
      :email      => model.,
      :invoice    =>  model.oid,
      :filename   => model.text,
    }
    link = HtmlGrid::Link.new(:download, model, @session, self)
    url = URI.parse @lookandfeel._event_url(:download, data)
    url.scheme = protocol
    link.href = url.to_s
    link.value = protocol + "://" + model.text
    [link, ' ', @lookandfeel.lookup("adl_#{protocol}")]
  end
end


39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'src/view/paypal/return.rb', line 39

def download_link(model)
  if(model.expired?)
    time = model.expiry_time
    timestr = (time) \
      ? time.strftime(@lookandfeel.lookup(:time_format_long)) \
      : @lookandfeel.lookup(:paypal_e_invalid_time)
    @lookandfeel.lookup(:paypal_e_expired, model.text, timestr)
  else
    data = {
      :email      => model.,
      :invoice    =>  model.oid,
      :filename   => model.text,
    }
    link = HtmlGrid::Link.new(:download, model, @session, self)
    link.href = @lookandfeel._event_url(:download, data)
    link.value = "http://" << model.text
    link
  end
end