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='' ) { if ( $msg ) { $extra = "

{$msg}


"; } return <<
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 Username:
Your Forum Password:
EOF; } // ------------------------------------------------------------ // 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() { return << The upgrader is now ready to complete the upgrade of your {$this->product_name}. Click Start to begin the automatic process!



EOF; } // ------------------------------------------------------------ // Install Page Refresh Template // ------------------------------------------------------------ function install_page_refresh( $output=array() ) { $HTML = << //
    EOF; foreach( $output as $l ) { $HTML .= << $l EOF; } $HTML .= <<
    EOF; return $HTML; } // ------------------------------------------------------------ // Install Progress Screen // ------------------------------------------------------------ function install_progress( $line ) { $HTML = << EOF; foreach( $line as $l ) { $HTML .= << $l EOF; } $HTML .= << EOF; return $HTML; } // ------------------------------------------------------------ // Install Skin Revert // ------------------------------------------------------------ function install_template_skinrevert( $skin_name="" ) { $HTML = <<

    Revert skin changes?


    During upgrades, there are often changes to the skin templates to fix bugs or add new features.

    If you do not revert changes you have made to your skin templates, you will not see the changes we have made, however if you have modified your skin templates reverting the skin changes will cause you to lose the customizations you have made.

    If you have not made many customizations to your skins, it is recommended that you choose to revert your skin changes.

    If you have custom skins installed, or have heavily modified your skin templates, it is recommended that you use the skin difference tool available in your admin control panel after the upgrade is complete to apply new changes to your templates instead.

    Do you wish to revert changes made to '{$skin_name}'?

    EOF; return $HTML; } // ------------------------------------------------------------ // Install Done Screen // ------------------------------------------------------------ function install_done( $url ) { $HTML .= <<   Upgrade complete!

    Congratulations, your {$this->product_name} is now up to date and ready to use! Below are some links you may find useful.


    Useful Links

    EOF; return $HTML; } // ------------------------------------------------------------ // Warning Message Template // ------------------------------------------------------------ function warning( $messages ) { $HTML = <<
    EOF; foreach( $messages as $msg ) { $HTML .= "

    $msg

    "; } $HTML .= <<
    EOF; $this->append( $HTML ); } } ?>