[ Index ] |
|
Code source de b2evolution 2.1.0-beta |
1 <?php 2 /** 3 * This file implements the GenericCategory class. 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 * Parts of this file are copyright (c)2005-2006 by PROGIDISTRI - {@link http://progidistri.com/}. 10 * 11 * {@internal License choice 12 * - If you have received this file as part of a package, please find the license.txt file in 13 * the same folder or the closest folder above for complete license terms. 14 * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/) 15 * then you must choose one of the following licenses before using the file: 16 * - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php 17 * - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php 18 * }} 19 * 20 * {@internal Open Source relicensing agreement: 21 * PROGIDISTRI S.A.S. grants Francois PLANQUE the right to license 22 * PROGIDISTRI S.A.S.'s contributions to this file and the b2evolution project 23 * under any OSI approved OSS license (http://www.opensource.org/licenses/). 24 * }} 25 * 26 * @package evocore 27 * 28 * @author fplanque: Francois PLANQUE. 29 * @author mbruneau: Marc BRUNEAU / PROGIDISTRI 30 * 31 * @version $Id: _genericcategory.class.php,v 1.1 2007/06/25 11:00:15 fplanque Exp $ 32 */ 33 if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); 34 35 36 load_class('generic/model/_genericelement.class.php'); 37 38 39 /** 40 * GenericCategory Class 41 * 42 * @package evocore 43 */ 44 class GenericCategory extends GenericElement 45 { 46 var $parent_ID; 47 /** 48 * To display parent name in form 49 */ 50 var $parent_name; 51 52 /** 53 * Category children list 54 */ 55 var $children = array(); 56 57 /** 58 * Constructor 59 * 60 * @param string Table name 61 * @param string 62 * @param string DB ID name 63 * @param array|NULL Database row 64 */ 65 function GenericCategory( $tablename, $prefix = '', $dbIDname = 'ID', $db_row = NULL ) 66 { 67 global $Debuglog; 68 69 // Call parent constructor: 70 parent::GenericElement( $tablename, $prefix, $dbIDname, $db_row ); 71 72 if( $db_row != NULL ) 73 { 74 $parentIDfield = $prefix.'parent_ID'; 75 $this->parent_ID = $db_row->$parentIDfield; 76 } 77 } 78 79 80 /** 81 * Load data from Request form fields. 82 * 83 * @todo fp> check that we are not creating a loop! 84 * 85 * @return boolean true if loaded data seems valid. 86 */ 87 function load_from_request() 88 { 89 parent::load_from_Request(); 90 91 if( param( $this->dbprefix.'parent_ID', 'integer', -1 ) !== -1 ) 92 { 93 $this->set_from_Request( 'parent_ID' ); 94 } 95 96 return ! param_errors_detected(); 97 } 98 99 100 /** 101 * Set param value 102 * 103 * By default, all values will be considered strings 104 * 105 * @param string parameter name 106 * @param mixed parameter value 107 */ 108 function set( $parname, $parvalue ) 109 { 110 switch( $parname ) 111 { 112 case 'parent_ID': 113 $this->set_param( $parname, 'string', $parvalue, true ); 114 break; 115 116 case 'name': 117 default: 118 $this->set_param( $parname, 'string', $parvalue ); 119 } 120 } 121 122 123 /** 124 * Add a child 125 * @todo dh> "children" is plural..! 126 * @param GenericCategory 127 */ 128 function add_children( & $GenericCategory ) 129 { 130 $this->children[] = & $GenericCategory; 131 } 132 133 } 134 135 136 /* 137 * $Log: _genericcategory.class.php,v $ 138 * Revision 1.1 2007/06/25 11:00:15 fplanque 139 * MODULES (refactored MVC) 140 * 141 * Revision 1.14 2007/04/26 00:11:11 fplanque 142 * (c) 2007 143 * 144 * Revision 1.13 2006/12/09 17:59:33 fplanque 145 * started "moving chapters accross blogs" feature 146 * 147 * Revision 1.12 2006/11/24 18:27:24 blueyed 148 * Fixed link to b2evo CVS browsing interface in file docblocks 149 * 150 * Revision 1.11 2006/11/22 20:45:36 blueyed 151 * doc/todo 152 153 */ 154 ?>
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 |
![]() |