function _moduleContent(&$smarty, $module_name) { load_language_module($module_name); //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/agent_console/configs/default.conf.php"; // For asterisk AMI credentials global $arrConf; global $arrConfig; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $relative_dir_rich_text = "modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $smarty->assign("relative_dir_rich_text", $relative_dir_rich_text); // Conexión a la base de datos CallCenter y Asterisk (se utiliza root para pruebas) $pDB = new paloDB($cadena_dsn); // $cadena_dsn está ubicado en configs/default.conf.php if ($pDB->connStatus) { return "ERR: failed to connect to database: " . $pDB->errMsg; } // Mostrar pantalla correspondiente $contenidoModulo = ''; $sAction = 'list_agents'; if (isset($_REQUEST['action'])) { $sAction = $_REQUEST['action']; } switch ($sAction) { case 'new_agent': $contenidoModulo = newAgent($pDB, $smarty, $module_name, $local_templates_dir); break; case 'edit_agent': $contenidoModulo = editAgent($pDB, $smarty, $module_name, $local_templates_dir); break; case 'isAdministrator': $contenidoModulo = isAdministrator(); break; case 'existingQueue': $contenidoModulo = existingQueue($pDB); break; case 'list_agents': default: $contenidoModulo = listAgent($pDB, $smarty, $module_name, $local_templates_dir); break; } return $contenidoModulo; }
function _moduleContent(&$smarty, $module_name) { load_language_module($module_name); //include module files include_once "modules/{$module_name}/configs/default.conf.php"; include_once "modules/agent_console/configs/default.conf.php"; // For asterisk AMI credentials global $arrConf; global $arrConfig; //folder path for custom templates $base_dir = dirname($_SERVER['SCRIPT_FILENAME']); $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes'; $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $relative_dir_rich_text = "modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme']; $smarty->assign("relative_dir_rich_text", $relative_dir_rich_text); // Conexión a la base de datos CallCenter $pDB = new paloDB($arrConf['cadena_dsn']); // Mostrar pantalla correspondiente $contenidoModulo = ''; $sAction = 'list_agents'; if (isset($_GET['action'])) { $sAction = $_GET['action']; } switch ($sAction) { case 'new_agent': $contenidoModulo = newAgent($pDB, $smarty, $module_name, $local_templates_dir); break; case 'edit_agent': $contenidoModulo = editAgent($pDB, $smarty, $module_name, $local_templates_dir); break; case 'list_agents': default: $contenidoModulo = listAgent($pDB, $smarty, $module_name, $local_templates_dir); break; } return $contenidoModulo; }