[interchange-cvs] interchange - heins modified 2 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Thu Sep 12 11:57:01 2002


User:      heins
Date:      2002-09-12 15:56:33 GMT
Modified:  dist/lib/UI Primitive.pm
Modified:  scripts  interchange.PL
Log:
* Remove unused code from distribution.

Revision  Changes    Path
2.20      +6 -73     interchange/dist/lib/UI/Primitive.pm


rev 2.20, prev_rev 2.19
Index: Primitive.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/dist/lib/UI/Primitive.pm,v
retrieving revision 2.19
retrieving revision 2.20
diff -u -r2.19 -r2.20
--- Primitive.pm	18 Aug 2002 15:11:32 -0000	2.19
+++ Primitive.pm	12 Sep 2002 15:56:32 -0000	2.20
@@ -1,6 +1,6 @@
 # UI::Primitive - Interchange configuration manager primitives
=20
-# $Id: Primitive.pm,v 2.19 2002/08/18 15:11:32 mheins Exp $
+# $Id: Primitive.pm,v 2.20 2002/09/12 15:56:32 mheins Exp $
=20
 # Copyright (C) 1998-2002 Red Hat, Inc. <interchange@redhat.com>
=20
@@ -25,7 +25,7 @@
=20
 package UI::Primitive;
=20
-$VERSION =3D substr(q$Revision: 2.19 $, 10);
+$VERSION =3D substr(q$Revision: 2.20 $, 10);
=20
 $DEBUG =3D 0;
=20
@@ -95,76 +95,6 @@
 my %wrap_dest;
 my $compdb;
=20
-sub ui_wrap {
-	my $path =3D shift;
-	if($CGI::values{ui_destination}) {
-		my $sub =3D $wrap_dest{$CGI::values{ui_destination}} || return 1;
-		return $sub->($path);
-	}
-	$Vend::Cfg->{VendURL} .=3D '/ui_wrap';
-	$UI::Editing =3D \&resolve_var;
-	$compdb =3D ::database_exists_ref($::Variable->{UI_COMPONENT_TABLE} ||=3D=
 'component');
-	$path =3D~ s:([^/]+)::;
-	$Vend::RedoAction =3D 1;
-	my $snoop =3D $1;
-	return $snoop;
-}
-
-sub wrap_edit {
-	package Vend::Interpolate;
-	my $name =3D shift;
-#::logGlobal("entering wrap_edit $name");
-	my $ref;
-	if ($compdb->record_exists($name)) {
-		$ref =3D $compdb->row_hash($name);
-	}
-	else {
-		return $::Variable->{$name} if ! $::Variable->{$name};
-		$ref =3D { variable =3D> $::Variable->{$name} };
-	}
-	if ($ref->{variable} =3D~ s/^(\s*\[)include(\s+)/$1 . 'file' . $2/e) {
-		$ref->{variable} =3D ::interpolate_html($ref->{variable});
-	}
-	my $edit_link;
-	my $url =3D $Vend::Cfg->{VendURL};
-	$url =3D~ s!/ui_wrap$!$::Variable->{UI_BASE} || $Global::Variable->{UI_BA=
SE} || 'admin'!e;
-	$url .=3D "/";
-	if(not $edit_link =3D $::Variable->{UI_EDIT_LINK}) {
-		my $url =3D Vend::Interpolate::tag_area(
-						"$::Variable->{UI_BASE}/compedit",
-						$name,
-						);
-		$url =3D~ s:/ui_wrap/:/:;
-		$edit_link =3D <<EOF;
-<A HREF=3D"$url" target=3D"_blank"><u>edit</u></A>
-EOF
-		chop $edit_link;
-	}
-	my $out =3D <<EOF;
-[calc] \$C_stack =3D [] unless \$C_stack;
-		push \@\$C_stack, \$Scratch->{ui_component} || '';
-		\$Scratch->{ui_component} =3D q{$name}; return; [/calc]
-EOF
-	chop $out;
-
-	for( qw/preedit preamble variable postamble postedit/ ) {
-		$out .=3D $ref->{$_};
-	}
-	$out .=3D qq{[calc] \$Scratch->{ui_component} =3D pop \@\$C_stack; return=
; [/calc]};
-	$out =3D~ s:\[comment\]\s*\$EDIT_LINK\$\s*\[/comment\]:$edit_link:;
-#::logGlobal("returning wrap_edit $out");
-	return $out;
-}
-
-sub resolve_var {
-	my ($name, $ref) =3D @_;
-	if ($compdb) {
-		return wrap_edit($name);
-	}
-	return $ref->{$name} if $ref and defined $ref->{$name};
-	return $::Variable->{$name};
-}
-
 sub ui_acl_enabled {
 	my $try =3D shift;
 	my $table;
@@ -518,8 +448,10 @@
 	my ($keep, $suf, $base) =3D @_;
 	$suf =3D $Vend::Cfg->{StaticSuffix} if ! $suf;
 	$base =3D Vend::Util::catfile($Vend::Cfg->{VendRoot}, $base) if $base;
-	$base =3D $Vend::Cfg->{PageDir} if ! $base;
+	$base ||=3D $Vend::Cfg->{PageDir};
 	my @names;
+	$suf =3D quotemeta($suf);
+#::logDebug("Finding, ext=3D$suf base=3D$base");
 	my $wanted =3D sub {
 					return undef unless -f $_;
 					return undef unless /$suf$/;
@@ -529,6 +461,7 @@
 					push(@names, $n);
 				};
 	find($wanted, $base);
+#::logDebug("Found files: " . join (",", @names));
 	return sort @names;
 }
=20



2.58      +4 -15     interchange/scripts/interchange.PL


rev 2.58, prev_rev 2.57
Index: interchange.PL
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/scripts/interchange.PL,v
retrieving revision 2.57
retrieving revision 2.58
diff -u -r2.57 -r2.58
--- interchange.PL	12 Sep 2002 05:33:29 -0000	2.57
+++ interchange.PL	12 Sep 2002 15:56:32 -0000	2.58
@@ -3,7 +3,7 @@
 #
 # Interchange version 4.9.3
 #
-# $Id: interchange.PL,v 2.57 2002/09/12 05:33:29 mheins Exp $
+# $Id: interchange.PL,v 2.58 2002/09/12 15:56:32 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. and others.
 # http://www.icdevgroup.org/
@@ -1902,7 +1902,6 @@
=20
 my %action =3D (
     process	=3D> \&do_process,
-	ui_wrap =3D> \&UI::Primitive::ui_wrap,
 	ui		=3D> sub {=20
 					&UI::Primitive::ui_acl_global();
 					&do_process(@_);
@@ -2457,19 +2456,9 @@
 		$CGI::values{mv_todo} =3D $CGI::values{mv_action}
 			if ! defined $CGI::values{mv_todo}
 			and ! defined $CGI::values{mv_doit};
-		if($path[0] eq 'ui_wrap') {
-			$Vend::Action =3D 'ui_wrap';
-			delete $CGI::values{mv_action};
-			shift(@path);
-			$CGI::values{mv_nextpage} =3D $path[0]
-				if ! defined $CGI::values{mv_nextpage};
-			$path[0] =3D "process/$path[0]";
-		}
-		else {
-			$Vend::Action =3D 'process';
-			$CGI::values{mv_nextpage} =3D $Vend::FinalPath
-				if ! defined $CGI::values{mv_nextpage};
-		}
+		$Vend::Action =3D 'process';
+		$CGI::values{mv_nextpage} =3D $Vend::FinalPath
+			if ! defined $CGI::values{mv_nextpage};
 	}
 	else {
 		$Vend::Action =3D shift @path;