mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Don't use printf format strings as array keys
An array with printf format strings as keys looks pretty ugly
This commit is contained in:
parent
4d199180b3
commit
eca0d50bae
@ -26,15 +26,26 @@ $contactHelper = $this->getHelper('ContactFlags');
|
|||||||
) ?>"><strong><?= $contact->contact_name ?></strong></a> (<?= $contact->contact_alias ?>)
|
) ?>"><strong><?= $contact->contact_name ?></strong></a> (<?= $contact->contact_alias ?>)
|
||||||
<?php
|
<?php
|
||||||
foreach (array(
|
foreach (array(
|
||||||
'eMail: <a href="mailto:%1$s">%1$s</a>' => $contact->contact_email,
|
'eMail' => array(
|
||||||
'Pager: %s' => $contact->contact_pager,
|
$contact->contact_email, '<a href="mailto:%1$s">%1$s</a>'
|
||||||
'Service notification period: %s' => $contact->contact_notify_service_timeperiod,
|
),
|
||||||
'Host notification period: %s' => $contact->contact_notify_host_timeperiod
|
'Pager' => $contact->contact_pager,
|
||||||
) as $format => $value):
|
'Service notification period' => $contact->contact_notify_service_timeperiod,
|
||||||
|
'Host notification period' => $contact->contact_notify_host_timeperiod
|
||||||
|
) as $key => $value):
|
||||||
|
if (is_string($value)) {
|
||||||
|
$format = '%s';
|
||||||
|
} else {
|
||||||
|
$format = $value[1];
|
||||||
|
$value = $value[0];
|
||||||
|
}
|
||||||
if ($value): ?>
|
if ($value): ?>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
printf($format, htmlspecialchars($value));
|
printf(
|
||||||
|
'%s: %s', $key,
|
||||||
|
sprintf($format, htmlspecialchars($value))
|
||||||
|
);
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user