function _moduleContent(&$smarty, $module_name) { //folder path for custom templates $local_templates_dir = getWebDirModule($module_name); //user credentials $arrCredentiasls = getUserCredentials($_SESSION['elastix_user']); //user permissions global $arrPermission; $arrPermission = getResourceActionsByUser($arrCredentiasls['idUser'], $module_name); if ($arrPermission == false) { header("Location: index.php"); } //actions $action = getAction(); $content = ""; switch ($action) { case "save_new": $content = saveApplets_Admin($module_name); break; default: // view_form $content = showApplets_Admin($module_name); break; } return $content; }
function _moduleContent(&$smarty, $module_name) { //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/{$module_name}/libs/paloSantoAppletAdmin.class.php"; //include file language agree to elastix configuration //if file language not exists, then include language by default (en) $lang = get_language(); $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $lang_file = "modules/{$module_name}/lang/{$lang}.lang"; if (file_exists("{$base_dir}/{$lang_file}")) { include_once "{$lang_file}"; } else { include_once "modules/{$module_name}/lang/en.lang"; } //global variables global $arrConf; global $arrConfModule; global $arrLang; global $arrLangModule; $arrConf = array_merge($arrConf, $arrConfModule); $arrLang = array_merge($arrLang, $arrLangModule); //folder path for custom templates $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; //actions $action = getAction(); $content = ""; switch ($action) { case "save_new": $content = saveApplets_Admin($module_name); break; default: // view_form $content = showApplets_Admin($module_name); break; } return $content; }