View | Details | Raw Unified | Return to bug 8377
Collapse All | Expand All

(-)a/C4/HTML5Media.pm (-19 / +16 lines)
Lines 36-48 This module gets the relevant data from field 856 (MARC21/UNIMARC) to create a H Link Here
36
36
37
=head2 gethtml5media
37
=head2 gethtml5media
38
38
39
Get all relevant data from field 856. Takes $template and $record in the subroutine call, sets appropriate params.
39
Get all relevant data from field 856. Takes a $record in the subroutine call, sets appropriate params.
40
40
41
=cut
41
=cut
42
42
43
sub gethtml5media {
43
sub gethtml5media {
44
    my $self = shift;
44
    my $self = shift;
45
    my $template = shift;
46
    my $record = shift;
45
    my $record = shift;
47
    my @HTML5Media_sets = ();
46
    my @HTML5Media_sets = ();
48
    my @HTML5Media_fields = $record->field(856);
47
    my @HTML5Media_fields = $record->field(856);
Lines 189-226 sub gethtml5media { Link Here
189
        }
188
        }
190
    }
189
    }
191
    # parent element
190
    # parent element
192
    for my $i ( 0 .. $#HTML5Media_sets ) {
191
    for my $media ( @HTML5Media_sets ) {
193
        if ( ($HTML5Media_sets[$i]{mime}) && ($HTML5Media_sets[$i]{mime} =~ /audio/) ) {
192
        if ( ($media->{mime}) && ($media->{mime} =~ /audio/) ) {
194
            if ( $HTML5MediaParent ne 'video' ) {
193
            if ( $HTML5MediaParent ne 'video' ) {
195
                $HTML5MediaParent = 'audio';
194
                $HTML5MediaParent = 'audio';
196
                $HTML5MediaWidth = '';
195
                $HTML5MediaWidth = '';
197
            }
196
            }
198
        }
197
        }
199
        elsif ( ($HTML5Media_sets[$i]{mime}) && ($HTML5Media_sets[$i]{mime} =~ /video/) ) {
198
        elsif ( ($media->{mime}) && ($media->{mime} =~ /video/) ) {
200
            $HTML5MediaParent = 'video';
199
            $HTML5MediaParent = 'video';
201
            $HTML5MediaWidth = ' width="480"';
200
            $HTML5MediaWidth = ' width="480"';
202
        }
201
        }
203
    }
202
    }
204
    # child element
203
    # child element
205
    for my $j ( 0 .. $#HTML5Media_sets ) {
204
    for my $media ( @HTML5Media_sets ) {
206
        if ( ($HTML5Media_sets[$j]{type}) && ( ($HTML5Media_sets[$j]{type} eq 'video') || ($HTML5Media_sets[$j]{type} eq 'audio') ) ) {
205
        if ( ($media->{type}) && ( ($media->{type} eq 'video') || ($media->{type} eq 'audio') ) ) {
207
            if ( $HTML5Media_sets[$j]{type} eq $HTML5MediaParent ) {
206
            if ( $media->{type} eq $HTML5MediaParent ) {
208
                $HTML5Media_sets[$j]{child} = 'source';
207
                $media->{child} = 'source';
209
            }
208
            }
210
        }
209
        }
211
        else {
210
        else {
212
            $HTML5Media_sets[$j]{child} = $HTML5Media_sets[$j]{type};
211
            $media->{child} = $media->{type};
213
        }
212
        }
214
    }
213
    }
215
    # template parameters
214
216
    if ( (scalar(@HTML5Media_sets) > 0) && ($HTML5MediaParent) ) {
215
    return (
217
        $template->param(
216
        HTML5MediaEnabled  => ( (scalar(@HTML5Media_sets) > 0) && ($HTML5MediaParent) ),
218
            HTML5MediaEnabled  => 1,
217
        HTML5MediaSets     => \@HTML5Media_sets,
219
            HTML5MediaSets     => \@HTML5Media_sets,
218
        HTML5MediaParent   => $HTML5MediaParent,
220
            HTML5MediaParent   => $HTML5MediaParent,
219
        HTML5MediaWidth    => $HTML5MediaWidth,
221
            HTML5MediaWidth    => $HTML5MediaWidth);
220
    );
222
    }
223
    return $template;
224
}
221
}
225
222
226
1;
223
1;
(-)a/catalogue/detail.pl (-2 / +2 lines)
Lines 362-369 if ( C4::Context->preference("LocalCoverImages") == 1 ) { Link Here
362
}
362
}
363
363
364
# HTML5 Media
364
# HTML5 Media
365
if ( (C4::Context->preference("HTML5MediaEnabled") eq 'staff') || (C4::Context->preference("HTML5MediaEnabled") eq 'both') ) {
365
if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->preference("HTML5MediaEnabled") eq 'staff') ) {
366
    $template = C4::HTML5Media->gethtml5media($template,$record);
366
    $template->param( C4::HTML5Media->gethtml5media($record));
367
}
367
}
368
368
369
369
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (+4 lines)
Lines 2496-2498 div.authorizedheading { Link Here
2496
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
2496
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
2497
.ui-timepicker-div td { font-size: 90%; }
2497
.ui-timepicker-div td { font-size: 90%; }
2498
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
2498
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
2499
2500
video {
2501
    width: 480px;
2502
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +1 lines)
Lines 550-556 function verify_images() { Link Here
550
[% IF ( HTML5MediaEnabled ) %]
550
[% IF ( HTML5MediaEnabled ) %]
551
<div id="html5media">
551
<div id="html5media">
552
        <p>
552
        <p>
553
        <[% HTML5MediaParent %][% HTML5MediaWidth %] controls preload=none>
553
        <[% HTML5MediaParent %] controls preload=none>
554
          [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
554
          [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
555
            <[% HTML5MediaSet.child  %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] />
555
            <[% HTML5MediaSet.child  %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] />
556
          [% END %]
556
          [% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/css/opac.css (+4 lines)
Lines 2820-2822 body#opac-main #opacmainuserblockmobile { Link Here
2820
.tagweight9 {
2820
.tagweight9 {
2821
    font-size: 30px;
2821
    font-size: 30px;
2822
}
2822
}
2823
2824
video {
2825
    width: 480px;
2826
}
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-1 / +1 lines)
Lines 1149-1155 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1149
[% IF ( HTML5MediaEnabled ) %]
1149
[% IF ( HTML5MediaEnabled ) %]
1150
<div id="html5media">
1150
<div id="html5media">
1151
        <p>
1151
        <p>
1152
        <[% HTML5MediaParent %][% HTML5MediaWidth %] controls preload=none>
1152
        <[% HTML5MediaParent %] controls preload=none>
1153
          [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
1153
          [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
1154
            <[% HTML5MediaSet.child  %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] />
1154
            <[% HTML5MediaSet.child  %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] />
1155
          [% END %]
1155
          [% END %]
(-)a/opac/opac-detail.pl (-3 / +2 lines)
Lines 758-765 if (C4::Context->preference("OPACLocalCoverImages")){ Link Here
758
}
758
}
759
759
760
# HTML5 Media
760
# HTML5 Media
761
if ( (C4::Context->preference("HTML5MediaEnabled") eq 'opac') || (C4::Context->preference("HTML5MediaEnabled") eq 'both') ) {
761
if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->preference("HTML5MediaEnabled") eq 'opac') ) {
762
    $template = C4::HTML5Media->gethtml5media($template,$record);
762
    $template->param( C4::HTML5Media->gethtml5media($record));
763
}
763
}
764
764
765
my $syndetics_elements;
765
my $syndetics_elements;
766
- 

Return to bug 8377