if(md5($GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'].'|'.$randomKey) == $combinedKey || $this->checkPassword($randomKey)) {
$this->passwordOK = true;
} else {
- $this->viewObj->addContent($this->basicsObj->getLabel('label_login'), $this->loginForm());
+ $this->viewObj->addContent('', $this->loginForm());
echo $this->viewObj->getDocCode();
}
}
);
}
- $this->basicsObj->addError(sprintf($this->basicsObj->getLabel('msg_error_login_not_sucessful_message'), md5($password)), FATAL, 'fields', 'password');
+ $this->basicsObj->addError(sprintf($this->basicsObj->getLabel('msg_error_login_not_sucessful_message'), md5($password)), FATAL, 'fields', 'typo3_install_password');
}
}
'options' => array(
'name' => 'form_setuplogin',
'submit' => $this->basicsObj->getLabel('label_login'),
+ 'id' => 'formLogin'
),
'elements' => array(
+ array (
+ 'type' => 'plain',
+ 'value' => $this->viewObj->renderTag('h4', $this->basicsObj->getLabel('label_login'))
+ ),
array(
'type' => 'formelement',
'value' => array(
'label' => 'label_setup_password',
+ 'label_align' => 'top',
'elementType' => 'password',
'options' => array(
- 'name' => 'typo3_install_password'
+ 'name' => 'typo3_install_password',
+ 'id' => 'typo3_install_password',
+ 'class' => 'bg'
)
)
),
array(
- 'type' => 'plain',
- 'value' => $this->basicsObj->getLabel('msg_login_passwordhint')
+ 'type' => 'message',
+ 'value' => array(
+ 'message' => $this->basicsObj->getLabel('msg_login_passwordhint'),
+ 'addBR' => false
+ )
)
)
)
$renderMethod = 'render'.ucfirst($type);
if(method_exists($this, $renderMethod)) {
-
$content = $this->$renderMethod($data);
} else {
$content = sprintf($this->pObj->getBasicsObject()->getLabel('no_method'), $type);
case 'general':
if(is_array($this->errors['general'])) {
$hasErrors = true;
-
+
foreach ($this->errors['general'] as $errorItem) {
- $content .= '<li>'.$this->renderError($errorItem).'</li>';
+ $content .= $this->renderErrorListItem($errorItem);
}
}
break;
$hasErrors = true;
foreach ($this->errors['fields'][$reqFieldName] as $errorItem) {
- $content .= '<li>'.$this->renderError($errorItem).'</li>';
+ $content .= $this->renderErrorListItem($errorItem);
}
}
break;
}
- $content .= '</ul><div>';
+ $content .= '</ul></div>';
$returnValue = $content;
if(!$hasErrors) {
return $returnValue;
}
+ /**
+ * Renders a list item for a single error. (<li>error message</li>)
+ *
+ * @param array $errorItem: The data of the error item (array('severity', 'message'))
+ * @return XHTML for a single list item <li>...
+ */
+ private function renderErrorListItem($errorItem) {
+ $result = '<li';
+
+ switch ($errorItem['severity']) {
+ case WARNING:
+ $result .= ' class="severity-warning"';
+ break;
+ case FATAL:
+ $result .= ' class="severity-fatal"';
+ break;
+ }
+
+ $result .= '>'.$this->renderError($errorItem).'</li>';
+ return $result;
+ }
+
/**
* Returns the HTML markup for a single error message, adds CSS class depending on the severity,
* adds a "FATAL" if we have a fatal error and wraps the message with <span></span>.
* @return string HTML output
*/
private function renderMessage($data) {
- $out = '<div'.(($data['severity']) ? ' class="installer-message severity_'.$data['severity'].'"' : '').'>';
+ $out = '<div class="installer-message'.(($data['severity']) ? ' severity_'.$data['severity'] : '').'">';
if ($data['label']) {
if (is_array($data['label'])) {
$tag = $data['label'][0];
if ($data['options']['ajax'] == true) {
$content .= '<br /><button class="submit" onclick="return '.$data['options']['action'].'">'.$data['options']['submit'].'</button>';
} else {
- $content .= '<br /><input type="submit" class="submit" value="'.$data['options']['submit'].'" />';
+ $content .= '<br /><input type="submit" class="submit bg" value="'.$data['options']['submit'].'" />';
}
$content .= '</form>';
*/
public function renderFormelement($data) {
$content = '';
- $viewObj = $this->pObj->getViewObject();
$basicsObj = $this->pObj->getBasicsObject();
if ($data['elementType'] == 'fieldset') {
if(method_exists($this, $elementRenderMethod)) {
// set the value of the field from the environment if no error is recognized for it
// also set an error string if error was found
- $errors = $viewObj->getErrors();
+ $errors = $this->getErrors();
+
if(!isset($errors['fields'][$data['options']['name']])) {
$environment = $this->pObj->getEnvironment();
if(!empty($environment[$data['options']['name']])) {
}
$errorStr = '';
} else {
- $errorStr = $viewObj->renderErrors(true, 'fields', $data['options']['name']);
+ $errorStr = $this->renderErrors(true, 'fields', $data['options']['name']);
}
// render the form element
// align the label (default is left)
switch ($data['label_align']) {
+ case 'top':
+ $formElementCode = $label.'<br />'.$errorStr.$formElementCode;
+ break;
case 'right':
$formElementCode = $errorStr.$formElementCode.$label;
break;
$this->getAttributeString('id', $data['id']).
$this->getAttributeString('size', $data['size'], 20).
$this->getAttributeString('value', $data['value'], '').
+ $this->getAttributeString('class', $data['class']).
' />';
return $content;
$this->getAttributeString('name', $data['name']).
$this->getAttributeString('id', $data['id']).
$this->getAttributeString('size', $data['size'], 20).
+ $this->getAttributeString('class', $data['class']).
' />';
return $content;
*
* @param string $helpStr
* @param string $id: A unique ID for the container. A random value is appended
- * @return array ('button', 'conatiner')
+ * @return array ('button', 'container')
*/
public function renderHelp($helpStr, $id) {
if (empty($helpStr)) {
<label index="no_image">No image found</label>
<label index="msg_error_login_not_sucessful">Login was not sucessful</label>
- <label index="msg_error_login_not_sucessful_message">The submitted password was not correct. Your md5 checksum is "%s"</label>
+ <label index="msg_error_login_not_sucessful_message">The submitted password was not correct.<br />Your md5 checksum is "%s"</label>
<label index="login_emailwarning_true_subject">Install Tool Login at "%s"</label>
<label index="login_emailwarning_true_message">There has been a Install Tool login at TYPO3 site "%s" (%s) from remote address "%s" (%s).</label>
BTW: This Install Tool will only work if cookies are accepted by your web browser. If this dialog pops up over and over again you didn't enable cookies.
</label>
<label index="msg_login_passwordhint">The Install Tool Password is not the admin password of TYPO3.
-If you don't know the current password, you can set a new one by setting the value of $TYPO3_CONF_VARS['BE']['installToolPassword'] in typo3conf/localconf.php to the md5() hash value of the password you desire.
- </label>
+
+If you don't know the current password, you can set a new one by setting the value of $TYPO3_CONF_VARS['BE']['installToolPassword'] in typo3conf/localconf.php to the md5() hash value of the password you desire.</label>
</languageKey>
</data>
</T3locallang>
\ No newline at end of file
padding:3px;
}
+/** styles for login box - start **/
+form#formLogin {
+ width: 400px;
+ position: absolute;
+ left: 50%;
+ margin-left: -200px;
+
+ background-color: #D7DBE2;
+ border: 1px solid #9BA1A8;
+ padding: 10px;
+}
+
+form#formLogin h4 {
+ font-size: 16px;
+ font-weight: bold;
+ background: none;
+ margin: 0 0 16px 0;
+}
+
+form#formLogin .formElement {
+ background-color: white;
+ border: 1px silver solid;
+ padding: 10px 5px;
+ text-align: center;
+}
+
+form#formLogin label {
+ font-weight: bold;
+}
+
+form#formLogin .installer-message {
+ margin: 10px 0;
+ font-size: 11px;
+ font-style: italic;
+}
+
+form#formLogin .submit {
+ font-weight: bold;
+ font-size: 12px;
+ width: 100%;
+ cursor: pointer;
+}
+
+form#formLogin .submit:hover {
+ color: green;
+}
+
+form#formLogin ul {
+ text-align: left;
+}
+
+/** styles for login box - end **/
+
label em {
font-style: italic;
display: block;
margin: 0px 0px 7px 20px;
}
+.error-header {
+ font-weight: bold;
+ color: red;
+ margin: 5px;
+}
+
.categoryTreeContainer {
position: fixed;
top: 5px;
padding: 3px;
}
+/** error messages **/
+
.severity_ok strong.message-header {
background-image: url('../../../imgs/icons/ok.png');
background-position: 4px 50%;
.error-warning {
color: #AA0000;
+}
+
+/* list items */
+li.severity-fatal {
+ list-style-image: url(../../../imgs/icons/cancel.png);
+}
+
+li.severity-warning {
+ list-style-image: url(../../../imgs/icons/warning.png);
}
\ No newline at end of file