Esempio n. 1
0
 function addToTree($tree)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $path = get_image_path() . "/button/";
     if ($this->cttype !== $this->get__table()) {
         $type = $this->cttype;
         $vtype = "cttype";
     } else {
         if (isset($this->ttype)) {
             $type = $this->ttype;
             $vtype = "ttype";
         } else {
             $type = $this->get__table();
             $vtype = "cttype";
         }
     }
     $img = $ghtml->get_image($path, $this->get__table(), "{$vtype}_v_{$type}", ".gif");
     if (!lxfile_exists("__path_program_htmlbase/{$img}")) {
         $img = $ghtml->get_image($path, $this->get__table(), "show", ".gif");
     }
     $name = $this->getId();
     $imgstr = "<img height=12 width=12 src={$img}> {$name} {$this->__v_message}";
     $showdisabledflag = $gbl->__var_tmp_disabled_flag;
     $disabled = null;
     $checked = null;
     if ($showdisabledflag) {
         $disabled = "disabled";
         if (isset($this->__var_checked) && $this->__var_checked) {
             $checked = "checked";
         } else {
             $checked = null;
         }
     }
     if (!isset($gbl->__tmp_checkbox_value)) {
         $gbl->__tmp_checkbox_value = 0;
     }
     $v = $gbl->__tmp_checkbox_value;
     $gbl->__tmp_checkbox_value++;
     $inputstr = "<input type=checkbox id=treecheckbox{$v} {$checked} {$disabled}  name=treecheckbox{$v} value={$this->getClName()} class=verysmall>";
     $img = null;
     $imgstr = $inputstr . $imgstr;
     $open = 'true';
     $alt = "{$name} is {$this->get__table()}";
     $help = $alt;
     $url = '';
     $pttr = createTreeObject($name, $img, $imgstr, $url, $open, $help, $alt);
     $tree->addToList('tree', $pttr);
     return $pttr;
 }
Esempio n. 2
0
 function print_ressingle($tree, $url, $psuedourl = NULL, $target = NULL, $nameflag = false)
 {
     $this->resolve_int_ext($url, $psuedourl, $target);
     $img_path = get_image_path();
     $buttonpath = $img_path . "/button";
     $iconpath = $img_path . "/button";
     $descr = $this->getActionDetails($url, $psuedourl, $buttonpath, $path, $post, $file, $name, $image, $__t_identity);
     //$img_b = $image;
     //$img_s = str_replace(".gif", "_s.gif", $image);
     $desc = $descr[2];
     if ($nameflag) {
         $desc = $descr[2] . "  ({$__t_identity})";
     }
     $help = $descr[2];
     //$help = $this->get_full_help($descr[3], $login->nname);
     $alt = lx_strip_tags($help);
     $help = $this->get_action_or_display_help($help, "action");
     $open = 'false';
     $name = $file . "_" . $name;
     /// Hack hack... Just not setting frame for navigation menus. THis is not the way to do it. a flag should be passed... is the correct way...
     $imgstr = "<img src={$image} width=14 height=14>{$descr['2']}";
     $ttr = createTreeObject($name, $image, $imgstr, $url, $open, $help, $alt);
     $tree->addToList('tree', $ttr);
     //print("$treename.add($total, $level, '<img src=$image width=14 height=14>$descr[2]', '$url', '', 'mainframe', '$image', '$image', $open, '$help', '$alt');\n");
 }
