[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // eZSetup - init part initialization 4 // 5 // Created on: <08-Nov-2002 11:00:54 kd> 6 // 7 // SOFTWARE NAME: eZ publish 8 // SOFTWARE RELEASE: 3.9.0 9 // BUILD VERSION: 17785 10 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 11 // SOFTWARE LICENSE: GNU General Public License v2.0 12 // NOTICE: > 13 // This program is free software; you can redistribute it and/or 14 // modify it under the terms of version 2.0 of the GNU General 15 // Public License as published by the Free Software Foundation. 16 // 17 // This program is distributed in the hope that it will be useful, 18 // but WITHOUT ANY WARRANTY; without even the implied warranty of 19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 // GNU General Public License for more details. 21 // 22 // You should have received a copy of version 2.0 of the GNU General 23 // Public License along with this program; if not, write to the Free 24 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 25 // MA 02110-1301, USA. 26 // 27 // 28 29 /*! 30 \class eZStepData ezstep_data.php 31 \brief Encapsulates information on all steps 32 33 */ 34 35 class eZStepData 36 { 37 function eZStepData( ) 38 { 39 } 40 41 /*! 42 \static 43 Get file and class info for specified step 44 45 \param step number or 46 step name 47 \return array containing file name and class name 48 */ 49 function &step( $description ) 50 { 51 if ( is_string( $description ) ) 52 { 53 foreach ( $this->StepTable as $step ) 54 { 55 if ( $step['class'] == $description ) 56 { 57 return $step; 58 } 59 } 60 } 61 else if ( is_int( $description ) ) 62 { 63 if ( isset( $this->StepTable[$description] ) ) 64 { 65 return $this->StepTable[$description]; 66 } 67 } 68 $retValue = null; 69 return $retValue; 70 } 71 72 /*! 73 \static 74 Get nest install step from step array 75 76 \param current step 77 78 \return next step 79 */ 80 function &nextStep( &$step ) 81 { 82 foreach ( $this->StepTable as $key => $tableStep ) 83 { 84 if ( $step['class'] == $tableStep['class'] ) 85 { 86 return $this->StepTable[++$key]; 87 } 88 } 89 $retValue = null; 90 return $retValue; 91 } 92 93 /*! 94 \static 95 Get previous install step from step array 96 97 \param current step 98 99 \return previous step 100 */ 101 function &previousStep( &$step ) 102 { 103 if ( is_string( $step ) ){ 104 foreach ( $this->StepTable as $key => $tableStep ) 105 { 106 if ( $step == $tableStep['class'] ) 107 { 108 return $this->StepTable[--$key]; 109 } 110 } 111 } 112 else 113 { 114 foreach ( $this->StepTable as $key => $tableStep ) 115 { 116 if ( $step['class'] == $tableStep['class'] ) 117 { 118 return $this->StepTable[--$key]; 119 } 120 } 121 } 122 $retValue = null; 123 return $retValue; 124 } 125 126 /*! 127 \static 128 Get setup progress in percent of total number of steps 129 130 \param current step 131 132 \return Percentage of completet setup, step 1 => 0%, final step => 100% 133 */ 134 function progress( &$step ) 135 { 136 $totalSteps = 0; 137 foreach ( $this->StepTable as $tableStep ) 138 { 139 if ( !isset( $tableStep['count_step'] ) or 140 $tableStep['count_step'] ) 141 ++$totalSteps; 142 } 143 144 $currentStep = 0; 145 foreach ( $this->StepTable as $key => $tableStep ) 146 { 147 if ( $step['class'] == $tableStep['class'] ) 148 { 149 break; 150 } 151 else if ( !isset( $tableStep['count_step'] ) or 152 $tableStep['count_step'] ) 153 ++$currentStep; 154 } 155 156 return (int) ( $currentStep * 100 / ( $totalSteps - 1 ) ); 157 } 158 159 /// \privatesection 160 /// Array contain all steps in the setup wizard 161 var $StepTable = array( array( 'file' => 'welcome', 162 'class' => 'Welcome' ), 163 array( 'file' => 'system_check', 164 'class' => 'SystemCheck' ), 165 array( 'file' => 'system_finetune', 166 'class' => 'SystemFinetune' ), 167 array( 'file' => 'email_settings', 168 'class' => 'EmailSettings' ), 169 array( 'file' => 'database_choice', 170 'class' => 'DatabaseChoice' ), 171 array( 'file' => 'database_init', 172 'class' => 'DatabaseInit' ), 173 array( 'file' => 'language_options', 174 'class' => 'LanguageOptions' ), 175 array( 'file' => 'site_types', 176 'class' => 'SiteTypes'), 177 // array( 'file' => 'site_packages', 178 // 'class' => 'SitePackages' ), 179 array( 'file' => 'site_access', 180 'class' => 'SiteAccess'), 181 array( 'file' => 'site_details', 182 'class' => 'SiteDetails'), 183 array( 'file' => 'site_admin', 184 'class' => 'SiteAdmin'), 185 array( 'file' => 'security', 186 'class' => 'Security' ), 187 array( 'file' => 'registration', 188 'class' => 'Registration' ), 189 array( 'file' => 'create_sites', 190 'class' => 'CreateSites', 191 'count_step' => false ), 192 array( 'file' => 'final', 193 'class' => 'Final') ); 194 195 } 196 197 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 10:30:04 2007 | par Balluche grâce à PHPXref 0.7 |