Bug #24583 ยป 17320.diff

Administrator Admin, 2011-01-26 00:24

View differences:

typo3/sysext/install/updates/class.tx_coreupdates_installnewsysexts.php (Arbeitskopie)
45 45
	 * @return	boolean		whether an update is needed (true) or not (false)
46 46
	 */
47 47
	public function checkForUpdate(&$description) {
48
		$result = false;
48
		$result = FALSE;
49 49
		$description = '
50 50
			<p>
51 51
				Install the following system extensions that are new in TYPO3
......
72 72
					</li>
73 73
				';
74 74

  
75
				$result = true;
75
				$result = TRUE;
76 76
			}
77 77
		}
78 78

  
79 79
		$description .= '
80 80
			</ul>
81 81
		';
82
		if ($this->isWizardDone()) {
83
			$result = FALSE;
84
		}
82 85

  
83 86
		return $result;
84 87
	}
......
134 137
	 * @return	boolean		whether it worked (true) or not (false)
135 138
	 */
136 139
	public function performUpdate(&$dbQueries, &$customMessages) {
137
		$result = FALSE;
138 140

  
139 141
			// Get extension keys that were submitted by the user to be installed and that are valid for this update wizard
140 142
		if (is_array($this->pObj->INSTALL['update']['installNewSystemExtensions']['sysext'])) {
......
143 145
				array_keys($this->pObj->INSTALL['update']['installNewSystemExtensions']['sysext'])
144 146
			);
145 147
			$this->installExtensions($extArray);
146
			$result = TRUE;
147 148
		}
148 149

  
149
		return $result;
150
			// Never show this wizard again
151
		$this->markWizardAsDone();
152

  
153
		return TRUE;
150 154
	}
151 155

  
152 156

  
typo3/sysext/install/updates/class.tx_coreupdates_installsysexts.php (Arbeitskopie)
45 45
	 * @return	boolean		whether an update is needed (true) or not (false)
46 46
	 */
47 47
	public function checkForUpdate(&$description) {
48
		$result = false;
48
		$result = FALSE;
49 49
		$description = '
50 50
			<p>
51 51
				Install the following system extensions as their functionality
......
107 107

  
108 108
		foreach($this->newSystemExtensions as $ext) {
109 109
			if (!t3lib_extMgm::isLoaded($ext)) {
110
				$result = true;
110
				$result = TRUE;
111 111
			}
112 112
		}
113
		if ($this->isWizardDone()) {
114
			$result = FALSE;
115
		}
113 116
		return $result;
114 117
	}
115 118

  
......
179 182
	 * @return	boolean		whether it worked (true) or not (false)
180 183
	 */
181 184
	public function performUpdate(&$dbQueries, &$customMessages) {
182
		$result = FALSE;
183 185

  
184 186
			// Get extension keys that were submitted by the user to be installed and that are valid for this update wizard
185 187
		if (is_array($this->pObj->INSTALL['update']['installSystemExtensions']['sysext'])) {
......
188 190
				array_keys($this->pObj->INSTALL['update']['installSystemExtensions']['sysext'])
189 191
			);
190 192
			$this->installExtensions($extArray);
191
			$result = TRUE;
192 193
		}
193 194

  
194
		return $result;
195
			// Never show this wizard again
196
		$this->markWizardAsDone();
197

  
198
		return TRUE;
195 199
	}
196 200

  
197 201
	/**
typo3/sysext/install/Classes/Updates/Base.php (Arbeitskopie)
220 220
		}
221 221
	}
222 222

  
223
	/**
224
	 * Marks some wizard as being "seen" so that it not shown again.
225
	 *
226
	 * Writes the info in localconf.php
227
	 *
228
	 * @return void
229
	 */
230
	protected function markWizardAsDone() {
231
		// Instance of install tool
232
		$install = new t3lib_install;
233
		$install->allowUpdateLocalConf = 1;
234
		$install->updateIdentity = 'TYPO3 Upgrade Wizard';
235
		// Get lines from localconf file
236
		$lines = $install->writeToLocalconf_control();
237
		$wizardClassName = get_class($this);
238
		$install->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'INSTALL\'][\'wizardDone\'][\'' . $wizardClassName . '\']', 1);
239
		$install->writeToLocalconf_control($lines);
240
	}
241

  
242
	/**
243
	 * Checks if this wizard has been "done" before
244
	 *
245
	 * @return boolean TRUE if wizard has been done before, FALSE otherwise
246
	 */
247
	protected function isWizardDone() {
248
		$wizardClassName = get_class($this);
249
		$done = FALSE;
250
		if (isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone'][$wizardClassName]) &&
251
			$GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone'][$wizardClassName]) {
252
			$done = TRUE;
253
		}
254
		return $done;
255
	}
223 256
}
224 257
?>
    (1-1/1)