diff options
author | Pellaeon Lin <nfsmwlin@gmail.com> | 2014-10-21 17:27:02 +0400 |
---|---|---|
committer | Pellaeon Lin <nfsmwlin@gmail.com> | 2014-10-21 17:27:02 +0400 |
commit | 0c71e30e792cba485e1e9536e30f57a80465e9ca (patch) | |
tree | 01e13156a416be6a6e3d07929e8bcae4c439cc9e | |
parent | f17129495385807e579633839787c8589d65081e (diff) |
Use custom message template
-rw-r--r-- | controller/registercontroller.php | 22 | ||||
-rw-r--r-- | templates/message.php | 21 |
2 files changed, 13 insertions, 30 deletions
diff --git a/controller/registercontroller.php b/controller/registercontroller.php index 94d5e39..5b3885e 100644 --- a/controller/registercontroller.php +++ b/controller/registercontroller.php @@ -89,13 +89,9 @@ class RegisterController extends Controller { \OC_Template::printErrorPage( 'A problem occurs during sending the e-mail please contact your administrator.'); return; } - // TODO: below is not an error, should add "message" template - return new TemplateResponse('', 'error', array( - 'errors' => array(array( - 'error' => $this->l10n->t('Verification email successfully sent.'), - 'hint' => '' - )) - ), 'error'); + return new TemplateResponse('registration', 'message', array('msgs' => + $this->l10n->t('Verification email successfully sent.') + )); } /** @@ -150,15 +146,9 @@ class RegisterController extends Controller { )) ), 'error'); } - // TODO: below is not an error, should add "message" template - return new TemplateResponse('', 'error', array( - 'errors' => array(array( - 'error' => str_replace('{link}', - $this->urlgenerator->getAbsoluteUrl('/'), - $this->l10n->t('Your account has been successfully created, you can <a href="{link}">log in now</a>.')), - 'hint' => '' - )) - ), 'error'); + return new TemplateResponse('registration', 'message', array('msgs' => + $this->l10n->t('Your account has been successfully created, you can <a href="{link}">log in now</a>.') + )); } } } diff --git a/templates/message.php b/templates/message.php index e134330..0d5f15d 100644 --- a/templates/message.php +++ b/templates/message.php @@ -1,14 +1,7 @@ -<?php if ( $_['errors'] ) { - echo '<ul class="error">'; - foreach ( $_['errors'] as $error ) { ?> - <li><?php echo $error; ?></li> - <?php } - echo '</ul>'; -} -if ( $_['messages'] ) { - echo '<ul class="success">'; - foreach ($_['messages'] as $message ) {?> - <li><?php echo $message; ?></li> -<?php } - echo '</ul>'; -}?> +<ul class="error-wide"> + <?php foreach($_["msgs"] as $msg):?> + <li class='msg'> + <?php print_unesacped($msg) ?><br/> + </li> + <?php endforeach ?> +</ul> |