summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorAdrian Lang <lang@cosmocode.de>2010-03-23 12:06:41 +0100
committerAdrian Lang <lang@cosmocode.de>2010-03-23 12:08:14 +0100
commit12c96ace70f7a177cc40000f905fa3cab633c04a (patch)
tree19a00597a5e85911c71f4d843dd3551ffada040d /inc/html.php
parent80fcb26867ee7f89b0c1e7db9c9e59dc4c9aeb58 (diff)
downloadrpg-12c96ace70f7a177cc40000f905fa3cab633c04a.tar.gz
rpg-12c96ace70f7a177cc40000f905fa3cab633c04a.tar.bz2
Send edit target in HTML_EDITFORM_SELECTION
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/inc/html.php b/inc/html.php
index e2128f2bc..088f8d3c5 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -1173,9 +1173,13 @@ function html_edit(){
$data = array('form' => $form,
'wr' => $wr,
'media_manager' => true,
+ 'target' => (isset($_REQUEST['target']) && $wr &&
+ $RANGE !== '') ? $_REQUEST['target'] : 'section',
'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);
} else {
html_edit_form($data);
@@ -1237,10 +1241,15 @@ function html_edit(){
*/
function html_edit_form($param) {
global $TEXT;
- extract($param);
+
+ if ($param['target'] !== 'section') {
+ msg('No editor for edit target ' . $param['target'] . ' found.', -1);
+ }
+
$attr = array('tabindex'=>'1');
- if (!$wr) $attr['readonly'] = 'readonly';
- $form->addElement(form_makeWikiText($TEXT, $attr));
+ if (!$param['wr']) $attr['readonly'] = 'readonly';
+
+ $param['form']->addElement(form_makeWikiText($TEXT, $attr));
}
/**