function _moduleContent(&$smarty, $module_name)
{
    //include elastix framework
    include_once "libs/paloSantoValidar.class.php";
    include_once "libs/misc.lib.php";
    include_once "libs/paloSantoForm.class.php";
    include_once "modules/{$module_name}/libs/paloSantoFTPBackup.class.php";
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    load_language_module($module_name);
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    //conexion resource
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //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'];
    $dir_backup = $arrConf["dir"];
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case 'delete_backup':
            //BOTON DE BORRAR BACKUP "ELIMINAR"
            $content = delete_backup($smarty, $module_name, $local_templates_dir, $dir_backup, $pDB);
            break;
        case 'backup':
            //BOTON "RESPALDAR"
            $content = backup_form($smarty, $local_templates_dir, $module_name);
            break;
        case 'submit_restore':
            //BOTON DE RSTAURAR, lleva a la ventana de seleccion para restaurar
            $content = restore_form($smarty, $local_templates_dir, $dir_backup, $module_name);
            break;
        case 'process_backup':
            $content = process_backup($smarty, $local_templates_dir, $module_name);
            break;
        case 'process_restore':
            $content = process_restore($smarty, $local_templates_dir, $dir_backup, $module_name);
            break;
        case 'download_file':
            $content = downloadBackup($smarty, $module_name, $local_templates_dir, $dir_backup);
            break;
            /******************************* PARA FTP BACKUP ***************************************/
        /******************************* PARA FTP BACKUP ***************************************/
        case "save_new_FTP":
            $content = saveNewFTPBackup($smarty, $module_name, $local_templates_dir, $pDB);
            break;
        case "view_form_FTP":
            $content = viewFormFTPBackup($smarty, $module_name, $local_templates_dir, $pDB);
            break;
        case 'uploadFTPServer':
            $content = file_upload_FTPServer($module_name, $pDB);
            break;
        case 'downloadFTPServer':
            $content = file_download_FTPServer($module_name, $pDB);
            break;
            /***************************************************************************************/
        /***************************************************************************************/
        case "detail":
            $content = viewDetail($smarty, $module_name, $local_templates_dir, $dir_backup);
            break;
            /******************************* PARA BACKUP AUTOMATICO ********************************/
        /******************************* PARA BACKUP AUTOMATICO ********************************/
        case "automatic":
            $content = automatic_backup($smarty, $module_name, $local_templates_dir, $dir_backup, $pDB);
            break;
            /***************************************************************************************/
        /***************************************************************************************/
        default:
            $content = report_backup_restore($smarty, $module_name, $local_templates_dir, $dir_backup, $pDB);
            break;
    }
    return $content;
}
Exemple #2
0
     break;
 case 'del_lang':
 case 'lang':
     translator($option);
     break;
 case 'refresh':
     generateBackuprefresh($cid, $option, $_REQUEST['backup']);
     break;
 case 'generate':
     generateBackup($cid, $option);
     break;
 case 'confirm':
     confirmBackup($option);
     break;
 case 'download':
     downloadBackup($_REQUEST[file]);
     break;
 case 'cron':
     HTML_cloner::Cron();
     break;
 case 'about':
 case 'credits':
     showHelp($option);
     break;
 case 'restore':
     HTML_cloner::Restore($option);
     break;
 case 'cron_delete':
     if (unlink($_CONFIG['multiple_config_dir'] . "/" . $_REQUEST['fconfig'])) {
         $msg = " was deleted";
     } else {
         $_REQUEST['mode'] = "start";
         if ($_CONFIG['enable_db_backup']) {
             goRecurseDatabases();
         }
         //initBackup($_REQUEST['bname']);
         //break;
     }
     generateBackup($cid, $option);
     break;
 case 'confirm':
     deleteXLog();
     confirmBackup($option);
     break;
 case 'download':
     $file = pathinfo($_REQUEST['file']);
     downloadBackup($file['basename']);
     break;
 case 'cron':
     $html->Cron();
     break;
 case 'about':
 case 'credits':
     showHelp($option);
     break;
 case 'restore':
     $html->Restore($option);
     break;
 case 'cron_delete':
     if (unlink($_CONFIG['multiple_config_dir'] . "/" . $_REQUEST['fconfig'])) {
         $msg = " was deleted";
     } else {