cleaups
This commit is contained in:
parent
aa12313ee4
commit
d93674485d
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user