--- loncom/interface/lonnavmaps.pm 2003/05/27 21:00:23 1.193 +++ loncom/interface/lonnavmaps.pm 2003/05/29 17:39:41 1.194 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.193 2003/05/27 21:00:23 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.194 2003/05/29 17:39:41 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1779,6 +1779,16 @@ object for that resource. This method, o (as in the resource object) is the only proper way to obtain a resource object. +=item * B(symb): + +Based on the symb of the resource, get a resource object for that +resource. This is one of the proper ways to get a resource object. + +=item * B(map_pc): + +Based on the map_pc of the resource, get a resource object for +the given map. This is one of the proper ways to get a resource object. + =cut # The strategy here is to cache the resource objects, and only construct them @@ -1809,6 +1819,14 @@ sub getBySymb { return $self->getById($map->map_pc() . '.' . $id); } +sub getByMapPc { + my $self = shift; + my $map_pc = shift; + my $map_id = $self->{NAV_HASH}->{'map_id_' . $map_pc}; + $map_id = $self->{NAV_HASH}->{'ids_' . $map_id}; + return $self->getById($map_id); +} + =pod =item * B():