Xataface 2.0
Xataface Application Framework
Dataface/ReferenceBrowser.php
Go to the documentation of this file.
00001 <?php
00002 /*-------------------------------------------------------------------------------
00003  * Xataface Web Application Framework
00004  * Copyright (C) 2005-2008 Web Lite Solutions Corp (shannah@sfu.ca)
00005  * 
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  * 
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  *-------------------------------------------------------------------------------
00020  */
00021 require_once 'HTML/QuickForm.php';
00022 
00023 class ReferenceBrowser {
00024 
00025 
00026         var $_table;
00027         var $_relationshipName;
00028         var $_relationship;
00029         
00030         function ReferenceBrowser( $tablename, $relationshipName){
00031                 $this->_table =& Dataface_Table::loadTable($tablename);
00032                 $this->_relationshipName = $relationshipName;
00033                 $this->_relationship =& $this->_table->getRelationship($relationshipName);
00034                 $this->HTML_QuickForm('Reference Browser');
00035         }
00036         
00037         
00038         function _build(){
00039                 
00040                 $type = $this->getRelationshipType($this->_relationshipName);
00041                 if ( $type != "many_to_many" ){
00042                         trigger_error("Attempt to build reference browser widget for relationship '".$this->_relationshipName."' in tablle '".$this->_table->tablename."' where the type is not 'many_to_many'.  The type found was '$type'.", E_USER_ERROR);
00043                 }
00044                 
00045                 $domainSQL = $this->_table->getRelationshipDomainSQL($this->_relationshipName);
00046                 $res = mysql_query($domainSQL, $this->_table->db);
00047                 
00048         
00049         }
00050 
00051 
00052 }
 All Data Structures Namespaces Files Functions Variables Enumerations