[interchange-cvs] interchange - heins modified
dist/lib/UI/ContentEditor.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Thu May 4 16:07:32 EDT 2006
User: heins
Date: 2006-05-04 20:07:32 GMT
Modified: dist/lib/UI ContentEditor.pm
Log:
* Add special not_editable control to prevent editing pages that will
be killed by the content editor.
Revision Changes Path
2.18 +14 -3 interchange/dist/lib/UI/ContentEditor.pm
rev 2.18, prev_rev 2.17
Index: ContentEditor.pm
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/ContentEditor.pm,v
retrieving revision 2.17
retrieving revision 2.18
diff -u -r2.17 -r2.18
--- ContentEditor.pm 8 Nov 2005 18:14:44 -0000 2.17
+++ ContentEditor.pm 4 May 2006 20:07:32 -0000 2.18
@@ -2,7 +2,7 @@
#
# UI::ContentEditor - Interchange page/component edit
#
-# $Id: ContentEditor.pm,v 2.17 2005/11/08 18:14:44 jon Exp $
+# $Id: ContentEditor.pm,v 2.18 2006/05/04 20:07:32 mheins Exp $
#
# Copyright (C) 2002-2005 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -24,7 +24,7 @@
package UI::ContentEditor;
-$VERSION = substr(q$Revision: 2.17 $, 10);
+$VERSION = substr(q$Revision: 2.18 $, 10);
$DEBUG = 0;
use POSIX qw/strftime/;
@@ -647,6 +647,10 @@
$vals->{$2} = $3;
}
+ if($scratches->{not_editable} and $vals->{not_editable}) {
+ return death('controls', "Not editable page");
+ }
+
my $idx;
for($idx = 0; $idx <= $#slots; $idx++) {
next if $slots[$idx] and $slots[$idx]{where};
@@ -2872,7 +2876,14 @@
}
save_store('page', $name, $pref);
- parse_page($pref, $opt);
+
+ ## If returns false then must be error or not editable
+ parse_page($pref, $opt)
+ or do {
+ Vend::Tags->error({ name => 'parse_page', set => "Error parsing page." });
+ return;
+ };
+
publish_page($pref, $opt) if $opt->{new};
#::logDebug("found a template name=$pref->{ui_name} store=$name: " . uneval($pref));
More information about the interchange-cvs
mailing list