This commit is contained in:
Ian 2016-03-19 17:18:11 +01:00
parent aa12313ee4
commit d93674485d
6 changed files with 25 additions and 17 deletions

View File

@ -10,22 +10,26 @@ if (!serendipity_checkPermission('adminTemplates')) {
return; return;
} }
class template_option { class template_option
{
var $config = null; var $config = null;
var $values = null; var $values = null;
var $keys = null; var $keys = null;
function introspect_config_item($item, &$bag) { function introspect_config_item($item, &$bag)
{
foreach($this->config[$item] AS $key => $val) { foreach($this->config[$item] AS $key => $val) {
$bag->add($key, $val); $bag->add($key, $val);
} }
} }
function get_config($item) { function get_config($item)
{
return $this->values[$item]; return $this->values[$item];
} }
function set_config($item, $value) { function set_config($item, $value)
{
global $serendipity; global $serendipity;
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}options serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}options
@ -48,12 +52,14 @@ class template_option {
return true; return true;
} }
function import(&$config) { function import(&$config)
{
foreach($config AS $key => $item) { foreach($config AS $key => $item) {
$this->config[$item['var']] = $item; $this->config[$item['var']] = $item;
$this->keys[$item['var']] = $item['var']; $this->keys[$item['var']] = $item['var'];
} }
} }
} }
$data = array(); $data = array();
@ -187,7 +193,7 @@ foreach ($stack as $theme => $info) {
if (file_exists($serendipity["serendipityPath"] . $serendipity["templatePath"] . $theme . "/preview${backendId}_fullsize.jpg")) { if (file_exists($serendipity["serendipityPath"] . $serendipity["templatePath"] . $theme . "/preview${backendId}_fullsize.jpg")) {
$data["templates"][$theme]["fullsize${backendId}_preview"] = $serendipity["baseURL"] . $serendipity["templatePath"] . $theme . "/preview${backendId}_fullsize.jpg"; $data["templates"][$theme]["fullsize${backendId}_preview"] = $serendipity["baseURL"] . $serendipity["templatePath"] . $theme . "/preview${backendId}_fullsize.jpg";
} elseif (!empty($info["preview{$backendId}_fullsizeURL"])) { // preview{$backendId}_fullsizeURL is not actually set yet in spartacus } elseif (!empty($info["preview{$backendId}_fullsizeURL"])) { // preview{$backendId}_fullsizeURL is not actually set in spartacus yet
if (file_exists($serendipity["serendipityPath"] . "/templates_c/template_cache/". $theme ."{$backendId}.jpg")) { if (file_exists($serendipity["serendipityPath"] . "/templates_c/template_cache/". $theme ."{$backendId}.jpg")) {
$data["templates"][$theme]["fullsize${backendId}_preview"] = $serendipity["baseURL"] . "templates_c/template_cache/". $theme ."{$backendId}.jpg"; $data["templates"][$theme]["fullsize${backendId}_preview"] = $serendipity["baseURL"] . "templates_c/template_cache/". $theme ."{$backendId}.jpg";
} else { } else {

View File

@ -789,11 +789,11 @@ function serendipity_insertComment($id, $commentInfo, $type = 'NORMAL', $source
if (!empty($ca['status'])) { if (!empty($ca['status'])) {
$commentInfo['status'] = $ca['status']; $commentInfo['status'] = $ca['status'];
} }
if ($serendipity['serendipityAuthedUser']) { if ($serendipity['serendipityAuthedUser']) {
$authorReply = true; $authorReply = true;
$authorEmail = $serendipity['serendipityEmail']; $authorEmail = $serendipity['serendipityEmail'];
} }
$title = serendipity_db_escape_string(isset($commentInfo['title']) ? $commentInfo['title'] : ''); $title = serendipity_db_escape_string(isset($commentInfo['title']) ? $commentInfo['title'] : '');
$comments = $commentInfo['comment']; $comments = $commentInfo['comment'];

View File

@ -1202,7 +1202,7 @@ function serendipity_getPermissionNames() {
* *
* This function caches all permission chacks in static function variables to not * This function caches all permission chacks in static function variables to not
* fetch all permissions time and again. * fetch all permissions time and again.
* The permission checks are performed agains the values of each group. If a privilege * The permission checks are performed against the values of each group. If a privilege
* is set in one of the groups the author is a user of, the function returns true. * is set in one of the groups the author is a user of, the function returns true.
* If a privilege is not set, the userlevel of an author is checked to act for backwards-compatibility. * If a privilege is not set, the userlevel of an author is checked to act for backwards-compatibility.
* *
@ -2082,7 +2082,7 @@ function serendipity_setFormToken($type = 'form') {
global $serendipity; global $serendipity;
if ($type == 'form') { if ($type == 'form') {
return '<input type="hidden" name="serendipity[token]" value="' . md5(session_id()) . '" />'; return '<input type="hidden" name="serendipity[token]" value="' . md5(session_id()) . '" />'."\n";
} elseif ($type == 'url') { } elseif ($type == 'url') {
return 'serendipity[token]=' . md5(session_id()); return 'serendipity[token]=' . md5(session_id());
} else { } else {

View File

@ -1226,7 +1226,7 @@ function serendipity_printEntries($entries, $extended = 0, $preview = false, $sm
'is_comment_added' => (isset($serendipity['GET']['csuccess']) && $serendipity['GET']['csuccess'] == 'true' ? true: false), 'is_comment_added' => (isset($serendipity['GET']['csuccess']) && $serendipity['GET']['csuccess'] == 'true' ? true: false),
'is_comment_moderate' => (isset($serendipity['GET']['csuccess']) && $serendipity['GET']['csuccess'] == 'moderate' ? true: false) 'is_comment_moderate' => (isset($serendipity['GET']['csuccess']) && $serendipity['GET']['csuccess'] == 'moderate' ? true: false)
); );
if ($serendipity['serendipityAuthedUser'] === true) { if ($serendipity['serendipityAuthedUser'] === true) {
$userData = array(); $userData = array();
$userData['name'] = $serendipity['realname']; $userData['name'] = $serendipity['realname'];
@ -1235,7 +1235,7 @@ function serendipity_printEntries($entries, $extended = 0, $preview = false, $sm
} else { } else {
$userData = $serendipity['POST']; $userData = $serendipity['POST'];
} }
$serendipity['smarty']->assign($comment_add_data); $serendipity['smarty']->assign($comment_add_data);
serendipity_displayCommentForm( serendipity_displayCommentForm(
$entry['id'], $entry['id'],

View File

@ -446,7 +446,7 @@ function serendipity_plugin_config(&$plugin, &$bag, &$name, &$desc, &$config_nam
$assign_plugin_config($data); $assign_plugin_config($data);
break; break;
case 'hidden': case 'hidden':
$data['ctype'] = 'hidden'; $data['ctype'] = 'hidden';
$data['cbag_value'] = $cbag->get('value'); $data['cbag_value'] = $cbag->get('value');

View File

@ -9,10 +9,12 @@ if (IN_serendipity !== true) {
@serendipity_plugin_api::load_language(dirname(__FILE__)); @serendipity_plugin_api::load_language(dirname(__FILE__));
class serendipity_plugin_recententries extends serendipity_plugin { class serendipity_plugin_recententries extends serendipity_plugin
{
var $title = PLUGIN_RECENTENTRIES_TITLE; var $title = PLUGIN_RECENTENTRIES_TITLE;
function introspect(&$propbag) { function introspect(&$propbag)
{
$this->title = $this->get_config('title', $this->title); $this->title = $this->get_config('title', $this->title);
$propbag->add('name', PLUGIN_RECENTENTRIES_TITLE); $propbag->add('name', PLUGIN_RECENTENTRIES_TITLE);