FormManager->Type->TypeDefinitionList[$Item['Type']];
if($Item['Value'] != '')
{
$Output = ''.$Item['Filter'].'';
} else $Output = '';
return($Output);
}
function OnEdit($Item)
{
$Output = '';
if($this->FormManager->ShowRelation)
{
$URL = '';
if(array_key_exists('OnPreset', $Item))
{
$Preset = call_user_func($Item['OnPreset'], $Item['Values']);
$URL = str_replace('&', '&', '&'.http_build_query($Preset));
}
$Output .= 'FormManager->Root.'/is/?a=addsub&t='.$Table.'&r='.$Item['Name'].'&rt='.$Item['Type'].$URL.'","test");" style="cursor:hand;cursor:pointer"/>';
$Output .= 'FormManager->Root.'/is/?a=select&t='.$Table.'&r='.$Item['Name'].'","test");" style="cursor:hand;cursor:pointer"/>';
}
return($Output);
}
function OnLoad($Item)
{
if($_POST[$Item['Name']] == '') return(NULL);
else return($_POST[$Item['Name']]);
}
function OnLoadDb($Item)
{
if($Item['Value'] == '') return(NULL);
else return($Item['Value']);
}
function OnFilterName($Item)
{
return('`'.$Item['Name'].'_Filter`');
}
function OnFilterNameQuery($Item)
{
$Type = $this->FormManager->Type->TypeDefinitionList[$Item['Type']];
//if($Item['Value'] != '')
//{
if(array_key_exists('View', $Type['Parameters'])) $Table = $Type['Parameters']['View'];
else $Table = $Type['Parameters']['Table'];
$Output = '`'.$Item['Name'].'`, (SELECT '.$Type['Parameters']['Name'].''.
' AS `Name` FROM '.$Table.' WHERE `'.
$Type['Parameters']['Id'].'`=`TX`.`'.$Item['Name'].'`) AS `'.$Item['Name'].'_Filter`';
//} else $Output = '`'.$Item['Name'].'`, `'.$Item['Name'].'` AS `'.$Item['Name'].'_Filter`';
return($Output);
}
}