simplification, fixes, additions and changes to entries.inc.php/tpl
This commit is contained in:
@@ -129,44 +129,27 @@ function serendipity_drawList() {
|
||||
// Print the entries
|
||||
$smartentries = array();
|
||||
foreach ($entries as $ey) {
|
||||
// Find out if the entry has been modified later than 30 minutes after creation
|
||||
if ($ey['timestamp'] <= ($ey['last_modified'] - 60*30)) {
|
||||
$lm = '<a href="#" title="' . LAST_UPDATED . ': ' . serendipity_formatTime(DATE_FORMAT_SHORT, $ey['last_modified']) . '" onclick="alert(this.title)"><img src="'. serendipity_getTemplateFile('admin/img/clock.png') .'" alt="*" /></a>';
|
||||
} else {
|
||||
$lm = '';
|
||||
}
|
||||
|
||||
if (!$serendipity['showFutureEntries'] && $ey['timestamp'] >= serendipity_serverOffsetHour()) {
|
||||
$entry_pre = '<a href="#" title="' . ENTRY_PUBLISHED_FUTURE . '" onclick="alert(this.title)"><img src="'. serendipity_getTemplateFile('admin/img/clock_future.png') .'" alt="*" /></a> ';
|
||||
} else {
|
||||
$entry_pre = '';
|
||||
}
|
||||
|
||||
if (serendipity_db_bool($ey['properties']['ep_is_sticky'])) {
|
||||
$entry_pre .= ' ' . STICKY_POSTINGS . ': ';
|
||||
}
|
||||
|
||||
if (count($ey['categories'])) {
|
||||
$cats = array();
|
||||
foreach ($ey['categories'] as $cat) {
|
||||
$caturl = serendipity_categoryURL($cat);
|
||||
$cats[] = '<a href="' . $caturl . '">' . htmlspecialchars($cat['category_name']) . '</a>';
|
||||
$cats[] = '<a href="' . serendipity_categoryURL($cat) . '">' . htmlspecialchars($cat['category_name']) . '</a>';
|
||||
}
|
||||
$entry_cats = implode(', ', $cats);
|
||||
}
|
||||
|
||||
$smartentries[] = array(
|
||||
'clock' => $entry_pre,
|
||||
'id' => $ey['id'],
|
||||
'title' => htmlspecialchars($ey['title']),
|
||||
'pubdate' => date("c", (int)$ey['timestamp']),
|
||||
'stime' => serendipity_formatTime(DATE_FORMAT_SHORT, $ey['timestamp']) . ' ' .$lm,
|
||||
'author' => htmlspecialchars($ey['author']),
|
||||
'cats' => $entry_cats,
|
||||
'link' => serendipity_archiveURL($ey['id'], $ey['title'], 'serendipityHTTPPath', true, array('timestamp' => $ey['timestamp'])),
|
||||
'draft_pre' => ((serendipity_db_bool($ey['isdraft']) || (!$serendipity['showFutureEntries'] && $ey['timestamp'] >= serendipity_serverOffsetHour())) ? true : false),
|
||||
'link' => serendipity_archiveURL($ey['id'], $ey['title'], 'serendipityHTTPPath', true, array('timestamp' => $ey['timestamp'])),
|
||||
'preview_link' => '?serendipity[noBanner]=true&serendipity[noSidebar]=true&serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=preview&serendipity[id]=' . $ey['id']
|
||||
'id' => $ey['id'],
|
||||
'title' => htmlspecialchars($ey['title']),
|
||||
'timestamp' => (int)$ey['timestamp'],
|
||||
'last_modified' => (int)$ey['last_modified'],
|
||||
'isdraft' => serendipity_db_bool($ey['isdraft']),
|
||||
'ep_is_sticky' => (serendipity_db_bool($ey['properties']['ep_is_sticky']) ? true : false),
|
||||
'pubdate' => date("c", (int)$ey['timestamp']),
|
||||
'author' => htmlspecialchars($ey['author']),
|
||||
'cats' => $entry_cats,
|
||||
'preview' => ((serendipity_db_bool($ey['isdraft']) || (!$serendipity['showFutureEntries'] && $ey['timestamp'] >= serendipity_serverOffsetHour())) ? true : false),
|
||||
'archive_link' => serendipity_archiveURL($ey['id'], $ey['title'], 'serendipityHTTPPath', true, array('timestamp' => $ey['timestamp'])),
|
||||
'preview_link' => '?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=preview&' . serendipity_setFormToken('url') . '&serendipity[id]=' . $ey['id']
|
||||
);
|
||||
|
||||
} // end entries output
|
||||
@@ -239,8 +222,7 @@ switch($serendipity['GET']['adminAction']) {
|
||||
}
|
||||
|
||||
// Save the entry, or just display a preview
|
||||
$use_legacy = true;
|
||||
$data['use_legacy'] = $use_legacy;
|
||||
$data['use_legacy'] = $use_legacy = true;
|
||||
serendipity_plugin_api::hook_event('backend_entry_iframe', $use_legacy);
|
||||
|
||||
if ($use_legacy) {
|
||||
@@ -436,11 +418,8 @@ if (!is_object($serendipity['smarty'])) {
|
||||
}
|
||||
|
||||
$serendipity['smarty']->assign($data);
|
||||
|
||||
$tfile = dirname(__FILE__) . "/tpl/entries.inc.tpl";
|
||||
|
||||
$content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up
|
||||
|
||||
$content = $serendipity['smarty']->fetch('file:'. $tfile);
|
||||
echo $content;
|
||||
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
||||
@@ -59,7 +59,7 @@ if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken()
|
||||
}
|
||||
/*
|
||||
if (count($_POST[$item['var']]) < 1) {
|
||||
echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . WARNING_NO_GROUPS_SELECTED . '</div>';
|
||||
echo '<div class="serendipityAdminMsgError msg_error"><img class="img_error" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . WARNING_NO_GROUPS_SELECTED . '</div>';
|
||||
} else {
|
||||
serendipity_updateGroups($_POST[$item['var']], $serendipity['authorid'], false);
|
||||
}
|
||||
|
||||
@@ -98,18 +98,7 @@
|
||||
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
{literal}
|
||||
function invertSelection() {
|
||||
var f = document.formMultiDelete;
|
||||
for (var i = 0; i < f.elements.length; i++) {
|
||||
if (f.elements[i].type == 'checkbox') {
|
||||
f.elements[i].checked = !(f.elements[i].checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
{/literal}
|
||||
</script>
|
||||
<script type="text/javascript" language="JavaScript" src="{serendipity_getFile file='admin/admin_scripts.js'}"></script>
|
||||
|
||||
<form action="?" method="post" name="formMultiDelete" id="formMultiDelete">
|
||||
{$formtoken}
|
||||
@@ -127,7 +116,7 @@
|
||||
<table width="100%" cellspacing="0" cellpadding="3">
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{if (!$showFutureEntries) && ($entry.timestamp >= $serverOffsetHour)}<a href="#" title="{$CONST.ENTRY_PUBLISHED_FUTURE}" onclick="alert(this.title)"><img src="{serendipity_getFile file='admin/img/clock_future.png'}" alt="*" style="border: 0px none ; vertical-align: bottom;" /></a> {else}{/if}{if $entry.properties.ep_is_sticky == true} {$CONST.STICKY_POSTINGS}: {/if}{if $entry.isdraft == true}{$CONST.DRAFT}: {/if}<a href="?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]={$entry.id}" title="#{$entry.id}">{$entry.title|escape|truncate:50:"…"}</a></strong>
|
||||
<strong>{if (!$showFutureEntries) && ($entry.timestamp >= $serverOffsetHour)}<a href="#" title="{$CONST.ENTRY_PUBLISHED_FUTURE}" onclick="alert(this.title)"><img src="{serendipity_getFile file='admin/img/clock_future.png'}" alt="*" style="border: 0px none ; vertical-align: bottom;" /></a> {else}{/if}{if $entry.ep_is_sticky} {$CONST.STICKY_POSTINGS}: {/if}{if $entry.isdraft}{$CONST.DRAFT}: {/if}<a href="?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]={$entry.id}" title="#{$entry.id}">{$entry.title|escape|truncate:50:"…"}</a></strong>
|
||||
</td>
|
||||
<td align="right">
|
||||
{* Find out if the entry has been modified later than 30 minutes after creation *}
|
||||
@@ -137,26 +126,19 @@
|
||||
<tr>
|
||||
<td>
|
||||
{$CONST.POSTED_BY} {$entry.author|escape}
|
||||
{if count($entry.categories)}
|
||||
{if count($entry.cats)}
|
||||
{$CONST.IN}
|
||||
{foreach $entry.categories as $cat}
|
||||
{assign var="caturl" value="serendipity_categoryURL($cat)"}{* serendipity_categoryURL($cat) include to allowed php_functions in Smarty Security, or rebuild somehow, or rewrite tpl *}
|
||||
{$cats = ['<a href="{$caturl}">{$cat.category_name|escape)}</a>']}
|
||||
{/foreach}
|
||||
{foreach $cats AS $implode_cat}
|
||||
{$implode_cat}{if (count($cats) > 1) && !$implode_cat@last}, {/if}
|
||||
{foreach $entry.cats AS $cat}
|
||||
{$cat}{if (count($entry.cats) > 1) && !$cat@last}, {/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
{* Smarty3 allows you to {$var = ['foo' => 'bar', 'sub' => [1, 2, 3]]} and {$var.foo = 'other'} *}
|
||||
{* $tst = ['timestamp' => $entry.timestamp] *}
|
||||
|
||||
</td>
|
||||
<td align="right">
|
||||
{if ($entry.isdraft == true) || (!$showFutureEntries && ($entry.timestamp >= $serverOffsetHour))}
|
||||
<a target="_blank" href="?serendipity[noBanner]=true&serendipity[noSidebar]=true&serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=preview&serendipity[id]={$entry.id}&{$urltoken}" title="{$CONST.PREVIEW} #{$entry.id}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/zoom.png'}" alt="{$CONST.PREVIEW}" />{$CONST.PREVIEW}</a>
|
||||
{else} {* serendipity_archiveURL() include to allowed php_functions in Smarty Security, or rebuild somehow, or rewrite tpl *}
|
||||
<a target="_blank" href="{serendipity_archiveURL($entry.id, $entry.title, "serendipityHTTPPath", true, ['timestamp' => $entry.timestamp])}" title="{$CONST.VIEW} #{$entry.id}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/zoom.png'}" alt="{$CONST.VIEW}" />{$CONST.VIEW}</a>
|
||||
{if $entry.preview || (!$showFutureEntries && ($entry.timestamp >= $serverOffsetHour))}
|
||||
<a href="{$entry.preview_link}" title="{$CONST.PREVIEW} #{$entry.id}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/zoom.png'}" alt="{$CONST.PREVIEW}" />{$CONST.PREVIEW}</a>
|
||||
{else}
|
||||
<a href="{$entry.archive_link}" title="{$CONST.VIEW} #{$entry.id}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/zoom.png'}" alt="{$CONST.VIEW}" />{$CONST.VIEW}</a>
|
||||
{/if}
|
||||
<a href="?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]={$entry.id}" title="{$CONST.EDIT} #{$entry.id}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/edit.png'}" alt="{$CONST.EDIT}" />{$CONST.EDIT}</a>
|
||||
<a href="?{$urltoken}&serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=delete&serendipity[id]={$entry.id}" title="{$CONST.DELETE} #{$entry.id}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/delete.png'}" alt="{$CONST.DELETE}" />{$CONST.DELETE}</a>
|
||||
@@ -215,8 +197,7 @@
|
||||
</div><!-- // div.serendipity_admin_list drawList end -->
|
||||
|
||||
{/if}{* $drawList end *}
|
||||
|
||||
{if (($switched_output !== true && empty($entries)) || (!$drawList && empty($entries))) && ($get.adminAction != 'new' && $get.adminAction != 'edit')}
|
||||
{if ( ( (!$switched_output && empty($entries)) || (!$drawList && empty($entries)) ) && ( $get.adminAction != 'new' || $get.adminAction != 'edit' ) && !$is_iframepreview )}
|
||||
|
||||
<div class="serendipity_admin_list">
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #000000; vertical-align: top"><strong>{$cname}</strong>
|
||||
{if $cdesc != ''}
|
||||
<br><span style="color: #5E7A94; font-size: 8pt;"> {$cdesc}</span>
|
||||
<br><span style="color: #5E7A94; font-size: 8pt;"> {$cdesc}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td style="border-bottom: 1px solid #000000; vertical-align: middle" width="250">
|
||||
@@ -31,7 +31,7 @@
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #000000; vertical-align: top"><strong>{$cname}</strong>
|
||||
{if $cdesc != ''}
|
||||
<br /><span style="color: #5E7A94; font-size: 8pt;"> {$cdesc}</span>
|
||||
<br /><span style="color: #5E7A94; font-size: 8pt;"> {$cdesc}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td style="border-bottom: 1px solid #000000; vertical-align: middle;" width="250">
|
||||
@@ -40,7 +40,7 @@
|
||||
<div class="clearfix">
|
||||
{/if}
|
||||
<input class="direction_{$lang_direction} input_radio" type="radio" id="serendipity_plugin_{$r['id']}" name="serendipity[{$postKey}][{$config_item}]" value="{$r['value']}" {(!empty($r['checked'])) ? 'checked="checked"' : ''} title="{$r['index']|escape}" />
|
||||
<label for="serendipity_plugin_{$r['id']}">{$r['index']}{* escape is already done *}</label>
|
||||
<label for="serendipity_plugin_{$r['id']}">{$r['index']}{* escapement is already done *}</label>
|
||||
{if ($r['counter'] == $per_row)}
|
||||
{assign var="r" value="counter[0]"}
|
||||
</div>
|
||||
|
||||
@@ -13,34 +13,34 @@ window.log = function f(){ log.history = log.history || []; log.history.push(arg
|
||||
// - serendipity_plugins_admin.inc.php::serendipity_plugin_config() function
|
||||
// - templates/default/admin/default_staticpage_backend.tpl
|
||||
function showConfig(id) {
|
||||
if (document.getElementById) {
|
||||
dlm = document.getElementById(id);
|
||||
if (dlm.style.display == 'none') {
|
||||
document.getElementById('option' + id).src = img_minus;
|
||||
dlm.style.display = '';
|
||||
} else {
|
||||
document.getElementById('option' + id).src = img_plus;
|
||||
dlm.style.display = 'none';
|
||||
}
|
||||
if (document.getElementById) {
|
||||
dlm = document.getElementById(id);
|
||||
if (dlm.style.display == 'none') {
|
||||
document.getElementById('option' + id).src = img_minus;
|
||||
dlm.style.display = '';
|
||||
} else {
|
||||
document.getElementById('option' + id).src = img_plus;
|
||||
dlm.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var state='';
|
||||
function showConfigAll(count) {
|
||||
if (document.getElementById) {
|
||||
for (i = 1; i <= count; i++) {
|
||||
document.getElementById('el' + i).style.display = state;
|
||||
document.getElementById('optionel' + i).src = (state == '' ? img_minus : img_plus);
|
||||
}
|
||||
|
||||
if (state == '') {
|
||||
document.getElementById('optionall').src = img_minus;
|
||||
state = 'none';
|
||||
} else {
|
||||
document.getElementById('optionall').src = img_plus;
|
||||
state = '';
|
||||
}
|
||||
var state='';
|
||||
if (document.getElementById) {
|
||||
for (i = 1; i <= count; i++) {
|
||||
document.getElementById('el' + i).style.display = state;
|
||||
document.getElementById('optionel' + i).src = (state == '' ? img_minus : img_plus);
|
||||
}
|
||||
|
||||
if (state == '') {
|
||||
document.getElementById('optionall').src = img_minus;
|
||||
state = 'none';
|
||||
} else {
|
||||
document.getElementById('optionall').src = img_plus;
|
||||
state = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function chkAll(frm, arr, mark) {
|
||||
@@ -53,3 +53,13 @@ function chkAll(frm, arr, mark) {
|
||||
}
|
||||
}
|
||||
|
||||
function invertSelection() {
|
||||
var f = document.formMultiDelete;
|
||||
for (var i = 0; i < f.elements.length; i++) {
|
||||
if (f.elements[i].type == 'checkbox') {
|
||||
f.elements[i].checked = !(f.elements[i].checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user