Example #1
0
 function &getRelationship(&$table)
 {
     if (Dataface_ImportForm::formSubmitted()) {
         if (!isset($_POST['-relationship'])) {
             trigger_error(df_translate('scripts.Dataface.ImportForm.getRelationship.ERROR_RELATIONSHIP_NOT_FOUND', 'Field \'-relationship\' not found in Import Form.') . Dataface_Error::printStackTrace(), E_USER_ERROR);
         }
         $relname = $_POST['-relationship'];
         if (strlen($relname) > 0) {
             $rel =& $table->getRelationship($relname);
             return $rel;
         } else {
             $null = null;
             return $null;
         }
     } else {
         if (!isset($_GET['-relationship'])) {
             $null = null;
             return $null;
         } else {
             $relname = $_GET['-relationship'];
             if (strlen($relname) > 0) {
                 $rel =& $table->getRelationship($relname);
                 return $rel;
             }
         }
     }
     $null = null;
     return $null;
 }