From: garvinhicking Date: Wed, 30 May 2007 20:18:33 +0000 (+0000) Subject: Allow plugins to set different entry templates for the editing form. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=12c46fd769ccd8b9018d8fbf934c22a8f5102d96;p=s9y.git Allow plugins to set different entry templates for the editing form. This can allow a plugin to offer dedicated entry templates depending on the selected category, based on the user or other cool stuff. --- diff --git a/include/functions_entries_admin.inc.php b/include/functions_entries_admin.inc.php index 1d7a187..4fbc12f 100644 --- a/include/functions_entries_admin.inc.php +++ b/include/functions_entries_admin.inc.php @@ -109,14 +109,14 @@ function serendipity_printEntryForm($targetURL, $hiddens = array(), $entry = arr if (in_array($cat['categoryid'], $selected)) { $cat['is_selected'] = true; } - + $cat['depth_pad'] = str_repeat(' ', $cat['depth']); $template_vars['category_options'][] = $cat; $cat_list .= '' . "\n"; } } - + $cat_list .= '' . $n; if (!empty($serendipity['GET']['title'])) { @@ -167,10 +167,13 @@ function serendipity_printEntryForm($targetURL, $hiddens = array(), $entry = arr 'body' => 'serendipity[body]', 'extended' => 'serendipity[extended]' ); + $template_vars['entry_template'] = serendipity_getTemplateFile('admin/entries.tpl', 'serendipityPath'); + $serendipity['smarty']->register_modifier('emit_htmlarea_code', 'serendipity_emit_htmlarea_code'); $serendipity['smarty']->assign('admin_view', 'entryform'); + serendipity_plugin_api::hook_event('backend_entryform_smarty', $template_vars); $serendipity['smarty']->assign_by_ref('entry_vars', $template_vars); - $serendipity['smarty']->display(serendipity_getTemplateFile('admin/entries.tpl', 'serendipityPath')); + $serendipity['smarty']->display($template_vars['entry_template']); return true; }