function _moduleContent(&$smarty, $module_name)
{
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    $arrFormDHCP = createFieldForm();
    $oForm = new paloForm($smarty, $arrFormDHCP);
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("CONFIGURATION_UPDATE", _tr("Update"));
    $smarty->assign("SERVICE_START", _tr("Service Start"));
    $smarty->assign("SERVICE_STOP", _tr("Service Stop"));
    $smarty->assign("STATUS", _tr("Status"));
    $smarty->assign("START_RANGE_OF_IPS", _tr("Start range of IPs"));
    $smarty->assign("END_RANGE_OF_IPS", _tr("End range of IPs"));
    $smarty->assign("DNS_1", _tr("DNS 1"));
    $smarty->assign("DNS_2", _tr("DNS 2"));
    $smarty->assign("WINS", _tr("WINS"));
    $smarty->assign("GATEWAY", _tr("Gateway"));
    $smarty->assign("OPTIONAL", _tr("Optional"));
    $smarty->assign("icon", "web/apps/{$module_name}/images/system_network_dhcp_server.png");
    $smarty->assign("OF_1_TO_50000_SECONDS", _tr("Of 1 to 50000 Seconds"));
    if (isset($_POST["in_iniciar"])) {
        $accion = "service_start";
    } else {
        if (isset($_POST["in_finalizar"])) {
            $accion = "service_stop";
        } else {
            if (isset($_POST["in_actualizar_conf_red"])) {
                $accion = "service_update";
            } else {
                $accion = "service_show";
            }
        }
    }
    $content = "";
    switch ($accion) {
        case "service_start":
            $content = serviceStartDHCP($smarty, $module_name, $local_templates_dir, $oForm);
            break;
        case "service_stop":
            $content = serviceStopDHCP($smarty, $module_name, $local_templates_dir, $oForm);
            break;
        case "service_update":
            $content = serviceUpdateDHCP($smarty, $module_name, $local_templates_dir, $oForm);
            break;
        default:
            //service_show
            $content = serviceShowDHCP($smarty, $module_name, $local_templates_dir, $oForm);
            break;
    }
    return $content;
}
Exemple #2
0
function _moduleContent(&$smarty, $module_name)
{
    include_once "libs/paloSantoForm.class.php";
    include_once "libs/paloSantoGrid.class.php";
    include_once "libs/paloSantoValidar.class.php";
    include_once "libs/paloSantoNetwork.class.php";
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoDHCP.class.php";
    $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
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    $arrFormDHCP = createFieldForm($arrLang);
    $oForm = new paloForm($smarty, $arrFormDHCP);
    $smarty->assign("REQUIRED_FIELD", $arrLang["Required field"]);
    $smarty->assign("CONFIGURATION_UPDATE", $arrLang["Update"]);
    $smarty->assign("SERVICE_START", $arrLang["Service Start"]);
    $smarty->assign("SERVICE_STOP", $arrLang["Service Stop"]);
    $smarty->assign("STATUS", $arrLang["Status"]);
    $smarty->assign("START_RANGE_OF_IPS", $arrLang["Start range of IPs"]);
    $smarty->assign("END_RANGE_OF_IPS", $arrLang["End range of IPs"]);
    $smarty->assign("DNS_1", $arrLang["DNS 1"]);
    $smarty->assign("DNS_2", $arrLang["DNS 2"]);
    $smarty->assign("WINS", $arrLang["WINS"]);
    $smarty->assign("GATEWAY", $arrLang["Gateway"]);
    $smarty->assign("OPTIONAL", $arrLang["Optional"]);
    $smarty->assign("icon", "modules/{$module_name}/images/system_network_dhcp_server.png");
    $smarty->assign("OF_1_TO_50000_SECONDS", $arrLang["Of 1 to 50000 Seconds"]);
    if (isset($_POST["in_iniciar"])) {
        $accion = "service_start";
    } else {
        if (isset($_POST["in_finalizar"])) {
            $accion = "service_stop";
        } else {
            if (isset($_POST["in_actualizar_conf_red"])) {
                $accion = "service_update";
            } else {
                $accion = "service_show";
            }
        }
    }
    $content = "";
    switch ($accion) {
        case "service_start":
            $content = serviceStartDHCP($smarty, $module_name, $local_templates_dir, $oForm, $arrLang);
            break;
        case "service_stop":
            $content = serviceStopDHCP($smarty, $module_name, $local_templates_dir, $oForm, $arrLang);
            break;
        case "service_update":
            $content = serviceUpdateDHCP($smarty, $module_name, $local_templates_dir, $oForm, $arrLang);
            break;
        default:
            //service_show
            $content = serviceShowDHCP($smarty, $module_name, $local_templates_dir, $oForm, $arrLang);
            break;
    }
    return $content;
}