Example #1
0
function _moduleContent($smarty, $module_name)
{
    include_once "libs/paloSantoFax.class.php";
    include_once "libs/paloSantoForm.class.php";
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.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'];
    // DefiniciĆ³n del formulario
    $smarty->assign("REQUIRED_FIELD", $arrLang["Required field"]);
    $smarty->assign("CANCEL", $arrLang["Cancel"]);
    $smarty->assign("APPLY_CHANGES", $arrLang["Apply changes"]);
    $smarty->assign("SAVE", $arrLang["Save"]);
    $smarty->assign("EDIT", $arrLang["Edit"]);
    $smarty->assign("EDIT_PARAMETERS", $arrLang["Edit Parameters"]);
    $smarty->assign("icon", "/modules/{$module_name}/images/fax_email_template.png");
    $arrFaxConfig = array("remite" => array("LABEL" => $arrLang['Fax From'], "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => array("style" => "width:240px"), "VALIDATION_TYPE" => "email", "EDITABLE" => "si", "VALIDATION_EXTRA_PARAM" => ""), "remitente" => array("LABEL" => $arrLang["Fax From Name"], "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => array("style" => "width:240px"), "VALIDATION_TYPE" => "name", "EDITABLE" => "si", "VALIDATION_EXTRA_PARAM" => ""), "subject" => array("LABEL" => $arrLang["Fax Suject"], "REQUIRED" => "yes", "INPUT_TYPE" => "TEXT", "INPUT_EXTRA_PARAM" => array("style" => "width:240px"), "VALIDATION_TYPE" => "text", "EDITABLE" => "si", "VALIDATION_EXTRA_PARAM" => ""), "content" => array("LABEL" => $arrLang["Fax Content"], "REQUIRED" => "no", "INPUT_TYPE" => "TEXTAREA", "INPUT_EXTRA_PARAM" => "", "VALIDATION_TYPE" => "text", "EDITABLE" => "si", "COLS" => "50", "ROWS" => "4", "VALIDATION_EXTRA_PARAM" => ""));
    $oForm = new paloForm($smarty, $arrFaxConfig);
    $contenidoModulo = "";
    $action = "";
    if (isset($_POST["submit_edit"])) {
        $action = "submit_edit";
    }
    if (isset($_POST["submit_apply_change"])) {
        $action = "submit_apply_change";
    }
    switch ($action) {
        case 'submit_edit':
            $contenidoModulo = editParameterFaxMail($smarty, $module_name, $local_templates_dir, $oForm);
            break;
        case 'submit_apply_change':
            $contenidoModulo = applyChnageParameterFaxMail($smarty, $module_name, $local_templates_dir, $oForm);
            break;
        default:
            $contenidoModulo = listParameterFaxMail($smarty, $module_name, $local_templates_dir, $oForm);
            break;
    }
    return $contenidoModulo;
}
Example #2
0
function _moduleContent($smarty, $module_name)
{
    global $arrConf;
    include_once "libs/paloSantoForm.class.php";
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]);
    //user credentials
    global $arrCredentials;
    $action = getAction();
    switch ($action) {
        case 'save':
            $contenidoModulo = applyChnageParameterFaxMail($smarty, $module_name, $local_templates_dir, $pDB, $arrCredentials);
            break;
        default:
            $contenidoModulo = listParameterFaxMail($smarty, $module_name, $local_templates_dir, $pDB, $arrCredentials);
            break;
    }
    return $contenidoModulo;
}