--- lib/TWiki/Plugins/SectionalEditPlugin.pm.bkp 2006-10-03 16:28:55.133197000 +0200
+++ lib/TWiki/Plugins/SectionalEditPlugin.pm 2006-10-05 10:40:44.353926000 +0200
@@ -53,7 +53,7 @@ sub initPlugin
$leftjustify = ($leftjustify =~ /left/i ? 1 : 0);
$alwayssection = &TWiki::Func::getPreferencesValue( "EDITSECTIONS" ) || 0;
- $sectiondepth = &TWiki::Func::getPreferencesValue( "SECTIONDEPTH" ) || 0;
+ $sectiondepth = &TWiki::Func::getPreferencesValue( "SECTIONDEPTH" ) || 6;
$sectiondepthmin = &TWiki::Func::getPreferencesValue( "SECTIONDEPTHMIN" ) || 0;
$sectiondepthmin = $sectiondepth if ($sectiondepthmin > $sectiondepth);
$sectioninit = ($sectiondepthmin) ? 0 : 1;
@@ -102,10 +102,11 @@ sub editCell
# =========================
sub editableContentCell
{
+ my $pos = shift;
if ($editstyle) {
- return "
\n" . join("", @_) . "
";
+ return "\n" . join("", @_) . "
";
} else {
- return "\n" .
+ return " | \n" .
join("", @_) . " | ";
}
}
@@ -124,11 +125,12 @@ sub contentCell
sub editRow
{
my ($eurl,$pos,@content) = @_;
+ $placement
+ ? unshift( @content, editCell($eurl,$pos) )
+ : push( @content, editCell($eurl,$pos) );
return (($editstyle)?"":"") .
- ($placement
- ? editCell($eurl,$pos) . editableContentCell(@content)
- : editableContentCell(@content) . editCell($eurl,$pos)) .
- (($editstyle)?"":"
");
+ editableContentCell($pos, @content) . "
" .
+ (($editstyle)?"":"");
}
# =========================
@@ -185,7 +187,7 @@ sub preRenderingHandler
my $text = $_[0];
my $sec = "";
my $foundit = ($sectioninit) ? 1 : 0;
- while ( $text =~ m/^---(\+{1,$sectiondepth})[^+]/mg ) {
+ while ( $text =~ m/^---+(\+{1,$sectiondepth})[^+]/mg ) {
# Minor bug in the above regex: A "---+" with no
# title text before either newline or end of topic
# does not render as heading but is treated as
@@ -329,7 +331,7 @@ sub edit
# cannot check for this, as we might have used %TEXTSTART%
my $lastmark = "";
my $lastpos = 0;
- while ( $text =~ m/^---\+{1,$sectiondepth}[^+]/mg ) {
+ while ( $text =~ m/^---+\+{1,$sectiondepth}[^+]/mg ) {
if ( $pos == $theSec ) {
$postxt = $&.$';
$sectxt = $lastmark.substr($text,$lastpos,(pos $text) - length($&) - $lastpos);
--- lib/TWiki/Contrib/EditContrib.pm.bkp 2006-10-03 16:29:44.123093000 +0200
+++ lib/TWiki/Contrib/EditContrib.pm 2006-10-05 10:37:24.834276000 +0200
@@ -336,6 +336,8 @@ sub finalize_edit {
my $cgiAppType = $query->param( 'contenttype' ) ||
$query->param( 'apptype' ) || 'text/html';
+ my $pos = $query->param( 'sec' );
+ $tmpl =~ s/%SECTIONBOX%/sectionbox$pos/go;
$pretxt = TWiki::entityEncode($pretxt);
$pretxt = protect($pretxt);
--- templates/editsection.pattern.tmpl.bkp 2006-10-03 16:30:48.572961000 +0200
+++ templates/editsection.pattern.tmpl 2006-10-05 10:43:28.553642000 +0200
@@ -47,7 +47,7 @@
%TMPL:P{"toolbar"}%%TMPL:P{"syntaxhelp"}%