Merge branch '2.0' of github.com:s9y/Serendipity into 2.0
This commit is contained in:
commit
9ef4523f47
@ -18,12 +18,6 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
case 'imgedit':
|
||||
$data['case_imgedit'] = true;
|
||||
|
||||
if (!isset($serendipity['eyecandy']) || serendipity_db_bool($serendipity['eyecandy'])) {
|
||||
// what??
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
include_once(S9Y_INCLUDE_PATH . "include/functions_images_crop.inc.php");
|
||||
$media['is_imgedit'] = true;
|
||||
$media['css_imgedit'] = serendipity_getTemplateFile('admin/imgedit.css');
|
||||
|
@ -223,10 +223,7 @@ if (isset($serendipity['GET']['importFrom']) && serendipity_checkFormToken()) {
|
||||
$data['formToken'] = serendipity_setFormToken();
|
||||
$fields = $importer->getInputFields();
|
||||
foreach ($fields as &$field ) {
|
||||
ob_start();
|
||||
serendipity_guessInput($field['type'], 'serendipity[import]['. $field['name'] .']', (isset($serendipity['POST']['import'][$field['name']]) ? $serendipity['POST']['import'][$field['name']] : $field['default']), $field['default']);
|
||||
$field['guessedInput'] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$field['guessedInput'] = serendipity_guessInput($field['type'], 'serendipity[import]['. $field['name'] .']', (isset($serendipity['POST']['import'][$field['name']]) ? $serendipity['POST']['import'][$field['name']] : $field['default']), $field['default']);
|
||||
}
|
||||
$data['fields'] = $fields;
|
||||
$data['notes'] = $importer->getImportNotes();
|
||||
|
@ -4,41 +4,40 @@ if (IN_serendipity !== true) {
|
||||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
global $serendipity;
|
||||
|
||||
$user = serendipity_fetchAuthor($serendipity['authorid']);
|
||||
|
||||
// old s9y variant
|
||||
// $bookmarklet = "javascript:bm=document.selection?document.selection.createRange().text:document.getSelection();void(newwin=open('" . $serendipity['baseURL'] . "serendipity_admin.php?serendipity[adminModule]=entries&serendipity[adminAction]=new&serendipity[title]='+escape(document.title)+'&serendipity[body]='+escape(bm)+'&serendipity[url]='+escape(location.href),'new_log_entry','resizable=yes,scrollbars=yes,width=800,height=600,location=yes,status=yes'));newwin.focus();";
|
||||
|
||||
// non-popup variant
|
||||
$bookmarklet = "javascript:if(navigator.userAgent.indexOf('Safari')%20>=%200){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='" . $serendipity['baseURL'] . "'+encodeURIComponent(document.title)+'encodeURIComponent(Q)+''+encodeURIComponent(location.href)";
|
||||
|
||||
// chrome-compatible, from Oliver Gassner, adapted from TextPattern. Hi guys, keep it up. :-)
|
||||
$bookmarklet = "javascript:var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='" . $serendipity['baseURL'] . "',l=d.location,e=encodeURIComponent,p='serendipity_admin.php?serendipity[adminModule]=entries&serendipity[adminAction]=new&serendipity[title]='+e(d.title)+'&serendipity[body]='+e(s)+'&serendipity[url]='+location.href,u=f+p;a=function(){%20%20if(!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=800,height=800'))%20%20%20%20l.href=u;};if(/Firefox/.test(navigator.userAgent))%20%20setTimeout(a,0);else%20%20a();void(0)";
|
||||
|
||||
$output = array(
|
||||
'welcome' => WELCOME_BACK . ' ' . htmlspecialchars($user[0]['realname']),
|
||||
'show_links' => true,
|
||||
'links_title' => FURTHER_LINKS,
|
||||
'bookmarklet' => $bookmarklet,
|
||||
'links' => array(
|
||||
'<a href="http://www.s9y.org/">' . FURTHER_LINKS_S9Y . '</a>',
|
||||
'<a href="http://www.s9y.org/33.html">' . FURTHER_LINKS_S9Y_DOCS . '</a>',
|
||||
'<a href="http://blog.s9y.org/">' . FURTHER_LINKS_S9Y_BLOG . '</a>',
|
||||
'<a href="http://www.s9y.org/forums/">' . FURTHER_LINKS_S9Y_FORUMS . '</a>',
|
||||
'<a href="http://spartacus.s9y.org/">' . FURTHER_LINKS_S9Y_SPARTACUS . '</a>',
|
||||
'<a href="' . $bookmarklet . '" onclick="alert(\'' . FURTHER_LINKS_S9Y_BOOKMARKLET_DESC . '\'); return false;" title="' . FURTHER_LINKS_S9Y_BOOKMARKLET_DESC . '">' . FURTHER_LINKS_S9Y_BOOKMARKLET . '</a>'
|
||||
),
|
||||
'links_css' => 'further_links',
|
||||
'more' => ''
|
||||
);
|
||||
$data = array();
|
||||
$data['bookmarklet'] = $bookmarklet;
|
||||
$data['username'] = $user[0]['realname'];
|
||||
|
||||
$output = array();
|
||||
serendipity_plugin_api::hook_event('backend_frontpage_display', $output);
|
||||
$data['backend_frontpage_display'] = $output['more'];
|
||||
|
||||
$data['output'] = $output;
|
||||
$data['curVersion'] = serendipity_getCurrentVersion();
|
||||
$data['usedVersion'] = $serendipity['version'];
|
||||
$data['update'] = version_compare($data['usedVersion'], $data['curVersion'], '<');
|
||||
|
||||
if (!is_object($serendipity['smarty'])) {
|
||||
serendipity_smarty_init();
|
||||
}
|
||||
|
||||
$data['comments'] = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPrefix']}comments c
|
||||
LEFT JOIN {$serendipity['dbPrefix']}entries e ON (e.id = c.entry_id)
|
||||
ORDER BY c.id DESC LIMIT 5");
|
||||
|
||||
$data['entries'] = serendipity_fetchEntries(
|
||||
false,
|
||||
false,
|
||||
5,
|
||||
true,
|
||||
false,
|
||||
'timestamp DESC',
|
||||
'e.timestamp >= ' . serendipity_serverOffsetHour()
|
||||
);
|
||||
|
||||
$data['token'] = serendipity_setFormToken('url');
|
||||
|
||||
echo serendipity_smarty_show('admin/overview.inc.tpl', $data);
|
||||
|
||||
|
@ -381,12 +381,8 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
|
||||
$data['save'] = true;
|
||||
$data['timestamp'] = serendipity_strftime('%H:%M:%S');
|
||||
}
|
||||
|
||||
if (!isset($serendipity['eyecandy']) || serendipity_db_bool($serendipity['eyecandy'])) {
|
||||
$data['eyecandy'] = true;
|
||||
}
|
||||
|
||||
serendipity_plugin_api::hook_event("backend_pluginlisting_header" ,$eyecandy);
|
||||
|
||||
serendipity_plugin_api::hook_event("backend_pluginlisting_header", $null);
|
||||
|
||||
ob_start();
|
||||
serendipity_plugin_api::hook_event('backend_plugins_sidebar_header', $serendipity);
|
||||
|
@ -1195,4 +1195,22 @@ function serendipity_verifyFTPChecksums() {
|
||||
|
||||
return $badsums;
|
||||
}
|
||||
|
||||
function serendipity_getCurrentVersion() {
|
||||
$updateURL = 'https://raw.github.com/s9y/Serendipity/master/docs/RELEASE';
|
||||
|
||||
$file = fopen($updateURL, 'r');
|
||||
if (!$file) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (!feof($file)) {
|
||||
$line = fgets($file);
|
||||
|
||||
if (preg_match('/stable:(.+$)/', $line, $match)) {
|
||||
return $match[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* vim: set sts=4 ts=4 sw=4 expandtab : */
|
||||
|
@ -90,14 +90,11 @@ function show_plugins($event_only = false, $sidebars = null)
|
||||
}
|
||||
}
|
||||
|
||||
$eyecandy = !isset($serendipity['eyecandy']) || serendipity_db_bool($serendipity['eyecandy']);
|
||||
|
||||
$data['event_only'] = $event_only;
|
||||
$data['eyecandy'] = $eyecandy;
|
||||
if (!$eyecandy) {
|
||||
$data['eyecandy'] = false;
|
||||
} elseif (!$event_only) {
|
||||
if (!$event_only) {
|
||||
$data['event_only'] = false;
|
||||
$data['is_first'] = $is_first = true;
|
||||
$data['is_first'] = true;
|
||||
}
|
||||
|
||||
$data['serendipity_setFormToken'] = serendipity_setFormToken();
|
||||
|
@ -77,14 +77,6 @@
|
||||
'permission' => 'personalConfiguration',
|
||||
'flags' => array('config')),
|
||||
|
||||
array('var' => 'eyecandy',
|
||||
'title' => PREFERENCE_USE_JS,
|
||||
'description' => PREFERENCE_USE_JS_DESC,
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'permission' => 'personalConfiguration',
|
||||
'flags' => array('config')),
|
||||
|
||||
array('var' => 'mail_comments',
|
||||
'title' => USERCONF_SENDCOMMENTS,
|
||||
'description' => USERCONF_SENDCOMMENTS_DESC,
|
||||
|
@ -1,13 +1,88 @@
|
||||
<h2>{$output.welcome}</h2>
|
||||
{$output.more}
|
||||
{if $output.show_links}
|
||||
<aside class="{$output.links_css}">
|
||||
<h3>{$output.links_title}</h3>
|
||||
<h2>{$CONST.WELCOME_BACK} {$username|escape:"html"}</h2>
|
||||
|
||||
<aside id="further_links">
|
||||
<h3>{$CONST.FURTHER_LINKS}</h3>
|
||||
|
||||
<ul class="plainList">
|
||||
{foreach $output.links AS $link}
|
||||
<li>{$link}</li>
|
||||
{/foreach}
|
||||
<li><a href="http://www.s9y.org/">{$CONST.FURTHER_LINKS_S9Y}</a></li>
|
||||
<li><a href="http://www.s9y.org/33.html">{$CONST.FURTHER_LINKS_S9Y_DOCS}</a></li>
|
||||
<li><a href="http://blog.s9y.org/">{$CONST.FURTHER_LINKS_S9Y_BLOG}</a></li>
|
||||
<li><a href="http://www.s9y.org/forums/">{$CONST.FURTHER_LINKS_S9Y_FORUMS}</a></li>
|
||||
<li><a href="http://spartacus.s9y.org/">{$CONST.FURTHER_LINKS_S9Y_SPARTACUS}</a></li>
|
||||
<li>
|
||||
<a href="{$bookmarklet}" onclick="alert('{$CONST.FURTHER_LINKS_S9Y_BOOKMARKLET_DESC}'); return false;" title="{$CONST.FURTHER_LINKS_S9Y_BOOKMARKLET_DESC}">
|
||||
{$CONST.FURTHER_LINKS_S9Y_BOOKMARKLET}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
|
||||
{$backend_frontpage_display}
|
||||
|
||||
{if $update}
|
||||
<section id="dashboard_update" class="dashboard">
|
||||
<h4>UPDATER_TITLE</h4>
|
||||
New Version available: {$curVersion}
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{if is_array($comments)}
|
||||
<section id="dashboard_comments" class="dashboard">
|
||||
<h4>{$CONST.COMMENTS}</h4>
|
||||
<ol>
|
||||
{foreach $comments as $comment}
|
||||
<li>
|
||||
{$comment.body}
|
||||
<ul class="plainList actions">
|
||||
{if ($comment.status == 'pending') || ($comment.status == 'confirm')}
|
||||
<li><a class="button_link" href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=approve&serendipity[id]={$comment.id}&{$token}" title="{$CONST.APPROVE}"><span class="icon-lock-open"></span><span class="visuallyhidden">{$CONST.APPROVE}</span></a></li>
|
||||
{/if}
|
||||
{if ($comment.status == 'approved')}
|
||||
<li><a class="button_link" href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=pending&serendipity[id]={$comment.id}&{$token}" title="{$CONST.SET_TO_MODERATED}"><span class="icon-lock"></span><span class="visuallyhidden"> {$CONST.SET_TO_MODERATED}</span></a></li>
|
||||
{/if}
|
||||
{if $comment.excerpt}
|
||||
<li><a class="button_link toggle_comment_full" href="#c{$comment.id}_full" title="{$CONST.TOGGLE_ALL}"><span class="icon-plus"></span><span class="visuallyhidden"> {$CONST.TOGGLE_ALL}</span></a></li>
|
||||
{/if}
|
||||
<li><a class="button_link" href="{$comment.entrylink}" title="{$CONST.VIEW}"><span class="icon-eye"></span><span class="visuallyhidden"> {$CONST.VIEW}</span></a></li>
|
||||
<li><a class="button_link" href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=edit&serendipity[id]={$comment.id}&serendipity[entry_id]={$comment.entry_id}&{$token}" title="{$CONST.EDIT}"><span class="icon-edit"></span><span class="visuallyhidden"> {$CONST.EDIT}</span></a></li>
|
||||
<li><a class="button_link comments_delete" href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=delete&serendipity[id]={$comment.id}&serendipity[entry_id]={$comment.entry_id}&{$token}" data-delmsg='{($CONST.COMMENT_DELETE_CONFIRM|sprintf:$comment.id:$comment.author)|escape}' title="{$CONST.DELETE}"><span class="icon-trash"></span><span class="visuallyhidden"> {$CONST.DELETE}</span></a></li>
|
||||
<li><a class="button_link comments_reply" href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=reply&serendipity[id]={$comment.id}&serendipity[entry_id]={$comment.entry_id}&serendipity[noBanner]=true&serendipity[noSidebar]=true&{$token}" title="{$CONST.REPLY}"><span class="icon-chat"></span><span class="visuallyhidden"> {$CONST.REPLY}</span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{if is_array($entries)}
|
||||
<section id="dashboard_entries" class="dashboard">
|
||||
<h4>Future Entries</h4>
|
||||
<ol>
|
||||
{foreach $entries as $entry}
|
||||
<li>
|
||||
{$entry.title}
|
||||
<ul class="plainList actions">
|
||||
<li>
|
||||
<a class="button_link" href="?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=preview&{$token}&serendipity[id]={$entry.id}" title="{$CONST.PREVIEW} #{$entry.id}">
|
||||
<span class="icon-eye"></span>
|
||||
<span class="visuallyhidden">
|
||||
{$CONST.PREVIEW}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="button_link" href="?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]={$entry.id}" title="{$CONST.EDIT} #{$entry.id}">
|
||||
<span class="icon-edit"></span>
|
||||
<span class="visuallyhidden">
|
||||
{$CONST.EDIT}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
|
@ -117,11 +117,9 @@
|
||||
<span class="msg_success"><span class="icon-ok-circled"></span> {$CONST.DONE}:{$CONST.SETTINGS_SAVED_AT|sprintf:"$timestamp"}</span>
|
||||
{/if}
|
||||
<h2>{$CONST.BELOW_IS_A_LIST_OF_INSTALLED_PLUGINS}</h2>
|
||||
{if $eyecandy}
|
||||
<script src="{serendipity_getFile file="admin/js/jquery.autoscroll.js"}"></script>
|
||||
<script src="{serendipity_getFile file="admin/js/jquery.sortable.js"}"></script>
|
||||
<script src="{serendipity_getFile file="admin/js/dragdrop.js"}"></script>
|
||||
{/if}
|
||||
<section id="pluginlist_sidebar">
|
||||
<h3>{$CONST.SIDEBAR_PLUGINS}</h3>
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
{* functions_plugins_admin.inc.php::function_show_plugins() including output of functions_plugins_admin.inc.php::function ownership() *}
|
||||
|
||||
{if !$eyecandy}
|
||||
<form action="?serendipity[adminModule]=plugins" method="post">
|
||||
{elseif !$event_only}
|
||||
|
||||
{if !$event_only}
|
||||
<form action="?serendipity[adminModule]=plugins" method="post">
|
||||
<input id="order" name="serendipity[pluginorder]" type="hidden" value="">
|
||||
{else}
|
||||
@ -65,7 +63,7 @@
|
||||
{/if}
|
||||
|
||||
</li>
|
||||
{($eyecandy) ? '<noscript>' : ''}
|
||||
<noscript>
|
||||
<li class="pluginmanager_place">
|
||||
<select name="serendipity[placement][{$plugin_data['name']}]">
|
||||
{foreach $plugin_data.gopts as $k => $v}
|
||||
@ -93,7 +91,7 @@
|
||||
</a>
|
||||
{/if}
|
||||
</li>
|
||||
{($eyecandy) ? '</noscript>' : ''}
|
||||
</noscript>
|
||||
</ul>
|
||||
</li>
|
||||
{/foreach}
|
||||
|
@ -1555,6 +1555,10 @@ form > .button_link:first-of-type {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#further_links {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* FOOTER
|
||||
----------------------------------------------------------------- */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user