diff options
author | Adrian Lang <lang@cosmocode.de> | 2010-03-22 16:42:58 +0100 |
---|---|---|
committer | Adrian Lang <lang@cosmocode.de> | 2010-03-22 17:01:21 +0100 |
commit | 2ffea8f2f2886a64535d5fd81745a8e5944a24c9 (patch) | |
tree | 1dc76d85180bc2b3043e8abdb8c7208837558fcd /inc | |
parent | 71a1b3ab64b4601b9132e877e3b53c9b85d03429 (diff) | |
download | rpg-2ffea8f2f2886a64535d5fd81745a8e5944a24c9.tar.gz rpg-2ffea8f2f2886a64535d5fd81745a8e5944a24c9.tar.bz2 |
Do not trigger HTML_FORM_SELECTION in some cases
When the page is not editable or the section info is out of date, a custom
editor should not be used.
Diffstat (limited to 'inc')
-rw-r--r-- | inc/html.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/inc/html.php b/inc/html.php index 23eadebc4..86cda46f0 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1121,6 +1121,8 @@ function html_updateprofile(){ * Preprocess edit form data * * @author Andreas Gohr <andi@splitbrain.org> + * + * @triggers HTML_EDITFORM_OUTPUT */ function html_edit(){ global $ID; @@ -1167,10 +1169,16 @@ function html_edit(){ $form->addHidden('suffix', $SUF); $form->addHidden('changecheck', $check); - $data = compact('wr', 'form'); - $data['media_manager'] = true; - $data['intro_locale'] = $include; - trigger_event('HTML_EDIT_FORMSELECTION', $data, 'html_edit_form', true); + $data = array('form' => $form, + 'wr' => $wr, + 'media_manager' => true, + 'intro_locale' => $include); + if ($wr && $RANGE !== '') { + // Only emit event if page is writable and section edit data is valid. + trigger_event('HTML_EDIT_FORMSELECTION', $data, 'html_edit_form', true); + } else { + html_edit_form($data); + } if (isset($data['intro_locale'])) { echo p_locale_xhtml($data['intro_locale']); } @@ -1225,8 +1233,6 @@ function html_edit(){ * Display the default edit form * * Is the default action for HTML_EDIT_FORMSELECTION. - * - * @triggers HTML_EDITFORM_OUTPUT */ function html_edit_form($param) { global $TEXT; |