[interchange-cvs] interchange - racke modified 3 files
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Mon Nov 3 11:26:14 EST 2003
User: racke
Date: 2003-11-03 16:26:14 GMT
Modified: . WHATSNEW
Modified: dist/lib/UI ContentEditor.pm
Modified: dist/lib/UI/pages/include page_editor
Log:
Fix content editor to actually use the selected template for new pages.
Made code in extract_template a little bit more obvious.
Revision Changes Path
2.161 +2 -0 interchange/WHATSNEW
rev 2.161, prev_rev 2.160
Index: WHATSNEW
===================================================================
RCS file: /anon_cvs/repository/interchange/WHATSNEW,v
retrieving revision 2.160
retrieving revision 2.161
diff -u -r2.160 -r2.161
--- WHATSNEW 3 Nov 2003 14:10:34 -0000 2.160
+++ WHATSNEW 3 Nov 2003 16:26:14 -0000 2.161
@@ -26,6 +26,8 @@
* Force user to enter name of new page/template/component name to avoid server
crashes.
+* Fix content editor to actually use the selected template for new pages.
+
Usertags
--------
2.13 +11 -6 interchange/dist/lib/UI/ContentEditor.pm
rev 2.13, prev_rev 2.12
Index: ContentEditor.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/ContentEditor.pm,v
retrieving revision 2.12
retrieving revision 2.13
diff -u -r2.12 -r2.13
--- ContentEditor.pm 3 Nov 2003 14:42:22 -0000 2.12
+++ ContentEditor.pm 3 Nov 2003 16:26:14 -0000 2.13
@@ -2,7 +2,7 @@
#
# UI::ContentEditor - Interchange page/component edit
#
-# $Id: ContentEditor.pm,v 2.12 2003/11/03 14:42:22 racke Exp $
+# $Id: ContentEditor.pm,v 2.13 2003/11/03 16:26:14 racke Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -24,7 +24,7 @@
package UI::ContentEditor;
-$VERSION = substr(q$Revision: 2.12 $, 10);
+$VERSION = substr(q$Revision: 2.13 $, 10);
$DEBUG = 0;
use POSIX qw/strftime/;
@@ -176,10 +176,15 @@
my $sref = shift;
my $opt = shift || {};
my $tname;
- $sref =~ /\nui_page_template:\s*(\w+)/
- or $sref =~ /\nui_template_name:\s*(\w+)/
- or ( $sref =~ /\@_(\w+)_TOP_\@/ and $tname = lc $1);
- $tname ||= $1;
+
+ if ($sref =~ /\nui_(page_template|template_name):\s*(\w+)/) {
+ $tname = $2;
+ } elsif ($sref =~ /\@_(\w+)_TOP_\@/) {
+ $tname = lc $1;
+ } else {
+ $tname = $opt->{ui_page_template};
+ }
+
#::logDebug("extract_template read template name='$tname'");
my $tdef;
my $tref;
1.12 +1 -1 interchange/dist/lib/UI/pages/include/page_editor
rev 1.12, prev_rev 1.11
Index: page_editor
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/pages/include/page_editor,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- page_editor 3 Nov 2003 15:41:58 -0000 1.11
+++ page_editor 3 Nov 2003 16:26:14 -0000 1.12
@@ -1,4 +1,4 @@
-[content-editor name="[cgi ui_name]" type="page"]
+[content-editor name="[cgi ui_name]" ui_page_template="[cgi ui_page_template]" type="page"]
[pages]
<script language=JavaScript>
More information about the interchange-cvs
mailing list