diff options
author | Adrian Lang <lang@cosmocode.de> | 2010-02-04 14:50:10 +0100 |
---|---|---|
committer | Adrian Lang <lang@cosmocode.de> | 2010-02-04 15:37:17 +0100 |
commit | 90df9a4d69a2e467433b419b94fe799d11590539 (patch) | |
tree | be212d380d1aafd710370d5c12df0e71b6fdfbac /inc/html.php | |
parent | 1807fcf5084f3bda9cef9580a624b9afed38b559 (diff) | |
download | rpg-90df9a4d69a2e467433b419b94fe799d11590539.tar.gz rpg-90df9a4d69a2e467433b419b94fe799d11590539.tar.bz2 |
Rewrite section edit handling according to #1860
Diffstat (limited to 'inc/html.php')
-rw-r--r-- | inc/html.php | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/inc/html.php b/inc/html.php index 8a215f440..a6ec628cf 100644 --- a/inc/html.php +++ b/inc/html.php @@ -91,22 +91,19 @@ function html_secedit_button($matches){ global $ID; global $INFO; - $edittarget = ($matches[1] === 'SECTION') ? 'plain' : - strtolower($matches[1]); + $nr = $matches[1]; + $target = strtolower($matches[2]); - $section = $matches[3]; - $name = $matches[2]; + $name = $matches[3]; + $section = $matches[4]; - $secedit = ''; - $secedit .= '<div class="secedit editbutton_' . $edittarget . '">'; - $secedit .= html_btn('secedit',$ID,'', + return "<div class='secedit editbutton_$target editbutton_$nr'>" . + html_btn('secedit',$ID,'', array('do' => 'edit', 'lines' => $section, - 'edittarget' => $edittarget, + 'edittarget' => $target, 'rev' => $INFO['lastmod']), - 'post', $name); - $secedit .= '</div>'; - return $secedit; + 'post', $name) . '</div>'; } /** @@ -117,7 +114,7 @@ function html_secedit_button($matches){ function html_secedit($text,$show=true){ global $INFO; - $regexp = '#<!-- ([A-Z]+) (?:"(.*)" )?\[(\d+-\d*)\] -->#'; + $regexp = '#<!-- EDIT(\d+) ([A-Z]+) (?:"([^"]*)" )?\[(\d+-\d*)\] -->#'; if($INFO['writable'] && $show && !$INFO['rev']){ $text = preg_replace_callback($regexp, |