Remove 'View' option for drafted entries in the 'Edit entries' section and replace with a 'Preview' option.
This commit is contained in:
@@ -3,6 +3,9 @@
|
|||||||
Version 1.2 ()
|
Version 1.2 ()
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
* Remove "View" option for drafted entries in the "Edit entries"
|
||||||
|
section and replace with a "Preview" option. (garvinhicking)
|
||||||
|
|
||||||
* Make spamblock plugin be more verbose in moderation-queue emails.
|
* Make spamblock plugin be more verbose in moderation-queue emails.
|
||||||
RFE #1626712 (garvinhicking)
|
RFE #1626712 (garvinhicking)
|
||||||
|
|
||||||
|
@@ -274,12 +274,17 @@ function serendipity_drawList() {
|
|||||||
}
|
}
|
||||||
echo implode(', ', $cats);
|
echo implode(', ', $cats);
|
||||||
}
|
}
|
||||||
$entry['link'] = serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath', true, array('timestamp' => $entry['timestamp']));
|
$entry['link'] = serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath', true, array('timestamp' => $entry['timestamp']));
|
||||||
|
$entry['preview_link'] = '?serendipity[noBanner]=true&serendipity[noSidebar]=true&serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=preview&serendipity[id]=' . $entry['id'];
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
|
<?php if (serendipity_db_bool($entry['isdraft'])) { ?>
|
||||||
|
<a target="_blank" href="<?php echo $entry['preview_link']; ?>" title="<?php echo PREVIEW . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo PREVIEW; ?>" /><?php echo PREVIEW ?></a>
|
||||||
|
<?php } else { ?>
|
||||||
<a target="_blank" href="<?php echo $entry['link']; ?>" title="<?php echo VIEW . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo VIEW; ?>" /><?php echo VIEW ?></a>
|
<a target="_blank" href="<?php echo $entry['link']; ?>" title="<?php echo VIEW . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo VIEW; ?>" /><?php echo VIEW ?></a>
|
||||||
|
<?php } ?>
|
||||||
<a href="?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]=<?php echo $entry['id']; ?>" title="<?php echo EDIT . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/edit.png'); ?>" alt="<?php echo EDIT; ?>" /><?php echo EDIT ?></a>
|
<a href="?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]=<?php echo $entry['id']; ?>" title="<?php echo EDIT . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/edit.png'); ?>" alt="<?php echo EDIT; ?>" /><?php echo EDIT ?></a>
|
||||||
<a href="?<?php echo serendipity_setFormToken('url'); ?>&serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=delete&serendipity[id]=<?php echo $entry['id']; ?>" title="<?php echo DELETE . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/delete.png'); ?>" alt="<?php echo DELETE; ?>" /><?php echo DELETE ?></a>
|
<a href="?<?php echo serendipity_setFormToken('url'); ?>&serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=delete&serendipity[id]=<?php echo $entry['id']; ?>" title="<?php echo DELETE . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/delete.png'); ?>" alt="<?php echo DELETE; ?>" /><?php echo DELETE ?></a>
|
||||||
<input type="checkbox" name="serendipity[multiDelete][]" value="<?php echo $entry['id']; ?>" />
|
<input type="checkbox" name="serendipity[multiDelete][]" value="<?php echo $entry['id']; ?>" />
|
||||||
@@ -345,20 +350,29 @@ if (!empty($serendipity['GET']['editSubmit'])) {
|
|||||||
$serendipity['GET']['adminAction'] = 'edit';
|
$serendipity['GET']['adminAction'] = 'edit';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$preview_only = false;
|
||||||
|
|
||||||
switch($serendipity['GET']['adminAction']) {
|
switch($serendipity['GET']['adminAction']) {
|
||||||
|
case 'preview':
|
||||||
|
$entry = serendipity_fetchEntry('id', $serendipity['GET']['id'], 1, 1);
|
||||||
|
$serendipity['POST']['preview'] = true;
|
||||||
|
$preview_only = true;
|
||||||
|
|
||||||
case 'save':
|
case 'save':
|
||||||
$entry = array(
|
if (!$preview_only) {
|
||||||
'id' => $serendipity['POST']['id'],
|
$entry = array(
|
||||||
'title' => $serendipity['POST']['title'],
|
'id' => $serendipity['POST']['id'],
|
||||||
'timestamp' => $serendipity['POST']['timestamp'],
|
'title' => $serendipity['POST']['title'],
|
||||||
'body' => $serendipity['POST']['body'],
|
'timestamp' => $serendipity['POST']['timestamp'],
|
||||||
'extended' => $serendipity['POST']['extended'],
|
'body' => $serendipity['POST']['body'],
|
||||||
'categories' => $serendipity['POST']['categories'],
|
'extended' => $serendipity['POST']['extended'],
|
||||||
'isdraft' => $serendipity['POST']['isdraft'],
|
'categories' => $serendipity['POST']['categories'],
|
||||||
'allow_comments' => $serendipity['POST']['allow_comments'],
|
'isdraft' => $serendipity['POST']['isdraft'],
|
||||||
'moderate_comments' => $serendipity['POST']['moderate_comments'],
|
'allow_comments' => $serendipity['POST']['allow_comments'],
|
||||||
'exflag' => (!empty($serendipity['POST']['extended']) ? true : false)
|
'moderate_comments' => $serendipity['POST']['moderate_comments'],
|
||||||
);
|
'exflag' => (!empty($serendipity['POST']['extended']) ? true : false)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if ($entry['allow_comments'] != 'true' && $entry['allow_comments'] !== true) {
|
if ($entry['allow_comments'] != 'true' && $entry['allow_comments'] !== true) {
|
||||||
$entry['allow_comments'] = 'false';
|
$entry['allow_comments'] = 'false';
|
||||||
@@ -464,18 +478,20 @@ switch($serendipity['GET']['adminAction']) {
|
|||||||
$entry['id'] = $serendipity['lastSavedEntry'];
|
$entry['id'] = $serendipity['lastSavedEntry'];
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
|
if (!$preview_only) {
|
||||||
serendipity_printEntryForm(
|
include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
|
||||||
'?',
|
serendipity_printEntryForm(
|
||||||
array(
|
'?',
|
||||||
'serendipity[action]' => 'admin',
|
array(
|
||||||
'serendipity[adminModule]' => 'entries',
|
'serendipity[action]' => 'admin',
|
||||||
'serendipity[adminAction]' => 'save',
|
'serendipity[adminModule]' => 'entries',
|
||||||
'serendipity[timestamp]' => $entry['timestamp']
|
'serendipity[adminAction]' => 'save',
|
||||||
),
|
'serendipity[timestamp]' => $entry['timestamp']
|
||||||
|
),
|
||||||
|
|
||||||
$entry
|
$entry
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user