<?php


//by Arkadiusz Binder @ 2010-11-10
//function to join needed functions looks them from the expected name and execute it
// it should be called ex.: SEF(AUTHORIZE_USER_BY_AUTH_MODULE('ARG1','ARG2'));


if(!function_exists("SEF")) {

function SEF($ARG1) {
	global $localpath;
	if (!function_exists('DEBUG_S')) include_once('superedit-DEBUG_S.php');

	//DEBUG_S(6,'SEF szuka',$ARG1);
	if (function_exists($ARG1)) return;

	if (isset($_SESSION['INIT_TABLE_FILE'][$ARG1])) {
		eval($_SESSION['INIT_TABLE_FILE'][$ARG1]);
		return;
	}

	if (defined('APP_PATH_ROOT')) {
		if (file_exists(APP_PATH_ROOT . "/superedit-{$ARG1}.php")) {
			require(APP_PATH_ROOT . "/superedit-{$ARG1}.php");
			return;
		}
	}

	if (file_exists("superedit-{$ARG1}.php")) {
		require("superedit-{$ARG1}.php");
	}
	else if (isset($_SESSION['INIT_TABLE_FILE'][$ARG1])) {
		eval($_SESSION['INIT_TABLE_FILE'][$ARG1]);
	}
	else if (file_exists($localpath."billing-".$ARG1.".php")) {
		include("{$localpath}billing-{$ARG1}.php");
	}
	else if (file_exists("{$localpath}{$ARG1}.php")) {
		include("{$localpath}{$ARG1}.php");
	}
}

}

