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'] ] = $this->ipsclass->txt_convert_charsets( $data['menu'], 'UTF-8' ); } } $this->install_pages['done'] = 'Завершение'; /* 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 << Мастер обновления продуктов Invision Power Services

 

 

 

Инструмент обновления Invision Power Services

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

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

Обновление {$this->product_name}

{$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 .= <<
Вас приветствует мастер обновления {$this->product_name}. Он поможет вам обновить установленный продукт до последней версии.

{$extra}

Обязательная проверка — авторизация

Для работы с мастером вам необходимо войти в систему под учетной записью с правами администратора.

Ваш EOF; if( $this->ipsclass->login_type == 'username' ) { $output .= <<
Ваш пароль:
EOF; return $output; } // ------------------------------------------------------------ // Overview Page Template // ------------------------------------------------------------ function overview_page( $current_version, $summary ) { return <<
Вас приветствует мастер обновления {$this->product_name}. Он поможет вам обновить установленный продукт до последней версии.

Информация

Текущая версия: $current_version.
Мастер осуществит $summary

EOF; } // ------------------------------------------------------------ // EULA Page Template // ------------------------------------------------------------ function eula_page( $eula ) { return << check_eula = function() { if( document.getElementById( 'eula' ).checked == true ) { return true; } else { alert( 'Вы должны принять пользовательское соглашение, прежде чем продолжить обновление' ); return false; } } document.getElementById( 'install-form' ).onsubmit = check_eula; Пожалуйста прочитайте и примите пользовательское соглашение.

$eula
Я принимаю EOF; } // ------------------------------------------------------------ // Install Page Splash Template // ------------------------------------------------------------ function install_page( $show_manual=0 ) { $output = ""; $output = << Мастер собрал все данные и готов начать обновление {$this->product_name}. Нажмите Запустить обновление для запуска автоматического процесса обновления продукта!