Skip to content

Commit

Permalink
Fixed: attachment not showing on OPAC
Browse files Browse the repository at this point in the history
Added: New admin template
  • Loading branch information
dicarve committed May 6, 2013
1 parent 33006cb commit f46df89
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 53 deletions.
21 changes: 21 additions & 0 deletions admin/admin_template/default/index_template.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta http-equiv="Expires" content="Sat, 26 Jul 1997 05:00:00 GMT" />
<link rel="icon" href="<?php echo SWB; ?>webicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo SWB; ?>webicon.ico" type="image/x-icon" />
<link href="<?php echo SWB; ?>template/core.style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $sysconf['admin_template']['css']; ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo JWB; ?>chosen/chosen.css" rel="stylesheet" type="text/css" />
<link href="<?php echo JWB; ?>colorbox/colorbox.css" rel="stylesheet" type="text/css" />
Expand Down Expand Up @@ -56,6 +57,26 @@
<div id="footer"><?php echo $sysconf['page_footer']; ?></div>
<!-- license info end -->

<script type="text/javascript">
jQuery(document).ready( function() {

var timeOut = null;
jQuery('#mainMenu .menuCurrent, #mainMenu .home').bind('mouseover', function() {
var menu = jQuery(this);
var menuPos = menu.position();
jQuery('#sidepan').css({left: menuPos.left+'px'}).slideDown().bind('mouseover', function() {
clearTimeout(timeOut);
});
}).bind('mouseout', function() {
timeOut = setTimeout( function() { jQuery('#sidepan').slideUp(); }, 1000 );
});

jQuery('body').not('#sidepan a').click( function() { jQuery('#sidepan').fadeOut(); clearTimeout(timeOut); } );

})

</script>

<!-- fake submit iframe for search form, DONT REMOVE THIS! -->
<iframe name="blindSubmit" style="visibility: hidden; width: 0; height: 0;"></iframe>
<!-- <iframe name="blindSubmit" style="visibility: visible; width: 100%; height: 300px;"></iframe> -->
Expand Down
21 changes: 15 additions & 6 deletions admin/admin_template/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,21 @@ submenu
#sidepan {
width: 250px;
background: #fff;
box-shadow: inset -5px 0px 10px #e6e6e6 !important;
-webkit-box-shadow: inset -5px 0px 10px #e6e6e6 !important;
-moz-box-shadow: inset -5px 0px 10px #e6e6e6 !important;
overflow: auto;
position: absolute;
bottom: 20px;
box-shadow: 0px 0px 10px #999 !important;
-webkit-box-shadow: 0px 0px 10px #999 !important;
-moz-box-shadow: 0px 0px 10px #999 !important;
overflow: hidden;
position: fixed;
bottom: 45px;
height: 300px;
max-height: 300px;
display: none;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}

#sidepan:hover {
overflow-y: scroll;
}

.subMenuHeader, .per_title {
Expand Down
6 changes: 4 additions & 2 deletions js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ jQuery.fn.registerAdminEvents = function(params) {
});

// change all search form submit behaviour to AJAX
container.find('form.disabled').disableForm();
var disabledForm = container.find('form.disabled');
if (disabledForm.length > 0) { disabledForm.disableForm(); }

