Issue 106: Invalid HTML output fixed
This commit is contained in:
parent
96934bf2aa
commit
becd504aae
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">
|
<!DOCTYPE html>
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>{$flatpress.title}{$pagetitle}</title>
|
<title>{$flatpress.title}{$pagetitle}</title>
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
//require_once('../init.php');
|
// require_once('../init.php');
|
||||||
//utils_redirect('../admin.php');
|
// utils_redirect('../admin.php');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html>
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>FlatPress</title>
|
<title>FlatPress</title>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
{html_form}
|
{html_form}
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script>
|
||||||
{literal}
|
{literal}
|
||||||
|
|
||||||
function admin_entry_comment_delete() { return confirm({/literal}'{$plang.act_del_confirm}'{literal}); }
|
function admin_entry_comment_delete() { return confirm({/literal}'{$plang.act_del_confirm}'{literal}); }
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
/*
|
/*
|
||||||
* function admin_plugin_adminheader() {
|
* function admin_plugin_adminheader() {
|
||||||
* $f = ADMIN_DIR . '/panels/plugin/admin.plugin.js';
|
* $f = ADMIN_DIR . '/panels/plugin/admin.plugin.js';
|
||||||
* echo '<script src="$f" type="text/javascript"></script>
|
* echo '<script src="$f"></script>
|
||||||
* ';
|
* ';
|
||||||
*
|
*
|
||||||
* }
|
* }
|
||||||
|
@ -1,124 +1,107 @@
|
|||||||
<?php
|
<?php
|
||||||
function admin_widgets_head() {
|
|
||||||
echo '<script type="text/javascript" src="'.BLOG_BASEURL.ADMIN_DIR.'panels/widgets/admin.widgets.js"></script>';
|
|
||||||
}
|
|
||||||
add_action('wp_footer', 'admin_widgets_head');
|
|
||||||
|
|
||||||
|
function admin_widgets_head() {
|
||||||
|
echo '<script src="' . BLOG_BASEURL . ADMIN_DIR . 'panels/widgets/admin.widgets.js"></script>';
|
||||||
|
}
|
||||||
|
add_action('wp_footer', 'admin_widgets_head');
|
||||||
|
|
||||||
class admin_widgets_default extends AdminPanelAction {
|
class admin_widgets_default extends AdminPanelAction {
|
||||||
|
|
||||||
//var $validators = array(array('content', 'content', 'notEmpty', false, false));
|
// var $validators = array(array('content', 'content', 'notEmpty', false, false));
|
||||||
var $events = array('save');
|
var $events = array(
|
||||||
|
'save'
|
||||||
|
);
|
||||||
|
|
||||||
|
function get_widget_lists($wlist, $wpos, &$widget_list, $registered_w, $add_empties) {
|
||||||
|
if (!isset($wlist [$wpos]))
|
||||||
|
return;
|
||||||
|
|
||||||
function get_widget_lists($wlist, $wpos, &$widget_list, $registered_w, $add_empties) {
|
$widget_list [$wpos] = array();
|
||||||
|
|
||||||
if (!isset($wlist[$wpos]))
|
foreach ($wlist [$wpos] as $idx => $wdg) {
|
||||||
return;
|
|
||||||
|
|
||||||
$widget_list[$wpos] = array();
|
$widget_list [$wpos] [$idx] = array();
|
||||||
|
|
||||||
foreach($wlist[$wpos] as $idx => $wdg) {
|
$newid = $wdg; // @list($newid, $params) = explode(":", $wdg);
|
||||||
|
|
||||||
$widget_list[$wpos][$idx] = array();
|
$widget_list [$wpos] [$idx] ['id'] = $newid;
|
||||||
|
|
||||||
$newid = $wdg; # @list($newid, $params) = explode(":", $wdg);
|
if (isset($registered_w [$newid])) {
|
||||||
|
$thiswdg = $registered_w [$newid];
|
||||||
|
|
||||||
$widget_list[$wpos][$idx]['id'] = $newid;
|
$widget_list [$wpos] [$idx] ['name'] = $thiswdg ['name'];
|
||||||
|
|
||||||
|
if ($thiswdg ['nparams'] > 0) {
|
||||||
if (isset($registered_w[$newid])){
|
$widget_list [$wpos] [$idx] ['params'] = $params;
|
||||||
$thiswdg = $registered_w[$newid];
|
|
||||||
|
|
||||||
$widget_list[$wpos][$idx]['name'] = $thiswdg['name'];
|
|
||||||
|
|
||||||
if ($thiswdg['nparams'] > 0) {
|
|
||||||
$widget_list[$wpos][$idx]['params'] = $params;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* here should go the check for
|
|
||||||
* limited parameters: parameters limited to a
|
|
||||||
* particular set would mean using a <select> control
|
|
||||||
* in the template
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$widget_list[$wpos][$idx]['name'] = $newid;
|
|
||||||
$widget_list[$wpos][$idx]['class'] = 'errors';
|
|
||||||
|
|
||||||
$errs = sprintf($lang['admin']['widgets']['errors']['generic'], $newid);
|
|
||||||
$this->smarty->append('warnings', $errs);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* here should go the check for
|
||||||
|
* limited parameters: parameters limited to a
|
||||||
|
* particular set would mean using a <select> control
|
||||||
|
* in the template
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
} else {
|
||||||
|
|
||||||
if (!$widget_list[$wpos] && !$add_empties)
|
global $lang;
|
||||||
unset($widget_list[$wpos]);
|
|
||||||
|
|
||||||
|
$widget_list [$wpos] [$idx] ['name'] = $newid;
|
||||||
|
$widget_list [$wpos] [$idx] ['class'] = 'errors';
|
||||||
|
|
||||||
}
|
$errs = sprintf($lang ['admin'] ['widgets'] ['errors'] ['generic'], $newid);
|
||||||
|
$this->smarty->append('warnings', $errs);
|
||||||
function main() {
|
|
||||||
|
|
||||||
|
|
||||||
lang_load('admin.widgets');
|
|
||||||
# $this->smarty->assign('warnings', admin_widgets_checkall());
|
|
||||||
global $fp_widgets;
|
|
||||||
|
|
||||||
|
|
||||||
$registered_w = get_registered_widgets();
|
|
||||||
$registered_ws = get_registered_widgetsets(null);
|
|
||||||
$this->smarty->assign('fp_registered_widgets', $registered_w);
|
|
||||||
|
|
||||||
|
|
||||||
$wlist = $fp_widgets->getList();
|
|
||||||
$widget_list = array();
|
|
||||||
|
|
||||||
foreach($registered_ws as $wpos) {
|
|
||||||
|
|
||||||
$widget_list[$wpos] = array();
|
|
||||||
|
|
||||||
$this->get_widget_lists($wlist, $wpos, $widget_list, $registered_w, true);
|
|
||||||
|
|
||||||
unset($wlist[$wpos]);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$oldwidget_list = array();
|
|
||||||
foreach($wlist as $wpos => $c){
|
|
||||||
$this->get_widget_lists($wlist, $wpos, $oldwidget_list, $registered_w, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->smarty->assign('widgetlist', $widget_list);
|
|
||||||
$this->smarty->assign('oldwidgetlist', $oldwidget_list);
|
|
||||||
|
|
||||||
|
|
||||||
$conf = io_load_file(CONFIG_DIR . 'widgets.conf.php');
|
|
||||||
|
|
||||||
$this->smarty->assign('pluginconf', $conf);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function onsave() {
|
|
||||||
|
|
||||||
$fp_widgets = isset($_POST['widgets'])? $_POST['widgets'] : array();
|
|
||||||
$success = system_save(CONFIG_DIR . 'widgets.conf.php', compact('fp_widgets'));
|
|
||||||
|
|
||||||
$this->smarty->assign('success', ( $success )? 1 : -1 );
|
|
||||||
|
|
||||||
return PANEL_REDIRECT_CURRENT;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$widget_list [$wpos] && !$add_empties)
|
||||||
|
unset($widget_list [$wpos]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
lang_load('admin.widgets');
|
||||||
|
// $this->smarty->assign('warnings', admin_widgets_checkall());
|
||||||
|
global $fp_widgets;
|
||||||
|
|
||||||
|
$registered_w = get_registered_widgets();
|
||||||
|
$registered_ws = get_registered_widgetsets(null);
|
||||||
|
$this->smarty->assign('fp_registered_widgets', $registered_w);
|
||||||
|
|
||||||
|
$wlist = $fp_widgets->getList();
|
||||||
|
$widget_list = array();
|
||||||
|
|
||||||
|
foreach ($registered_ws as $wpos) {
|
||||||
|
|
||||||
|
$widget_list [$wpos] = array();
|
||||||
|
|
||||||
|
$this->get_widget_lists($wlist, $wpos, $widget_list, $registered_w, true);
|
||||||
|
|
||||||
|
unset($wlist [$wpos]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$oldwidget_list = array();
|
||||||
|
foreach ($wlist as $wpos => $c) {
|
||||||
|
$this->get_widget_lists($wlist, $wpos, $oldwidget_list, $registered_w, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->smarty->assign('widgetlist', $widget_list);
|
||||||
|
$this->smarty->assign('oldwidgetlist', $oldwidget_list);
|
||||||
|
|
||||||
|
$conf = io_load_file(CONFIG_DIR . 'widgets.conf.php');
|
||||||
|
|
||||||
|
$this->smarty->assign('pluginconf', $conf);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onsave() {
|
||||||
|
$fp_widgets = isset($_POST ['widgets']) ? $_POST ['widgets'] : array();
|
||||||
|
$success = system_save(CONFIG_DIR . 'widgets.conf.php', compact('fp_widgets'));
|
||||||
|
|
||||||
|
$this->smarty->assign('success', ($success) ? 1 : -1);
|
||||||
|
|
||||||
|
return PANEL_REDIRECT_CURRENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">
|
<!DOCTYPE html>
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>{$flatpress.title}{$pagetitle}</title>
|
<title>{$flatpress.title}{$pagetitle}</title>
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
</h3>
|
</h3>
|
||||||
{include file=shared:entryadminctrls.tpl}
|
{include file=shared:entryadminctrls.tpl}
|
||||||
|
|
||||||
<span itemprop="articleBody">
|
<div itemprop="articleBody">
|
||||||
{$content|tag:the_content}
|
{$content|tag:the_content}
|
||||||
</span>
|
</div>
|
||||||
|
|
||||||
<ul class="entry-footer">
|
<ul class="entry-footer">
|
||||||
|
|
||||||
|
@ -780,7 +780,7 @@ function plugin_bbcode_toolbar() {
|
|||||||
// $bblang = lang_load('plugin:bbcode');
|
// $bblang = lang_load('plugin:bbcode');
|
||||||
// $_FP_SMARTY->assign('bblang', $bblang);
|
// $_FP_SMARTY->assign('bblang', $bblang);
|
||||||
echo "<!-- bbcode plugin -->\n";
|
echo "<!-- bbcode plugin -->\n";
|
||||||
echo '<script type="text/javascript" src="' . plugin_geturl('bbcode') . 'res/editor.js"></script>' . "\n";
|
echo '<script src="' . plugin_geturl('bbcode') . 'res/editor.js"></script>' . "\n";
|
||||||
echo $_FP_SMARTY->fetch('plugin:bbcode/toolbar');
|
echo $_FP_SMARTY->fetch('plugin:bbcode/toolbar');
|
||||||
echo "<!-- end of bbcode plugin -->\n";
|
echo "<!-- end of bbcode plugin -->\n";
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -13,8 +13,8 @@ function plugin_jquery_head() {
|
|||||||
$pdir = plugin_geturl('jquery');
|
$pdir = plugin_geturl('jquery');
|
||||||
echo '
|
echo '
|
||||||
<!-- start of jsUtils -->
|
<!-- start of jsUtils -->
|
||||||
<script type="text/javascript" src="' . $pdir . 'res/jquery/3.6/jquery-3.6.0.min.js"></script>
|
<script src="' . $pdir . 'res/jquery/3.6/jquery-3.6.0.min.js"></script>
|
||||||
<script type="text/javascript" src="' . $pdir . 'res/jqueryui/1.13.0/jquery-ui.min.js"></script>
|
<script src="' . $pdir . 'res/jqueryui/1.13.0/jquery-ui.min.js"></script>
|
||||||
<!-- end of jsUtils -->';
|
<!-- end of jsUtils -->';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ function plugin_lightbox2_footer() {
|
|||||||
$pdir = plugin_geturl('lightbox2');
|
$pdir = plugin_geturl('lightbox2');
|
||||||
echo '
|
echo '
|
||||||
<!-- start of lightbox -->
|
<!-- start of lightbox -->
|
||||||
<script type="text/javascript" src="' . $pdir . 'res/slimbox2.js"></script>
|
<script src="' . $pdir . 'res/slimbox2.js"></script>
|
||||||
<!-- end of lightbox -->';
|
<!-- end of lightbox -->';
|
||||||
}
|
}
|
||||||
add_action('wp_footer', 'plugin_lightbox2_footer');
|
add_action('wp_footer', 'plugin_lightbox2_footer');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user