Browse Source

Replace modal with lightbox for viewing images

tags/3.1.0
Mike Koch 2 years ago
parent
commit
dd68103be6

+ 1
- 0
css/jquery.fancybox.min.css
File diff suppressed because it is too large
View File


+ 1
- 1
css/mods-for-hesk-new.css View File

@@ -121,7 +121,7 @@
vertical-align: middle;
}

.attachment-table > tbody > tr > td > span > img {
.attachment-table > tbody > tr > td > a > img {
max-height: 80px;
max-width: 80px;
cursor: pointer;

+ 1
- 1
css/mods-for-hesk.css View File

@@ -35,7 +35,7 @@ button.dropdown-submit {
vertical-align: middle;
}

.attachment-table > tbody > tr > td > span > img {
.attachment-table > tbody > tr > td > a > img {
max-height: 80px;
max-width: 80px;
cursor: pointer;

+ 2
- 0
inc/header.inc.php View File

@@ -89,6 +89,7 @@ if (is_dir(HESK_PATH . 'install')) {
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/bootstrap-clockpicker.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/jquery.jgrowl.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/bootstrap-colorpicker.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/jquery.fancybox.min.css?v=<? echo MODS_FOR_HESK_BUILD ?>">
<?php if (defined('USE_JQUERY_2')): ?>
<script src="<?php echo HESK_PATH; ?>js/jquery-2.2.4.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
<?php else: ?>
@@ -111,6 +112,7 @@ if (is_dir(HESK_PATH . 'install')) {
<script type="text/javascript" src="<?php echo HESK_PATH; ?>internal-api/js/core.php?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/jquery.jgrowl.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-colorpicker.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/jquery.fancybox.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
<style>
.navbar-default {
background-color: <?php echo $modsForHesk_settings['navbarBackgroundColor']; ?>;

+ 2
- 0
inc/headerAdmin.inc.php View File

@@ -64,6 +64,7 @@ $modsForHesk_settings = mfh_getSettings();
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/colors.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/positions.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/displays.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/jquery.fancybox.min.css?v=<? echo MODS_FOR_HESK_BUILD ?>">
<?php if (defined('USE_JQUERY_2')): ?>
<script src="<?php echo HESK_PATH; ?>js/jquery-2.2.4.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
<?php else: ?>
@@ -88,6 +89,7 @@ $modsForHesk_settings = mfh_getSettings();
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/jquery.jgrowl.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-colorpicker.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/jquery.slimscroll.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/jquery.fancybox.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
<?php
if (defined('EXTRA_JS')) {
echo EXTRA_JS;

+ 9
- 25
inc/view_attachment_functions.inc.php View File

@@ -15,6 +15,7 @@ function mfh_listAttachments($attachments = '', $reply = 0, $is_staff)

/* List attachments */
$att = explode(',', substr($attachments, 0, -1));
$uniq_identifier = null;
echo '<div class="table-responsive">';
echo '<table class="table table-striped attachment-table">';
echo '<thead>
@@ -29,8 +30,12 @@ function mfh_listAttachments($attachments = '', $reply = 0, $is_staff)
</thead>';
echo '<tbody>';
foreach ($att as $myatt) {

list($att_id, $att_name) = explode('#', $myatt);

if ($uniq_identifier === null) {
$uniq_identifier = $att_id;
}

$fileparts = pathinfo($att_name);
$fontAwesomeIcon = mfh_getFontAwesomeIconForFileExtension($fileparts['extension']);
echo '
@@ -44,30 +49,9 @@ function mfh_listAttachments($attachments = '', $reply = 0, $is_staff)
if ($path == '') {
echo '<i class="fa fa-ban fa-4x" data-toggle="tooltip" title="' . $hesklang['attachment_removed'] . '"></i>';
} else {
echo '<span data-toggle="tooltip" title="' . $hesklang['click_to_preview'] . '">
<img src="' . $path . '" alt="' . $hesklang['image'] . '" data-toggle="modal" data-target="#modal-attachment-' . $att_id . '">
</span>';
$download_path = '';
if ($is_staff) {
$download_path = '../';
}
echo '<div class="modal fade" id="modal-attachment-' . $att_id . '" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">' . $att_name . '</h4>
</div>
<div class="modal-body">
<img class="img-responsive" src="' . $path . '" alt="' . $hesklang['image'] . '">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">' . $hesklang['close_modal'] . '</button>
<a href="' . $download_path . 'download_attachment.php?att_id=' . $att_id . '&amp;track=' . $trackingID . $email . '" class="btn btn-success">' . $hesklang['dnl'] . '</a>
</div>
</div>
</div>
</div>';
echo '<a href="' . $path . '" data-fancybox="' . htmlspecialchars($uniq_identifier) . '">
<img src="' . $path . '" alt="' . $hesklang['image'] . '" data-toggle="tooltip" title="' . $hesklang['click_to_preview'] . '">
</a>';
}
} else {
//-- Display the FontAwesome icon in the panel's body

+ 12
- 0
js/jquery.fancybox.min.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save