Skip to content

Commit 854e81a

Browse files
committed
Added improved attachment overview
1 parent a58f7ad commit 854e81a

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

CHANGELOG

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ CHANGELOG
55

66
This is a log of major user-visible changes in each phpMyFAQ release.
77

8-
Version 2.10.0-alpha - 2017-05-
8+
Version 2.10.0-alpha - 2017-06-
99
- changed PHP requirement to PHP 5.6+ and PHP 7+ (Thorsten)
1010
- added LDAP configuration frontend (Thorsten)
1111
- added configuration for enable/disable XML sitemap (Thorsten)
1212
- added support for category images (Thorsten)
1313
- added support for categories on startpage (Thorsten)
1414
- added image slider template (Thorsten)
15+
- added improved attachment overview (Thorsten)
1516
- improved REST/JSON API including login (Thorsten)
1617
- improved sticky records (Thorsten)
1718
- updated bundled Symfony ClassLoader to version 2.7.16 (Thorsten)

phpmyfaq/admin/att.main.php

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Ajax interface for attachments.
44
*
5-
* PHP Version 5.5
5+
* PHP Version 5.6
66
*
77
* This Source Code Form is subject to the terms of the Mozilla Public License,
88
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
@@ -56,15 +56,17 @@
5656
<table class="table table-striped">
5757
<thead>
5858
<tr>
59+
<th>#</th>
5960
<th><?php echo $PMF_LANG['msgAttachmentsFilename'] ?></th>
6061
<th><?php echo $PMF_LANG['msgTransToolLanguage'] ?></th>
6162
<th><?php echo $PMF_LANG['msgAttachmentsFilesize'] ?></th>
62-
<th colspan="2"><?php echo $PMF_LANG['msgAttachmentsMimeType'] ?></th>
63+
<th colspan="3"><?php echo $PMF_LANG['msgAttachmentsMimeType'] ?></th>
6364
</tr>
6465
</thead>
6566
<tbody>
6667
<?php foreach ($crumbs as $item): ?>
6768
<tr class="att_<?php echo $item->id ?>" title="<?php echo $item->thema ?>">
69+
<td><?php echo $item->id ?></td>
6870
<td><?php echo $item->filename ?></td>
6971
<td><?php echo $item->record_lang ?></td>
7072
<td><?php echo $item->filesize ?></td>
@@ -75,6 +77,12 @@ class="btn btn-danger" title="<?php echo $PMF_LANG['ad_gen_delete'] ?>">
7577
<i aria-hidden="true" class="fa fa-trash-o"></i>
7678
</a>
7779
</td>
80+
<td>
81+
<a title="<?php echo $PMF_LANG['ad_entry_faq_record'] ?>" class="btn btn-info"
82+
href="../index.php?action=artikel&id=<?php echo $item->record_id ?>&lang=<?php echo $item->record_lang ?>">
83+
<i aria-hidden="true" class="fa fa-external-link"></i>
84+
</a>
85+
</td>
7886
</tr>
7987
<?php endforeach; ?>
8088
</tbody>
@@ -87,25 +95,26 @@ class="btn btn-danger" title="<?php echo $PMF_LANG['ad_gen_delete'] ?>">
8795
</div>
8896
</div>
8997

90-
<script type="text/javascript">
98+
<script>
9199
/**
92100
* Ajax call for deleting attachments
93101
*
94102
* @param att_id Attachment id
95103
*/
96-
function deleteAttachment(att_id)
97-
{
98-
if (confirm('<?php echo $PMF_LANG['msgAttachmentsWannaDelete'] ?>')) {
99-
$('#saving_data_indicator').html('<i aria-hidden="true" class="fa fa-spinner fa-spin"></i> Deleting ...');
100-
$.ajax({
101-
type: "GET",
102-
url: "index.php?action=ajax&ajax=att&ajaxaction=delete",
103-
data: {attId: att_id},
104-
success: function(msg) {
105-
$('.att_' + att_id).fadeOut('slow');
106-
$('#saving_data_indicator').html('<p class="alert alert-success">' + msg + '</p>');
107-
}
108-
});
109-
}
104+
function deleteAttachment(att_id) {
105+
if (confirm('<?php echo $PMF_LANG['msgAttachmentsWannaDelete'] ?>')) {
106+
$('#saving_data_indicator').html('<i aria-hidden="true" class="fa fa-spinner fa-spin"></i> Deleting ...');
107+
$.ajax(
108+
{
109+
type: "GET",
110+
url: "index.php?action=ajax&ajax=att&ajaxaction=delete",
111+
data: {attId: att_id},
112+
success: function (msg) {
113+
$('.att_' + att_id).fadeOut('slow');
114+
$('#saving_data_indicator').html('<p class="alert alert-success">' + msg + '</p>');
115+
}
116+
}
117+
);
118+
}
110119
}
111120
</script>

0 commit comments

Comments
 (0)