fixed some errors occuring in Apache error log - thx laborix
This commit is contained in:
parent
36b3e50006
commit
1b9022c5f6
@ -28,7 +28,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<input type="text" class="{$class}"
|
<input type="text" class="{$class}"
|
||||||
name="subject" id="subject"
|
name="subject" id="subject"
|
||||||
value="{$subject|default:$smarty.request.subject|wp_specialchars:1}" /><br />
|
value="{$subject|default:{$smarty.request.subject|default:''}|wp_specialchars:1}" /><br />
|
||||||
<input type="hidden" name="timestamp" value="{$date}" />
|
<input type="hidden" name="timestamp" value="{$date}" />
|
||||||
<input type="hidden" name="entry" value="{$id}" />
|
<input type="hidden" name="entry" value="{$id}" />
|
||||||
</p>
|
</p>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<p>
|
<p>
|
||||||
<textarea name="content" class="{$class}"
|
<textarea name="content" class="{$class}"
|
||||||
id="content" rows="20" cols="74">{$content|default:$smarty.request.content|htmlspecialchars}</textarea><br />
|
id="content" rows="20" cols="74">{$content|default:{$smarty.request.content|default:''}|htmlspecialchars}</textarea><br />
|
||||||
{*here will go a plugin hook*}
|
{*here will go a plugin hook*}
|
||||||
{action hook=simple_edit_form}
|
{action hook=simple_edit_form}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ function draft_getlist() {
|
|||||||
static $list = array();
|
static $list = array();
|
||||||
|
|
||||||
if (!$list) {
|
if (!$list) {
|
||||||
$obj = & draft_init();
|
$obj = &draft_init();
|
||||||
$list = $obj->getList();
|
$list = $obj->getList();
|
||||||
krsort($list);
|
krsort($list);
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ function draft_save(&$entry, $id = null, $update_index = false, $update_date = f
|
|||||||
fs_delete($ed . EXT);
|
fs_delete($ed . EXT);
|
||||||
|
|
||||||
// remove from normal flow
|
// remove from normal flow
|
||||||
$o = & entry_init();
|
$o = &entry_init();
|
||||||
$o->delete($id, null);
|
$o->delete($id, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -177,7 +177,7 @@ function smarty_block_draft($params, $content, &$smarty, &$repeat) {
|
|||||||
'version' => '',
|
'version' => '',
|
||||||
'id' => ''
|
'id' => ''
|
||||||
));
|
));
|
||||||
$arr = & $smarty->getTemplateVars('draft_list');
|
$arr = $smarty->getTemplateVars('draft_list');
|
||||||
|
|
||||||
$id = $subject = null;
|
$id = $subject = null;
|
||||||
if ($arr) {
|
if ($arr) {
|
||||||
|
@ -1,126 +1,110 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
function lang_load($postfix = null) {
|
||||||
|
global $fp_config;
|
||||||
|
|
||||||
function lang_load($postfix=null) {
|
$pluginpath = '';
|
||||||
global $fp_config;
|
|
||||||
|
// checks if we already loaded this lang file
|
||||||
$pluginpath='';
|
$old_lang = &$GLOBALS ['lang'];
|
||||||
|
|
||||||
// checks if we already loaded this lang file
|
if (!$old_lang)
|
||||||
$vals = explode('.', $postfix); // my.file.name ---> my, file, name
|
$old_lang = array();
|
||||||
$old_lang =& $GLOBALS['lang'];
|
|
||||||
|
if ($postfix) {
|
||||||
if (!$old_lang)
|
|
||||||
$old_lang = array();
|
if (strpos($postfix, 'plugin:') === 0) {
|
||||||
|
$pluginpath = substr($postfix, 7);
|
||||||
if ($postfix) {
|
|
||||||
|
|
||||||
if (strpos($postfix, 'plugin:')===0) {
|
|
||||||
$pluginpath = substr($postfix, 7);
|
|
||||||
}
|
|
||||||
|
|
||||||
$file = "lang.$postfix.php";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$postfix='default';
|
|
||||||
$file = "lang.default.php";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$fpath=LANG_DIR."{$fp_config['locale']['lang']}/$file";
|
|
||||||
$fallback=LANG_DIR.LANG_DEFAULT."/$file";
|
|
||||||
|
|
||||||
|
|
||||||
$path = '';
|
|
||||||
$plugin=$pluginpath;
|
|
||||||
|
|
||||||
|
|
||||||
if ($pluginpath) {
|
|
||||||
if (($n = strpos($pluginpath, '/'))!==false) {
|
|
||||||
$plugin = substr($plugin, 0, $n-1);
|
|
||||||
$path = substr($plugin, $n+1);
|
|
||||||
$path = str_replace('/', '.', $path);
|
|
||||||
}
|
|
||||||
|
|
||||||
$dir = plugin_getdir($plugin);
|
|
||||||
|
|
||||||
$fpath = $dir . "lang/lang.{$fp_config['locale']['lang']}{$path}.php";
|
|
||||||
$fallback = $dir . "lang/lang.".LANG_DEFAULT."{$path}.php";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!file_exists($fpath)) {
|
|
||||||
/* if file does not exist, we fall back on English */
|
|
||||||
if (!file_exists($fallback)) {
|
|
||||||
trigger_error("No suitable language file was found <b>$postfix</b>", E_USER_WARNING);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$fpath = $fallback;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* load $lang from file */
|
$file = "lang.$postfix.php";
|
||||||
|
} else {
|
||||||
/*
|
|
||||||
* utf encoded files may output whitespaces known as BOM, we must
|
$postfix = 'default';
|
||||||
* capture this chars
|
$file = "lang.default.php";
|
||||||
*/
|
}
|
||||||
|
|
||||||
ob_start();
|
$fpath = LANG_DIR . "{$fp_config['locale']['lang']}/$file";
|
||||||
|
$fallback = LANG_DIR . LANG_DEFAULT . "/$file";
|
||||||
include_once ($fpath);
|
|
||||||
|
$path = '';
|
||||||
|
$plugin = $pluginpath;
|
||||||
if (!isset($lang)){
|
|
||||||
return $GLOBALS['lang'];
|
if ($pluginpath) {
|
||||||
|
if (($n = strpos($pluginpath, '/')) !== false) {
|
||||||
|
$plugin = substr($plugin, 0, $n - 1);
|
||||||
|
$path = substr($plugin, $n + 1);
|
||||||
|
$path = str_replace('/', '.', $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ob_end_clean();
|
|
||||||
|
|
||||||
|
|
||||||
$GLOBALS['lang'] = array_merge_recursive($lang, $old_lang);
|
|
||||||
|
|
||||||
return $GLOBALS['lang'];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function lang_getconf($id) {
|
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$fpath=LANG_DIR."$id/lang.conf.php";
|
$dir = plugin_getdir($plugin);
|
||||||
if (file_exists($fpath)) {
|
|
||||||
include ($fpath);
|
$fpath = $dir . "lang/lang.{$fp_config['locale']['lang']}{$path}.php";
|
||||||
return $langconf;
|
$fallback = $dir . "lang/lang." . LANG_DEFAULT . "{$path}.php";
|
||||||
} else
|
|
||||||
trigger_error("Error loading config for language \"$file\"", E_USER_WARNING);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!file_exists($fpath)) {
|
||||||
|
/* if file does not exist, we fall back on English */
|
||||||
class lang_indexer extends fs_filelister {
|
if (!file_exists($fallback)) {
|
||||||
|
trigger_error("No suitable language file was found <b>$postfix</b>", E_USER_WARNING);
|
||||||
var $_directory=LANG_DIR;
|
return;
|
||||||
|
|
||||||
function _checkFile($directory, $file) {
|
|
||||||
|
|
||||||
if (is_dir("$directory/$file")) {
|
|
||||||
if (!preg_match('![a-z]{2}-[a-z]{2}!', $file)) return 0;
|
|
||||||
$this->_list[$file] = lang_getconf($file);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$fpath = $fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
function lang_list() {
|
/* load $lang from file */
|
||||||
$obj = new lang_indexer();
|
|
||||||
return $obj->getList();
|
/*
|
||||||
|
* utf encoded files may output whitespaces known as BOM, we must
|
||||||
|
* capture this chars
|
||||||
|
*/
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
include_once ($fpath);
|
||||||
|
|
||||||
|
if (!isset($lang)) {
|
||||||
|
return $GLOBALS ['lang'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ob_end_clean();
|
||||||
|
|
||||||
|
$GLOBALS ['lang'] = array_merge_recursive($lang, $old_lang);
|
||||||
|
|
||||||
|
return $GLOBALS ['lang'];
|
||||||
|
}
|
||||||
|
|
||||||
|
function lang_getconf($id) {
|
||||||
|
global $lang;
|
||||||
|
|
||||||
|
$fpath = LANG_DIR . "$id/lang.conf.php";
|
||||||
|
if (file_exists($fpath)) {
|
||||||
|
include ($fpath);
|
||||||
|
return $langconf;
|
||||||
|
} else
|
||||||
|
trigger_error("Error loading config for language \"$file\"", E_USER_WARNING);
|
||||||
|
}
|
||||||
|
|
||||||
|
class lang_indexer extends fs_filelister {
|
||||||
|
|
||||||
|
var $_directory = LANG_DIR;
|
||||||
|
|
||||||
|
function _checkFile($directory, $file) {
|
||||||
|
if (is_dir("$directory/$file")) {
|
||||||
|
if (!preg_match('![a-z]{2}-[a-z]{2}!', $file))
|
||||||
|
return 0;
|
||||||
|
$this->_list [$file] = lang_getconf($file);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function lang_list() {
|
||||||
|
$obj = new lang_indexer();
|
||||||
|
return $obj->getList();
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user