00001 <?php 00002 // --------------------------------------------------------------------------- 00003 // $Id$ 00004 // --------------------------------------------------------------------------- 00005 // DaCMS Content Management System 00006 // Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de 00007 // 00008 // This program is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU General Public License 00010 // as published by the Free Software Foundation; either version 2 00011 // of the License, or (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with this program; if not, write to the Free Software 00020 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00021 // --------------------------------------------------------------------------- 00022 00023 class ObjectFactory 00024 { 00025 function create( $objectid ) 00026 { 00027 $o = new Object( $objectid ); 00028 00029 switch( $o->getType() ) 00030 { 00031 case OR_TYPE_FILE: 00032 $x = new File( $objectid ); 00033 break; 00034 00035 case OR_TYPE_FOLDER: 00036 $x = new Folder( $objectid ); 00037 break; 00038 00039 case OR_TYPE_PAGE: 00040 $x = new Page( $objectid ); 00041 break; 00042 00043 case OR_TYPE_LINK: 00044 $x = new Link( $objectid ); 00045 break; 00046 00047 default: 00048 die( "Unknown Object-Typ: ".$o->getType() ); 00049 debug_backtrace(); 00050 } 00051 00052 $x->load(); 00053 return $x; 00054 } 00055 } 00056 00057 ?>
1.5.8