diff options
Diffstat (limited to '')
-rw-r--r-- | application/views/helpers/Column.php | 51 | ||||
-rw-r--r-- | application/views/helpers/ColumnHeader.php | 17 | ||||
-rw-r--r-- | application/views/helpers/Event.php | 12 | ||||
-rw-r--r-- | application/views/helpers/EventMessage.php | 70 | ||||
-rw-r--r-- | application/views/scripts/config/index.phtml | 21 | ||||
-rw-r--r-- | application/views/scripts/config/monitoring.phtml | 7 | ||||
-rw-r--r-- | application/views/scripts/event/index-plain.phtml | 62 | ||||
-rw-r--r-- | application/views/scripts/event/index.phtml | 174 | ||||
-rw-r--r-- | application/views/scripts/events/details-plain.phtml | 18 | ||||
-rw-r--r-- | application/views/scripts/events/details.phtml | 50 | ||||
-rw-r--r-- | application/views/scripts/events/index-plain.phtml | 19 | ||||
-rw-r--r-- | application/views/scripts/events/index.phtml | 93 | ||||
-rw-r--r-- | application/views/scripts/format/text.phtml | 13 |
13 files changed, 607 insertions, 0 deletions
diff --git a/application/views/helpers/Column.php b/application/views/helpers/Column.php new file mode 100644 index 0000000..b343de4 --- /dev/null +++ b/application/views/helpers/Column.php @@ -0,0 +1,51 @@ +<?php +/* Icinga Web 2 | (c) 2016 Icinga Development Team | GPLv2+ */ + +use Icinga\Module\Eventdb\Event; + +class Zend_View_Helper_Column extends Zend_View_Helper_Abstract +{ + public function column($column, Event $event, $classes = array()) + { + switch ($column) { + case 'host_name': + $default = 'host_url'; + break; + case 'message': + $default = 'message'; + break; + default: + $default = null; + break; + } + + if ($column === 'ack') { + $html = $event->$column ? $this->view->icon('ok', $this->view->translate('Acknowledged')) : '-'; + } else { + $renderer = $this->view->columnConfig->get($column, 'renderer', $default); + + switch ($renderer) { + case 'host_url': + $html = $this->view->qlink($event->$column, 'eventdb/event/host', + array('host' => $event->$column)); + break; + case 'service_url': + $html = $this->view->qlink($event->$column, 'eventdb/event/service', + array('service' => $event->$column, 'host' => $event->host_name)); + break; + case 'url': + $html = $this->view->qlink($event->$column, $event->$column); + break; + case 'message': + $html = $this->view->eventMessage($event->$column); + break; + default: + $html = $this->view->escape($event->$column); + break; + } + } + + return '<td class="' . 'event-' . $this->view->escape($column) . ' ' + . implode(' ', $classes) . '" data-base-target="_next">' . $html . '</td>'; + } +} diff --git a/application/views/helpers/ColumnHeader.php b/application/views/helpers/ColumnHeader.php new file mode 100644 index 0000000..3c7f7cd --- /dev/null +++ b/application/views/helpers/ColumnHeader.php @@ -0,0 +1,17 @@ +<?php +/* Icinga Web 2 | (c) 2016 Icinga Development Team | GPLv2+ */ + +class Zend_View_Helper_ColumnHeader extends Zend_View_Helper_Abstract +{ + public function columnHeader($columnHeader, $classes = array(), $plain = false) + { + $header = $this->view->columnConfig->get($columnHeader, 'label', ucwords(str_replace('_', ' ', $columnHeader))); + if ($plain) { + return $header; + } + $htm = '<th classes="' . implode(' ', $classes) . '">'; + $htm .= $this->view->escape($header); + $htm .= '</th>'; + return $htm; + } +} diff --git a/application/views/helpers/Event.php b/application/views/helpers/Event.php new file mode 100644 index 0000000..f61a793 --- /dev/null +++ b/application/views/helpers/Event.php @@ -0,0 +1,12 @@ +<?php +/* Icinga Web 2 | (c) 2016 Icinga Development Team | GPLv2+ */ + +use Icinga\Module\Eventdb\Event; + +class Zend_View_Helper_Event extends Zend_View_Helper_Abstract +{ + public function event($data) + { + return Event::fromData($data); + } +} diff --git a/application/views/helpers/EventMessage.php b/application/views/helpers/EventMessage.php new file mode 100644 index 0000000..de52518 --- /dev/null +++ b/application/views/helpers/EventMessage.php @@ -0,0 +1,70 @@ +<?php +/* Icinga Web 2 | (c) 2016 Icinga Development Team | GPLv2+ */ + +use Icinga\Application\Config; + +class Zend_View_Helper_EventMessage extends Zend_View_Helper_Abstract +{ + /** + * The RegExp for locating URLs. + * + * Modifications: + * - Don't allow ; in + * + * @source https://mathiasbynens.be/demo/url-regex + */ + const URL_REGEX = '@(https?)://(-\.)?([^\s/?\.#-]+\.?)+(/[^\s;]*)?@i'; + + /** + * Purifier instance + * + * @var HTMLPurifier + */ + protected static $purifier; + + public function eventMessage($message) + { + $htm = $this->getPurifier()->purify($message); + + // search for URLs and make them a link + $htm = preg_replace_callback( + static::URL_REGEX, + function ($match) { + return sprintf( + '<a href="%s" target="_blank">%s</a>', + htmlspecialchars($match[0]), + htmlspecialchars($match[0]) + ); + }, + $htm + ); + + return $htm; + } + + /** + * Get the purifier instance + * + * @return HTMLPurifier + */ + protected function getPurifier() + { + if (self::$purifier === null) { + require_once 'HTMLPurifier/Bootstrap.php'; + require_once 'HTMLPurifier.php'; + require_once 'HTMLPurifier.autoload.php'; + + $config = HTMLPurifier_Config::createDefault(); + $config->set('Core.EscapeNonASCIICharacters', true); + $config->set('HTML.Allowed', Config::module('eventdb')->get( + 'frontend', + 'allowed_html', + 'p,br,b,a[href|target],i,table,tr,td[colspan],div,*[class]' + )); + $config->set('Attr.AllowedFrameTargets', array('_blank')); + $config->set('Cache.DefinitionImpl', null); + self::$purifier = new HTMLPurifier($config); + } + return self::$purifier; + } +} diff --git a/application/views/scripts/config/index.phtml b/application/views/scripts/config/index.phtml new file mode 100644 index 0000000..2c47663 --- /dev/null +++ b/application/views/scripts/config/index.phtml @@ -0,0 +1,21 @@ +<div class="controls"> + <?= $tabs ?> +</div> +<div class="content"> + <h2><?= $this->translate('Database backend') ?></h2> + <?= $this->qlink( + $this->translate('Create a New Resource'), + 'config/createresource', + null, + array( + 'class' => 'button-link', + 'data-base-target' => '_next', + 'icon' => 'plus', + 'title' => $this->translate('Create a new resource'), + ) + ) ?> + <?= $backendConfig ?> + + <h2><?= $this->translate('Configure module') ?></h2> + <?= $globalConfig ?> +</div> diff --git a/application/views/scripts/config/monitoring.phtml b/application/views/scripts/config/monitoring.phtml new file mode 100644 index 0000000..1f6bbde --- /dev/null +++ b/application/views/scripts/config/monitoring.phtml @@ -0,0 +1,7 @@ +<div class="controls"> + <?= $tabs ?> +</div> +<div class="content"> + <h2><?= $this->translate('Configure integration into the monitoring module') ?></h2> + <?= $form ?> +</div> diff --git a/application/views/scripts/event/index-plain.phtml b/application/views/scripts/event/index-plain.phtml new file mode 100644 index 0000000..5b6ea8d --- /dev/null +++ b/application/views/scripts/event/index-plain.phtml @@ -0,0 +1,62 @@ +<?php +/** @var \Icinga\Module\Eventdb\Event $event */ +/** @var array $additionalColumns */ +/** @var \Icinga\Repository\RepositoryQuery $comments */ +/** @var \Icinga\Repository\RepositoryQuery $groupedEvents */ + +$commentTypes = array( + $this->translate('Comment'), + $this->translate('Acknowledgement'), + $this->translate('Revocation'), +); + +$displayColumns = array_merge(array('program', 'message', 'facility'), $additionalColumns); +?> +<?= $this->translate('Timestamp') ?>: <?= $event->created ?> + +<?= $this->translate('Priority') ?>: <?= strtoupper($event->getPriority()) ?> +<?= $event->ack ? sprintf(' (%s)', $this->translate('Acknowledged')) : '' ?> + +<?= $this->translate('Type') ?>: <?= $event->getType() ?> + +<?php foreach ($displayColumns as $col): ?> +<?= $this->columnHeader($col, null, true) ?>: <?= htmlspecialchars($event->offsetGet($col)) ?> + +<?php endforeach ?> + +<?php if ($comments->hasResult()): ?> +[ <?= $this->translate('Comments') ?> ] + +<?php foreach ($comments as $comment): ?> +<?= $commentTypes[$comment->type] ?>: <?= $comment->created ?> + +<?= $this->translate('User') ?>: <?= $comment->user ?> + +<?= $this->translate('Message') ?>: <?= $comment->message ?> + + +<?php endforeach ?> + +<?php endif; ?> +<?php if ($groupedEvents !== null && $groupedEvents->hasResult()): ?> +[ <?= $this->translate('Grouped Events') ?> ] + +<?php foreach ($groupedEvents as $groupedEventData): + /** @var \Icinga\Module\Eventdb\Event $groupedEvent */ + $groupedEvent = $this->event($groupedEventData); +?> +<?= $this->translate('Timestamp') ?>: <?= $event->created ?> + +<?= $this->translate('Priority') ?>: <?= strtoupper($event->getPriority()) ?> +<?= $event->ack ? sprintf(' (%s)', $this->translate('Acknowledged')) : '' ?> + +<?= $this->translate('Type') ?>: <?= $event->getType() ?> + +<?php foreach (array('host_name', 'program', 'message') as $col): ?> +<?= $this->columnHeader($col, null, true) ?>: <?= htmlspecialchars($event->offsetGet($col)) ?> + +<?php endforeach ?> + +<?php endforeach ?> +<?php endif; ?> + diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml new file mode 100644 index 0000000..83dcf01 --- /dev/null +++ b/application/views/scripts/event/index.phtml @@ -0,0 +1,174 @@ +<?php +/** @var \Icinga\Module\Eventdb\Event $event */ +/** @var array $additionalColumns */ +/** @var \Icinga\Repository\RepositoryQuery $comments */ +/** @var \Icinga\Repository\RepositoryQuery $groupedEvents */ + +$commentIcons = array( + $this->icon('comment', $this->translate('Comment')), + $this->icon('ok', $this->translate('Acknowledgement')), + $this->icon('cancel', $this->translate('Revocation')) +); + +if (! $this->compact): ?> +<div class="controls"> + <?= $this->tabs ?> +</div> +<?php endif ?> +<div class="content"> + <table class="event-summary-table"> + <tr> + <td rowspan="2" class="priority-col <?= $event->getPriority() ?> <?= $event->ack ? 'ack' : '' ?>"> + <div class="priority-label"><?= strtoupper($event->getPriority()) ?></div> + <div class="event-meta"><span class="timeago" title="<?= $event->created ?>"><?= $this->timeAgo(strtotime($event->created)) ?></span></div> + </td> + <td rowspan="2" class="icon-col"> + <?= $this->icon($event->getTypeIcon(), $event->getType()) ?> + <?php if ($event->ack) { echo $this->icon('ok', $this->translate('Acknowledged')); } ?> + <?php if ($event->group_autoclear) { echo $this->icon('reschedule', $this->translate('Auto-Clear')); } ?> + </td> + <?= $this->column('host_name', $event, array('selectable')) ?> + </tr> + <tr> + <?= $this->column('host_address', $event, array('selectable')) ?> + </tr> + </table> + <h2><?= $this->translate('Details') ?></h2> + <table class="name-value-table"> + <?php + $displayColumns = array_merge(array('program', 'message', 'facility'), $additionalColumns); + foreach ($displayColumns as $column): + if ($column === 'message') continue; + ?> + <tr> + <?= $this->columnHeader($column) ?> + <?= $this->column($column, $event) ?> + </tr> + <?php endforeach ?> + </table> + <?php if ($event->message): ?> + <h2><?= $this->translate('Message') ?></h2> + <div class="event-message detail preformatted"><?= $this->eventMessage($event->message) ?></div> + <?php endif; ?> + + <?php + foreach ($extensionsHtml as $extensionHtml) { + echo $extensionHtml; + } + ?> + + <h2><?= $this->translate('Actions') ?></h2> + <table class="name-value-table" data-base-target="_next"> + <tr> + <th><?= $this->translate('Other events for') ?></th> + <td><?= $this->qlink( + $this->translate('Host'), + 'eventdb/events', + array('host_name' => $event->host_name), + array( + 'icon' => 'search', + 'class' => 'action-link' + ) + ) ?> + <?php if ($event->program): ?> + <?= $this->qlink( + $this->translate('Program'), + 'eventdb/events', + array( + 'program' => $event->program, + ), + array( + 'icon' => 'search', + 'class' => 'action-link' + ) + ) ?> + <?= $this->qlink( + $this->translate('Program and Host'), + 'eventdb/events', + array( + 'host_name' => $event->host_name, + 'program' => $event->program, + ), + array( + 'icon' => 'search', + 'class' => 'action-link' + ) + ) ?> + <?php endif; ?> + </td> + </tr> + <tr> + <tr> + <th><?= $this->translate('Monitoring') ?></th> + <td> + <?= $this->qlink( + $this->translate('Host service status'), + 'eventdb/event/host', + array('host' => $event->host_name), + array( + 'icon' => 'search', + 'class' => 'action-link' + ) + ) ?> + </td> + </tr> + </table> + + <?php if (isset($commentForm)): ?> + <h2><?= $this->translate('Add comment / acknowledge') ?></h2> + <?php if ($event->group_autoclear): ?> + <div class="warning"> + <?= $this->translate('This event is set to auto-clear.') ?> + <?= $this->translate('Please only acknowledge manually, if you know what that means.') ?> + </div> + <?php endif; ?> + <div class="comment-form"><?= $commentForm ?></div> + <?php endif ?> + + <h2><?= $this->translate('Comments') ?></h2> + <?php if (! $comments->hasResult()): ?> + <p><?= $this->translate('No comments recorded for this event yet.') ?></p> + <?php else: ?> + <table class="common-table comments-table"> + <tbody> + <?php foreach ($comments as $comment): ?> + <tr> + <td class="comment-created timeago" title="<?= $comment->created ?>"><?= $this->timeAgo(strtotime($comment->created)) ?></td> + <td class="comment-type"><?= $commentIcons[$comment->type] ?></td> + <td class="comment-user"><?= $this->escape($comment->user) ?></td> + <td class="comment-message"><?= $this->escape($comment->message) ?></td> + </tr> + <?php endforeach ?> + </tbody> + </table> + <?php endif; ?> + + <?php if ($groupedEvents !== null && $groupedEvents->hasResult()): ?> + <h2><?= $this->translate('Grouped Events') ?></h2> + <table class="common-table events-table" data-base-target="_next"> + <tbody> + <?php foreach ($groupedEvents as $groupedEventData): + /** @var \Icinga\Module\Eventdb\Event $groupedEvent */ + $groupedEvent = $this->event($groupedEventData); + ?> + <tr> + <td class="priority-col <?= $groupedEvent->getPriority() ?> <?= $groupedEvent->ack ? 'ack' : '' ?>"> + <div class="priority-label"><?= strtoupper($groupedEvent->getPriority()) ?></div> + <div class="event-meta"><span class="timeago" title="<?= $groupedEvent->created ?>"><?= $this->timeAgo(strtotime($groupedEvent->created)) ?></span></div> + </td> + <td class="icon-col"> + <?= $this->icon($groupedEvent->getTypeIcon(), $groupedEvent->getType()) ?> + <?php if ($groupedEvent->ack) { echo $this->icon('ok', $this->translate('Acknowledged')); } ?> + <?php if ($groupedEvent->group_autoclear) { $autoClear = true; echo $this->icon('reschedule', $this->translate('Auto-Clear')); } ?> + </td> + <?= $this->column('host_name', $groupedEvent) ?> + <?= $this->column('program', $groupedEvent) ?> + <?= $this->column('message', $groupedEvent) ?> + </tr> + <?php endforeach ?> + </tbody> + </table> + <?php endif; ?> + +</div> + diff --git a/application/views/scripts/events/details-plain.phtml b/application/views/scripts/events/details-plain.phtml new file mode 100644 index 0000000..d5eb724 --- /dev/null +++ b/application/views/scripts/events/details-plain.phtml @@ -0,0 +1,18 @@ +<?php foreach($events as $eventData): + /** @var \Icinga\Module\Eventdb\Event $event */ + $event = $this->event($eventData); + $url = $this->url('eventdb/event', array('id' => $event->id)); +?> +<?= $this->translate('Timestamp') ?>: <?= $event->created ?> + +<?= $this->translate('Priority') ?>: <?= strtoupper($event->getPriority()) ?> +<?= $event->ack ? sprintf(' (%s)', $this->translate('Acknowledged')) : '' ?> + +<?= $this->translate('Type') ?>: <?= $event->getType() ?> + +<?php foreach (array('host_name', 'program', 'message') as $col): ?> +<?= $this->columnHeader($col, null, true) ?>: <?= htmlspecialchars($event->offsetGet($col)) ?> + +<?php endforeach ?> + +<?php endforeach ?> diff --git a/application/views/scripts/events/details.phtml b/application/views/scripts/events/details.phtml new file mode 100644 index 0000000..ee9f3cd --- /dev/null +++ b/application/views/scripts/events/details.phtml @@ -0,0 +1,50 @@ +<?php +/** @var array $events */ + +if (! $this->compact): +?> +<div class="controls"> + <?= $this->tabs ?> +</div> +<?php endif ?> +<div class="content"> + <table class="common-table event-summary-table table-row-selectable" data-base-target="_next"> + <?php $autoClear = false; foreach($events as $eventData): + /** @var \Icinga\Module\Eventdb\Event $event */ + $event = $this->event($eventData); + $url = $this->url('eventdb/event', array('id' => $event->id)); + ?> + <tr href="<?= $url ?>"> + <td class="priority-col <?= $event->getPriority() ?> <?= $event->ack ? 'ack' : '' ?>"> + <div class="priority-label"><?= strtoupper($event->getPriority()) ?></div> + <div class="event-meta"><span class="timeago" title="<?= $event->created ?>"><?= $this->timeAgo(strtotime($event->created)) ?></span></div> + </td> + <td class="icon-col"> + <?= $this->icon($event->getTypeIcon(), $event->getType()) ?> + <?php if ($event->ack) { echo $this->icon('ok', $this->translate('Acknowledged')); } ?> + <?php if ($event->group_autoclear) { $autoClear = true; echo $this->icon('reschedule', $this->translate('Auto-Clear')); } ?> + </td> + <?= $this->column('host_name', $event) ?> + <?= $this->column('program', $event) ?> + <?= $this->column('message', $event) ?> + </tr> + <?php endforeach; ?> + </table> + + <?php + foreach ($extensionsHtml as $extensionHtml) { + echo $extensionHtml; + } + ?> + + <?php if (isset($commentForm)): ?> + <h3><?= $this->translate('Add comment / acknowledge') ?></h3> + <?php if ($autoClear): ?> + <div class="warning"> + <?= $this->translate('At least one event is set to auto-clear.') ?> + <?= $this->translate('Please only acknowledge manually, if you know what that means.') ?> + </div> + <?php endif; ?> + <div class="comment-form"><?= $commentForm ?></div> + <?php endif ?> +</div> diff --git a/application/views/scripts/events/index-plain.phtml b/application/views/scripts/events/index-plain.phtml new file mode 100644 index 0000000..55f4c2e --- /dev/null +++ b/application/views/scripts/events/index-plain.phtml @@ -0,0 +1,19 @@ +<?php /** @var \Icinga\Repository\RepositoryQuery $events */ +if (! $events->hasResult()): ?> +<?= $this->translate('No events recorded yet.') ?> +<?php else: +$displayColumns = array_merge(array('host_name', 'program', 'message', 'facility'), $additionalColumns); +foreach ($events as $eventData): /** @var \Icinga\Module\Eventdb\Event $event */ $event = $this->event($eventData); ?> +<?= $this->translate('Timestamp') ?>: <?= $event->created ?> + +<?= $this->translate('Priority') ?>: <?= strtoupper($event->getPriority()) ?> +<?= $event->ack ? sprintf(' (%s)', $this->translate('Acknowledged')) : '' ?> + +<?= $this->translate('Type') ?>: <?= $event->getType() ?> + +<?php foreach ($displayColumns as $col): ?> +<?= $this->columnHeader($col, null, true) ?>: <?= htmlspecialchars($event->offsetGet($col)) ?> + +<?php endforeach ?> + +<?php endforeach; endif; ?> diff --git a/application/views/scripts/events/index.phtml b/application/views/scripts/events/index.phtml new file mode 100644 index 0000000..f1e4da7 --- /dev/null +++ b/application/views/scripts/events/index.phtml @@ -0,0 +1,93 @@ +<?php if (! $this->compact): ?> +<div class="controls"> + <?= $this->tabs ?> + <?php + $helpMessage = $this->translate( + 'Press and hold the Ctrl key while clicking on rows to select multiple rows or press and hold the Shift key to' + . ' select a range of rows', + 'Multi-selection help' + ); + ?> + <div class="selection-info" title="<?= $this->escape($helpMessage) ?>"> + <?= sprintf( + /// TRANSLATORS: Please leave %s as it is because the selection counter is wrapped in a span tag for updating + /// the counter via JavaScript + $this->translate('%s row(s) selected', 'Multi-selection count'), + '<span class="selection-info-count">0</span>' + ) ?> + </div> + <?= $this->paginator ?> + <div class="sort-controls-container"> + <?= $this->limiter ?> + <?= $this->sortBox ?> + </div> + <?= $this->filterEditor ?> + <div class="quick-filter-controls"> + <?= $this->severityFilterForm ?> + <?= $this->ackFilterForm ?> + </div> +</div> +<?php endif ?> +<div class="content"> +<?php /** @var \Icinga\Repository\RepositoryQuery $events */if (! $events->hasResult()): ?> + <p><?= $this->translate('No events recorded yet.') ?></p> +</div> +<?php return; endif; $displayColumns = array_merge(array('host_name', 'program', 'message', 'facility'), $additionalColumns); ?> + <table class="common-table table-row-selectable multiselect table-responsive events-table" + data-base-target="_next" + data-icinga-multiselect-url="<?= $this->href('eventdb/events/details') ?>" + data-icinga-multiselect-controllers="<?= $this->href('eventdb/events') ?>" + data-icinga-multiselect-data="id"> + <?php if (! $this->compact): ?> + <thead> + <tr> + <th></th> + <th></th> + <?php foreach ($displayColumns as $displayColumn): ?> + <?= $this->columnHeader($displayColumn) ?> + <?php endforeach ?> + </tr> + </thead> + <?php endif; ?> + <tbody> + <?php + foreach ($events as $eventData): + /** @var \Icinga\Module\Eventdb\Event $event */ + $event = $this->event($eventData); + $created = $event->created; + $createdTs = strtotime($created); + $url = $this->url('eventdb/event', array('id' => $event->id)); + $classes = array('priority-col', $event->getPriority()); + if ($event->ack) { + $classes[] = 'ack'; + } + ?> + <tr href="<?= $url ?>"> + <td class="<?= implode(' ', $classes) ?>"> + <div class="priority-label"><?= strtoupper($event->getPriority()) ?></div> + <div class="event-meta"><a href="<?= $url ?>" class="timeago" title="<?= $created ?>"><?= $this->timeAgo($createdTs) ?></a></div> + </td> + <td class="icon-col"> + <?= $this->icon($event->getTypeIcon(), $event->getType()) ?> + <?php if ($event->ack) { echo $this->icon('ok', $this->translate('Acknowledged')); } ?> + <?php if ($event->group_autoclear) { echo $this->icon('reschedule', $this->translate('Auto-Clear')); } ?> + </td> + <?php foreach ($displayColumns as $displayColumn): ?> + <?= $this->column($displayColumn, $event) ?> + <?php endforeach ?> + </tr> + <?php endforeach ?> + </tbody> + </table> +<?php if ($this->compact && $events->hasMore()): ?> + <?= $this->qlink( + $this->translate('Show More'), + $this->url()->without(array('view', 'limit')), + null, + array( + 'data-base-target' => '_next', + 'class' => 'action-link' + ) + ) ?> +<?php endif; ?> +</div> diff --git a/application/views/scripts/format/text.phtml b/application/views/scripts/format/text.phtml new file mode 100644 index 0000000..647914b --- /dev/null +++ b/application/views/scripts/format/text.phtml @@ -0,0 +1,13 @@ +<?php +/** @var string $text */ +/** @var string|null $partial */ +if (! $this->compact): ?> +<div class="controls"><?= $this->tabs ?></div> +<?php endif ?> +<div class="content"> +<?php if ($partial !== null): ?> + <pre class="copyable"><?= $this->partial($partial . '.phtml', null, $this) ?></pre> +<?php else: ?> + <pre class="copyable"><?= htmlspecialchars($text) ?></pre> +<?php endif ?> +</div> |