diff --git a/admin/admin-inline.tpl b/admin/admin-inline.tpl index 648f24a..926b8e2 100644 --- a/admin/admin-inline.tpl +++ b/admin/admin-inline.tpl @@ -1,4 +1,4 @@ - + {$flatpress.title}{$pagetitle} diff --git a/admin/index.php b/admin/index.php index db0b4f9..eeee52f 100755 --- a/admin/index.php +++ b/admin/index.php @@ -1,10 +1,9 @@ - + FlatPress diff --git a/admin/panels/entry/admin.entry.commentlist.tpl b/admin/panels/entry/admin.entry.commentlist.tpl index 5617af8..cb366af 100755 --- a/admin/panels/entry/admin.entry.commentlist.tpl +++ b/admin/panels/entry/admin.entry.commentlist.tpl @@ -13,7 +13,7 @@ {html_form} - + * echo ' * '; * * } diff --git a/admin/panels/widgets/admin.widgets.default.php b/admin/panels/widgets/admin.widgets.default.php index d3b60cf..5c58d85 100644 --- a/admin/panels/widgets/admin.widgets.default.php +++ b/admin/panels/widgets/admin.widgets.default.php @@ -1,124 +1,107 @@ '; - } - add_action('wp_footer', 'admin_widgets_head'); - - - class admin_widgets_default extends AdminPanelAction { - - //var $validators = array(array('content', 'content', 'notEmpty', false, false)); - var $events = array('save'); - - - function get_widget_lists($wlist, $wpos, &$widget_list, $registered_w, $add_empties) { - - if (!isset($wlist[$wpos])) - return; - - $widget_list[$wpos] = array(); - - foreach($wlist[$wpos] as $idx => $wdg) { - - $widget_list[$wpos][$idx] = array(); - - $newid = $wdg; # @list($newid, $params) = explode(":", $wdg); - - $widget_list[$wpos][$idx]['id'] = $newid; - - - if (isset($registered_w[$newid])){ - $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 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); } - - $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; + } + +} ?> diff --git a/fp-interface/themes/leggero/cpheader.tpl b/fp-interface/themes/leggero/cpheader.tpl index 01d74b1..683353b 100644 --- a/fp-interface/themes/leggero/cpheader.tpl +++ b/fp-interface/themes/leggero/cpheader.tpl @@ -1,4 +1,4 @@ - + {$flatpress.title}{$pagetitle} diff --git a/fp-interface/themes/leggero/entry-default.tpl b/fp-interface/themes/leggero/entry-default.tpl index 10092ab..31430a4 100644 --- a/fp-interface/themes/leggero/entry-default.tpl +++ b/fp-interface/themes/leggero/entry-default.tpl @@ -12,9 +12,9 @@ {include file=shared:entryadminctrls.tpl} - +
{$content|tag:the_content} - +