예제 #1
0
파일: index.php 프로젝트: hardikk/HNH
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoDHCP_Configuration.class.php";
    load_language_module($module_name);
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    //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'];
    //conexion resource
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //actions
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case "new_dhcpconft":
            $content = viewFormDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $edit = "false");
            break;
        case "view_dhcpconf":
            $content = viewFormDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $edit = "false");
            break;
        case "edit_dhcpconf":
            $content = viewFormDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $edit = "true");
            break;
        case "update_dhacp":
            $content = saveDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, true);
            break;
        case "save_dhcp":
            $content = saveDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "delete_dhcpConf":
            $content = deleteDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        default:
            $content = reportDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}
예제 #2
0
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);
    //conexion resource
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //actions
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case "new_dhcpconft":
            $content = viewFormDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $edit = "false");
            break;
        case "view_dhcpconf":
            $content = viewFormDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $edit = "false");
            break;
        case "edit_dhcpconf":
            $content = viewFormDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $edit = "true");
            break;
        case "update_dhacp":
            $content = saveDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, true);
            break;
        case "save_dhcp":
            $content = saveDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "delete_dhcpConf":
            $content = deleteDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        default:
            $content = reportDHCP_Configuration($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}