[ Index ] |
|
Code source de b2evolution 2.1.0-beta |
1 <?php 2 /** 3 * This file implements the Link class, which manages extra links on items. 4 * 5 * This file is part of the evoCore framework - {@link http://evocore.net/} 6 * See also {@link http://sourceforge.net/projects/evocms/}. 7 * 8 * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/} 9 * 10 * {@internal License choice 11 * - If you have received this file as part of a package, please find the license.txt file in 12 * the same folder or the closest folder above for complete license terms. 13 * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/) 14 * then you must choose one of the following licenses before using the file: 15 * - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php 16 * - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php 17 * }} 18 * 19 * {@internal Open Source relicensing agreement: 20 * }} 21 * 22 * @package evocore 23 * 24 * {@internal Below is a list of authors who have contributed to design/coding of this file: }} 25 * @author fplanque: Francois PLANQUE. 26 * 27 * @version $Id: _link.class.php,v 1.2 2007/09/28 02:15:45 fplanque Exp $ 28 */ 29 if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); 30 31 load_class('_core/model/dataobjects/_dataobject.class.php'); 32 33 /** 34 * Item Link 35 * 36 * @package evocore 37 */ 38 class Link extends DataObject 39 { 40 var $ltype_ID = 0; 41 var $Item; 42 var $File; 43 44 45 /** 46 * Constructor 47 * 48 * @param table Database row 49 */ 50 function Link( $db_row = NULL ) 51 { 52 // Call parent constructor: 53 parent::DataObject( 'T_links', 'link_', 'link_ID', 54 'datecreated', 'datemodified', 'creator_user_ID', 'lastedit_user_ID' ); 55 56 if( $db_row != NULL ) 57 { 58 $this->ID = $db_row->link_ID; 59 $this->ltype_ID = $db_row->link_ltype_ID; 60 61 // source of link: 62 $ItemCache = & get_Cache( 'ItemCache' ); 63 $this->Item = & $ItemCache->get_by_ID( $db_row->link_itm_ID ); 64 65 $FileCache = & get_Cache( 'FileCache' ); 66 // fp> do not halt on error. For some reason (ahem bug) a file can disappear and if we fail here then we won't be 67 // able to delete the link 68 $this->File = & $FileCache->get_by_ID( $db_row->link_file_ID, false, false ); 69 } 70 else 71 { // New object: 72 73 } 74 } 75 76 77 /** 78 * Return type of target for this Link: 79 * 80 * @todo incomplete 81 */ 82 function target_type() 83 { 84 if( !is_null($this->File) ) 85 { 86 return 'file'; 87 } 88 89 90 return 'unkown'; 91 } 92 93 } 94 95 /* 96 * $Log: _link.class.php,v $ 97 * Revision 1.2 2007/09/28 02:15:45 fplanque 98 * fix 99 * 100 * Revision 1.1 2007/06/25 11:00:28 fplanque 101 * MODULES (refactored MVC) 102 * 103 * Revision 1.6 2007/04/26 00:11:12 fplanque 104 * (c) 2007 105 * 106 * Revision 1.5 2006/11/24 18:27:24 blueyed 107 * Fixed link to b2evo CVS browsing interface in file docblocks 108 */ 109 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 23:58:50 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |