Example #1
0
function _moduleContent(&$smarty, $module_name)
{
    //include elastix framework
    include_once "libs/paloSantoGrid.class.php";
    include_once "libs/paloSantoForm.class.php";
    include_once "libs/paloSantoConfig.class.php";
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoRecordings.class.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    /*
        $lang=get_language();
        $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";
    */
    load_language_module($module_name);
    //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'];
    $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*");
    $arrConfig = $pConfig->leer_configuracion(false);
    $dsn_agi_manager['password'] = $arrConfig['AMPMGRPASS']['valor'];
    $dsn_agi_manager['host'] = $arrConfig['AMPDBHOST']['valor'];
    $dsn_agi_manager['user'] = '******';
    $pDBACL = new paloDB($arrConf['elastix_dsn']['acl']);
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case "record":
            $content = new_recording($smarty, $module_name, $local_templates_dir, $arrLang, $dsn_agi_manager, $arrConf, $pDBACL);
            break;
        case "save":
            $content = save_recording($smarty, $module_name, $local_templates_dir, $arrLang, $arrConf, $pDBACL);
            break;
        default:
            $content = form_Recordings($smarty, $module_name, $local_templates_dir, $arrLang, $pDBACL);
            break;
    }
    return $content;
}
Example #2
0
function record($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $dsn_agi_manager, $credentials)
{
    session_commit();
    $status = TRUE;
    $status = new_recording($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $dsn_agi_manager, $credentials);
    $jsonObject = new PaloSantoJSON();
    $msgResponse["record"] = $status;
    $jsonObject->set_status("OK");
    $jsonObject->set_message($msgResponse);
    return $jsonObject->createJSON();
}