Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
ReferenceBrowser.php
Go to the documentation of this file.
1 <?php
2 /*-------------------------------------------------------------------------------
3  * Xataface Web Application Framework
4  * Copyright (C) 2005-2008 Web Lite Solutions Corp (shannah@sfu.ca)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *-------------------------------------------------------------------------------
20  */
21 require_once 'HTML/QuickForm.php';
22 
24 
25 
26  var $_table;
29 
30  function ReferenceBrowser( $tablename, $relationshipName){
31  $this->_table =& Dataface_Table::loadTable($tablename);
32  $this->_relationshipName = $relationshipName;
33  $this->_relationship =& $this->_table->getRelationship($relationshipName);
34  $this->HTML_QuickForm('Reference Browser');
35  }
36 
37 
38  function _build(){
39 
40  $type = $this->getRelationshipType($this->_relationshipName);
41  if ( $type != "many_to_many" ){
42  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);
43  }
44 
45  $domainSQL = $this->_table->getRelationshipDomainSQL($this->_relationshipName);
46  $res = mysql_query($domainSQL, $this->_table->db);
47 
48 
49  }
50 
51 
52 }