Esempio n. 3
0
 function updateform($subaction, $param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $progname = $sgbl->__var_program_name;
     $parent = $this->getParentO();
     $tree = createTreeObject('name', null, null, null, null, null, null);
     $gbl->__var_restore_tree = $tree;
     if ($this->rm_username) {
         $this->rm_username = fix_meta_character($this->rm_username);
     }
     switch ($subaction) {
         case "backup":
             if (trim($this->ftp_server)) {
                 $vlist['ftp_server'] = array('M', null);
                 $vlist['rm_username'] = array('M', null);
                 $vlist['rm_password'] = array('M', '***');
                 $vlist['upload_to_ftp'] = array('M', null);
             } else {
                 $vlist['upload_to_ftp'] = array('M', "Ftp Server Not Set");
             }
             if (!$this->getParentO()->checkIfLockedForAction('backup')) {
                 if ($this->backupstage === 'doing') {
                     $this->backupstage = 'program_interrupted';
                 }
             }
             $this->backupstage = fix_nname_to_be_variable($this->backupstage);
             $vlist['backupstage'] = array('M', null);
             $vlist['backup_to_file_f'] = null;
             $parent->backupExtraVar($vlist);
             $vlist['__v_button'] = 'Backup Now';
             return $vlist;
         case "restore_confirm":
             $gbl->__var_tmp_disabled_flag = false;
             if ($param) {
                 $this->backupcheckForConsistency($tree, $param);
             }
             $vlist['__v_childheir'] = '__var_backup';
             $vlist['__v_showcheckboxflag'] = true;
             if ($sgbl->isDebug()) {
                 $vlist['__v_resourcefunc'] = "getBackupChildList";
             } else {
                 $vlist['__v_resourcefunc'] = "getDisplayBackupChildList";
             }
             $vlist['__v_param'] = $param;
             $vlist['__v_button'] = 'Restore Now';
             print_time("restore_process", "Restore Processing Took");
             return $vlist;
         case "restore_confirm_confirm":
             $gbl->__var_tmp_disabled_flag = true;
             print_time("restore_process");
             if ($param) {
                 $this->backupcheckForConsistency($tree, $param);
             }
             $vlist['__v_childheir'] = '__var_backup';
             if ($sgbl->isDebug()) {
                 $vlist['__v_resourcefunc'] = "getBackupChildList";
             } else {
                 $vlist['__v_resourcefunc'] = "getDisplayBackupChildList";
             }
             $vlist['__v_showcheckboxflag'] = true;
             $vlist['__v_param'] = $param;
             $vlist['__v_button'] = 'Restore Now';
             print_time("restore_process", "Restore Processing Took");
             return $vlist;
         case "schedule_conf":
             if ($parent->isSimpleBackup()) {
                 $sched = array('disabled', 'weekly', 'monthly');
             } else {
                 $sched = array('disabled', 'daily', 'weekly', 'monthly');
             }
             if (!$this->backupschedule_type) {
                 $this->backupschedule_type = 'disabled';
             }
             if ($this->priv->isOn('backupschedule_flag')) {
                 $vlist['backupschedule_type'] = array('s', $sched);
             } else {
                 $vlist['backupschedule_type'] = array('M', 'Disabled');
             }
             $vlist['rm_last_number'] = null;
             $vlist['__v_updateall_button'] = array();
             break;
         case "ftp_conf":
             $vlist['ftp_server'] = null;
             $vlist['rm_username'] = null;
             $vlist['rm_password'] = array('m', get_star_password());
             $vlist['rm_directory'] = null;
             $vlist['upload_to_ftp'] = null;
             $vlist['upload_type'] = array('M', 'ftp');
             $vlist['no_local_copy_flag'] = null;
             $vlist['dont_verify_ftp_f'] = null;
             $vlist['__v_updateall_button'] = array();
             break;
         case "restore_from_ftp":
             if (!$this->ftp_server) {
                 $vlist['ftp_server'] = array("M", "Ftp Server is Not Set");
                 break;
             }
             $vlist['ftp_server'] = array('M', null);
             $vlist['rm_username'] = array('M', null);
             $vlist['rm_password'] = array('M', "****");
             $vlist['backup_ftp_file_f'] = null;
             $vlist['__v_next'] = 'restore_confirm';
             $vlist['__v_button'] = 'Continue';
             break;
         case "restore_from_file":
             if (!$this->getParentO()->checkIfLockedForAction('restore')) {
                 if ($this->restorestage === 'doing') {
                     $this->restorestage = 'program_interrupted';
                 }
             }
             $vlist['restorestage'] = array('M', null);
             $vlist['backup_from_file_f'] = array('L', "/");
             $vlist['__v_next'] = 'restore_confirm';
             $vlist['__v_button'] = 'Start Restore Process';
             break;
     }
     return $vlist;
 }