[TYPO3-core] FYI: Installer changes
Steffen Kamper
steffen at sk-typo3.de
Mon Jan 21 17:01:25 CET 2008
Hi Thomas,
congrats, install on a fresh site works now. 2 minor errors:
* if you fill out name of a "new" database, next page says "can't connect
to database "" ", so one step back and one step forward did it.
* some labels are missing
vg Steffen
"Thomas Hempel" <thomas at typo3-unleashed.net> schrieb im Newsbeitrag
news:mailman.1.1200832099.4024.typo3-team-core at lists.netfielders.de...
> Hello,
>
> Here are the changes from the most recent commit.
> I appologize, that this is such a huge patch (~80KB) but it was not
> possible to commit anything and don't break something else.
>
> A lot of changes depends on other ones and so I had to create this big
> patch.
>
> Nevertheless would it be great, if you could test the installer and the
> backendmodule as much as you can. The project is almost feature complete
> but need's a lot of bugfixing and even more improvements in style.
>
> Here are the changes (c&p from changelog):
>
> * Installer: Renamed the tab back from "Setup" to "Installer" to avoid
> problems in translation tool
> * Installer: reorganized installer module (rewrite)
> * Installer: implemeted some features for setup module to make it usable
> for most cases
> * Installer: added database checks (big thanks to Francois Suter!!!)
> * Installer: started implementation of image checks
> * Installer: prepared codebase for third party patches
>
>
> Greets,
> Thomas
>
>
> --
> typo3-unleashed.net
>
--------------------------------------------------------------------------------
> Index: typo3/sysext/install/mod/class.tx_install.php
> ===================================================================
> --- typo3/sysext/install/mod/class.tx_install.php (revision 2928)
> +++ typo3/sysext/install/mod/class.tx_install.php (working copy)
> @@ -174,7 +174,7 @@
> $this->viewObj->addContent('', 'Install Tool deactivated.<br />You must
> enable it by setting a password in typo3conf/localconf.php. If you insert
> the line below, the password will be "joh316":<br /><br
> />$TYPO3_CONF_VARS[\'BE\'][\'installToolPassword\'] =
> \'bacb98acf97e0b6112b1d1b650b84971\';');
> echo $this->viewObj->getDocCode();
> die();
> - }
> + }
>
> // set some default module if nothing was set
> if (empty($this->env['module'])) {
> @@ -211,6 +211,7 @@
> }
> }
>
> + // Let's go on with the content if everything is fine here
> if($this->passwordOK) {
>
> // Try to connect to the database
> @@ -218,7 +219,7 @@
> $moduleContent = $this->basicsObj->executeMethod(array('database',
> 'checkDatabaseConnect'));
> }
>
> - // load module and execute main method
> + // get the method to execute
> $method = 'main';
> if ($this->env['method']) {
> $method = $this->env['method'];
> @@ -227,7 +228,7 @@
> // execute given method and save the result in a local variable
> // This method is only be executed if we have database connection
> $moduleContent =
> $this->basicsObj->executeMethod(array($this->env['module'], $method));
> -
> +
> // check if we have to handle the module content with AJAX
> if ($this->env['ajax'] == 1) {
> header('X-JSON: (true)');
> Index: typo3/sysext/install/mod/class.tx_install_basics.php
> ===================================================================
> --- typo3/sysext/install/mod/class.tx_install_basics.php (revision 2928)
> +++ typo3/sysext/install/mod/class.tx_install_basics.php (working copy)
> @@ -189,9 +189,8 @@
>
> if($moduleClassName) {
> $modules = $this->pObj->getLoadedModules();
> -
> -
> - if(!is_object($modules[$moduleName])) {
> + if(!is_object($modules[$moduleName])) {
> + $res = $this->loadModuleConfig($moduleName);
> if($this->loadModuleConfig($moduleName) !== false) {
> // try to load the language data before we load the module
> $this->loadModuleLocallang($moduleName);
> @@ -252,7 +251,7 @@
> } else if(!method_exists($moduleObj, $methodName)) {
> $this->addError(sprintf($this->getLabel('msg_error_methodnotfound'),
> $methodName, $moduleName), FATAL);
> $returnValue = false;
> - } else if($args == NULL) {
> + } else if (is_null($args)) {
> $returnValue = $moduleObj->$methodName();
> } else {
> $returnValue = $moduleObj->$methodName($args);
> @@ -506,6 +505,10 @@
> array_shift($path);
> }
>
> + if ($path[0] == 'db') {
> + $this->addDbDataToLocalconf(array($path[1] => $value));
> + }
> +
> $path = t3lib_div::trimExplode('/', $path[0]);
>
> $data = &$this->localconfCache['data'];
> @@ -717,9 +720,10 @@
> * @param integer $errorSeverity: The severity of the error (defined in
> view object!)
> * @param string $errorContext: The context of the error (general or
> fields)
> * @param string $errorField: The field where the error occured if
> errorContext is field
> + * @param boolean $onTop: If true, the error message is inserted on top
> of the list and not at the end
> * @return void
> */
> - public function addError($errorMsg, $errorSeverity = WARNING,
> $errorContext = 'general', $errorField = NULL, $getLL = true) {
> + public function addError($errorMsg, $errorSeverity = WARNING,
> $errorContext = 'general', $errorField = NULL, $onTop = false) {
> $viewObj = $this->pObj->getViewObject();
>
> if(substr($errorMsg, 0, 4) == 'LLL:') {
> @@ -729,11 +733,11 @@
>
> switch ($errorContext) {
> case 'fields':
> - $viewObj->addError($errorContext, $error, $errorField);
> + $viewObj->addError($errorContext, $error, $errorField, $onTop);
> break;
> case 'general':
> default:
> - $viewObj->addError($errorContext, $error);
> + $viewObj->addError($errorContext, $error, '', $onTop);
> break;
> }
> }
> Index: typo3/sysext/install/mod/class.tx_install_view.php
> ===================================================================
> --- typo3/sysext/install/mod/class.tx_install_view.php (revision 2928)
> +++ typo3/sysext/install/mod/class.tx_install_view.php (working copy)
> @@ -559,6 +559,7 @@
> * severity => string
> * label => string
> * message => string
> + * addBR => boolean
> * )
> *
> * @param array $data: The content that should be rendered
> @@ -565,7 +566,7 @@
> * @return string HTML output
> */
> private function renderMessage($data) {
> - $out = '<div'.(($data['severity']) ? '
> class="severity_'.$data['severity'].'"' : '').'>';
> + $out = '<div'.(($data['severity']) ? ' class="installer-message
> severity_'.$data['severity'].'"' : '').'>';
> if ($data['label']) {
> if (is_array($data['label'])) {
> $tag = $data['label'][0];
> @@ -576,7 +577,7 @@
> $label = $data['label'];
> $br = '<br />';
> }
> - $out .= $this->renderTag($tag, $label).$br;
> + $out .= $this->renderTag($tag, $label, array('class' =>
> 'message-header')).(($data['addBR'] === true) ? $br : '');
> }
> $out .= ($data['message']) ? $this->render($data['message']) : '';
> $out .= '</div>';
> @@ -932,12 +933,20 @@
> * @param string error type
> * @param string error message
> */
> - public function addError($type, $errorMessage, $errorField = '') {
> + public function addError($type, $errorMessage, $errorField = '', $onTop
> = false) {
>
> - if($type == 'fields') {
> - $this->errors[$type][$errorField][] = $errorMessage;
> + if ($onTop) {
> + if($type == 'fields') {
> + array_unshift($this->errors[$type][$errorField], $errorMessage);
> + } else {
> + array_unshift($this->errors[$type], $errorMessage);
> + }
> } else {
> - $this->errors[$type][] = $errorMessage;
> + if($type == 'fields') {
> + $this->errors[$type][$errorField][] = $errorMessage;
> + } else {
> + $this->errors[$type][] = $errorMessage;
> + }
> }
> }
>
> Index: typo3/sysext/install/mod/locallang_mod.xml
> ===================================================================
> --- typo3/sysext/install/mod/locallang_mod.xml (revision 2928)
> +++ typo3/sysext/install/mod/locallang_mod.xml (working copy)
> @@ -8,7 +8,7 @@
> <languageKey index="default" type="array">
> <label index="mlang_labels_tablabel">Setup Center</label>
> <label index="mlang_labels_tabdescr">Provides a simple link to the Setup
> Center. Notice the Install Tool (in typo3/install/) must be enabled.<br
> /><em>Access for 'admin' users only!</em></label>
> - <label index="mlang_tabs_tab">Setup</label>
> + <label index="mlang_tabs_tab">Installation</label>
>
> <!-- ERRORS and WARNINGS -->
> <label index="msg_error_occured">An error occured. Please see
> details:</label>
> @@ -68,6 +68,7 @@
> <label index="label_category_server">Server</label>
> <label index="label_category_gfx">Graphics</label>
> <label index="label_category_system">System</label>
> + <label index="label_category_update">Update-Wizard</label>
>
> <label index="label_subcategory_connection">Connection</label>
> <label index="label_subcategory_cleanup">Clean Up</label>
> @@ -80,12 +81,12 @@
> <label index="label_subcategory_gd">GD</label>
> <label index="label_subcategory_igm">Image- GrapicsMagick</label>
> <label index="label_subcategory_quality">Quality</label>
> + <label index="label_subcategory_checks">Check</label>
> <label index="label_subcategory_development">Development</label>
>
> <!-- DESCRIPTIONS -->
> - <label index="descr_database">You are in section "Database". Here you
> can change and check all settings concerning your database.</label>
> - <label index="descr_server">You are in section "Server".</label>
> - <label index="descr_system">You are in section "System".</label>
> + <label index="description_module_server">You are in section
> "Server".</label>
> + <label index="description_module_system">You are in section
> "System".</label>
>
> <!-- MESSAGES -->
> <label index="msg_setup_firstcall">SECURITY:
> Index: typo3/sysext/install/mod/scripts.js
> ===================================================================
> --- typo3/sysext/install/mod/scripts.js (revision 2928)
> +++ typo3/sysext/install/mod/scripts.js (working copy)
> @@ -190,6 +190,16 @@
> }
> }
>
> +/**
> + * This function takes a list of checkboxes (identified by their ID)
> + * and toggles them on or off depeding on the value of the flag
> + */
> +function toggleCheckboxes(checkboxList, flag) {
> + for (i = 0; i < checkboxList.length; i++) {
> + $(checkboxList[i]).checked = flag;
> + }
> +}
> +
> allOpen = false;
>
> // add event observers
> Index: typo3/sysext/install/modules/class.tx_install_module_base.php
> ===================================================================
> --- typo3/sysext/install/modules/class.tx_install_module_base.php
> (revision 2928)
> +++ typo3/sysext/install/modules/class.tx_install_module_base.php (working
> copy)
> @@ -92,8 +92,22 @@
> *
> * @return void
> */
> - protected function addError($errorMsg, $errorSeverity = WARNING,
> $errorContext = 'general', $errorField = NULL, $getLL = true) {
> - $this->basicsObject->addError($errorMsg, $errorSeverity, $errorContext,
> $errorField, $getLL);
> + protected function addError($errorMsg, $errorSeverity = WARNING,
> $errorContext = 'general', $errorField = NULL, $onTop = false) {
> + $this->basicsObject->addError($errorMsg, $errorSeverity, $errorContext,
> $errorField, $onTop);
> + }
> +
> + /**
> + * Adds an array of errors to the general error-field. This uses the
> local addError method with default values
> + * for severity, context, field and onTop
> + *
> + * @param array $errors: Array with errormessages
> + */
> + protected function addErrors($errors) {
> + if (is_array($errors)) {
> + foreach ($errors as $error) {
> + $this->addError($error);
> + }
> + }
> }
> }
>
> Index:
> typo3/sysext/install/modules/database/class.tx_install_module_database.php
> ===================================================================
> ---
> typo3/sysext/install/modules/database/class.tx_install_module_database.php
> (revision 2928)
> +++
> typo3/sysext/install/modules/database/class.tx_install_module_database.php
> (working copy)
> @@ -60,6 +60,9 @@
> $this->addError('LLL:msg_database_error_cantconnect');
> return false;
> }
> +
> +
> $this->pObj->getViewObject()->addMessage($this->get_LL('msg_database_connected'));
> +
> return true;
> }
>
> @@ -71,6 +74,60 @@
> }
> return true;
> }
> +
> +
> + /*
> + * METHODS
> + */
> +
> + /**
> + * Renders an overview over the most interesting database releated things
> + *
> + */
> + public function renderOverview() {
> + // connection possible?
> + $message = $this->get_LL('title_typo_db_host').': '.TYPO3_db_host.'<br
> />'.
> + $this->get_LL('title_typo_db_username').': '.TYPO3_db_username.'<br />'.
> + $this->get_LL('title_typo_db_password').': '.TYPO3_db_password;
> +
> + $messageConf = array (
> + 'type' => 'message',
> + 'value' => array (
> + 'message' => '',
> + )
> +
> + );
> +
> + if ($this->checkSelectDatabase() == true) {
> + $messageConf['value']['severity'] = 'ok';
> + $messageConf['value']['label'] =
> $this->get_LL('msg_database_connected');
> +
> + $t3lib_install = t3lib_div::makeInstance('t3lib_install');
> + $whichTables = $t3lib_install->getListOfTables();
> +
> + $messageConf['value']['message'] = $message;
> +
> + $messageConf = array($messageConf, array(
> + 'type' => 'message',
> + 'value' => array (
> + 'severity' => 'ok',
> + 'label' => $this->get_LL('title_module_database'),
> + 'message' => sprintf($this->get_LL('msg_database_connectedto'),
> TYPO3_db, count($whichTables))
> + )
> + ));
> +
> + } else {
> + $messageConf['value']['severity'] = 'error';
> + $messageConf['value']['label'] =
> $this->get_LL('msg_database_notconnected');
> +
> + $message = $this->get_LL('msg_database_failedwith').'<br
> />'.$messageConf['value']['message'];
> + $message .= $this->pObj->getViewObject()->renderErrors(true);
> + // $messageConf['value']['message'] .=
> $this->pObj->getViewObject()->renderErrors();
> + $messageConf['value']['message'] = $message;
> + }
> +
> + return $this->pObj->getViewObject()->render($messageConf);
> + }
>
>
> /*
> @@ -116,13 +173,16 @@
> // get all options for this step
>
> $elements = array(
> +
> 'advanced' => array (
> $this->pObj->getViewObject()->renderOption('typo_db_host',
> $GLOBALS['MCA']['database']['options']['typo_db_host'])
> ),
> +
> 'normal' => array (
> - $this->pObj->getViewObject('typo_db_username',
> $GLOBALS['MCA']['database']['options']['typo_db_username'])->renderOption(),
> - $this->pObj->getViewObject('typo_db_password',
> $GLOBALS['MCA']['database']['options']['typo_db_password'])->renderOption()
> + $this->pObj->getViewObject()->renderOption('typo_db_username',
> $GLOBALS['MCA']['database']['options']['typo_db_username']),
> + $this->pObj->getViewObject()->renderOption('typo_db_password',
> $GLOBALS['MCA']['database']['options']['typo_db_password'])
> )
> +
> );
>
> return $elements;
> @@ -128,14 +188,14 @@
> return $elements;
> }
>
> - public function connectDatabaseProcess($staticFields) {
> + public function connectDatabaseProcess() {
> // try to connect with the given values
> $connectResult = $this->checkDatabaseConnect($this->env['typo_db_host'],
> $this->env['typo_db_username'], $this->env['typo_db_password']);
> - if(!$connectResult) {
> + if(!$connectResult) {
> return false;
> }
>
> - // if connection was sucessfull, write to localconf cache aand save it
> to file
> + // if connection was sucessfull, write to localconf cache and save it to
> file
> $this->basicsObject->addDbDataToLocalconf(array(
> 'typo_db_host' => $this->env['typo_db_host'],
> 'typo_db_username' => $this->env['typo_db_username'],
> @@ -150,34 +210,13 @@
> /**
> * Provides the form for selecting or creating the database
> */
> - public function createDatabase($staticFields) {
> - global $MCA;
> -
> + public function selectDatabaseForm() {
> // get all options for this step
> - $options = array (
> - 'typo_db' => $MCA['database']['options']['typo_db'],
> - 'typo_db_new' => $MCA['database']['options']['typo_db_new'],
> - );
> -
> - $formConfig = array (
> - 'type' => 'form',
> - 'value' => array (
> - 'options' => array (
> - 'name' => 'form_createDatabase',
> - 'submit' => $this->get_LL('label_next_step'),
> - ),
> - 'hidden' => $staticFields
> - )
> - );
> -
> - foreach ($options as $optionName => $optionConfig) {
> - $elementConfig = $this->pObj->getViewObject()->renderOption($optionName,
> $optionConfig);
> - if ($elementConfig !== false) {
> - $formConfig['value']['elements'][] = $elementConfig;
> - }
> - }
> -
> - return $this->pObj->getViewObject()->render($formConfig);
> + $elements = array ('normal' => array (
> + 'typo_db' => $this->pObj->getViewObject()->renderOption('typo_db',
> $GLOBALS['MCA']['database']['options']['typo_db']),
> + 'typo_db_new' =>
> $this->pObj->getViewObject()->renderOption('typo_db_new',
> $GLOBALS['MCA']['database']['options']['typo_db_new']),
> + ));
> + return $elements;
> }
>
>
> @@ -184,9 +223,9 @@
> /**
> * Does the processing of creating the database
> */
> - public function createDatabaseProcess($staticFields) {
> + public function createDatabase() {
> // check if a database was selected or if a new databse was filled in
> - if (empty($this->env['typo_db']) && empty($this->env['typo_db_new'])) {
> + if (empty($this->env['typo_db']) && empty($this->env['typo_db_new'])) {
> $this->addError('LLL:msg_database_warning_selectdb');
> return false;
> }
> @@ -192,19 +231,20 @@
> }
>
> // set an existing database or try to create a new one. If a new name was
> entered, try to create new one
> - if (!empty($this->env['typo_db_new'])) {
> + if (!empty($this->env['typo_db_new'])) {
> +
> // check name
> - if (!ereg('[^[:alnum:]_-]', $this->env['typo_db_new'])) {
> + if (!ereg('[^[:alnum:]_-]', $this->env['typo_db_new'])) {
> // try to create the database
> - if ($this->checkDatabaseConnect()) {
> - $GLOBALS['TYPO3_DB']->admin_query('CREATE DATABASE
> '.$this->env['typo_db_new'].' DEFAULT CHARACTER SET utf8 COLLATE
> utf8_general_ci');
> + if ($this->checkDatabaseConnect()) {
> + $res = $GLOBALS['TYPO3_DB']->admin_query('CREATE DATABASE
> '.$this->env['typo_db_new'].' DEFAULT CHARACTER SET utf8 COLLATE
> utf8_general_ci');
> $res = $GLOBALS['TYPO3_DB']->admin_query('SHOW DATABASES');
> - $tables = array();
> + $databases = array();
> while($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
> - $tables[] = $row;
> + $databases[] = $row[0];
> }
>
> - if(t3lib_div::inArray($tables, $this->env['typo_db_new'])) {
> + if(t3lib_div::inArray($databases, $this->env['typo_db_new'])) {
> // db created -> write name to localconf
> $this->basicsObject->addDbDataToLocalconf(array('typo_db' =>
> $this->env['typo_db_new']));
> if($this->basicsObject->saveLocalconf()) {
> @@ -210,16 +250,29 @@
> if($this->basicsObject->saveLocalconf()) {
> return true;
> }
> - } else
> $this->addError(sprintf($this->get_LL('msg_database_error_couldnotcreate'),
> $this->env['typo_db_new']), WARNING, 'fields', 'typo_db_new');
> + } else {
> +
> $this->addError(sprintf($this->get_LL('msg_database_error_couldnotcreate'),
> $this->env['typo_db_new']), WARNING, 'fields', 'typo_db_new');
> + }
> }
> - } else
> $this->addError(sprintf($this->get_LL('msg_database_warning_invalidname'),
> $this->env['typo_db_new']), WARNING, 'fields', 'typo_db_new');
> + } else {
> +
> $this->addError(sprintf($this->get_LL('msg_database_warning_invalidname'),
> $this->env['typo_db_new']), WARNING, 'fields', 'typo_db_new');
> + }
> +
> // if we reach this point, something went wrong
> return false;
> } else {
> - $this->basicsObject->addDbDataToLocalconf(array('typo_db' =>
> $this->env['typo_db']));
> - if (!$this->basicsObject->saveLocalconf()) {
> + // use an existing database
> + // try to select that database
> + if ($this->checkSelectDatabase(TYPO3_db_host, TYPO3_db_username,
> TYPO3_db_password, $this->env['typo3_db'])) {
> + $this->basicsObject->addDbDataToLocalconf(array('typo_db' =>
> $this->env['typo_db']));
> + if (!$this->basicsObject->saveLocalconf()) {
> + return false;
> + }
> + } else {
> + // database coul not be selected
> return false;
> }
> +
> }
>
> return true;
> @@ -227,9 +280,20 @@
>
>
> /**
> + * Searches for sql files in typo3conf directory. Returns true or false
> wether some files where or not.
> + *
> + * @return boolean
> + */
> + public function checkForStaticFiles() {
> + $sFiles = t3lib_div::getFilesInDir(PATH_typo3conf,'sql',1,1);
> + return (count($sFiles) > 0);
> + }
> +
> +
> + /**
> * Provides the form for initial database import.
> */
> - public function createTables($staticFields) {
> + public function selectStaticFileForm() {
> $sFiles = t3lib_div::getFilesInDir(PATH_typo3conf,'sql',1,1);
>
> // Check if default database scheme "database.sql" already exists,
> otherwise create it
> @@ -248,31 +312,21 @@
> $elements['import|'.$key] = htmlspecialchars(basename($f));
> }
>
> - $formConfig = array (
> - 'type' => 'form',
> - 'value' => array (
> - 'options' => array (
> - 'name' => 'form_createTables',
> - 'submit' => $this->get_LL('label_next_step'),
> - ),
> - 'hidden' => $staticFields,
> - 'elements' => array (
> - array (
> - 'type' => 'formelement',
> - 'value' => array (
> - 'label' => 'label_selectdump',
> - 'elementType' => 'selectbox',
> - 'options' => array (
> - 'name' => 'L',
> - 'elements' => $elements
> - )
> - )
> + $elements = array ( 'normal' => array (
> + array (
> + 'type' => 'formelement',
> + 'value' => array (
> + 'label' => 'label_selectdump',
> + 'elementType' => 'selectbox',
> + 'options' => array (
> + 'name' => 'action',
> + 'elements' => $elements
> )
> )
> )
> - );
> + ));
>
> - return $this->pObj->getViewObject()->render($formConfig);
> + return $elements;
> }
>
> /**
> @@ -278,7 +332,7 @@
> /**
> * Does the processing for initial database import
> */
> - public function createTablesProcess($staticFields) {
> + public function importTables() {
> if (!$GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username,
> TYPO3_db_password)) {
> $this->addError('LLL:msg_database_error_cantconnect', CRITICAL);
> return false;
> @@ -289,13 +343,35 @@
> return false;
> }
>
> - $tblFileContent = t3lib_div::getUrl(PATH_t3lib.'stddb/tables.sql');
> + if (!isset($this->env['action'])) $this->env['action'] =
> 'import|CURRENT_TABLES+STATIC';
> + $actionParts = t3lib_div::trimExplode('|', $this->env['action']);
> +
> + if (preg_match('/^CURRENT_/', $actionParts[1])) {
> + if (!strcmp($actionParts[1],'CURRENT_TABLES') ||
> !strcmp($actionParts[1],'CURRENT_TABLES+STATIC')) {
> + $tblFileContent = t3lib_div::getUrl(PATH_t3lib.'stddb/tables.sql');
>
> - reset($GLOBALS['TYPO3_LOADED_EXT']);
> - foreach ($GLOBALS['TYPO3_LOADED_EXT'] as $loadedExtConf) {
> - if (is_array($loadedExtConf) && $loadedExtConf['ext_tables.sql']) {
> - $tblFileContent.=
> chr(10).chr(10).chr(10).chr(10).t3lib_div::getUrl($loadedExtConf['ext_tables.sql']);
> + reset($GLOBALS['TYPO3_LOADED_EXT']);
> + while(list(,$loadedExtConf)=each($GLOBALS['TYPO3_LOADED_EXT'])) {
> + if (is_array($loadedExtConf) && $loadedExtConf['ext_tables.sql']) {
> + $tblFileContent.=
> chr(10).chr(10).chr(10).chr(10).t3lib_div::getUrl($loadedExtConf['ext_tables.sql']);
> + }
> + }
> + }
> + if (!strcmp($actionParts[1],'CURRENT_STATIC') ||
> !strcmp($actionParts[1],'CURRENT_TABLES+STATIC')) {
> + reset($GLOBALS['TYPO3_LOADED_EXT']);
> + while(list(,$loadedExtConf)=each($GLOBALS['TYPO3_LOADED_EXT'])) {
> + if (is_array($loadedExtConf) &&
> $loadedExtConf['ext_tables_static+adt.sql']) {
> + $tblFileContent.=
> chr(10).chr(10).chr(10).chr(10).t3lib_div::getUrl($loadedExtConf['ext_tables_static+adt.sql']);
> + }
> + }
> }
> + } elseif (@is_file($actionParts[1])) {
> + $tblFileContent = t3lib_div::getUrl($actionParts[1]);
> + }
> +
> + if (empty($tblFileContent)) {
> + $this->addError($this->get_LL('msg_database_error_emptydump'));
> + return false;
> }
>
> $t3lib_install = t3lib_div::makeInstance('t3lib_install');
> @@ -328,42 +404,32 @@
> /**
> * Provides a form for creating a new admin user
> */
> - public function createAdmin($staticFields) {
> - $formConfig = array (
> - 'type' => 'form',
> - 'value' => array (
> - 'options' => array (
> - 'name' => 'form_getlanguage',
> - 'submit' => $this->get_LL('label_next_step'),
> - ),
> - 'hidden' => $staticFields,
> - 'elements' => array (
> - array (
> - 'type' => 'formelement',
> - 'value' => array (
> - 'label' => 'label_admin_username',
> - 'elementType' => 'input',
> - 'options' => array (
> - 'name' => 'createadmin_username',
> - )
> - )
> - ),
> - array (
> - 'type' => 'formelement',
> - 'value' => array (
> - 'label' => 'label_admin_password',
> - 'elementType' => 'password',
> - 'renderTwice' => true,
> - 'options' => array (
> - 'name' => 'createadmin_password'
> - )
> - )
> + public function createAdminForm() {
> + $elements = array ( 'normal' => array (
> + array (
> + 'type' => 'formelement',
> + 'value' => array (
> + 'label' => 'label_admin_username',
> + 'elementType' => 'input',
> + 'options' => array (
> + 'name' => 'createadmin_username',
> + )
> + )
> + ),
> + array (
> + 'type' => 'formelement',
> + 'value' => array (
> + 'label' => 'label_admin_password',
> + 'elementType' => 'password',
> + 'renderTwice' => true,
> + 'options' => array (
> + 'name' => 'createadmin_password'
> )
> )
> )
> - );
> + ));
>
> - return $this->pObj->getViewObject()->render($formConfig);
> + return $elements;
> }
>
> /**
> @@ -372,8 +438,8 @@
> * @param unknown_type $staticFields
> * @return unknown
> */
> - public function createAdminProcess($staticFields) {
> - if (ereg('[^[:alnum:]_-]', $this->env['createadmin_username'])) {
> + public function createAdmin() {
> + if (ereg('[^[:alnum:]_-]', $this->env['createadmin_username'])) {
> $this->addError(sprintf($this->get_LL('msg_warning_invalidusername'),
> $this->env['createadmin_username']), FATAL, 'fields',
> 'createadmin_username');
> return false;
> }
> @@ -479,17 +545,27 @@
>
> // Updating database...
> if ($this->env['action'] == 'performUpdate') {
> - /*
> - * Here the script has to perform the update of the database. The code is
> pasted from old install class.
> - */
> - $t3lib_install->performUpdateQueries($update_statements['add'],
> $this->env);
> - $t3lib_install->performUpdateQueries($update_statements['change'],
> $this->env);
> - $t3lib_install->performUpdateQueries($remove_statements['change'],
> $this->env);
> - $t3lib_install->performUpdateQueries($remove_statements['drop'],
> $this->env);
> + // Here the script has to perform the update of the database. The code
> is pasted from old install class.
> + $errors =
> $t3lib_install->performUpdateQueries($update_statements['add'],
> $this->env);
> + if (is_array($errors)) $this->addErrors($errors);
> +
> + $errors =
> $t3lib_install->performUpdateQueries($update_statements['change'],
> $this->env);
> + if (is_array($errors)) $this->addErrors($errors);
> +
> + $errors =
> $t3lib_install->performUpdateQueries($remove_statements['change'],
> $this->env);
> + if (is_array($errors)) $this->addErrors($errors);
> +
> + $errors =
> $t3lib_install->performUpdateQueries($remove_statements['drop'],
> $this->env);
> + if (is_array($errors)) $this->addErrors($errors);
>
> - $t3lib_install->performUpdateQueries($update_statements['create_table'],
> $this->env);
> - $t3lib_install->performUpdateQueries($remove_statements['change_table'],
> $this->env);
> - $t3lib_install->performUpdateQueries($remove_statements['drop_table'],
> $this->env);
> + $errors =
> $t3lib_install->performUpdateQueries($update_statements['create_table'],
> $this->env);
> + if (is_array($errors)) $this->addErrors($errors);
> +
> + $errors =
> $t3lib_install->performUpdateQueries($remove_statements['change_table'],
> $this->env);
> + if (is_array($errors)) $this->addErrors($errors);
> +
> + $errors =
> $t3lib_install->performUpdateQueries($remove_statements['drop_table'],
> $this->env);
> + if (is_array($errors)) $this->addErrors($errors);
>
> // Init again / first time depending...
> $FDdb = $t3lib_install->getFieldDefinitions_database();
> @@ -501,7 +577,9 @@
>
> // render form and / or message depending on result of DB compare
> if ($remove_statements || $update_statements) {
> - $formContent = $this->get_LL('msg_database_updateneeded').'<br
> />'.$this->generateUpdateDatabaseForm($update_statements,
> $remove_statements);
> + $errors = $this->pObj->getViewObject()->getErrors();
> + if (count($errors['general']) > 0)
> $this->addError($this->get_LL('msg_database_warning_failedstatements'),
> WARNING, 'general', NULL, true);
> + $formContent .=
> $this->pObj->getViewObject()->renderErrors().$this->get_LL('msg_database_updateneeded').'<br
> />'.$this->generateUpdateDatabaseForm($update_statements,
> $remove_statements, $allErrors);
> } else {
> $formContent = $this->get_LL('msg_database_noupdateneeded');
> }
> @@ -509,6 +587,8 @@
> return $formContent;
> }
>
> +
> +
> /**
> * Generates the form for selecting actions that can be performed after a
> comparison.
> *
> @@ -523,15 +603,15 @@
> $elements = array();
>
> // Fields
> - $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_update['add'], 'Add
> fields'));
> - $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_update['change'],
> 'Changing fields', (t3lib_extMgm::isLoaded('dbal') ? false : true),
> $arr_update['change_currentValue']));
> - $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_remove['change'],
> 'Remove unused fields (rename with prefix)'));
> - $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_remove['drop'], 'Drop
> fields (really!)'));
> + $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_update['add'],
> $this->get_LL('label_addfields')));
> + $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_update['change'],
> $this->get_LL('label_changefields'), (t3lib_extMgm::isLoaded('dbal') ?
> false : true), $arr_update['change_currentValue']));
> + $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_remove['change'],
> $this->get_LL('label_removeunusedfields')));
> + $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_remove['drop'],
> $this->get_LL('label_dropfields')));
>
> // Tables
> - $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_update['create_table'],
> 'Add tables'));
> - $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_remove['change_table'],
> 'Removing tables (rename with prefix)',
> $this->setAllCheckBoxesByDefault));
> - $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_remove['drop_table'],
> 'Drop tables (really!)', $this->setAllCheckBoxesByDefault));
> + $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_update['create_table'],
> $this->get_LL('label_addtables')));
> + $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_remove['change_table'],
> $this->get_LL('label_removeunusedtables'),
> $this->setAllCheckBoxesByDefault));
> + $elements = array_merge($elements,
> $this->generateUpdateDatabaseForm_checkboxes($arr_remove['drop_table'],
> $this->get_LL('label_removetables'), $this->setAllCheckBoxesByDefault));
>
> // prepare config for rendering
> $formConfig = array (
> @@ -554,7 +634,7 @@
>
> // render the form in viewObj
> $content = $this->pObj->getViewObject()->render($formConfig);
> -
> +
> return $content;
> }
>
> @@ -576,7 +656,7 @@
>
> 'value' => array (
> 'elementType' => 'checkbox',
> - 'label' => nl2br(htmlspecialchars($statement)).'<br /><br
> />'.((empty($currentValue[$key]) ? '' : '<em>Current value:
> '.$currentValue[$key].'</em>')),
> + 'label' => nl2br(htmlspecialchars($statement)).'<br /><br
> />'.((empty($currentValue[$key]) ? '' : '<em>Current value:
> '.$currentValue[$key].'</em><br />')),
> 'label_align' => 'right',
> 'options' => array (
> 'name' => $key,
> @@ -590,6 +670,132 @@
>
> return $result;
> }
> +
> + /**
> + * Displays a form for loading or reloading data into the so-called
> static tables
> + */
> + public function analyzeStaticTables() {
> + $content = '<p>'.$this->get_LL('msg_database_reloadstaticdata').'</p>';
> +
> + // Read all table definitions
> + $tblFileContent = '';
> + reset($GLOBALS['TYPO3_LOADED_EXT']);
> + foreach($GLOBALS['TYPO3_LOADED_EXT'] as $loadedExtConf) {
> + if (is_array($loadedExtConf) &&
> $loadedExtConf['ext_tables_static+adt.sql']) {
> + $tblFileContent.=
> chr(10).chr(10).chr(10).chr(10).t3lib_div::getUrl($loadedExtConf['ext_tables_static+adt.sql']);
> + }
> + }
> +
> + // Get an instance of the t3lib_install class
> + $t3lib_install = t3lib_div::makeInstance('t3lib_install');
> +
> + // Transform string of SQL statements into an array
> + $statements = $t3lib_install->getStatementArray($tblFileContent, 1);
> +
> + // Get all the statements indexed for each table
> + list($statements_table, $insertCount) =
> $t3lib_install->getCreateTables($statements, 1);
> +
> + // Get list of existing tables
> + $whichTables = $t3lib_install->getListOfTables();
> +
> + // Drop/create selected static tables, load corresponding data
> + $actionMessages = array();
> + if ($this->env['action'] == 'performUpdate') {
> + foreach ($this->env as $table => $value) {
> + if ($this->env[$table] && isset($statements_table[$table])) {
> + $res = $GLOBALS['TYPO3_DB']->admin_query('DROP TABLE IF EXISTS
> '.$table);
> + $res = $GLOBALS['TYPO3_DB']->admin_query($statements_table[$table]);
> +
> + // An error has occurred, issue message
> + if ($res === false) {
> + $actionMessages[] = '<p class="error
> error-fatal">'.sprintf($this->get_LL('msg_database_error_createtable'),
> $table).' ['.$this->get_LL('label_sqlerror').':
> '.$GLOBALS['TYPO3_DB']->sql_error().']'.'</p>';
> + }
> +
> + // The table was successfully created, load the data
> + else {
> + if (!empty($insertCount[$table])) {
> + $statements_insert =
> $t3lib_install->getTableInsertStatements($statements, $table);
> + $dataErrors = array();
> + $lineCounter = 0;
> + foreach($statements_insert as $sql) {
> + $lineCounter++;
> + $res = $GLOBALS['TYPO3_DB']->admin_query($sql);
> + if ($res === false) {
> + $dataErrors[$lineCounter] = '('.$this->get_LL('label_line').'
> '.$lineCounter.') '.$GLOBALS['TYPO3_DB']->sql_error();
> + }
> + }
> + // Display result message. If errors occurred, list them after result
> message
> + $actionMessages[] =
> '<p>'.sprintf($this->get_LL('msg_database_staticdatareloaded'), $table,
> $lineCounter).'</p>';
> + if (count($dataErrors) > 0) {
> + $message = '<p class="error
> error-fatal">'.sprintf($this->get_LL('msg_database_error_insertingdata'),
> count($dataErrors));
> + foreach ($dataErrors as $sqlError) {
> + $message .= '<br />'.$sqlError;
> + }
> + $actionMessages[] = $message.'</p>';
> + }
> + }
> + }
> + }
> + }
> + }
> +
> + // Assemble checkboxes for each table that could be updated
> + if (count($statements_table) > 0) {
> + $labels = array();
> + foreach ($statements_table as $table => $definition) {
> + $label = $table;
> + if (isset($insertCount[$table])) $label .= ' -
> '.$this->get_LL('label_rows').': '.$insertCount[$table];
> + if (isset($whichTables[$table])) $label .= ' -
> '.$this->get_LL('label_tableexists');
> + $labels[$table] = $label;
> + }
> + $checkboxes = $this->generateUpdateDatabaseForm_checkboxes($labels,
> $this->get_LL('label_selectimporttables'), false);
> +
> + // prepare config for rendering
> + $formConfig = array (
> + 'type' => 'form',
> + 'value' => array (
> + 'options' => array (
> + 'name' => 'form_analyzeStaticTables',
> + 'id' => 'form_analyzeStaticTables',
> + 'submit' => $this->get_LL('label_writechanges'),
> + 'ajax' => true,
> + 'action' => 'sendMethodForm(\'form_analyzeStaticTables\', \'database\',
> \'analyzeStaticTables\', displayMethodResult)',
> + ),
> + 'hidden' => array (
> + 'action' => 'performUpdate',
> + 'target' => 'analyze_staticTables_result'
> + ),
> + 'elements' => $checkboxes
> + )
> + );
> +
> + // render link to check/uncheck all checkboxes
> + // first get a list of all checkbox id's
> + $checkboxesID = array();
> + foreach ($checkboxes as $elementInfo) {
> + if ($elementInfo['value']['elementType'] == 'checkbox') {
> + $checkboxesID[] = $elementInfo['value']['options']['id'];
> + }
> + }
> + // assemble links with javascript calls to toggle checkboxes function
> + $checkboxJSArray = "new Array('".implode("','", $checkboxesID)."')";
> + $jsControl = '<a href="javascript:toggleCheckboxes('.$checkboxJSArray.',
> true)">'.$this->get_LL('label_selectall').'</a>';
> + $jsControl .= ' / ';
> + $jsControl .= '<a
> href="javascript:toggleCheckboxes('.$checkboxJSArray.',
> false)">'.$this->get_LL('label_deselectall').'</a>';
> + $content .= $this->pObj->getViewObject()->renderTag('p', $jsControl);
> +
> + // render the form in viewObj
> + $content .= $this->pObj->getViewObject()->render($formConfig);
> + }
> +
> + // If actions were performed, display their messages
> + if (count($actionMessages) > 0) {
> + foreach ($actionMessages as $aMessage) {
> + $content .= $aMessage;
> + }
> + }
> + return $content;
> + }
>
> }
>
> Index: typo3/sysext/install/modules/database/conf.php
> ===================================================================
> --- typo3/sysext/install/modules/database/conf.php (revision 2928)
> +++ typo3/sysext/install/modules/database/conf.php (working copy)
> @@ -71,7 +71,14 @@
> 'categorySub' => 'analyze',
> 'tags' => array('database', 'db', 'cleanup', 'compare'),
> 'method' => 'database:analyzeCompareFile',
> - 'autostart' => true
> + 'autostart' => false
> + ),
> + 'analyze_staticTables' => array (
> + 'categoryMain' => 'database',
> + 'categorySub' => 'analyze',
> + 'tags' => array('database', 'db', 'cleanup', 'compare'),
> + 'method' => 'database:analyzeStaticTables',
> + 'autostart' => false
> ),
> 'cleanUp_cachedImageSizes' => array(
> 'title' => 'title_cleanUp_cachedImageSizes',
> Index: typo3/sysext/install/modules/database/locallang.xml
> ===================================================================
> --- typo3/sysext/install/modules/database/locallang.xml (revision 2928)
> +++ typo3/sysext/install/modules/database/locallang.xml (working copy)
> @@ -7,6 +7,8 @@
> <data type="array">
> <languageKey index="default" type="array">
> <label index="title_module_database">Database</label>
> + <label index="description_module_database">In this section you can get
> an overview of your currently selected database compared to sql-files. You
> can also import sql-data directly into the database or upgrade tables from
> earlier versions of TYPO3.</label>
> +
> <label index="title_typo_db_host">Database host</label>
> <label index="description_typo_db_host">Enter the hostname where the
> database server can be reached.</label>
> <label index="help_typo_db_host">The hostname is a server where the
> database server is running. In most cases this will be
> "localhost".</label>
> @@ -16,6 +18,7 @@
> <label index="title_typo_db">TYPO3 database</label>
>
> <label index="title_analyze_compareFile">Compare against default
> database</label>
> + <label index="title_analyze_staticTables">Reload static tables</label>
>
> <label index="label_database_defaulttables">Create default database
> tables</label>
> <label index="label_selectdump">Please select a database dump</label>
> @@ -21,18 +24,38 @@
> <label index="label_selectdump">Please select a database dump</label>
> <label index="label_execute">Execute</label>
> <label index="label_writechanges">Write selected changes to
> database</label>
> + <label index="label_addfields">Add fields</label>
> + <label index="label_changefields">Change fields</label>
> + <label index="label_removeunusedfields">Remove unused fields (rename
> with prefix)</label>
> + <label index="label_dropfields">Drop fields (really!)</label>
> + <label index="label_addtables">Add tables</label>
> + <label index="label_removeunusedtables">Remove unused tables (rename
> with prefix)</label>
> + <label index="label_droptables">Drop tables (really!)</label>
> + <label index="label_sqlerror">SQL error</label>
> + <label index="label_selectimporttables">Select tables to import</label>
> + <label index="label_rows">Rows</label>
> + <label index="label_tableexists">Table exists!</label>
> + <label index="label_line">Line</label>
> + <label index="label_selectall">Select all</label>
> + <label index="label_deselectall">Deselect all</label>
>
> - <label index="msg_database_error_cantconnect">FATAL: Can't connect to
> database-server!</label>
> - <label index="msg_database_error_cantselectdb">FATAL: Can't select
> database "%s"</label>
> + <label index="msg_database_error_cantconnect">Can't connect to
> database-server!</label>
> + <label index="msg_database_error_cantselectdb">Can't select database
> "%s"</label>
> <label index="msg_database_error_couldnotcreate">Could not create
> database with name "%s"</label>
> <label index="msg_database_error_filenotfound">The compare-file "%s" was
> not found!</label>
> <label index="msg_database_error_nocreatedefinitions">There were no
> "CREATE TABLE" definitions in the provided file: %s</label>
> + <label index="msg_database_error_createtable">There was an error
> creating table "%s"</label>
> + <label index="msg_database_error_insertingdata">However %d error(s)
> occurred when trying to load the data:</label>
> + <label index="msg_database_error_emptydump">The selected database dump
> is empty.</label>
>
> <label index="msg_database_warning_selectdb">Please select a database or
> fill in a name for a new database.</label>
> <label index="msg_database_warning_invalidname">The NEW database name
> "%s" was not alphanumeric, a-zA-Z0-9_-</label>
> + <label index="msg_database_warning_failedstatements">Some statements
> failed to execute due to SQL errors. They are detailed below.</label>
>
> <label index="msg_database_updateneeded">Table and field definitions
> should be updated!<br /> There seems to be a number of differences
> between the database and the selected SQL-file. Please select which
> statements you want to execute in order to update your database:</label>
> <label index="msg_database_noupdateneeded">Table and field definitions
> are OK.<br />The tables and fields in the current database
> correspond perfectly to the database in the selected SQL-file.</label>
> + <label index="msg_database_reloadstaticdata">Check in the form below for
> which static table you want to load or reload the data. Be careful if the
> table already exists: it will be dropped before the data is loaded, so any
> changes will be lost.</label>
> + <label index="msg_database_staticdatareloaded">Table "%s" was
> (re)created successfully and %d rows of data were loaded.</label>
> </languageKey>
> </data>
> </T3locallang>
> \ No newline at end of file
> Index: typo3/sysext/install/modules/gfx/class.tx_install_module_gfx.php
> ===================================================================
> --- typo3/sysext/install/modules/gfx/class.tx_install_module_gfx.php
> (revision 2928)
> +++ typo3/sysext/install/modules/gfx/class.tx_install_module_gfx.php
> (working copy)
> @@ -3,7 +3,10 @@
> *
> */
> class tx_install_module_gfx extends tx_install_module_base {
> -
> +
> + public function overview() {
> +
> + }
> }
>
> ?>
> Index: typo3/sysext/install/modules/gfx/conf.php
> ===================================================================
> --- typo3/sysext/install/modules/gfx/conf.php (revision 2928)
> +++ typo3/sysext/install/modules/gfx/conf.php (working copy)
> @@ -5,17 +5,6 @@
> ),
>
> 'options' => array (
> - /*
> - '' => array (
> - 'categoryMain' => 'gfx',
> - 'categorySub' => 'general',
> - 'tags' => array (),
> - 'elementType' => 'checkbox',
> - 'value' => 'LC:GFX/',
> - 'default' => 1
> - ),
> - */
> -
> /** GENERAL **/
>
> 'image_processing' => array (
> @@ -257,16 +246,15 @@
> 'method' => 'php:checkVersion'
> )
> ),
> + */
>
> 'methods' => array (
> - 'phpinfo' => array (
> - 'title' => 'module_php_method_phpversion_title',
> - 'description' => 'module_php_method_phpversion_description',
> - 'categoryMain' => 'server',
> - 'categorySub' => 'php',
> - 'method' => 'php:getPHPInfo'
> + 'gfxOverview' => array (
> + 'categoryMain' => 'gfx',
> + 'categorySub' => 'checks',
> + 'method' => 'gfx:overview',
> + 'autostart' => true
> )
> )
> - */
> );
> ?>
> Index: typo3/sysext/install/modules/gfx/locallang.xml
> ===================================================================
> --- typo3/sysext/install/modules/gfx/locallang.xml (revision 2928)
> +++ typo3/sysext/install/modules/gfx/locallang.xml (working copy)
> @@ -6,12 +6,43 @@
> </meta>
> <data type="array">
> <languageKey index="default" type="array">
> - <label index="module_gfx_title">Graphics</label>
> - <label index="module_gfx_description">Let you setup the graphic
> subsystem of your TYPO3 installation.</label>
> + <label index="title_module_gfx">Graphics</label>
> + <label index="description_module_gfx">
> +<strong>What is it?</strong>
> +TYPO3 is known for its ability to process images on the
> server.<br/>
> +In the backend interface (TBE) thumbnails are automatically generated (by
> ImageMagick in thumbs.php) as well as icons, menu items and pane tabs (by
> GDLib).<br/>
> +In the TypoScript enabled frontend all kinds of graphical elements are
> processed. Typically images are scaled down to fit the pages (by
> ImageMagick) and menu items, graphical headers and such are generated
> automatically (by GDLib + ImageMagick).<br/>
> +In addition TYPO3 is able to handle many file formats (thanks to
> ImageMagick), for example TIF, BMP, PCX, TGA, AI and PDF in addition to
> the standard web formats; JPG, GIF, PNG.<br/>
> +<br/>
> +In order to do this, TYPO3 uses two sets of tools:<br/>
> +<br/>
> +<strong>ImageMagick:</strong><br/>
> +For conversion of non-web formats to webformats, combining images with
> alpha-masks, performing image-effects like blurring and
> sharpening.<br/>
> +ImageMagick is a collection of external programs on the server called by
> the exec() function in PHP. TYPO3 uses three of these, namely 'convert'
> (converting fileformats, scaling, effects), 'combine'/'composite'
> (combining images with masks) and 'identify' (returns image
> information).<br/>
> +Because ImageMagick are external programs, two requirements must be met:
> 1) The programs must be installed on the server and working and 2) if
> safe_mode is enabled, the programs must be located in the folder defined
> by the php.ini setting, <em>safe_mode_exec_dir</em> (else they
> are not executed).<br/>
> +ImageMagick is available for both Windows and Unix. The current version
> is 5+, but TYPO3 enthusiasts prefer an old version 4.2.9 because that
> version has three main advantages: It's faster in some operations, the
> blur-function works, the sharpen-function works. Anyway you do it, you
> must tell TYPO3 by configuration whether you're using version 5+ or 4.2.9.
> (flag: [GFX][im_version_5])<br/>
> +ImageMagick homepage is at <a target="_blank"
> href="http://www.imagemagick.org/">http://www.imagemagick.org/</a><br/>
> +<br/>
> +<strong>GDLib:</strong><br/>
> +For drawing boxes and rendering text on images with truetype fonts. Also
> used for icons, menuitems and generally the TypoScript GIFBUILDER object
> is based on GDlib, but extensively utilizing ImageMagick to process
> intermediate results.<br/>
> +GDLib is accessed through internal functions in PHP, so in this case, you
> have no safe_mode problems, but you'll need a version of PHP with GDLib
> compiled in. Also in order to use TrueType fonts with GDLib you'll need
> FreeType compiled in as well.<br/>
> +You can get GDLib in the PNG version from <a target="_blank"
> href="http://www.boutell.com/gd/">http://www.boutell.com/gd/</a>.<br/>FreeType
> is for download at <a target="_blank"
> href="http://www.freetype.org/">http://www.freetype.org/</a>.<br/>
> +Generally, software for TYPO3 is found at <a target="_blank"
> href="http://typo3.sunsite.dk/software/">http://typo3.sunsite.dk/software/</a>
> and packages listed at <a target="_blank"
> href="http://typo3.org/1274.0.html">http://typo3.org/1274.0.html</a>.<br/>
> +<br/>
> +You can disable all image processing options in TYPO3
> ([GFX][image_processing]=0), but that would seriously disable TYPO3.
> + </label>
>
> - <label index="title_"></label>
> - <label index="description_"></label>
> - <label index="help_"></label>
> + <label index="title_gfxOverview">Image Processing</label>
> + <label index="description_gfxOverview">
> +<strong>Verifying the image processing capabilities of your
> server</strong><br/>
> +This page performs image processing and displays the result. It's a
> thorough check that everything you've configured is working
> correctly.<br/>
> +It's quite simple to verify your installation; Just look down the page,
> the images in pairs should look like each other. If some images are not
> alike, something is wrong. You may also notice warnings and errors if this
> tool found signs of any problems.<br/>
> +<br/>
> +The image to the right is the reference image (how it should be) and to
> the left the image made by your server.<br/>
> +The reference images are made with the classic ImageMagick install based
> on the 4.2.9 RPM and 5.2.3 RPM. If the version 5 flag is set, the
> reference images are made by the 5.2.3 RPM.<br/>
> +<br/>
> +This test will work only if your ImageMagick/GDLib configuration allows
> it to. The typo3temp/ folder must be writable for all the temporary image
> files. They are all prefixed 'install_' so they are easy to recognize and
> delete afterwards.
> + </label>
>
> <label index="title_image_processing">Image Processing</label>
> <label index="description_image_processing">Enables image processing
> features.</label>
> Index:
> typo3/sysext/install/modules/installer/class.tx_install_module_installer.php
> ===================================================================
> ---
> typo3/sysext/install/modules/installer/class.tx_install_module_installer.php
> (revision 2928)
> +++
> typo3/sysext/install/modules/installer/class.tx_install_module_installer.php
> (working copy)
> @@ -30,40 +30,124 @@
>
> /**
> * Defines the steps for the installation.
> - * The format is the same as for calling methods: module:method
> - *
> + *
> + * Each step consists of a set of methods, checks and options in various
> states of processing.
> + * Each step can have the following states
> + *
> + * - pre: Only checks are allowed here! This checks are executed each
> time a step is called. If any of
> + * the checks return false, the step can't be be processed.
> + *
> + * - main: The main method that is executed in this step. In most cases
> this will be a formconfig for
> + * the render engine.
> + *
> + * - post: Here are all things located that has to be executed before a
> step can be finished. This is
> + * the right place for processing and checking the input data from the
> main method.
> + * If any of this checks returns false the main state is called again.
> + *
> * @var array
> */
> - private $steps = array (
> + private $stepConfig = array (
> // these steps basically reimplements the old 1-2-3 installer with some
> small improvements
> - // 1 => 'installer:initialChecks',
> - 1 => 'installer:selectLanguage',
> +
> + // inital checks / no further processing
> + 0 => array (
> + 'pre' => array (
> + 0 => 'php:checkVersion',
> + 1 => 'directories:checkDirs'
> + ),
> + 'main' => array (
> + 0 => array (
> + 'type' => 'form',
> + 'module' => 'installer',
> + 'method' => 'selectLanguage'
> + )
> + )
> + ),
> +
> + // database connection
> + 1 => array (
> + 'main' => array (
> + 0 => array (
> + 'type' => 'form',
> + 'module' => 'database',
> + 'method' => 'databaseConnectionData'
> + )
> + ),
> + 'post' => array (
> + 'database:connectDatabaseProcess'
> + )
> + ),
> +
> + // select / create database
> + 2 => array (
> + 'main' => array (
> + array (
> + 'type' => 'form',
> + 'module' => 'database',
> + 'method' => 'selectDatabaseForm'
> + )
> + ),
> + 'post' => array (
> + 'database:createDatabase'
> + )
> + ),
> +
> + // create / import tables from file
> + 3 => array (
> + 'preMode' => 'skipMain',
> + 'pre' => array (
> + 'database:checkForStaticFiles'
> + ),
> + 'main' => array (
> + array (
> + 'type' => 'form',
> + 'module' => 'database',
> + 'method' => 'selectStaticFileForm'
> + )
> + ),
> + 'post' => array (
> + 'database:importTables'
> + )
> + ),
> +
> + // create an admin user
> + 4 => array (
> + 'main' => array (
> + array (
> + 'type' => 'form',
> + 'module' => 'database',
> + 'method' => 'createAdminForm'
> + )
> + ),
> + 'post' => array (
> + 'database:createAdmin'
> + )
> + ),
>
> - 2 => 'database:connectDatabase',
> - 3 => 'database:createDatabase',
> - 4 => 'database:createTables',
> - 5 => 'database:createAdmin',
> - 6 => 'installer:getBasicSettingsAndFinish'
> + 5 => array (
> + 'main' => array (
> + array (
> + 'type' => 'label',
> + 'index' => 'msg_step5_done'
> + )
> + )
> + )
>
> - // here we define some optional steps
> );
>
> /**
> - * Here is a list of all checks that have to be performed at the very
> beginning of the installation
> - * The format is the same as for calling methods: module:method
> + * Defines which is the last mandatory step
> *
> - * @var array
> + * @var integer
> */
> - private $initialChecks = array (
> - 'directories:checkDirs'
> - );
> + private $lastMandatoryStep = 5;
>
> /**
> - * Defines which is the last mandatory step
> + * Holds the current step
> *
> * @var integer
> */
> - private $lastMandatoryStep = 6;
> + private $step = null;
>
> /**
> * This is the main method
> @@ -69,18 +153,33 @@
> * This is the main method
> */
> public function main() {
> - $this->step = (empty($this->env['step'])) ? 1 :
> intval($this->env['step']);
> + // get the current step
> + $this->step = (empty($this->env['step'])) ? 0 :
> intval($this->env['step']);
>
> - // do we call first time or do we have to process?
> - if ($this->env['action'] == 'process') {
> - $stepResult = $this->executeStep($this->step, true);
> - if ($stepResult) {
> - $this->step++;
> - }
> + // get the state
> + $stepResult = $this->executeStep($this->step);
> +
> + // render back button if step is bigger than 1
> + if ($this->step > 0) {
> + $formConfig = array (
> + 'type' => 'form',
> + 'value' => array(
> + 'options' => array(
> + 'name' => 'form_stepData',
> + 'submit' => $this->get_LL('label_prev_step'),
> + ),
> + 'hidden' => array (
> + 'step' => $this->step-1,
> + 'mode' => '123',
> + 'state' => 'post'
> + ),
> + )
> + );
> +
> + $btnBack = $this->pObj->getViewObject()->render($formConfig);
> + } else {
> + $btnBack = '';
> }
> -
> - // call the step (this can be current or next one)
> - $stepContent = $this->executeStep($this->step);
>
> // build-up the output
> $marker = array (
> @@ -88,7 +187,8 @@
> '###PROGRESS###' => $this->getProgress(),
> '###MSG_TITLE###' => $this->get_LL('msg_step'.$this->step.'_title'),
> '###MSG_DESCRIPTION###' =>
> $this->get_LL('msg_step'.$this->step.'_description'),
> - '###CONTENT###' => $stepContent
> + '###BTN_BACK###' => $btnBack,
> + '###CONTENT###' => $stepResult
> );
>
> if (count($this->pObj->getViewObject()->getErrors('general')) > 0) {
> @@ -111,56 +211,187 @@
> return $result;
> }
>
> - private function executeStep($stepIndex, $process = false) {
> + /**
> + * Executes all states of a certain step.
> + */
> + private function executeStep() {
> // let's check if the step is defined, die if not
> - if (!isset($this->steps[$stepIndex])) {
> - die($this->get_LL('msg_error_stepnotdefined'));
> + if (!isset($this->stepConfig[$this->step])) {
> + $this->addError(sprintf($this->get_LL('msg_error_stepnotdefined'),
> $this->step), FATAL);
> + return false;
> }
>
> - // get the information where the step logic is defined
> - list($stepModuleName, $stepMethodName) = t3lib_div::trimExplode(':',
> $this->steps[$stepIndex]);
> - $stepModule =
> $this->pObj->getBasicsObject()->loadModule($stepModuleName);
> + // process pre state
> + if (isset($this->stepConfig[$this->step]['pre'])) {
> + $preResult = $this->executeStepState('pre');
> + } else {
> + $preResult = true;
> + }
> +
> + // exit if pre checks are not sucessfull
> + if ($preResult === false) {
> + // depending on preMode we only skip state main or stop here immediately
> + if (!isset($this->stepConfig[$this->step]['preMode'])
> &&Ê(!strcmp($this->stepConfig[$this->step]['preMode'], 'skipMain'))) {
> + return false;
> + } else {
> + $this->env['state'] = 'post';
> + }
> + }
>
> - // die if the module could not be loaded
> - if (!$stepModule) {
> - die(sprintf($this->get_LL('msg_error_modulenotfound'),
> $stepModuleName));
> + // if state is post, execute that state
> + $processResult = true;
> + if ($this->env['state'] == 'post') {
> + // execute process methods (has to be configured)
> + $processResult = $this->executeStepState('post');
> + $this->env['state'] = NULL;
> +
> + // go to next step if process was ok
> + if ($processResult === true) {
> + $this->step++;
> + return $this->executeStep();
> + }
> }
>
> - // search for the processMethod if process flag is set
> - if ($process) {
> - $stepMethodName .= 'Process';
> + // execute main state (has to be configured!)
> + $mainResult = $this->executeStepState('main');
> +
> + if ($mainResult === false) {
> + return false;
> }
>
> - // die if method is not defined in module
> - if (!method_exists($stepModule, $stepMethodName)) {
> - if ($process) {
> + return $mainResult;
> + }
> +
> +
> + /**
> + * Executes a certain state in a step. It dispatches all the config to
> the particular handlers.
> + * For example rendering forms, or calling the methods in that specific
> module.
> + *
> + * @param integer $state: The state that has to be executed
> + * @return The collected results of all given methods (In state pre and
> post it returns false if any of the methods returns false!)
> + */
> + private function executeStepState($state) {
> + $stateConfig = $this->stepConfig[$this->step][$state];
> +
> + // check if there is any config for this state in this particular step
> + if (!is_array($stateConfig)) {
> + if ($state == 'pre' || $state == 'post') {
> + // state pre and post don't have to be set, if they are not configured
> we estimate that everything is ok and return true
> return true;
> } else {
> - die(sprintf($this->get_LL('msg_error_methodnotfound'), $stepMethodName,
> $stepModuleName));
> + $this->addError(sprintf($this->get_LL('msg_error_stepstatenotdefined'),
> $state, $this->step), FATAL);
> + return false;
> }
> }
>
> - // create an array with environment variables that have to be sent via
> hidden fields
> - $staticFields = array (
> - 'step' => $this->step,
> - 'mode' => '123',
> - 'action' => 'process'
> - );
> + // prepare result streams
> + $formElements = array('normal' => NULL, 'advanced' => NULL);
> + $stateResult = '';
> +
> + // cycle through the various methods defined for this state
> + foreach ($stateConfig as $index => $stateMethod) {
> + $stateMethodResult = $this->dispatchStateMethod($stateMethod,
> $formElements);
> +
> + if ($state == 'main') {
> + if ($stateMethodResult == false) {
> + return false;
> + }
> + if (is_string($stateMethodResult)) {
> + $stateResult .= $stateMethodResult;
> + }
> + } else {
> + $stateResult = $stateMethodResult;
> +
> + // exit cycle if in pre or post state any state method returned false
> + if ($stateResult === false) {
> + break;
> + }
> + }
> + }
> +
> + // render form if any fields are set
> + if ($state == 'main' && (is_array($formElements['normal']) ||
> is_array($formElements['advanced']))) {
> + $elements = array(array(
> + 'type' => 'formelement',
> + 'value' => array (
> + 'elementType' => 'fieldset',
> + 'label' => $this->get_LL('label_normalFields')
> + )
> + ));
> +
> + $elements = array_merge($elements, $formElements['normal']);
> +
> + if (is_array($formElements['advanced'])) {
> + $elements[] = array (
> + 'type' => 'formelement',
> + 'value' => array (
> + 'elementType' => 'fieldset',
> + 'label' => $this->get_LL('label_advancedFields'),
> + 'class' => 'fieldset-advanced'
> + )
> + );
> + $elements = array_merge($elements, $formElements['advanced']);
> + }
> +
> + $formConfig = array (
> + 'type' => 'form',
> + 'value' => array(
> + 'options' => array(
> + 'name' => 'form_stepData',
> + 'submit' => $this->get_LL('label_next_step'),
> + ),
> + 'hidden' => array (
> + 'step' => $this->step,
> + 'mode' => '123',
> + 'state' => 'post'
> + ),
> + 'elements' => $elements
> + )
> + );
> +
> + $stateResult =
> $this->pObj->getViewObject()->render($formConfig).$stateResult;
> + }
> +
> + return $stateResult;
> + }
> +
> + private function dispatchStateMethod($stateMethod, &$formElements) {
> + $result = true;
> + if ($stateMethod['type'] == 'label') {
> + $methodResult = nl2br($this->get_LL($stateMethod['index']));
> + } else {
> + if (is_string($stateMethod)) {
> + $methodResult =
> $this->pObj->getBasicsObject()->executeMethod($stateMethod);
> + } else {
> + $methodResult =
> $this->pObj->getBasicsObject()->executeMethod(array($stateMethod['module'],
> $stateMethod['method']));
> + }
> + }
>
> - $environment = $this->pObj->getEnvironment();
> - if (isset($environment['L'])) {
> - $staticFields['L'] = $environment['L'];
> + if ($methodResult === false) {
> + return false;
> }
>
> - // now everything is checked and we can call the method and return the
> result
> - return $stepModule->$stepMethodName($staticFields);
> + switch ($stateMethod['type']) {
> + case 'form':
> + $formElements = array_merge($formElements, $methodResult);
> + break;
> + default:
> + $result = $methodResult;
> + break;
> + }
> +
> + return $result;
> }
>
>
> + /**
> + * Returns an XHTML fragment with a progressbar, that shows the progress
> in the installation process.
> + *
> + * @return string
> + */
> private function getProgress() {
> - $progressBar = '<div id="progressbar"><div class="';
> - $progressBar .= ($this->step <= $this->lastMandatoryStep) ? 'mandatory'
> : 'optional';
> - $progressBar .= '" style="width:'.(100 /count($this->steps)
> *$this->step).'%"></div></div>';
> + $progressBar = '<div id="progressbar"><div class="mandatory" ';
> + $progressBar .= 'style="width:'.(100 /count($this->stepConfig)
> *$this->step).'%"></div></div>';
> return $progressBar;
> }
>
> @@ -168,24 +399,18 @@
> * STEP METHODS
> */
>
> - private function initialChecks($staticFields) {
> - $checkString = '';
> - foreach ($this->initialChecks as $check) {
> - $result = $this->pObj->getBasicsObject()->executeMethod($check);
> - if ($result) {
> - $checkString .= $this->pObj->getViewObject()->getLastMessage(true);
> - } else {
> - $checkString .= $this->pObj->getViewObject()->renderErrors(true);
> - }
> - }
> - return $checkString;
> - //
> t3lib_div::debug(array($this->pObj->getViewObject()->getLastMessage(true)));
> + /**
> + * Shows the welcome screen.
> + *
> + */
> + public function welcomeScreen() {
> + return 'Hi';
> }
> -
> +
> /**
> * provides a selectbox with all available languages
> */
> - private function selectLanguage($staticFields) {
> + public function selectLanguage() {
> $languageData =
> $this->pObj->getLanguageObject()->includeLLFile('EXT:setup/mod/locallang.xml',
> false);
>
> $this->pObj->setLocalLang(t3lib_div::array_merge_recursive_overrule($this->pObj->getLocalLang(),
> $languageData));
>
> @@ -194,25 +419,15 @@
> $opt[$val] = $this->pObj->getBasicsObject()->getLabel('lang_'.$val);
> }
>
> - $formConfig = array (
> - 'type' => 'form',
> - 'value' => array (
> - 'options' => array (
> - 'name' => 'form_getlanguage',
> - 'submit' => $this->pObj->getBasicsObject()->getLabel('label_next_step'),
> - ),
> - 'hidden' => $staticFields,
> - 'elements' => array (
> - array (
> - 'type' => 'formelement',
> - 'value' => array (
> - 'label' => 'label_available_languages',
> - 'elementType' => 'selectbox',
> - 'options' => array (
> - 'name' => 'L',
> - 'elements' => $opt
> - )
> - )
> + $elements['normal'] = array (
> + array (
> + 'type' => 'formelement',
> + 'value' => array (
> + 'label' => 'label_available_languages',
> + 'elementType' => 'selectbox',
> + 'options' => array (
> + 'name' => 'L',
> + 'elements' => $opt
> )
> )
> )
> @@ -218,11 +433,7 @@
> )
> );
>
> - return $this->pObj->getViewObject()->render($formConfig);
> - }
> -
> - private function getBasicSettingsAndFinish($staticFields) {
> -
> + return $elements;
> }
> }
>
> Index: typo3/sysext/install/modules/installer/conf.php
> ===================================================================
> --- typo3/sysext/install/modules/installer/conf.php (revision 2928)
> +++ typo3/sysext/install/modules/installer/conf.php (working copy)
> @@ -1,2 +1,5 @@
> <?php
> +
> +
> +
> ?>
> \ No newline at end of file
> Index: typo3/sysext/install/modules/installer/locallang.xml
> ===================================================================
> --- typo3/sysext/install/modules/installer/locallang.xml (revision 2928)
> +++ typo3/sysext/install/modules/installer/locallang.xml (working copy)
> @@ -6,20 +6,34 @@
> </meta>
> <data type="array">
> <languageKey index="default" type="array">
> - <label index="msg_step1_title">Welcome to TYPO3</label>
> - <label index="msg_step1_description">This is the installation wizard for
> the TYPO3 Content Management System. When you click "next" a few initial
> checks will be performed to test if your server is suitable for
> TYPO3.</label>
> + <label index="msg_step0_title">Welcome to TYPO3</label>
> + <label index="msg_step0_description">This is the installation wizard for
> the TYPO3 Content Management System. This wizard will guide you trough the
> complete installation process.<p>Please select the language for the
> installation process.</p></label>
> +
> + <label index="msg_step1_title">Database connection</label>
> + <label index="msg_step1_description">Please enter the information for
> connecting to your prefered database.</label>
>
> - <label index="msg_step2_title">Select language</label>
> - <label index="msg_step2_description">Please select the language for the
> installation process.</label>
> + <label index="msg_step4_title">Create admin user</label>
> + <label index="msg_step4_description">Your database is set up
> sucessfully. Now we have to create an admin account for logging into the
> backend.</label>
>
> - <label index="msg_step5_title">Create admin user</label>
> - <label index="msg_step5_description">Your database is set up
> sucessfully. Now we have to create an admin account for logging into the
> backend.</label>
> + <label index="msg_step5_title">Congratulation</label>
> + <label index="msg_step5_description">You're basic setup is
> ready!</label>
> + <label index="msg_step5_done">Apparently you have completed the basic
> setup of the TYPO3 database.
> +Now you can choose between these options:
>
> - <label index="msg_step6_title">Congratulation</label>
> - <label index="msg_step6_description">You are basically done! You can now
> use TYPO3 by logging into the backend or go on with some more basic
> settings.</label>
> +- <a href="../../index.php"><strong>Go to the frontend
> pages</strong></a>
> +
> +- <a href="../index.php"><strong>Go to the backend
> login</strong></a>
> +
> +- <a href="index.php"><strong>Continue to configure
> TYPO3</strong></a> (Recommended).
> + This will let you analyse and verify that everything in your PHP
> installation is alright. Also if you want to configure TYPO3 to use all
> the cool features, you <em>must</em> dig into the
> this!</label>
>
> <label index="label_step">Step %d</label>
> + <label index="label_prev_step">Previous</label>
> <label index="label_next_step">Next</label>
> +
> + <label index="label_normalFields">Normal</label>
> + <label index="label_advancedFields">Advanced</label>
> +
> <label index="label_available_languages">Select your language</label>
>
> <label index="label_admin_username">Enter username for
> administrator</label>
> @@ -26,8 +40,9 @@
> <label index="label_admin_password">Enter a password for
> administrator</label>
> <label index="label_admin_password_2">Retype the password</label>
>
> - <label index="msg_error_stepnotdefined">FATAL! The requested step is not
> defined.</label>
> - <label index="msg_error_methodnotfound">FATAL! The requested method "%s"
> was not found in module "%s".</label>
> + <label index="msg_error_stepnotdefined">The requested step (%s) is not
> defined.</label>
> + <label index="msg_error_stepstatenotdefined">The requested state (%s) in
> step (%s) is not defined.</label>
> + <label index="msg_error_methodnotfound">The requested method "%s" was
> not found in module "%s".</label>
>
> <label index="msg_warning_invalidusername">The username "%s" was not
> alphanumeric, a-zA-Z0-9_-</label>
> <label index="msg_warning_emptyusername">The username was empty!</label>
> Index: typo3/sysext/install/modules/installer/res/tpl_step.html
> ===================================================================
> --- typo3/sysext/install/modules/installer/res/tpl_step.html (revision
> 2928)
> +++ typo3/sysext/install/modules/installer/res/tpl_step.html (working
> copy)
> @@ -92,6 +92,7 @@
> ###ERRORS_GENERAL###
>
> ###CONTENT###
> + ###BTN_BACK###
>
> ###PROGRESS###
> </div>
> Index:
> typo3/sysext/install/modules/setup/class.tx_install_module_setup.php
> ===================================================================
> --- typo3/sysext/install/modules/setup/class.tx_install_module_setup.php
> (revision 2928)
> +++ typo3/sysext/install/modules/setup/class.tx_install_module_setup.php
> (working copy)
> @@ -96,26 +96,24 @@
> $ajaxContent = $this->pObj->getViewObj()->renderErrors(true);
> } else {
> $filterResults = $this->pObj->getFilterResults();
> -
> +
> // get content from deliverables
> $ajaxContent = $this->renderCategoryDeliverables($moduleDeliverables);
> -
> - // try to write the data to localconf
> - if (!$this->basicsObject->saveLocalconf()) {
> - $ajaxContent =
> $this->pObj->getViewObject()->renderErrors().$ajaxContent;
> - } else {
> - $modMessage = '';
> - // var_dump($modifiedFields);
> - if (count($modifiedFields) > 0) {
> - $modMessage = $this->pObj->getViewObject()->render(array('type' =>
> 'list', 'value' => $modifiedFields));
> - }
> - $ajaxContent =
> $aboutBox.$this->pObj->getViewObject()->getLastMessage().$modMessage.$ajaxContent;
> - }
> -
> + }
> + }
> +
> + // try to write the data to localconf
> + if (!$this->basicsObject->saveLocalconf()) {
> + $ajaxContent =
> $this->pObj->getViewObject()->renderErrors().$ajaxContent;
> + } else {
> + $modMessage = '';
> + if (count($modifiedFields) > 0) {
> + $modMessage = $this->pObj->getViewObject()->render(array('type' =>
> 'list', 'value' => $modifiedFields));
> }
> + $ajaxContent =
> $aboutBox.$this->pObj->getViewObject()->getLastMessage().$modMessage.$ajaxContent;
> }
>
> - $returnValue = $this->pObj->getViewObject()->renderTag('h1',
> $titleSection).$formWrap[0].$ajaxContent.$formWrap[1];
> + $returnValue = $this->pObj->getViewObject()->renderTag('h1',
> $titleSection).$ajaxContent;
>
> } else {
> // this is the default... In other words this is only executed on first
> call. All other requests are done via AJAX see above...
> @@ -141,10 +139,17 @@
> }
>
>
> + /**
> + * Adds the about box on top of the page.
> + * The box is not displayed if no description was found.
> + *
> + * @param string $category: the category for which the about should be
> generated
> + */
> private function addAboutBox($category = 'categoryMain') {
> // create a about box
> - $categoryDescription = $this->get_LL('descr_'.$this->env[$category]);
> - if (!empty($categoryDescription)) {
> + $categoryDescription =
> $this->get_LL('description_module_'.$this->env[$category]);
> +
> + // if (!empty($categoryDescription)) {
> $aboutBoxCode = array (
> 'type' => 'box',
> 'value' => array (
> @@ -158,7 +163,7 @@
> ),
> array (
> 'type' => 'plain',
> - 'value' => $this->get_LL('descr_'.$this->env[$category])
> + 'value' => $categoryDescription
> )
> )
> )
> @@ -166,25 +171,24 @@
>
> // add the about box
> $this->pObj->getViewObject()->addContent('',
> $this->pObj->getViewObject()->render($aboutBoxCode));
> - }
> + // }
> }
>
> +
> + /**
> + * This one of the most important methods in setup. Here we render all
> pages and deliverables. It also
> + * looks for changes and pushes them to the localconf cache.
> + *
> + * @param array $deliverables: The deliverable configs
> + * @return HTML with the rendered deliverables
> + */
> private function renderCategoryDeliverables($deliverables) {
> $result = '';
> + $this->pObj->getViewObject()->clearLastMessage();
>
> foreach ($deliverables as $deliverable => $names) {
> - $result .= $this->pObj->getViewObject()->renderTag('h2',
> $this->get_LL('label_deliverable_'.$deliverable));
> -
> - // add form for saving options
> - if ($deliverable == 'options') {
> - $formWrap = array (
> - '<form action="index.php" method="post" id="optionsForm">'.
> - '<input type="hidden" name="categoryMain"
> value="'.$this->env['categoryMain'].'" />'.
> - '<input type="hidden" name="categorySub"
> value="'.$this->env['categorySub'].'" />',
> - '<input type="button" onclick="sendForm(\'optionsForm\');"
> value="'.$this->get_LL('label_save').'" /></form>'
> - );
> - } else {
> - $formWrap = array('', '');
> + if (!empty($this->env['categorySub'])) {
> + $result .= $this->pObj->getViewObject()->renderTag('h2',
> $this->get_LL('label_deliverable_'.$deliverable));
> }
>
> $modifiedFields = array();
> @@ -189,6 +193,12 @@
>
> $modifiedFields = array();
>
> + if ($deliverable == 'options') {
> + $result .= '<form action="index.php" method="post" id="optionsForm">'.
> + '<input type="hidden" name="categoryMain"
> value="'.$this->env['categoryMain'].'" />'.
> + '<input type="hidden" name="categorySub"
> value="'.$this->env['categorySub'].'" />';
> + }
> +
> foreach ($names as $name => $mod) {
> $modConfig = $GLOBALS['MCA'][$mod][$deliverable][$name];
>
> @@ -211,15 +221,20 @@
> switch ($deliverable) {
> case 'checks':
> // execute check and print out result in plain
> - // $this->pObj->getViewObject()->clearLastMessage();
> $checkResult = $this->basicsObject->executeMethod($modConfig['method']);
> - $deliverableContent = $this->get_LL('label_'.(($checkResult) ? 'true' :
> 'false'));
> + $messageConfig = array(
> + 'type' => 'message',
> + 'value' => array (
> + 'severity' => (($checkResult) ? 'ok' : 'error'),
> + 'label' => (($checkResult) ?
> $this->pObj->getViewObject()->getLastMessage() :
> $this->get_LL('label_false'))
> + ));
> if (!$checkResult) {
> - $deliverableContent .= $this->pObj->getViewObject()->renderErrors();
> + $messageConfig['value']['message'] =
> $this->pObj->getViewObject()->renderErrors();
> } else {
> - $deliverableContent .= $this->pObj->getViewObject()->getLastMessage();
> - $this->pObj->getViewObject()->clearLastMessage();
> + $messageConfig['value']['message'] =
> $this->pObj->getViewObject()->clearLastMessage();
> }
> + $deliverableContent =
> $this->pObj->getViewObject()->render($messageConfig);
> + $this->pObj->getViewObject()->clearLastMessage();
> break;
> case 'options':
> // options are rendered as input elements
> @@ -261,6 +276,7 @@
>
> $descr .= $this->pObj->getViewObject()->renderTag('span',
> $this->get_LL('label_path').'
> '.$this->basicsObject->getLocalconfPath($modConfig['value']).' -
> '.$this->get_LL('label_default').' '.$modConfig['default'], array('class'
> => 'description italic'));
> $deliverableContent =
> $this->pObj->getViewObject()->renderFormelement($inputConfig);
> +
> break;
> case 'methods':
> // the result of methods is simply printed out
> @@ -297,7 +313,13 @@
>
> $result .= $this->pObj->getViewObject()->renderTag('div',
> $deliverableBox, $paramData);
> }
> +
> + // add form for saving options
> + if ($deliverable == 'options') {
> + $result .= '<input type="button" onclick="sendForm(\'optionsForm\');"
> value="'.$this->get_LL('label_save').'" /></form>';
> + }
> }
> +
> return $result;
> }
>
> @@ -310,7 +332,11 @@
> private function renderCategoryTree($data) {
> // add the searchbox
> $content = '<div class="categoryTreeContainer">
> - <input type="text" id="treeFilter" value="" /><br />
> + <div id="treeOptions">
> + <div id="treeFilterBox">
> + <input type="text" id="treeFilter" value="" />
> + </div>
> + </div>
> <span id="filterStatus"></span>
> <a href="#" onclick="toggleAllLeafs()" id="collapseExpandToggle">
> '.$this->get_LL('label_expandAll').'
> Index: typo3/sysext/install/modules/setup/res/search_bubble.png
> ===================================================================
> --- typo3/sysext/install/modules/setup/res/search_bubble.png (revision
> 2928)
> +++ typo3/sysext/install/modules/setup/res/search_bubble.png (working
> copy)
> @@ -1,9 +0,0 @@
> -?PNG
> -
> --IHDRð"`tEXtSoftwareAdobe
> ImageReadyqÉe<^IDATxÚìoKK#Y?¿xN^?s`ðFð,¢f®Ä?,+Á.¸7£àÂ.ë8¡ýÂ8èJ\^>AÜ^,¢E
> AD"I T£TóÖXMtÚÒIsú} (*.ªES'ßåoS-l6+"ÿ'Eü ¡À"
> -L¡À"ü
> "ü-<'&&êm6Ûpeeå@EEEoii©·¸¸ø§¢"þ/òsççgyzzúëññ1~J¥Z?Ä^<ßZ[[»þè=-éB[jjjf\.×"Ú|?C"È¢$-''¡À"|YàL&#J^QâJ4.p8¼¯¶.»»»¥õõõlÁzootz<zùææfcc£¸Ýn±ÛíbµZ¥¬¬LTþçÆ
> Y!/èz©,étZ'ɤÄb1¹½½.««+¹¼¼\.BYVWW#K¡.¼-¦¦¦ù¶¶6kk«('¥ªªJ<¼'âR^B¾,16DbHOH\[[+N§STêW%(ûUIo-^ÀJØÈÛÙÙ)^¾·¼¼oÒb&Ý}ñT*2WlWáWõñYjÿ[ÞzïêêsBä.¼ø×@ÔD"rxx(§§§Z*?sÝÝÝÒ××'ÕÕÕ|j"|EfH
> -?'W?Ä"ríÅÅÅë¼
> -ìr¹?.o>=mÖåÝØØ£££Ïß fÚvss#ccc"~7D?Kp
> -n)§|ápxXú=ß aeL>y!¯×ë.ÁÁAééé'""ÙÝÝÕ>¯««"''>%BÞNÁ-8×Ì
> -lz¼Çápô¢ÛO¯×»H>äíïï×ryìql<Oy[b¸ÇàsÙëL l³Ù¼úP'.0j^?ÈkD?ÖÏBÌ¥Òp
> ®å]`Ü"4OÝf4¬Òf#ú±~zbNb8×ò.°"øút>jÞffmpûÏÒ£³FyA³_4ÝÄJ§ÓÇTLægãÌ-
> ¡ÛO?:ϯjfmqq!íííú8!$p
> S-áZÞZÇã{*Âþ,$"F¸Ç?SÐm6Zë)¦?mookÓÇ0ùf'[^}S%\Ë»ÀÑht+<í§R)Y±-?1Td.BÚ4y±×
> ôZZ>)BrO©.p ®å½z>>»Vuåþþ^äk< i[ZZdhhH0s+Ëùù9Y!9ä.Sp ZÁµ¼G`
> Rä%§ÓÙbµZýúTÊ\s qµ/ºjgggÒÐÐÀ'EHZÔò?B¡8özëß½opyyÙ©êÙyUëú¹~ > \ No
> newline at end of file
> Index: typo3/sysext/install/modules/setup/res/search_reset.png
> ===================================================================
> --- typo3/sysext/install/modules/setup/res/search_reset.png (revision
> 2928)
> +++ typo3/sysext/install/modules/setup/res/search_reset.png (working copy)
> @@ -1,6 +0,0 @@
> -?PNG
> -
> --IHDR ©¬w&tEXtSoftwareAdobe
> ImageReadyqÉe<-IDATxÚ"'¡n"@Eo§UU"TôÙU¸fU]Á@j üB\Eû
> ·º,äªõà@,b±-$~¾T¼ÍRÕ>oÌ\ÞæÍïû`í^=ñBl?s8ßÄIî8øF¼\õļÄAðZ*¨iÖb¿áúNðÑ*Ç1LÓTA9J¿Z°¿µ,ë"&ó<£ë:A?eYày'$Aß÷-fî_F©®kE×u'ç¹ò+mßZÉ0
> ض,Ëà8Zò+Õ,Û]×EÒ4U»Ë1
> Cõu"ÿüC"çisʲDÛ¶ªr>YQUÆq"¶!¾7\ö±?áOëØ7\?]å@´ÿ½à¯Y ]=otIEND®B`,
> \ No newline at end of file
> Index: typo3/sysext/install/modules/setup/res/styles.css
> ===================================================================
> --- typo3/sysext/install/modules/setup/res/styles.css (revision 2928)
> +++ typo3/sysext/install/modules/setup/res/styles.css (working copy)
> @@ -21,7 +21,7 @@
> font-weight: bold;
> }
>
> -input, select, button {
> +input.bg, select.bg, button.bg {
> background: #fff url(../../../imgs/icons/bg_input.gif) no-repeat scroll
> left top;
> border: 1px solid #aaa;
> margin-top: 2px;
> @@ -38,10 +38,8 @@
> position: fixed;
> top: 5px;
> left: 5px;
> - width: 240px;
> + width: 210px;
> padding: 5px;
> - border: 1px gray solid;
> - background-color: white;
> }
>
> #collapseExpandToggle {
> @@ -52,20 +50,6 @@
> margin: 5px 0;
> text-decoration: none;
> border-top: 1px #f0f0f0 solid;
> - display: block;
> -}
> -
> -#treeFilter {
> - background: url(search_bubble.png) no-repeat top left;
> - border: none;
> -
> - height: 30px;
> - width: 240px;
> -
> - margin-bottom: 2px;
> - padding: 8px 17px 8px 30px;
> -
> - text-align: left;
> }
>
> .categoryTree {
> @@ -71,6 +55,7 @@
> .categoryTree {
> padding: 0;
> list-style-type: none;
> + clear: left;
> }
>
> .categoryTree img {
> @@ -123,6 +108,30 @@
> margin: 5px;
> }
>
> +.installer-message {
> + margin-bottom: 15px;
> +}
> +
> +.installer-message strong.message-header {
> + display: block;
> + background-color: #d9d5c9;
> + padding: 3px;
> +}
> +
> +.severity_ok strong.message-header {
> + background-image: url('../../../imgs/icons/ok.png');
> + background-position: 4px 50%;
> + background-repeat: no-repeat;
> + padding-left: 24px;
> +}
> +
> +.severity_error strong.message-header {
> + background-image: url('../../../imgs/icons/cancel.png');
> + background-position: 4px 50%;
> + background-repeat: no-repeat;
> + padding-left: 24px;
> +}
> +
> .error-fatal {
> color: red;
> }
>
More information about the TYPO3-team-core
mailing list