Display iframe widget for AVOD titles
authorJeff Godin <jgodin@tadl.org>
Tue, 9 Oct 2012 16:00:35 +0000 (12:00 -0400)
committerJeff Godin <jgodin@tadl.org>
Fri, 12 Oct 2012 21:07:54 +0000 (17:07 -0400)
First attempt at an AVOD widget, displayed when the user is logged
in. For SSL concerns, a custom proxy cgi is used. The proxy cgi
decides if it should display the widget or a static thumbnail.

In theory, this could be used for other content providers as well.

Add a "Resident patrons click here to view content" link for widgets
when not logged in.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
templates_tadlskin/opac/parts/misc_util.tt2
templates_tadlskin/opac/parts/record/summary.tt2

index a0b3c99..a72396c 100644 (file)
                         args.ezproxy = 1;
                         IF (avod_xtid = res.href.match('url=http://avod.films.com/PortalPlaylists.aspx\?aid=\d+&xtid=(\d+)'));
                             args.cover_url = 'https://secure.films.com/Common/FMGimages/' _ avod_xtid.0 _ '_full.jpg';
+                            args.widget_html = "<iframe height='310' frameborder='0' width='348' src='https://www.tadl.org/avod/play.cgi?xtid=" _ avod_xtid.0 _ "'  >&nbsp;</iframe>";
                         END;
                     END;
                 END;
index 5727a5c..ddb8656 100644 (file)
                        jacket_src = ctx.media_prefix _ '/opac/extras/ac/jacket/' _ record.summary.jacket_size _ '/r/' _ bre_id_urisafe;
                        jacket_href = ctx.media_prefix _ '/opac/extras/ac/jacket/large/r/' _ bre_id_urisafe; 
                END;
+
+               IF args.widget_html;
+                       jacket_href = mkurl(ctx.opac_root _ '/login');
+            login_teaser = "Resident patrons click here to view content";
+               END;
         %]
-        [% IF jacket_href %]<a href='[% jacket_href | html %]'>[% END %]<img
+
+    [% IF args.widget_html && ctx.user %]
+       [% args.widget_html %]
+    [% ELSE %]
+        [% IF jacket_href %]<a href='[% jacket_href | html %]'>[% END %]
+            [% IF login_teaser %]<p>[% login_teaser %]</p>[% END %]<img
             alt="[% l('Image of item') %]" id='rdetail_image'
             onerror="this.style.display='none';"
             src='[% jacket_src | html %]' />[% IF jacket_href %]</a>[% END %]
+    [% END %]
         <br />
     </div>