my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
{
- template_name => "opac-downloadshelf.tmpl",
+ template_name => "opac-downloadshelf.tt",
query => $query,
type => "opac",
authnotrequired => 1,
my $shelfid = $query->param('shelfid');
my $format = $query->param('format');
+my $context = $query->param('context');
+my $showprivateshelves = $query->param('showprivateshelves');
my $dbh = C4::Context->dbh;
if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $shelfid, 'view' ) ) {
if ($shelfid && $format) {
- my @shelf = GetShelf($shelfid);
my ($items, $totitems) = GetShelfContents($shelfid);
my $marcflavour = C4::Context->preference('marcflavour');
my $output;
print $output;
} else {
- $template->param(csv_profiles => GetCsvProfilesLoop());
- $template->param(shelfid => $shelfid);
+
+ # get details of the list
+ my ($shelfnumber,$shelfname,$owner,$category,$sorton) = GetShelf($shelfid);
+
+ # if modal context is passed set a variable so that page markup can be different
+ if($context eq "modal"){
+ $template->param(modal => 1);
+ } else {
+ $template->param(fullpage => 1);
+ }
+ $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
+ $template->param(
+ showprivateshelves => $showprivateshelves,
+ shelfid => $shelfid,
+ shelfname => $shelfname,
+ shelfnumber => $shelfnumber,
+ viewshelf => $shelfnumber
+ );
output_html_with_http_headers $query, $cookie, $template->output;
}
} else {
$template->param(invalidlist => 1);
output_html_with_http_headers $query, $cookie, $template->output;
-}
\ No newline at end of file
+}