- md5
- 7552ab7dfd65aada5574400bb1c6d0ad
- sha1
- 91b68d784c83fd44e77a306bdc57ef9d85a31002
- sha256
- 051c9bd8eaa2d928f0d44fa2ddca3578ae6a0ccfdb3c32cf262a37e4fcfa3226
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
<?php
/**
* @version $Id: view.php 14401 2010-01-26 14:10:00Z louis $
* @package Joomla
* @subpackage Installation
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
/**
* @package Joomla
* @subpackage Installation
*/
jimport('joomla.application.component.view');
class JInstallationView extends JView
{
/**
* The installation steps
*
* @var array
* @access protected
* @since 1.5
*/
var $_steps = null;
/**
* The templabe object
*
* @var object
* @access protected
* @since 1.5
*/
var $_template = null;
/**
* Language page
*
* @return boolean True if successful
* @access public
* @since 1.5
*/
function chooseLanguage()
{
$steps =& $this->getSteps();
$model =& $this->getModel();
$lists =& $model->getData('lists');
$tmpl =& $this->getTemplate( 'language.html' );
$steps['lang'] = 'on';
$tmpl->addVars( 'stepbar', $steps, 'step_' );
$tmpl->addRows( 'lang-options', $lists['langs'] );
return $this->display();
}
/**
* Create a template object
*
* @return boolean True if successful
* @access private
* @since 1.5
*/
function _createTemplate( $bodyHtml = null, $mainHtml = 'page.html' )
{
jimport('joomla.template.template');
$this->_template = new JTemplate();
$this->_template->applyInputFilter('ShortModifiers');
// load the wrapper and common templates
$this->_template->setRoot( JPATH_BASE . DS . 'template' . DS. 'tmpl' );
$this->_template->readTemplatesFromFile( $mainHtml );
if ($bodyHtml) {
$this->_template->setAttribute( 'body', 'src', $bodyHtml );
}
}
/**
* The DB Config page
*
* @return boolean True if successful
* @access public
* @since 1.5
*/
function dbConfig()
{
$steps =& $this->getSteps();
$model =& $this->getModel();
$lists =& $model->getData('lists');
$tmpl =& $this->getTemplate( 'dbconfig.html' );
$steps['dbconfig'] = 'on';
$tmpl->addVars( 'stepbar', $steps, 'step_' );
$tmpl->addRows( 'dbtype-options', $lists['dbTypes'] );
return $this->display();
}
/**
* Display the template
*
* @return boolean True if successful
* @access public
* @since 1.5
*/
function display()
{
$model =& $this->getModel();
$tmpl =& $this->getTemplate();
$lang =& JFactory::getLanguage();
$vars =& $model->getVars();
$tmpl->addVar( 'buttons', 'direction', $lang->isRTL() ? 'rtl' : 'ltr');
$tmpl->addVar( 'body', 'lang', $lang->getTag() );
$tmpl->addVars( 'body', $vars, 'var_' );
echo $tmpl->fetch( 'page' );
return true;
}
/**
* Report an error to the user
*
* @return boolean True if successful
* @access public
* @since 1.5
*/
function error()
{
$steps =& $this->getSteps();
$model =& $this->getModel();
$vars =& $model->getVars();
$tmpl =& $this->getTemplate( 'error.html' );
$msg = $model->getError();
$back = $model->getData('back');
$xmsg = $model->getData('errors');
$tmpl->addVars( 'stepbar', $steps, 'step_' );
$tmpl->addVar( 'messages', 'message', $msg );
if ($xmsg) {
$tmpl->addVar( 'xmessages', 'xmessage', $xmsg );
}
$tmpl->addVar( 'buttons', 'back', $back );
$tmpl->addVars( 'body', $vars, 'var_' );
return $this->display();
}
/**
* The the final page
*
* @return boolean True if successful
* @access public
* @since 1.5
*/
function finish()
{
$steps =& $this->getSteps();
$model =& $this->getModel();
$vars =& $model->getVars();
$tmpl =& $this->getTemplate( 'finish.html' );
$buffer = $model->getData('buffer');
$steps['finish'] = 'on';
$tmpl->addVars( 'stepbar', $steps, 'step_' );
if ($buffer) {
$tmpl->addVar( 'configuration-error', 'buffer', $buffer );
}
return $this->display();
}
/**
* Show the FTP config page
*
* @return boolean True if successful
* @access public
* @since 1.5
*/
function ftpConfig()
{
$steps =& $this->getSteps();
$model =& $this->getModel();
$tmpl =& $this->getTemplate( 'ftpconfig.html' );
$steps['ftpconfig'] = 'on';
$tmpl->addVars( 'stepbar', $steps, 'step_' );
return $this->display();
}
/**
* Get the installation steps
*
* @return array
* @access protected
* @since 1.5
*/
function & getSteps()
{
if ( is_null($this->_steps) )
{
$this->_steps = array(
'lang' => 'off',
'preinstall' => 'off',
'license' => 'off',
'dbconfig' => 'off',
'ftpconfig' => 'off',
'mainconfig' => 'off',
'finish' => 'off'
);
}
return $this->_steps;
}
/**
* Get the template object
*
* @param string The name of the body html file
* @return patTemplate
* @access protected
* @since 1.5
*/
function & getTemplate( $bodyHtml = null )
{
static $current;
$change = false;
// Record the current template body
if ( is_null($current) && $bodyHtml)
{
$current = $bodyHtml;
$change = true;
}
// Check if we need to create the body, possibly anew
if ( is_null( $this->_template) || $change )
{
$this->_createTemplate($bodyHtml);
}
return $this->_template;
}
/**
* The license page
*
* @return boolean True if successful
* @access public
* @since 1.5
*/
function license()
{
$steps =& $this->getSteps();
$model =& $this->getModel();
$tmpl =& $this->getTemplate( 'license.html' );
$steps['license'] = 'on';
$tmpl->addVars( 'stepbar', $steps, 'step_' );
return $this->display();
}
/**
* The main configuration page
*
* @return boolean True if successful
* @access public
* @since 1.5
*/
function mainConfig()
{
$steps =& $this->getSteps();
$model =& $this->getModel();
$tmpl =& $this->getTemplate( 'mainconfig.html' );
$steps['mainconfig'] = 'on';
$tmpl->addVars( 'stepbar', $steps, 'step_' );
$tmpl->addVar( 'buttons', 'previous', 'ftpconfig');
// $tmpl->addRows( 'folder-perms', $lists['folderPerms'] );
/*
* prepare migration encoding selection
*/
$encodings = array( 'iso-8859-1','iso-8859-2','iso-8859-3','iso-8859-4','iso-8859-5','iso-8859-6','iso-8859-7','iso-8859-8','iso-8859-9','iso-8859-10','iso-8859-13','iso-8859-14','iso-8859-15','cp874','windows-1250','windows-1251','windows-1252','windows-1253','windows-1254','windows-1255','windows-1256','windows-1257','windows-1258','utf-8','big5','euc-jp','euc-kr','euc-tw','iso-2022-cn','iso-2022-jp-2','iso-2022-jp','iso-2022-kr','iso-10646-ucs-2','iso-10646-ucs-4','koi8-r','koi8-ru','ucs2-internal','ucs4-internal','unicode-1-1-utf-7','us-ascii','utf-16' );
$tmpl->addVar( 'encoding_options', 'value', $encodings );
$max_upload_size = min(JInstallationHelper::let_to_num(ini_get('post_max_size')), JInstallationHelper::let_to_num(ini_get('upload_max_filesize')));
$tmpl->addVar( 'uploadsize', 'maxupload', JText::sprintf('UPLOADFILESIZE',(number_format($max_upload_size/(1024*1024), 2))."MB."));
return $this->display();
}
/**
* The the pre-install info page
*
* @return boolean True if successful
* @access public
* @since 1.5
*/
function preInstall()
{
$steps =& $this->getSteps();
$model =& $this->getModel();
$lists =& $model->getData('lists');
$version = new JVersion();
$tmpl =& $this->getTemplate( 'preinstall.html' );
$steps['preinstall'] = 'on';
$tmpl->addVars( 'stepbar', $steps, 'step_' );
$tmpl->addVar( 'body', 'version', $version->getLongVersion() );
$tmpl->addRows( 'php-options', $lists['phpOptions'] );
$tmpl->addRows( 'php-settings', $lists['phpSettings'] );
return $this->display();
}
/**
* Remove directory messages
*
* @return Boolean True if successful
* @access public
* @since 1.5
*/
function removedir()
{
$model =& $this->getModel();
$this->_createTemplate('', 'removedir.html');
$tmpl = $this->_template;
#$tmpl =& $this->getTemplate( 'removedir.html' );
return $this->display();
}
function migrateScreen() {
$steps =& $this->getSteps();
$model =& $this->getModel();
$tmpl =& $this->getTemplate( 'migration.html' );
$scriptpath =& $model->getData('scriptpath');
$tmpl->addVars( 'stepbar', $steps, 'step_' );
$tmpl->addVar( 'migration', 'migration', JRequest::getVar( 'migration', 0, 'post', 'bool' ));
$tmpl->addVar( 'buttons', 'previous', 'mainconfig');
return $this->display();
}
}
?>
The same content is in 11 releases, Joomla 1.5.16 to 1.5.26. See them all, or every version of this file.