From: Chris W. <la...@us...> - 2005-03-11 05:37:43
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_page/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv959/OpenInteract2 Modified Files: Page.pm Log Message: OIN-87: check to see if a page will overlap with an existing action before saving it (prevents orphaned pages) Index: Page.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_page/OpenInteract2/Page.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Page.pm 5 Oct 2004 03:21:52 -0000 1.12 --- Page.pm 11 Mar 2005 05:37:31 -0000 1.13 *************** *** 301,304 **** --- 301,313 ---- + sub does_url_exist_as_action { + my ( $self, $url ) = @_; + my ( $action_name ) = OpenInteract2::URL->parse( $url ); + my $action_info = eval { CTX->lookup_action_info( $action_name ) }; + return defined $action_info; + } + + + ######################################## # OBJECT METHODS *************** *** 525,528 **** --- 534,543 ---- directory. + B<does_url_exist_as_action( $url )> + + Returns true if C<$url> references an action, false if not. Called + when creating a new package to check if you're trying to create a page + that can't be reached. + =head2 Object Methods |