1 /* Copyright (C) 2000-2004 Thomas Bopp, Thorsten Hampel, Ludger Merkens
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * $Id: Exit.pike,v 1.1 2008/03/31 13:39:57 exodusd Exp $
19 inherit "/classes/Link";
23 #include <attributes.h>
24 class Exit : public Link{
34 object link = get_link_object();
35 LOG("Deleting link object !");
36 // two connected exits -> remove both
37 if ( objectp(link) && link->get_object_class() & CLASS_EXIT ) {
38 oLinkObject = 0; // set link to null before that !
39 LOG("Deleting connected Link !");
48 mapping do_duplicate(void|mapping vars)
50 if ( !mappingp(vars) )
52 vars->exit_to = oLinkObject;
53 return ::do_duplicate(vars);
57 * Get the destination of this exit. This might be another exit or
60 * @return the destination
65 object destination = get_link_object();
66 if ( objectp(destination) &&
67 destination->get_object_class() & CLASS_EXIT )
68 return destination->get_environment();
73 object get_destination()
79 * This function returns the stat() of this object. This has the
80 * same format as statting a file.
82 * @return status array as in file_stat()
83 * @see get_content_size
87 int creator_id = objectp(get_creator())?get_creator()->get_object_id():0;
90 return ({ 16832, -2, time(), time(), time(),
91 creator_id, creator_id,
92 "httpd/uni-directory" });
97 object destination = get_link_object();
98 // get the icon of the exit depending on the target
99 object icon = destination->query_attribute(OBJ_LINK_ICON);
100 if ( !objectp(icon) )
101 return query_attribute(OBJ_ICON);
105 int get_object_class() { return ::get_object_class() | CLASS_EXIT; }