ipsclass =& $ipsclass; //----------------------------------------- // Grab XML file and check //----------------------------------------- if ( file_exists( INS_ROOT_PATH . 'installfiles/sequence.xml' ) ) { $config = implode( '', file( INS_ROOT_PATH . 'installfiles/sequence.xml' ) ); $xml = new class_xml(); $config = $xml->xml_parse_document( $config ); //----------------------------------------- // Loop through and sort out settings... //----------------------------------------- foreach( $xml->xml_array['installdata']['action'] as $id => $entry ) { $_pages[ $entry['position']['VALUE'] ] = array( 'file' => $entry['file']['VALUE'], 'menu' => $entry['menu']['VALUE'] ); } ksort( $_pages ); foreach( $_pages as $position => $data ) { $this->install_pages[ $data['file'] ] = $data['menu']; } } $this->install_pages['done'] = 'Finish'; /* Set Current Page */ $this->page_current = ( $this->ipsclass->input['p'] ) ? $this->ipsclass->input['p'] : 'login'; if( ! $this->install_pages[$this->page_current] ) { $this->page_current = 'login'; } } /** * install_template::set_title * * Sets the title for the current page * * @var string $title */ function set_title( $title ) { $this->page_title = $title; } /** * install_template::append * * Adds to the main body output * * @var string $add */ function append( $add ) { $this->page_content .= $add; } /** * install_template::output * * Builds page and sends to browser * */ function output() { /* Build Side Bar */ $curr_reached = 0; $this->progress = array(); foreach( $this->install_pages as $key => $page ) { if( $key == $this->page_current ) { $this->progress[] = array( 'step_doing', $page ); $curr_reached = 1; } else if( $curr_reached ) { $this->progress[] = array( 'step_notdone', $page ); } else { $this->progress[] = array( 'step_done', $page ); } } $this->page_template(); } /*************************************************************** * * HTML TEMPLATE FUNCTIONS * **************************************************************/ // ------------------------------------------------------------ // Main Template // ------------------------------------------------------------ function page_template() { echo << IPS Upgrader

 

 

 

Welcome to the IPB Upgrader

{$this->install_pages[$this->page_current]}

    EOF; foreach( $this->progress as $p ) { echo "
  • {$p[1]}
  • "; } echo <<

{$this->product_name} Upgrade

{$this->page_content}

EOF; if( ! $this->hide_next ) { if( $this->next_action == 'disabled' ) { echo << EOF; } else if( $this->in_error == 1 ) { echo << EOF; } else { echo << EOF; } } echo <<
EOF; } // ------------------------------------------------------------ // Login Page Template // ------------------------------------------------------------ function login_page( $msg='' ) { $output = ""; if ( $msg ) { $extra = "

{$msg}


"; } $output .= <<
Welcome to the upgrade routine for {$this->product_name}. This wizard will guide you through the upgrade process.

{$extra}

Verification Required - Please Log In

You must log in with your forums administrative log in details to access the upgrade system.

Your Forum EOF; if( $this->ipsclass->login_type == 'username' ) { $output .= <<
Your Forum Password:
EOF; return $output; } // ------------------------------------------------------------ // Overview Page Template // ------------------------------------------------------------ function overview_page( $current_version, $summary ) { return <<
Welcome to the upgrader for {$this->product_name}. This wizard will guide you through the upgrade process.

Upgrade summary

Current version: $current_version.
This script will: $summary

EOF; } // ------------------------------------------------------------ // EULA Page Template // ------------------------------------------------------------ function eula_page( $eula ) { return << check_eula = function() { if( document.getElementById( 'eula' ).checked == true ) { return true; } else { alert( 'You must agree to the license before continuing' ); return false; } } document.getElementById( 'install-form' ).onsubmit = check_eula; Please read and agree to the End User License Agreement before continuing.

$eula
I agree to the license agreement EOF; } // ------------------------------------------------------------ // Install Page Splash Template // ------------------------------------------------------------ function install_page( $show_manual=0 ) { $output = ""; $output = << The upgrader is now ready to complete the upgrade of your {$this->product_name}. Click Start to begin the automatic process!