Add page titles

refs #7163
This commit is contained in:
Johannes Meyer 2014-11-11 15:27:14 +01:00
parent 79c2758ff5
commit 4974f582d3
24 changed files with 219 additions and 17 deletions

View File

@ -17,6 +17,18 @@ class BackendPage extends Form
public function createElements(array $formData)
{
$this->addElement(
new Note(
'title',
array(
'value' => mt('monitoring', 'Monitoring Backend', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',

View File

@ -25,6 +25,18 @@ class IdoResourcePage extends Form
'value' => 'db'
)
);
$this->addElement(
new Note(
'title',
array(
'value' => mt('monitoring', 'Monitoring IDO Resource', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',

View File

@ -17,6 +17,18 @@ class InstancePage extends Form
public function createElements(array $formData)
{
$this->addElement(
new Note(
'title',
array(
'value' => mt('monitoring', 'Monitoring Instance', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',

View File

@ -25,6 +25,18 @@ class LivestatusResourcePage extends Form
'value' => 'livestatus'
)
);
$this->addElement(
new Note(
'title',
array(
'value' => mt('monitoring', 'Monitoring Livestatus Resource', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',

View File

@ -17,6 +17,18 @@ class SecurityPage extends Form
public function createElements(array $formData)
{
$this->addElement(
new Note(
'title',
array(
'value' => mt('monitoring', 'Monitoring Security', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',

View File

@ -80,7 +80,7 @@ class BackendStep extends Step
public function getSummary()
{
$pageTitle = '<h2>' . mt('monitoring', 'Monitoring Backend') . '</h2>';
$pageTitle = '<h2>' . mt('monitoring', 'Monitoring Backend', 'setup.page.title') . '</h2>';
$backendDescription = '<p>' . sprintf(
mt(
'monitoring',

View File

@ -44,7 +44,7 @@ class InstanceStep extends Step
public function getSummary()
{
$pageTitle = '<h2>' . mt('monitoring', 'Monitoring Instance') . '</h2>';
$pageTitle = '<h2>' . mt('monitoring', 'Monitoring Instance', 'setup.page.title') . '</h2>';
if (isset($this->data['instanceConfig']['host'])) {
$pipeHtml = '<p>' . sprintf(

View File

@ -43,7 +43,7 @@ class SecurityStep extends Step
public function getSummary()
{
$pageTitle = '<h2>' . mt('monitoring', 'Monitoring Security') . '</h2>';
$pageTitle = '<h2>' . mt('monitoring', 'Monitoring Security', 'setup.page.title') . '</h2>';
$pageDescription = '<p>' . mt(
'monitoring',
'Icinga Web 2 will protect your monitoring environment against'

View File

@ -176,14 +176,26 @@ class AdminAccountPage extends Form
);
}
$this->addElement(
new Note(
'title',
array(
'value' => mt('setup', 'Administration', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',
array(
'value' => tp(
'Now it\'s time to configure your first administrative account.'
'Now it\'s time to configure your first administrative account for Icinga Web 2.'
. ' Please follow the instructions below:',
'Now it\'s time to configure your first administrative account.'
'Now it\'s time to configure your first administrative account for Icinga Web 2.'
. ' Below are several options you can choose from. Select one and follow its instructions:',
count($choices)
)

View File

@ -59,6 +59,19 @@ class AuthBackendPage extends Form
*/
public function createElements(array $formData)
{
$this->addElement(
new Note(
'title',
array(
'value' => mt('setup', 'Authentication Backend', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
if ($this->config['type'] === 'db') {
$note = mt(
'setup',
@ -137,7 +150,7 @@ class AuthBackendPage extends Form
'checkbox',
'skip_validation',
array(
'order' => 1,
'order' => 2,
'ignore' => true,
'required' => true,
'label' => mt('setup', 'Skip Validation'),

View File

@ -26,6 +26,18 @@ class AuthenticationPage extends Form
*/
public function createElements(array $formData)
{
$this->addElement(
new Note(
'title',
array(
'value' => mt('setup', 'Authentication', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',

View File

@ -87,6 +87,18 @@ class DatabaseCreationPage extends Form
*/
public function createElements(array $formData)
{
$this->addElement(
new Note(
'title',
array(
'value' => mt('setup', 'Database Setup', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',
@ -204,7 +216,7 @@ class DatabaseCreationPage extends Form
'checkbox',
'skip_validation',
array(
'order' => 1,
'order' => 2,
'required' => true,
'label' => mt('setup', 'Skip Validation'),
'description' => mt(

View File

@ -36,6 +36,18 @@ class DbResourcePage extends Form
'value' => 'db'
)
);
$this->addElement(
new Note(
'title',
array(
'value' => mt('setup', 'Database Resource', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',

View File

@ -27,6 +27,18 @@ class GeneralConfigPage extends Form
*/
public function createElements(array $formData)
{
$this->addElement(
new Note(
'title',
array(
'value' => mt('setup', 'Application Configuration', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',

View File

@ -17,7 +17,6 @@ class LdapDiscoveryConfirmPage extends Form
const TYPE_MISC = 'LDAP';
private $infoTemplate = <<< 'EOT'
Found LDAP server on {domain}
<table><tbody>
<tr><td><strong>Type:</strong></td><td>{type}</td></tr>
<tr><td><strong>Port:</strong></td><td>{port}</td></tr>
@ -73,7 +72,6 @@ EOT;
$resource = $this->config['resource'];
$backend = $this->config['backend'];
$html = $this->infoTemplate;
$html = str_replace('{domain}', $this->config['domain'], $html);
$html = str_replace('{type}', $this->config['type'], $html);
$html = str_replace('{hostname}', $resource['hostname'], $html);
$html = str_replace('{port}', $resource['port'], $html);
@ -81,6 +79,30 @@ EOT;
$html = str_replace('{user_attribute}', $backend['user_name_attribute'], $html);
$html = str_replace('{user_class}', $backend['user_class'], $html);
$this->addElement(
new Note(
'title',
array(
'value' => mt('setup', 'LDAP Discovery Results', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',
array(
'value' => sprintf(
mt('setup', 'The following directory service has been found on domain "%s":'),
$this->config['domain']
)
)
)
);
$this->addElement(
new Note(
'suggestion',

View File

@ -31,6 +31,18 @@ class LdapDiscoveryPage extends Form
*/
public function createElements(array $formData)
{
$this->addElement(
new Note(
'title',
array(
'value' => mt('setup', 'LDAP Discovery', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',
@ -46,6 +58,9 @@ class LdapDiscoveryPage extends Form
$this->discoveryForm = new LdapDiscoveryForm();
$this->addElements($this->discoveryForm->createElements($formData)->getElements());
$this->getElement('domain')->setRequired(
isset($formData['skip_validation']) === false || ! $formData['skip_validation']
);
$this->addElement(
'checkbox',

View File

@ -34,6 +34,18 @@ class LdapResourcePage extends Form
'value' => 'ldap'
)
);
$this->addElement(
new Note(
'title',
array(
'value' => mt('setup', 'LDAP Resource', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',

View File

@ -44,6 +44,18 @@ class PreferencesPage extends Form
*/
public function createElements(array $formData)
{
$this->addElement(
new Note(
'title',
array(
'value' => mt('setup', 'Preferences', 'setup.page.title'),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'h2'))
)
)
)
);
$this->addElement(
new Note(
'description',

View File

@ -7,6 +7,7 @@ $showRadioBoxes = strpos(strtolower(get_class($radioElem)), 'radio') !== false;
?>
<form id="<?= $form->getName(); ?>" name="<?= $form->getName(); ?>" enctype="<?= $form->getEncType(); ?>" method="<?= $form->getMethod(); ?>" action="<?= $form->getAction(); ?>">
<?= $form->getElement('title'); ?>
<?= $form->getElement('description'); ?>
<?php if (($byNameElem = $form->getElement('by_name')) !== null): ?>
<div>

View File

@ -112,9 +112,9 @@ class AuthenticationStep extends Step
public function getSummary()
{
$pageTitle = '<h2>' . mt('setup', 'Authentication') . '</h2>';
$backendTitle = '<h3>' . mt('setup', 'Backend Configuration') . '</h3>';
$adminTitle = '<h3>' . mt('setup', 'Initial Administrative Account') . '</h3>';
$pageTitle = '<h2>' . mt('setup', 'Authentication', 'setup.page.title') . '</h2>';
$backendTitle = '<h3>' . mt('setup', 'Authentication Backend', 'setup.page.title') . '</h3>';
$adminTitle = '<h3>' . mt('setup', 'Administration', 'setup.page.title') . '</h3>';
$authType = $this->data['backendConfig']['backend'];
$backendDesc = '<p>' . sprintf(

View File

@ -243,7 +243,7 @@ class DatabaseStep extends Step
}
}
return '<h2>' . mt('setup', 'Database Setup') . '</h2><p>' . $message . '</p>';
return '<h2>' . mt('setup', 'Database Setup', 'setup.page.title') . '</h2><p>' . $message . '</p>';
}
public function getReport()

View File

@ -52,7 +52,7 @@ class GeneralConfigStep extends Step
public function getSummary()
{
$pageTitle = '<h2>' . mt('setup', 'Application Configuration') . '</h2>';
$pageTitle = '<h2>' . mt('setup', 'Application Configuration', 'setup.page.title') . '</h2>';
$generalTitle = '<h3>' . t('General', 'app.config') . '</h3>';
$loggingTitle = '<h3>' . t('Logging', 'app.config') . '</h3>';

View File

@ -56,13 +56,13 @@ class ResourceStep extends Step
public function getSummary()
{
if (isset($this->data['dbResourceConfig']) && isset($this->data['ldapResourceConfig'])) {
$pageTitle = '<h2>' . mt('setup', 'Resources') . '</h2>';
$pageTitle = '<h2>' . mt('setup', 'Resources', 'setup.page.title') . '</h2>';
} else {
$pageTitle = '<h2>' . mt('setup', 'Resource') . '</h2>';
$pageTitle = '<h2>' . mt('setup', 'Resource', 'setup.page.title') . '</h2>';
}
if (isset($this->data['dbResourceConfig'])) {
$dbTitle = '<h3>' . mt('setup', 'Database') . '</h3>';
$dbTitle = '<h3>' . mt('setup', 'Database', 'setup.page.title') . '</h3>';
$dbHtml = ''
. '<table>'
. '<tbody>'

View File

@ -94,6 +94,13 @@
.setup-content {
margin: 1.5em 1.8em 0 1.8em;
form {
h2 {
font-size: 1.5em;
color: #444;
}
}
}
}