// change all search form submit behaviour to AJAX
container.find('.editFormLink').click(function(evt) {
Expand Down Expand Up @@ -462,7 +463,8 @@ $('document').ready(function() {
});

// disable form with class "disabled"
$('form.disabled').disableForm();
var disabledForm = $('form.disabled');
if (disabledForm.length > 0) { disabledForm.disableForm(); }
$(document).registerAdminEvents({ajaxifyLink: false, ajaxifyForm: false});

// jquery colorbox
Expand Down
6 changes: 3 additions & 3 deletions lib/contents/attachment_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
}
#if (preg_match('@(video|audio|image)/.+@i', $attachment_d['mime_type'])) {
if ($attachment_d['mime_type'] == 'application/pdf') {
echo '<li style="list-style-image: url(images/labels/ebooks.png)"><strong><a href="#" title="Read the book online" onclick="openHTMLpop(\'index.php?p=fstream&fid='.$attachment_d['file_id'].'&bid='.$attachment_d['biblio_id'].'\', 830, 500, \''.$attachment_d['file_title'].'\')">'.$attachment_d['file_title'].'</a></strong>';
echo '<li style="list-style-image: url(images/labels/ebooks.png)"><strong><a class="openPopUp" title="'.$attachment_d['file_title'].'" href="index.php?p=fstream&fid='.$attachment_d['file_id'].'&bid='.$attachment_d['biblio_id'].'" width="800" height="500">'.$attachment_d['file_title'].'</a></strong>';
echo '<div><i>'.$attachment_d['file_desc'].'</i></div>';
if (trim($attachment_d['file_url']) != '') { echo '<div><a href="'.trim($attachment_d['file_url']).'" title="Other Resource related to this book" target="_blank">Other Resource Link</a></div>'; }
echo '</li>';
} else if (preg_match('@(video|audio)/.+@i', $attachment_d['mime_type'])) {
echo '<li style="list-style-image: url(images/labels/auvi.png)"><strong><a href="#" title="Click to Play, Listen or View" onclick="openHTMLpop(\'index.php?p=multimediastream&fid='.$attachment_d['file_id'].'&bid='.$attachment_d['biblio_id'].'\', 400, 300, \''.$attachment_d['file_title'].'\')">'.$attachment_d['file_title'].'</a></strong>';
echo '<li style="list-style-image: url(images/labels/auvi.png)"><strong><a class="openPopUp" title="'.$attachment_d['file_title'].'" href="index.php?p=multimediastream&fid='.$attachment_d['file_id'].'&bid='.$attachment_d['biblio_id'].'" width="640" height="480">'.$attachment_d['file_title'].'</a></strong>';
echo '<div><i>'.$attachment_d['file_desc'].'</i></div>';
if (trim($attachment_d['file_url']) != '') { echo '<div><a href="'.trim($attachment_d['file_url']).'" title="Other Resource Link" target="_blank">Other Resource Link</a></div>'; }
echo '</li>';
Expand All @@ -92,7 +92,7 @@
$imgheight = 400;
}
#echo '<li style="list-style-image: url(images/labels/ebooks.png)"><strong><a href="#" title="Click To View File" onclick="openHTMLpop(\'index.php?p=fstream&fid='.$attachment_d['file_id'].'&bid='.$attachment_d['biblio_id'].'\', 600, 400, \''.$attachment_d['file_title'].'\')">'.$attachment_d['file_title'].'</a></strong>';
echo '<li style="list-style-image: url(images/labels/ebooks.png)"><strong><a href="#" title="Click To View File" onclick="openHTMLpop(\'index.php?p=fstream&fid='.$attachment_d['file_id'].'&bid='.$attachment_d['biblio_id'].'\', '.$imgwidth.', '.$imgheight.', \''.$attachment_d['file_title'].'\')">'.$attachment_d['file_title'].'</a></strong>';
echo '<li style="list-style-image: url(images/labels/ebooks.png)"><strong><a class="openPopUp" title="'.$attachment_d['file_title'].'" href="index.php?p=fstream&fid='.$attachment_d['file_id'].'&bid='.$attachment_d['biblio_id'].'" width="'.$imgwidth.'" height="'.$imgheight.'">'.$attachment_d['file_title'].'</a></strong>';
if (trim($attachment_d['file_url']) != '') { echo ' [<a href="'.trim($attachment_d['file_url']).'" title="Other Resource related to this file" target="_blank" style="font-size: 90%;">Other Resource Link</a>]'; }
echo '<div><i>'.$attachment_d['file_desc'].'</i></div></li>';
} else {
Expand Down
7 changes: 4 additions & 3 deletions lib/contents/fstream.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// be sure that this file not accessed directly
if (!defined('INDEX_AUTH')) {
die("can not access this file directly");
} elseif (INDEX_AUTH != 1) {
} elseif (INDEX_AUTH != 1) {
die("can not access this file directly");
}

Expand Down Expand Up @@ -108,8 +108,9 @@
exit();
}
} else {
die('<div class="errorBox">File Not Found!</div>');
echo '<div class="errorBox">File Not Found!</div>';
}
} else {
die('<div class="errorBox">File Not Found!</div>');
echo '<div class="errorBox">File Not Found!</div>';
}
exit();
1 change: 1 addition & 0 deletions lib/contents/multimediastream.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@
</script>
</body>
</html>
<?php exit(); ?>
4 changes: 2 additions & 2 deletions lib/detail.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function __construct($obj_db, $int_detail_id, $str_output_format = 'html'
public function showDetail()
{
if ($this->error) {
return '<div style="padding: 5px; margin: 3px; border: 1px dotted #FF0000; color: #FF0000;">Error Fetching data for record detail. Server return error message: '.$this->error.'</div>';
return '<div class="error">Error Fetching data for record detail. Server return error message: '.$this->error.'</div>';
} else {
if ($this->output_format == 'html' AND !empty($this->list_template)) {
return parent::parseListTemplate($this->htmlOutput());
Expand Down Expand Up @@ -477,7 +477,7 @@ public function DublinCoreOutput()
$_xml_output .= '<dc:subject>'.$this->record_detail['classification'].'</dc:subject>';

// Permalink
$_xml_output .= '<dc:identifier><![CDATA[http://'.$_SERVER['SERVER_NAME'].SWB.'index.php?p=show_detail&id='.$this->detail_id.']]></dc:identifier>';
$_xml_output .= '<dc:identifier><![CDATA[http://'.$_SERVER['SERVER_NAME'].SWB.'index.php?p=show_detail&id='.$this->detail_id.']]></dc:identifier>';

// ISBN/ISSN
$_xml_output .= '<dc:identifier>'.str_replace(array('-', ' '), '', $this->record_detail['isbn_issn']).'</dc:identifier>';
Expand Down
Loading

0 comments on commit f46df89

Please sign in to comment.