Skip to content
Snippets Groups Projects
Commit 12c96ace authored by Adrian Lang's avatar Adrian Lang
Browse files

Send edit target in HTML_EDITFORM_SELECTION

parent 80fcb268
No related branches found
No related tags found
No related merge requests found
...@@ -1173,9 +1173,13 @@ function html_edit(){ ...@@ -1173,9 +1173,13 @@ function html_edit(){
$data = array('form' => $form, $data = array('form' => $form,
'wr' => $wr, 'wr' => $wr,
'media_manager' => true, 'media_manager' => true,
'target' => (isset($_REQUEST['target']) && $wr &&
$RANGE !== '') ? $_REQUEST['target'] : 'section',
'intro_locale' => $include); 'intro_locale' => $include);
if ($wr && $RANGE !== '') {
// Only emit event if page is writable and section edit data is valid. if ($data['target'] !== 'section') {
// Only emit event if page is writable, section edit data is valid and
// edit target is not section.
trigger_event('HTML_EDIT_FORMSELECTION', $data, 'html_edit_form', true); trigger_event('HTML_EDIT_FORMSELECTION', $data, 'html_edit_form', true);
} else { } else {
html_edit_form($data); html_edit_form($data);
...@@ -1237,10 +1241,15 @@ function html_edit(){ ...@@ -1237,10 +1241,15 @@ function html_edit(){
*/ */
function html_edit_form($param) { function html_edit_form($param) {
global $TEXT; global $TEXT;
extract($param);
if ($param['target'] !== 'section') {
msg('No editor for edit target ' . $param['target'] . ' found.', -1);
}
$attr = array('tabindex'=>'1'); $attr = array('tabindex'=>'1');
if (!$wr) $attr['readonly'] = 'readonly'; if (!$param['wr']) $attr['readonly'] = 'readonly';
$form->addElement(form_makeWikiText($TEXT, $attr));
$param['form']->addElement(form_makeWikiText($TEXT, $attr));
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment