<?php
if(!isset($FIFORMS_CONFIG))
{
die('No Configuration found. Did you perhaps call an include file' .
' directly instead of calling it as part of the FiForms' .
' application?');
}
$FIFORMS_CONFIG['AVAILABLE_APPS'] = array();
$dir = dirname(__FILE__)."/";
if(array_key_exists('app',$_GET))
{
if(file_exists($dir.$_GET['app']."/appreg.php"))
{
include_once($dir.$_GET['app']."/appreg.php");
}
else if(file_exists($dir.$_GET['app']."/appinfo.xml"))
{
FIFORMS_REGISTER_XML($dir.$_GET['app']."/appinfo.xml");
}
}
else
{
if ($handle = opendir($dir))
{
while (($file = readdir($handle)) !== false)
{
if(filetype($dir.$file) == "dir")
{
if(file_exists($dir.$file."/appreg.php"))
{
include_once($dir.$file."/appreg.php");
}
else if(file_exists($dir.$file."/appinfo.xml"))
{
FIFORMS_REGISTER_XML($dir.$file."/appinfo.xml");
}
}
}
closedir($handle);
}
}
?>