From 8ca6cc32b2c789a3149861159ad258f2cb9491e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:39:39 +0200 Subject: Adding upstream version 2.11.4. Signed-off-by: Daniel Baumann --- application/views/helpers/CreateTicketLinks.php | 23 +++ application/views/helpers/FormDate.php | 46 ++++++ application/views/helpers/FormDateTime.php | 63 ++++++++ application/views/helpers/FormNumber.php | 77 ++++++++++ application/views/helpers/FormTime.php | 46 ++++++ application/views/helpers/ProtectId.php | 13 ++ application/views/helpers/Util.php | 68 ++++++++ application/views/scripts/about/index.phtml | 171 +++++++++++++++++++++ application/views/scripts/account/index.phtml | 11 ++ .../views/scripts/announcements/index.phtml | 71 +++++++++ .../views/scripts/authentication/login.phtml | 74 +++++++++ .../views/scripts/authentication/logout.phtml | 79 ++++++++++ application/views/scripts/config/devtools.phtml | 6 + application/views/scripts/config/general.phtml | 6 + .../config/module-configuration-error.phtml | 28 ++++ application/views/scripts/config/module.phtml | 136 ++++++++++++++++ application/views/scripts/config/modules.phtml | 42 +++++ application/views/scripts/config/resource.phtml | 73 +++++++++ .../views/scripts/config/resource/create.phtml | 6 + .../views/scripts/config/resource/modify.phtml | 6 + .../views/scripts/config/resource/remove.phtml | 6 + .../views/scripts/config/userbackend/reorder.phtml | 75 +++++++++ application/views/scripts/dashboard/error.phtml | 13 ++ application/views/scripts/dashboard/index.phtml | 26 ++++ .../views/scripts/dashboard/new-dashlet.phtml | 6 + .../views/scripts/dashboard/remove-dashlet.phtml | 6 + .../views/scripts/dashboard/remove-pane.phtml | 6 + .../views/scripts/dashboard/rename-pane.phtml | 6 + application/views/scripts/dashboard/settings.phtml | 91 +++++++++++ .../views/scripts/dashboard/update-dashlet.phtml | 6 + application/views/scripts/error/error.phtml | 106 +++++++++++++ application/views/scripts/filter/index.phtml | 11 ++ .../views/scripts/form/reorder-authbackend.phtml | 83 ++++++++++ application/views/scripts/group/form.phtml | 6 + application/views/scripts/group/list.phtml | 96 ++++++++++++ application/views/scripts/group/show.phtml | 108 +++++++++++++ application/views/scripts/iframe/index.phtml | 8 + application/views/scripts/index/welcome.phtml | 2 + application/views/scripts/inline.phtml | 2 + application/views/scripts/joystickPagination.phtml | 162 +++++++++++++++++++ .../views/scripts/layout/announcements.phtml | 1 + application/views/scripts/layout/menu.phtml | 20 +++ .../views/scripts/list/applicationlog.phtml | 29 ++++ application/views/scripts/mixedPagination.phtml | 79 ++++++++++ .../views/scripts/navigation/dashboard.phtml | 27 ++++ application/views/scripts/navigation/index.phtml | 78 ++++++++++ application/views/scripts/navigation/shared.phtml | 68 ++++++++ .../views/scripts/pivottablePagination.phtml | 48 ++++++ application/views/scripts/role/list.phtml | 65 ++++++++ application/views/scripts/search/hint.phtml | 8 + application/views/scripts/search/index.phtml | 7 + application/views/scripts/showConfiguration.phtml | 27 ++++ application/views/scripts/simple-form.phtml | 6 + application/views/scripts/user/form.phtml | 6 + application/views/scripts/user/list.phtml | 90 +++++++++++ application/views/scripts/user/show.phtml | 138 +++++++++++++++++ 56 files changed, 2567 insertions(+) create mode 100644 application/views/helpers/CreateTicketLinks.php create mode 100644 application/views/helpers/FormDate.php create mode 100644 application/views/helpers/FormDateTime.php create mode 100644 application/views/helpers/FormNumber.php create mode 100644 application/views/helpers/FormTime.php create mode 100644 application/views/helpers/ProtectId.php create mode 100644 application/views/helpers/Util.php create mode 100644 application/views/scripts/about/index.phtml create mode 100644 application/views/scripts/account/index.phtml create mode 100644 application/views/scripts/announcements/index.phtml create mode 100644 application/views/scripts/authentication/login.phtml create mode 100644 application/views/scripts/authentication/logout.phtml create mode 100644 application/views/scripts/config/devtools.phtml create mode 100644 application/views/scripts/config/general.phtml create mode 100644 application/views/scripts/config/module-configuration-error.phtml create mode 100644 application/views/scripts/config/module.phtml create mode 100644 application/views/scripts/config/modules.phtml create mode 100644 application/views/scripts/config/resource.phtml create mode 100644 application/views/scripts/config/resource/create.phtml create mode 100644 application/views/scripts/config/resource/modify.phtml create mode 100644 application/views/scripts/config/resource/remove.phtml create mode 100644 application/views/scripts/config/userbackend/reorder.phtml create mode 100644 application/views/scripts/dashboard/error.phtml create mode 100644 application/views/scripts/dashboard/index.phtml create mode 100644 application/views/scripts/dashboard/new-dashlet.phtml create mode 100644 application/views/scripts/dashboard/remove-dashlet.phtml create mode 100644 application/views/scripts/dashboard/remove-pane.phtml create mode 100644 application/views/scripts/dashboard/rename-pane.phtml create mode 100644 application/views/scripts/dashboard/settings.phtml create mode 100644 application/views/scripts/dashboard/update-dashlet.phtml create mode 100644 application/views/scripts/error/error.phtml create mode 100644 application/views/scripts/filter/index.phtml create mode 100644 application/views/scripts/form/reorder-authbackend.phtml create mode 100644 application/views/scripts/group/form.phtml create mode 100644 application/views/scripts/group/list.phtml create mode 100644 application/views/scripts/group/show.phtml create mode 100644 application/views/scripts/iframe/index.phtml create mode 100644 application/views/scripts/index/welcome.phtml create mode 100644 application/views/scripts/inline.phtml create mode 100644 application/views/scripts/joystickPagination.phtml create mode 100644 application/views/scripts/layout/announcements.phtml create mode 100644 application/views/scripts/layout/menu.phtml create mode 100644 application/views/scripts/list/applicationlog.phtml create mode 100644 application/views/scripts/mixedPagination.phtml create mode 100644 application/views/scripts/navigation/dashboard.phtml create mode 100644 application/views/scripts/navigation/index.phtml create mode 100644 application/views/scripts/navigation/shared.phtml create mode 100644 application/views/scripts/pivottablePagination.phtml create mode 100644 application/views/scripts/role/list.phtml create mode 100644 application/views/scripts/search/hint.phtml create mode 100644 application/views/scripts/search/index.phtml create mode 100644 application/views/scripts/showConfiguration.phtml create mode 100644 application/views/scripts/simple-form.phtml create mode 100644 application/views/scripts/user/form.phtml create mode 100644 application/views/scripts/user/list.phtml create mode 100644 application/views/scripts/user/show.phtml (limited to 'application/views') diff --git a/application/views/helpers/CreateTicketLinks.php b/application/views/helpers/CreateTicketLinks.php new file mode 100644 index 0000000..4f8a272 --- /dev/null +++ b/application/views/helpers/CreateTicketLinks.php @@ -0,0 +1,23 @@ +view->tickets; + /** @var \Icinga\Application\Hook\TicketHook $tickets */ + return isset($tickets) ? $tickets->createLinks($text) : $text; + } +} diff --git a/application/views/helpers/FormDate.php b/application/views/helpers/FormDate.php new file mode 100644 index 0000000..39e6d94 --- /dev/null +++ b/application/views/helpers/FormDate.php @@ -0,0 +1,46 @@ +_getInfo($name, $value, $attribs); + + extract($info); // name, id, value, attribs, options, listsep, disable + /** @var string $id */ + /** @var bool $disable */ + + $disabled = ''; + if ($disable) { + $disabled = ' disabled="disabled"'; + } + + /** @var \Icinga\Web\View $view */ + $view = $this->view; + + $html5 = sprintf( + 'escape($name), + $view->escape($id), + $view->escape($value), + $disabled, + $this->_htmlAttribs($attribs), + $this->getClosingBracket() + ); + + return $html5; + } +} diff --git a/application/views/helpers/FormDateTime.php b/application/views/helpers/FormDateTime.php new file mode 100644 index 0000000..de5eb4b --- /dev/null +++ b/application/views/helpers/FormDateTime.php @@ -0,0 +1,63 @@ +format($format); + } + + /** + * Render the date-and-time input control + * + * @param string $name The element name + * @param DateTime $value The default timestamp + * @param array $attribs Attributes for the element tag + * + * @return string The element XHTML + */ + public function formDateTime($name, $value = null, $attribs = null) + { + $info = $this->_getInfo($name, $value, $attribs); + extract($info); // name, id, value, attribs, options, listsep, disable + /** @var string $id */ + /** @var bool $disable */ + $disabled = ''; + if ($disable) { + $disabled = ' disabled="disabled"'; + } + if ($value instanceof DateTime) { + // If value was valid, it's a DateTime object + $value = $this->formatDate($value, $attribs['local']); + } + if (isset($attribs['placeholder']) && $attribs['placeholder'] instanceof DateTime) { + $attribs['placeholder'] = $this->formatDate($attribs['placeholder'], $attribs['local']); + } + $type = $attribs['local'] === true ? 'datetime-local' : 'datetime'; + unset($attribs['local']); // Unset local to not render it again in $this->_htmlAttribs($attribs) + $html5 = sprintf( + 'view->escape($name), + $this->view->escape($id), + $this->view->escape($value), + $disabled, + $this->_htmlAttribs($attribs), + $this->getClosingBracket() + ); + return $html5; + } +} diff --git a/application/views/helpers/FormNumber.php b/application/views/helpers/FormNumber.php new file mode 100644 index 0000000..f447180 --- /dev/null +++ b/application/views/helpers/FormNumber.php @@ -0,0 +1,77 @@ +view->escape( + sprintf( + ctype_digit((string) $number) ? '%d' : '%F', + $number + ) + ); + } + + /** + * Render the number input control + * + * @param string $name + * @param int $value + * @param array $attribs + * + * @return string The rendered number input control + */ + public function formNumber($name, $value = null, $attribs = null) + { + $info = $this->_getInfo($name, $value, $attribs); + extract($info); // name, id, value, attribs, options, listsep, disable + /** @var string $id */ + /** @var bool $disable */ + $disabled = ''; + if ($disable) { + $disabled = ' disabled="disabled"'; + } + $min = ''; + if (isset($attribs['min'])) { + $min = sprintf(' min="%s"', $this->formatNumber($attribs['min'])); + } + unset($attribs['min']); // Unset min to not render it again in $this->_htmlAttribs($attribs) + $max = ''; + if (isset($attribs['max'])) { + $max = sprintf(' max="%s"', $this->formatNumber($attribs['max'])); + } + unset($attribs['max']); // Unset max to not render it again in $this->_htmlAttribs($attribs) + $step = ''; + if (isset($attribs['step'])) { + $step = sprintf(' step="%s"', $attribs['step'] === 'any' ? 'any' : $this->formatNumber($attribs['step'])); + } + unset($attribs['step']); // Unset step to not render it again in $this->_htmlAttribs($attribs) + $html5 = sprintf( + 'view->escape($name), + $this->view->escape($id), + $this->view->escape($this->formatNumber($value)), + $min, + $max, + $step, + $disabled, + $this->_htmlAttribs($attribs), + $this->getClosingBracket() + ); + return $html5; + } +} diff --git a/application/views/helpers/FormTime.php b/application/views/helpers/FormTime.php new file mode 100644 index 0000000..39d1b83 --- /dev/null +++ b/application/views/helpers/FormTime.php @@ -0,0 +1,46 @@ +_getInfo($name, $value, $attribs); + + extract($info); // name, id, value, attribs, options, listsep, disable + /** @var string $id */ + /** @var bool $disable */ + + $disabled = ''; + if ($disable) { + $disabled = ' disabled="disabled"'; + } + + /** @var \Icinga\Web\View $view */ + $view = $this->view; + + $html5 = sprintf( + 'escape($name), + $view->escape($id), + $view->escape($value), + $disabled, + $this->_htmlAttribs($attribs), + $this->getClosingBracket() + ); + + return $html5; + } +} diff --git a/application/views/helpers/ProtectId.php b/application/views/helpers/ProtectId.php new file mode 100644 index 0000000..f6dc226 --- /dev/null +++ b/application/views/helpers/ProtectId.php @@ -0,0 +1,13 @@ +getRequest()->protectId($id); + } +} diff --git a/application/views/helpers/Util.php b/application/views/helpers/Util.php new file mode 100644 index 0000000..7a3e410 --- /dev/null +++ b/application/views/helpers/Util.php @@ -0,0 +1,68 @@ + 3600 * 24 * 3) { + if (date('Y') === date('Y', $timestamp)) { + return date('d.m.', $timestamp); + } + return date('m.Y', $timestamp); + } + return self::showHourMin($duration); + } + + public static function showHourMin($sec) + { + $min = floor($sec / 60); + if ($min < 60) { + return $min . 'm ' . ($sec % 60) . 's'; + } + $hour = floor($min / 60); + if ($hour < 24) { + return date('H:i', time() - $sec); + } + return floor($hour / 24) . 'd ' . ($hour % 24) . 'h'; + } + + public static function showSeconds($sec) + { + // Todo: localization + if ($sec < 1) { + return round($sec * 1000) . 'ms'; + } + if ($sec < 60) { + return $sec . 's'; + } + return floor($sec / 60) . 'm ' . ($sec % 60) . 's'; + } + + public static function showTime($timestamp) + { + // Todo: localization + if ($timestamp < 86400) { + return 'undef'; + } + if (date('Ymd') === date('Ymd', $timestamp)) { + return date('H:i:s', $timestamp); + } + if (date('Y') === date('Y', $timestamp)) { + return date('H:i d.m.', $timestamp); + } + return date('H:i d.m.Y', $timestamp); + } +} diff --git a/application/views/scripts/about/index.phtml b/application/views/scripts/about/index.phtml new file mode 100644 index 0000000..e80cd89 --- /dev/null +++ b/application/views/scripts/about/index.phtml @@ -0,0 +1,171 @@ + +
+ +
+
+ + img('img/icinga-logo-big.svg', null, array('class' => 'icinga-logo', 'width' => 194)) ?> + +
+ + + + + + + + + + + + + + + + + + + + + + + +
translate('Icinga Web 2 Version') ?>escape($version['appVersion']) ?>
translate('Git commit') ?>escape($version['gitCommitID']) ?>
translate('PHP Version') ?>escape(PHP_VERSION) ?>
translate('Git commit date') ?>escape($version['gitCommitDate']) ?>
+ + + +

translate('Loaded Libraries') ?>

+ + + + + + + +
+ escape($library->getName()) ?> + + escape($library->getVersion()) ?: '-' ?> +
+ +

translate('Loaded Modules') ?>

+ + + + + + + + +
+ escape($module->getName()) ?> + + + escape($module->getVersion()) ?> + + hasPermission('config/modules')): ?> + qlink( + $this->translate('Configure'), + 'config/module/', + array('name' => $module->getName()), + array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->getName())) + ) ?> + +
+
+ +
+ +
+ qlink( + null, + 'https://www.twitter.com/icinga', + null, + array( + 'target' => '_blank', + 'icon' => 'twitter', + 'title' => $this->translate('Icinga on Twitter') + ) + ) ?> qlink( + null, + 'https://www.facebook.com/icinga', + null, + array( + 'target' => '_blank', + 'icon' => 'facebook-squared', + 'title' => $this->translate('Icinga on Facebook') + ) + ) ?> +
+
+
diff --git a/application/views/scripts/account/index.phtml b/application/views/scripts/account/index.phtml new file mode 100644 index 0000000..efc2bcb --- /dev/null +++ b/application/views/scripts/account/index.phtml @@ -0,0 +1,11 @@ +
+ +
+
+ +

translate('Account') ?>

+ + +

translate('Preferences') ?>

+ +
diff --git a/application/views/scripts/announcements/index.phtml b/application/views/scripts/announcements/index.phtml new file mode 100644 index 0000000..ff87c66 --- /dev/null +++ b/application/views/scripts/announcements/index.phtml @@ -0,0 +1,71 @@ +compact): ?> +
+ tabs ?> + paginator ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?> +
+ +
+hasPermission('application/announcements')) { + echo $this->qlink( + $this->translate('Create a New Announcement') , + 'announcements/new', + null, + array( + 'class' => 'button-link', + 'data-base-target' => '_next', + 'icon' => 'plus', + 'title' => $this->translate('Create a new announcement') + ) + ); +} ?> +announcements)): ?> +

translate('No announcements found.') ?>

+
+ + + + + + + + + + + + + announcements as $announcement): /** @var object $announcement */ ?> + + + hasPermission('application/announcements')): ?> + + + + + + + hasPermission('application/announcements')): ?> + + + + + +
translate('Author') ?>translate('Message') ?>translate('Start') ?>translate('End') ?>
escape($announcement->author) ?> + + ellipsis($this->escape($announcement->message), 100) ?> + + ellipsis($this->escape($announcement->message), 100) ?>formatDateTime($announcement->start) ?>formatDateTime($announcement->end) ?>qlink( + null, + 'announcements/remove', + array('id' => $announcement->id), + array( + 'class' => 'action-link', + 'icon' => 'cancel', + 'title' => $this->translate('Remove this announcement') + ) + ) ?>
+ diff --git a/application/views/scripts/authentication/login.phtml b/application/views/scripts/authentication/login.phtml new file mode 100644 index 0000000..167a468 --- /dev/null +++ b/application/views/scripts/authentication/login.phtml @@ -0,0 +1,74 @@ +
+ +
    +
  • + qlink( + null, + 'https://twitter.com/icinga', + null, + array( + 'target' => '_blank', + 'icon' => 'twitter', + 'title' => $this->translate('Icinga on Twitter') + ) + ) ?> +
  • +
  • + qlink( + null, + 'https://www.facebook.com/icinga', + null, + array( + 'target' => '_blank', + 'icon' => 'facebook-squared', + 'title' => $this->translate('Icinga on Facebook') + ) + ) ?> +
  • +
  • qlink( + null, + 'https://github.com/Icinga', + null, + array( + 'target' => '_blank', + 'icon' => 'github-circled', + 'title' => $this->translate('Icinga on GitHub') + ) + ) ?> +
  • +
+
+
img('img/orb-analytics.png'); ?>
+
img('img/orb-automation.png'); ?>
+
img('img/orb-cloud.png'); ?>
+
img('img/orb-icinga.png'); ?>
+
img('img/orb-infrastructure.png'); ?>
+
img('img/orb-metrics.png'); ?>
+
img('img/orb-notifications.png'); ?>
diff --git a/application/views/scripts/authentication/logout.phtml b/application/views/scripts/authentication/logout.phtml new file mode 100644 index 0000000..d4bd78e --- /dev/null +++ b/application/views/scripts/authentication/logout.phtml @@ -0,0 +1,79 @@ + +
+ +
+ translate('Logging out...'); ?> +
+ translate( + 'If this message does not disappear, it might be necessary to quit the' + . ' current session manually by clearing the cache, or by closing the current' + . ' browser session.' + ); ?> +
+ + +
+ + diff --git a/application/views/scripts/config/devtools.phtml b/application/views/scripts/config/devtools.phtml new file mode 100644 index 0000000..245a71a --- /dev/null +++ b/application/views/scripts/config/devtools.phtml @@ -0,0 +1,6 @@ +
+tabs ?> +
+ + +
translate('UI Debug') ?>translate('toggle') ?>
diff --git a/application/views/scripts/config/general.phtml b/application/views/scripts/config/general.phtml new file mode 100644 index 0000000..13a8ed9 --- /dev/null +++ b/application/views/scripts/config/general.phtml @@ -0,0 +1,6 @@ +
+ +
+
+ +
diff --git a/application/views/scripts/config/module-configuration-error.phtml b/application/views/scripts/config/module-configuration-error.phtml new file mode 100644 index 0000000..85fb128 --- /dev/null +++ b/application/views/scripts/config/module-configuration-error.phtml @@ -0,0 +1,28 @@ +action)) ? $this->action : 'do something with'; + $moduleName = $this->moduleName; + $exceptionMessage = $this->exceptionMessage; +?> +tabs->render($this); ?> +
+
+

Could not module ""

+

+ While operation the following error occurred: +
+ +

+
+ +

+ This could have one or more of the following reasons: +

+

+ +

+ Details can be seen in your application log (if you don't have access to this file, call your administrator in this case). +

\ No newline at end of file diff --git a/application/views/scripts/config/module.phtml b/application/views/scripts/config/module.phtml new file mode 100644 index 0000000..6d41ab2 --- /dev/null +++ b/application/views/scripts/config/module.phtml @@ -0,0 +1,136 @@ +
+ tabs ?> +
+
+ + translate('There is no such module installed.') ?> + + getRequiredModules(); + $requiredLibs = $module->getRequiredLibraries(); + $restrictions = $module->getProvidedRestrictions(); + $permissions = $module->getProvidedPermissions(); + $unmetDependencies = $moduleManager->hasUnmetDependencies($module->getName()); + $isIcingadbSupported = isset($requiredMods['icingadb']); + $state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled'; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
escape($this->translate('Name')) ?>escape($module->getName()) ?>
translate('State') ?> + + toggleForm)): ?> + enabled || ! $unmetDependencies): ?> + toggleForm ?> + + icon('attention-alt', $this->translate('Module can\'t be enabled due to unmet dependencies')) ?> + + +
escape($this->translate('Version')) ?>escape($module->getVersion()) ?>
escape($this->translate('Git commit')) ?>escape($moduleGitCommitId) ?>
escape($this->translate('Description')) ?> + escape($module->getTitle()) ?>
+ escape($module->getDescription())) ?> +
escape($this->translate('Dependencies')) ?> + + translate('This module has no dependencies') ?> + + + + translate('Unmet dependencies found! Module can\'t be enabled unless all dependencies are met.') ?> + + + + + + $versionString): ?> + + + + + +
translate('Libraries') ?>
escape($libraryName) ?> + has($libraryName, $versionString === true ? null : $versionString)): ?> + escape($versionString) ?> + + escape($versionString) ?> + get($libraryName)) !== null): ?> + (getVersion() ?>) + + +
+ + + + + $versionString): ?> + has('icingadb', $requiredMods['icingadb'])) : ?> + + + + + + + + + + +
translate('Modules') ?>
escape($moduleName) ?> + has($moduleName, $versionString === true ? null : $versionString)): ?> + escape($versionString) ?> + + has('monitoring', $requiredMods['monitoring'])) ? 'class="optional"' : 'class="missing"' ?>> + escape($versionString) ?> + + hasInstalled($moduleName)): ?> + (translate('not installed') ?>) + + (getModule($moduleName, false)->getVersion() ?>hasEnabled($moduleName) ? '' : ', ' . $this->translate('disabled') ?>) + + + translate('or') ?>
+ + +
escape($this->translate('Permissions')) ?> + + escape($permission->name) ?>: escape($permission->description) ?>
+ +
escape($this->translate('Restrictions')) ?> + + escape($restriction->name) ?>: escape($restriction->description) ?>
+ +
+
diff --git a/application/views/scripts/config/modules.phtml b/application/views/scripts/config/modules.phtml new file mode 100644 index 0000000..b13b378 --- /dev/null +++ b/application/views/scripts/config/modules.phtml @@ -0,0 +1,42 @@ +compact): ?> +
+ tabs ?> + paginator ?> +
+ +
+ + + + + + + + + + + + + +
translate('Module') ?>
+ installed) { + $this->icon('flash', sprintf($this->translate('Module %s is dangling'), $module->name)); + } elseif ($module->enabled && $module->loaded) { + echo $this->icon('thumbs-up', sprintf($this->translate('Module %s is enabled'), $module->name)); + } elseif (! $module->enabled) { + echo $this->icon('block', sprintf($this->translate('Module %s is disabled'), $module->name)); + } else { // ! $module->loaded + echo $this->icon('block', sprintf($this->translate('Module %s has failed to load'), $module->name)); + } + + echo $this->qlink( + $module->name, + 'config/module', + array('name' => $module->name), + array( + 'class' => 'rowaction', + 'title' => sprintf($this->translate('Show the overview of the %s module'), $module->name) + ) + ); ?> +
+
diff --git a/application/views/scripts/config/resource.phtml b/application/views/scripts/config/resource.phtml new file mode 100644 index 0000000..317c115 --- /dev/null +++ b/application/views/scripts/config/resource.phtml @@ -0,0 +1,73 @@ +
+ +
+
+ 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') + ) + ) ?> + + + + + + + + +resources as $name => $value): ?> + + + + + + +
translate('Resource') ?>
+ type) { + case 'db': + $icon = 'database'; + break; + case 'ldap': + $icon = 'sitemap'; + break; + case 'ssh': + $icon = 'user'; + break; + case 'file': + case 'ini': + $icon = 'doc-text'; + break; + default: + $icon = 'edit'; + break; + } + ?> + qlink( + $name, + 'config/editresource', + array('resource' => $name), + array( + 'icon' => $icon, + 'title' => sprintf($this->translate('Edit resource %s'), $name) + ) + ) ?> + + qlink( + '', + 'config/removeresource', + array('resource' => $name), + array( + 'class' => 'action-link', + 'icon' => 'cancel', + 'title' => sprintf($this->translate('Remove resource %s'), $name) + ) + ) ?> +
+
diff --git a/application/views/scripts/config/resource/create.phtml b/application/views/scripts/config/resource/create.phtml new file mode 100644 index 0000000..13a8ed9 --- /dev/null +++ b/application/views/scripts/config/resource/create.phtml @@ -0,0 +1,6 @@ +
+ +
+
+ +
diff --git a/application/views/scripts/config/resource/modify.phtml b/application/views/scripts/config/resource/modify.phtml new file mode 100644 index 0000000..13a8ed9 --- /dev/null +++ b/application/views/scripts/config/resource/modify.phtml @@ -0,0 +1,6 @@ +
+ +
+
+ +
diff --git a/application/views/scripts/config/resource/remove.phtml b/application/views/scripts/config/resource/remove.phtml new file mode 100644 index 0000000..13a8ed9 --- /dev/null +++ b/application/views/scripts/config/resource/remove.phtml @@ -0,0 +1,6 @@ +
+ +
+
+ +
diff --git a/application/views/scripts/config/userbackend/reorder.phtml b/application/views/scripts/config/userbackend/reorder.phtml new file mode 100644 index 0000000..c77fd2e --- /dev/null +++ b/application/views/scripts/config/userbackend/reorder.phtml @@ -0,0 +1,75 @@ +
+ +
+
+ auth()->hasPermission('config/access-control/users')): ?> +

translate('User Backends') ?>

+ qlink( + $this->translate('Create a New User Backend') , + 'config/createuserbackend', + null, + array( + 'class' => 'button-link', + 'data-base-target' => '_next', + 'icon' => 'plus', + 'title' => $this->translate('Create a new user backend') + ) + ) ?> + + + + auth()->hasPermission('config/access-control/groups')): ?> +

translate('User Group Backends') ?>

+ qlink( + $this->translate('Create a New User Group Backend') , + 'usergroupbackend/create', + null, + array( + 'class' => 'button-link', + 'data-base-target' => '_next', + 'icon' => 'plus', + 'title' => $this->translate('Create a new user group backend') + ) + ) ?> + + + + + + + + + + $config): + $type = $config->get('backend'); +?> + + + + + + +
translate('Backend') ?>
+ qlink( + $backendName, + 'usergroupbackend/edit', + array('backend' => $backendName), + array( + 'icon' => $type === 'external' ? 'magic' : ($type === 'ldap' || $type === 'msldap' ? 'sitemap' : 'database'), + 'title' => sprintf($this->translate('Edit user group backend %s'), $backendName) + ) + ); ?> + + qlink( + null, + 'usergroupbackend/remove', + array('backend' => $backendName), + array( + 'class' => 'action-link', + 'icon' => 'cancel', + 'title' => sprintf($this->translate('Remove user group backend %s'), $backendName) + ) + ) ?> +
+ +
diff --git a/application/views/scripts/dashboard/error.phtml b/application/views/scripts/dashboard/error.phtml new file mode 100644 index 0000000..9396b49 --- /dev/null +++ b/application/views/scripts/dashboard/error.phtml @@ -0,0 +1,13 @@ +
+

translate('Could not save dashboard'); ?>

+

+ translate('Please copy the following dashboard snippet to '); ?> + config->getConfigFile(); ?>;. +
+ translate('Make sure that the webserver can write to this file.'); ?> +

+
config; ?>
+
+

translate('Error details'); ?>

+

error->getMessage(); ?>

+
\ No newline at end of file diff --git a/application/views/scripts/dashboard/index.phtml b/application/views/scripts/dashboard/index.phtml new file mode 100644 index 0000000..1d56114 --- /dev/null +++ b/application/views/scripts/dashboard/index.phtml @@ -0,0 +1,26 @@ +
+compact): ?> +tabs ?> + +
+dashboard): ?> +
+ dashboard ?> +
+ +
+

escape($this->translate('Welcome to Icinga Web!')) ?>

+

+ hasPermission('config/modules')) { + echo $this->escape($this->translate( + 'Currently there is no dashlet available. Please contact the administrator.' + )); + } else { + printf( + $this->escape($this->translate('Currently there is no dashlet available. This might change once you enabled some of the available %s.')), + $this->qlink($this->translate('modules'), 'config/modules') + ); + } ?> +

+
+ diff --git a/application/views/scripts/dashboard/new-dashlet.phtml b/application/views/scripts/dashboard/new-dashlet.phtml new file mode 100644 index 0000000..b265a25 --- /dev/null +++ b/application/views/scripts/dashboard/new-dashlet.phtml @@ -0,0 +1,6 @@ +
+ tabs ?> +
+
+ form; ?> +
\ No newline at end of file diff --git a/application/views/scripts/dashboard/remove-dashlet.phtml b/application/views/scripts/dashboard/remove-dashlet.phtml new file mode 100644 index 0000000..b265a25 --- /dev/null +++ b/application/views/scripts/dashboard/remove-dashlet.phtml @@ -0,0 +1,6 @@ +
+ tabs ?> +
+
+ form; ?> +
\ No newline at end of file diff --git a/application/views/scripts/dashboard/remove-pane.phtml b/application/views/scripts/dashboard/remove-pane.phtml new file mode 100644 index 0000000..b265a25 --- /dev/null +++ b/application/views/scripts/dashboard/remove-pane.phtml @@ -0,0 +1,6 @@ +
+ tabs ?> +
+
+ form; ?> +
\ No newline at end of file diff --git a/application/views/scripts/dashboard/rename-pane.phtml b/application/views/scripts/dashboard/rename-pane.phtml new file mode 100644 index 0000000..b265a25 --- /dev/null +++ b/application/views/scripts/dashboard/rename-pane.phtml @@ -0,0 +1,6 @@ +
+ tabs ?> +
+
+ form; ?> +
\ No newline at end of file diff --git a/application/views/scripts/dashboard/settings.phtml b/application/views/scripts/dashboard/settings.phtml new file mode 100644 index 0000000..a6cfe83 --- /dev/null +++ b/application/views/scripts/dashboard/settings.phtml @@ -0,0 +1,91 @@ +
+ tabs ?> +
+
+

+ + + + + + + + + + + dashboard->getPanes() as $pane): ?> + getDisabled()) continue; ?> + + + + + getDashlets(); ?> + + + + + + + getDisabled()) continue; ?> + + + + + + + + + +
+ + + +  
+ isUserWidget()): ?> + qlink( + $pane->getName(), + 'dashboard/rename-pane', + array('pane' => $pane->getName()), + array('title' => sprintf($this->translate('Edit pane %s'), $pane->getName())) + ) ?> + + escape($pane->getName()) ?> + + + qlink( + '', + 'dashboard/remove-pane', + array('pane' => $pane->getName()), + array( + 'icon' => 'trash', + 'title' => sprintf($this->translate('Remove pane %s'), $pane->getName()) + ) + ); ?> +
+ translate('No dashlets added to dashboard') ?>. +
+ qlink( + $dashlet->getTitle(), + 'dashboard/update-dashlet', + array('pane' => $pane->getName(), 'dashlet' => $dashlet->getName()), + array('title' => sprintf($this->translate('Edit dashlet %s'), $dashlet->getTitle())) + ); ?> + + qlink( + $dashlet->getUrl()->getRelativeUrl(), + $dashlet->getUrl()->getRelativeUrl(), + null, + array('title' => sprintf($this->translate('Show dashlet %s'), $dashlet->getTitle())) + ); ?> + + qlink( + '', + 'dashboard/remove-dashlet', + array('pane' => $pane->getName(), 'dashlet' => $dashlet->getName()), + array( + 'icon' => 'trash', + 'title' => sprintf($this->translate('Remove dashlet %s from pane %s'), $dashlet->getTitle(), $pane->getTitle()) + ) + ); ?> +
+
diff --git a/application/views/scripts/dashboard/update-dashlet.phtml b/application/views/scripts/dashboard/update-dashlet.phtml new file mode 100644 index 0000000..b265a25 --- /dev/null +++ b/application/views/scripts/dashboard/update-dashlet.phtml @@ -0,0 +1,6 @@ +
+ tabs ?> +
+
+ form; ?> +
\ No newline at end of file diff --git a/application/views/scripts/error/error.phtml b/application/views/scripts/error/error.phtml new file mode 100644 index 0000000..3c7462f --- /dev/null +++ b/application/views/scripts/error/error.phtml @@ -0,0 +1,106 @@ +compact && ! $hideControls): ?> +
+ +
+ +
+ $message) { + echo '

' . nl2br($this->escape($message)) . '

' + . '
' + . '
' . $this->escape($stackTraces[$i]) . '
'; + } +} else { + foreach ($messages as $message) { + echo '

' . nl2br($this->escape($message)) . '

'; + } +} + +$libraries = \Icinga\Application\Icinga::app()->getLibraries(); +$coreReason = []; +$modReason = []; + +if (isset($requiredVendor, $requiredProject) && $requiredVendor && $requiredProject) { + // TODO: I don't like this, can we define requirements somewhere else? + $coreDeps = ['icinga-php-library' => '>= 0.9', 'icinga-php-thirdparty' => '>= 0.11']; + + foreach ($coreDeps as $libraryName => $requiredVersion) { + if (! $libraries->has($libraryName)) { + $coreReason[] = sprintf($this->translate( + 'Library "%s" is required and missing. Please install a version of it matching the required one: %s' + ), $libraryName, $requiredVersion); + } elseif (! $libraries->has($libraryName, $requiredVersion) && $libraries->get($libraryName)->isRequired($requiredVendor, $requiredProject)) { + $coreReason[] = sprintf($this->translate( + 'Library "%s" is required and installed, but its version (%s) does not satisfy the required one: %s' + ), $libraryName, $libraries->get($libraryName)->getVersion() ?: '-', $requiredVersion); + } + } + + if (! empty($coreReason)) { + array_unshift($coreReason, $this->translate('You have unmet dependencies. Please check Icinga Web 2\'s installation instructions.')); + } +} + +if (isset($module)) { + $manager = \Icinga\Application\Icinga::app()->getModuleManager(); + if ($manager->hasUnmetDependencies($module->getName())) { + if (isset($requiredModule) && $requiredModule && isset($module->getRequiredModules()[$requiredModule])) { + if (! $manager->hasInstalled($requiredModule)) { + $modReason[] = sprintf($this->translate( + 'Module "%s" is required and missing. Please install a version of it matching the required one: %s' + ), $requiredModule, $module->getRequiredModules()[$requiredModule]); + } elseif (! $manager->hasEnabled($requiredModule)) { + $modReason[] = sprintf($this->translate( + 'Module "%s" is required and installed, but not enabled. Please enable module "%1$s".' + ), $requiredModule); + } elseif (! $manager->has($requiredModule, $module->getRequiredModules()[$requiredModule])) { + $modReason[] = sprintf($this->translate( + 'Module "%s" is required and installed, but its version (%s) does not satisfy the required one: %s' + ), $requiredModule, $manager->getModule($requiredModule, false)->getVersion(), $module->getRequiredModules()[$requiredModule]); + } + } elseif (isset($requiredVendor, $requiredProject) && $requiredVendor && $requiredProject) { + foreach ($module->getRequiredLibraries() as $libraryName => $requiredVersion) { + if (! $libraries->has($libraryName)) { + $modReason[] = sprintf($this->translate( + 'Library "%s" is required and missing. Please install a version of it matching the required one: %s' + ), $libraryName, $requiredVersion); + } elseif (! $libraries->has($libraryName, $requiredVersion) && $libraries->get($libraryName)->isRequired($requiredVendor, $requiredProject)) { + $modReason[] = sprintf($this->translate( + 'Library "%s" is required and installed, but its version (%s) does not satisfy the required one: %s' + ), $libraryName, $libraries->get($libraryName)->getVersion() ?: '-', $requiredVersion); + } + } + } + + if (! empty($modReason)) { + array_unshift($modReason, sprintf($this->translate( + 'This error might have occurred because module "%s" has unmet dependencies.' + . ' Please check it\'s installation instructions and install missing dependencies.' + ), $module->getName())); + } + } +} + +// The following doesn't use ipl\Html because that's what the error possibly is about +?> + +
+ + +

+ + +
+ + + +
+ + +

+ + +
+ +
diff --git a/application/views/scripts/filter/index.phtml b/application/views/scripts/filter/index.phtml new file mode 100644 index 0000000..5e6a63d --- /dev/null +++ b/application/views/scripts/filter/index.phtml @@ -0,0 +1,11 @@ +form; + +if ($this->tree) { + echo $this->tree->render($this); + echo '
';
+  echo $this->sqlString;
+  echo '
'; + print_r($this->params); +} \ No newline at end of file diff --git a/application/views/scripts/form/reorder-authbackend.phtml b/application/views/scripts/form/reorder-authbackend.phtml new file mode 100644 index 0000000..34b10b3 --- /dev/null +++ b/application/views/scripts/form/reorder-authbackend.phtml @@ -0,0 +1,83 @@ +
+ + + + + + + +getBackendOrder(); + $backendConfigs = $form->getConfig(); + for ($i = 0; $i < count($backendNames); $i++): + $type = $backendConfigs->getSection($backendNames[$i])->get('backend'); +?> + + + + + + + +
translate('Backend') ?>
+ qlink( + $backendNames[$i], + 'config/edituserbackend', + array('backend' => $backendNames[$i]), + array( + 'icon' => $type === 'external' ? + 'magic' : ($type === 'ldap' || $type === 'msldap' ? 'sitemap' : 'database'), + 'class' => 'rowaction', + 'title' => sprintf($this->translate('Edit user backend %s'), $backendNames[$i]) + ) + ) ?> + + qlink( + '', + 'config/removeuserbackend', + array('backend' => $backendNames[$i]), + array( + 'class' => 'action-link', + 'icon' => 'cancel', + 'title' => sprintf($this->translate('Remove user backend %s'), $backendNames[$i]) + ) + ) ?> + + 0): ?> + + + + + +
+ getElement($form->getTokenElementName()) ?> + getElement($form->getUidElementName()) ?> +
diff --git a/application/views/scripts/group/form.phtml b/application/views/scripts/group/form.phtml new file mode 100644 index 0000000..cbf0659 --- /dev/null +++ b/application/views/scripts/group/form.phtml @@ -0,0 +1,6 @@ +
+ showOnlyCloseButton(); ?> +
+
+ +
\ No newline at end of file diff --git a/application/views/scripts/group/list.phtml b/application/views/scripts/group/list.phtml new file mode 100644 index 0000000..d362db4 --- /dev/null +++ b/application/views/scripts/group/list.phtml @@ -0,0 +1,96 @@ +compact): ?> +
+ tabs ?> + paginator ?> +
+ limiter ?> + sortBox ?> +
+ backendSelection ?> + filterEditor ?> +
+ +
+translate('No backend found which is able to list user groups') . '
'; + return; +} else { + $extensible = $this->hasPermission('config/access-control/groups') && $backend instanceof Extensible; + $reducible = $this->hasPermission('config/access-control/groups') && $backend instanceof Reducible; +} +?> + + + qlink( + $this->translate('Add a New User Group'), + 'group/add', + array('backend' => $backend->getName()), + array( + 'class' => 'button-link', + 'data-base-target' => '_next', + 'icon' => 'plus' + ) + ) ?> + + +hasResult()): ?> +

translate('No user groups found matching the filter'); ?>

+ + + + + + + + + + + + + + + + + + + + + +
translate('User Group'); ?>translate('Remove'); ?>
+ qlink( + $group->group_name, + 'group/show', + array( + 'backend' => $backend->getName(), + 'group' => $group->group_name + ), + array( + 'title' => sprintf( + $this->translate('Show detailed information for user group %s'), + $group->group_name + ) + ) + ); ?> + + qlink( + null, + 'group/remove', + array( + 'backend' => $backend->getName(), + 'group' => $group->group_name + ), + array( + 'class' => 'action-link', + 'title' => sprintf($this->translate('Remove user group %s'), $group->group_name), + 'icon' => 'cancel' + ) + ); ?> +
+ diff --git a/application/views/scripts/group/show.phtml b/application/views/scripts/group/show.phtml new file mode 100644 index 0000000..75f0b75 --- /dev/null +++ b/application/views/scripts/group/show.phtml @@ -0,0 +1,108 @@ +hasPermission('config/access-control/groups') && $backend instanceof Extensible; + +$editLink = null; +if ($this->hasPermission('config/access-control/groups') && $backend instanceof Updatable) { + $editLink = $this->qlink( + null, + 'group/edit', + array( + 'backend' => $backend->getName(), + 'group' => $group->group_name + ), + array( + 'title' => sprintf($this->translate('Edit group %s'), $group->group_name), + 'class' => 'group-edit', + 'icon' => 'edit' + ) + ); +} + +?> +
+compact): ?> + + +

escape($group->group_name) ?>

+ + + + + + + + + +
translate('Created at'); ?>created_at === null ? '-' : $this->formatDateTime($group->created_at); ?>
translate('Last modified'); ?>last_modified === null ? '-' : $this->formatDateTime($group->last_modified); ?>
+compact): ?> +

translate('Members'); ?>

+
+ limiter; ?> + paginator; ?> + sortBox; ?> +
+ filterEditor; ?> + +
+
+ + qlink( + $this->translate('Add New Member'), + 'group/addmember', + array( + 'backend' => $backend->getName(), + 'group' => $group->group_name + ), + array( + 'icon' => 'plus', + 'class' => 'button-link' + ) + ) ?> + + +hasResult()): ?> +

translate('No group member found matching the filter'); ?>

+
+ + + + + + + + + + + + + + + + + + + + + +
translate('Username'); ?>translate('Remove'); ?>
+ hasPermission('config/access-control/users') + && ($userBackend = $backend->getUserBackendName($member->user_name)) !== null + ): ?> + qlink($member->user_name, 'user/show', array( + 'backend' => $userBackend, + 'user' => $member->user_name + ), array( + 'title' => sprintf($this->translate('Show detailed information about %s'), $member->user_name) + )); ?> + + escape($member->user_name); ?> + + + getElement('user_name')->setValue($member->user_name); echo $removeForm; ?> +
+ diff --git a/application/views/scripts/iframe/index.phtml b/application/views/scripts/iframe/index.phtml new file mode 100644 index 0000000..96e9de7 --- /dev/null +++ b/application/views/scripts/iframe/index.phtml @@ -0,0 +1,8 @@ + +
+ +
+ +
+ +
diff --git a/application/views/scripts/index/welcome.phtml b/application/views/scripts/index/welcome.phtml new file mode 100644 index 0000000..496dec9 --- /dev/null +++ b/application/views/scripts/index/welcome.phtml @@ -0,0 +1,2 @@ +

Welcome to Icinga!

+You should install/configure some modules now! diff --git a/application/views/scripts/inline.phtml b/application/views/scripts/inline.phtml new file mode 100644 index 0000000..2534d44 --- /dev/null +++ b/application/views/scripts/inline.phtml @@ -0,0 +1,2 @@ +layout()->content ?> + diff --git a/application/views/scripts/joystickPagination.phtml b/application/views/scripts/joystickPagination.phtml new file mode 100644 index 0000000..a8c24c9 --- /dev/null +++ b/application/views/scripts/joystickPagination.phtml @@ -0,0 +1,162 @@ +translate('%s: Show %s %u to %u out of %u', 'pagination.joystick'); +$xAxisPages = $xAxisPaginator->getPages('all'); +$yAxisPages = $yAxisPaginator->getPages('all'); + +$flipUrl = Url::fromRequest(); +if ($flipUrl->getParam('flipped')) { + $flipUrl->remove('flipped'); +} else { + $flipUrl->setParam('flipped'); +} +if ($flipUrl->hasParam('page')) { + $flipUrl->setParam('page', implode(',', array_reverse(explode(',', $flipUrl->getParam('page'))))); +} +if ($flipUrl->hasParam('limit')) { + $flipUrl->setParam('limit', implode(',', array_reverse(explode(',', $flipUrl->getParam('limit'))))); +} + +$totalYAxisPages = $yAxisPaginator->count(); +$currentYAxisPage = $yAxisPaginator->getCurrentPageNumber(); +$prevYAxisPage = $currentYAxisPage > 1 ? $currentYAxisPage - 1 : null; +$nextYAxisPage = $currentYAxisPage < $totalYAxisPages ? $currentYAxisPage + 1 : null; + +$totalXAxisPages = $xAxisPaginator->count(); +$currentXAxisPage = $xAxisPaginator->getCurrentPageNumber(); +$prevXAxisPage = $currentXAxisPage > 1 ? $currentXAxisPage - 1 : null; +$nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 : null; + +?> + + + + + + + + + + + flippable): ?> + + + + + + + + + + + + +
  + + qlink( + '', + Url::fromRequest(), + array( + 'page' => $currentXAxisPage . ',' . $prevYAxisPage + ), + array( + 'icon' => 'up-open', + 'data-base-target' => '_self', + 'title' => sprintf( + $showText, + $this->translate('Y-Axis', 'pagination.joystick'), + $this->translate('hosts', 'pagination.joystick'), + ($prevYAxisPage - 1) * $yAxisPages->itemCountPerPage + 1, + $prevYAxisPage * $yAxisPages->itemCountPerPage, + $yAxisPages->totalItemCount + ) + ) + ); ?> + + icon('up-open'); ?> + +  
+ + qlink( + '', + Url::fromRequest(), + array( + 'page' => $prevXAxisPage . ',' . $currentYAxisPage + ), + array( + 'icon' => 'left-open', + 'data-base-target' => '_self', + 'title' => sprintf( + $showText, + $this->translate('X-Axis', 'pagination.joystick'), + $this->translate('services', 'pagination.joystick'), + ($prevXAxisPage - 1) * $xAxisPages->itemCountPerPage + 1, + $prevXAxisPage * $xAxisPages->itemCountPerPage, + $xAxisPages->totalItemCount + ) + ) + ); ?> + + icon('left-open'); ?> + + qlink( + '', + $flipUrl, + null, + array( + 'icon' => 'arrows-cw', + 'data-base-target' => '_self', + 'title' => $this->translate('Flip grid axes') + ) + ) ?>  + + qlink( + '', + Url::fromRequest(), + array( + 'page' => $nextXAxisPage . ',' . $currentYAxisPage + ), + array( + 'icon' => 'right-open', + 'data-base-target' => '_self', + 'title' => sprintf( + $showText, + $this->translate('X-Axis', 'pagination.joystick'), + $this->translate('services', 'pagination.joystick'), + $currentXAxisPage * $xAxisPages->itemCountPerPage + 1, + $nextXAxisPage === $xAxisPages->last ? $xAxisPages->totalItemCount : $nextXAxisPage * $xAxisPages->itemCountPerPage, + $xAxisPages->totalItemCount + ) + ), + false + ); ?> + + icon('right-open'); ?> + +
  + + qlink( + '', + Url::fromRequest(), + array( + 'page' => $currentXAxisPage . ',' . $nextYAxisPage + ), + array( + 'icon' => 'down-open', + 'data-base-target' => '_self', + 'title' => sprintf( + $showText, + $this->translate('Y-Axis', 'pagination.joystick'), + $this->translate('hosts', 'pagination.joystick'), + $currentYAxisPage * $yAxisPages->itemCountPerPage + 1, + $nextYAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $nextYAxisPage * $yAxisPages->itemCountPerPage, + $yAxisPages->totalItemCount + ) + ) + ); ?> + + icon('down-open'); ?> + +  
diff --git a/application/views/scripts/layout/announcements.phtml b/application/views/scripts/layout/announcements.phtml new file mode 100644 index 0000000..3be6b83 --- /dev/null +++ b/application/views/scripts/layout/announcements.phtml @@ -0,0 +1 @@ +widget('announcements') ?> diff --git a/application/views/scripts/layout/menu.phtml b/application/views/scripts/layout/menu.phtml new file mode 100644 index 0000000..dfb544d --- /dev/null +++ b/application/views/scripts/layout/menu.phtml @@ -0,0 +1,20 @@ +setUser($this->Auth()->getUser()); + +if ($searchDashboard->search('dummy')->getPane('search')->hasDashlets()): ?> + + +setCssClass('primary-nav')->setElementTag('nav')->setHeading(t('Navigation')); ?> + diff --git a/application/views/scripts/list/applicationlog.phtml b/application/views/scripts/list/applicationlog.phtml new file mode 100644 index 0000000..aa1a90a --- /dev/null +++ b/application/views/scripts/list/applicationlog.phtml @@ -0,0 +1,29 @@ +compact): ?> +
+ tabs ?> + paginator ?> +
+ limiter ?> +
+
+ +
+logData !== null): ?> + + + logData as $value): ?> + datetime) ?> + + + + + + +
+ escape($datetime->format('d.m. H:i')) ?>
+ escape($value->loglevel) ?> +
+ escape($value->message), false) ?> +
+ +
diff --git a/application/views/scripts/mixedPagination.phtml b/application/views/scripts/mixedPagination.phtml new file mode 100644 index 0000000..e92a9c9 --- /dev/null +++ b/application/views/scripts/mixedPagination.phtml @@ -0,0 +1,79 @@ +pageCount <= 1) return; ?> + diff --git a/application/views/scripts/navigation/dashboard.phtml b/application/views/scripts/navigation/dashboard.phtml new file mode 100644 index 0000000..f069882 --- /dev/null +++ b/application/views/scripts/navigation/dashboard.phtml @@ -0,0 +1,27 @@ + +
+ +
+ diff --git a/application/views/scripts/navigation/index.phtml b/application/views/scripts/navigation/index.phtml new file mode 100644 index 0000000..bf08562 --- /dev/null +++ b/application/views/scripts/navigation/index.phtml @@ -0,0 +1,78 @@ +compact): ?> +
+ tabs ?> +
+ sortBox ?> +
+ filterEditor ?> +
+ +
+ qlink( + $this->translate('Create a New Navigation Item') , + 'navigation/add', + null, + array( + 'class' => 'button-link', + 'data-base-target' => '_next', + 'icon' => 'plus', + 'title' => $this->translate('Create a new navigation item') + ) + ) ?> + +

translate('You did not create any navigation item yet.') ?>

+
+ + + + + + + + + + + + + + + + + + + + +
translate('Navigation') ?>translate('Type') ?>translate('Shared') ?>
+ qlink( + $item->name, + 'navigation/edit', + array( + 'name' => $item->name, + 'type' => $item->type + ), + array( + 'title' => sprintf($this->translate('Edit navigation item %s'), $item->name) + ) + ) ?> + + type && isset($types[$item->type]) + ? $this->escape($types[$item->type]) + : $this->escape($this->translate('Unknown')) ?> + + owner ? $this->translate('Yes') : $this->translate('No') ?> + + qlink( + '', + 'navigation/remove', + array( + 'name' => $item->name, + 'type' => $item->type + ), + array( + 'class' => 'action-link', + 'icon' => 'cancel', + 'title' => sprintf($this->translate('Remove navigation item %s'), $item->name) + ) + ) ?> +
+ diff --git a/application/views/scripts/navigation/shared.phtml b/application/views/scripts/navigation/shared.phtml new file mode 100644 index 0000000..b6739fb --- /dev/null +++ b/application/views/scripts/navigation/shared.phtml @@ -0,0 +1,68 @@ +compact): ?> +
+ tabs; ?> +
+ sortBox ?> +
+
+ +
+ +

translate('There are currently no navigation items being shared'); ?>

+ + + + + + + + + + + + + + + parent): ?> + + + + + + + +
translate('Shared Navigation'); ?>translate('Type'); ?>translate('Owner'); ?>translate('Unshare'); ?>
qlink( + $item->name, + 'navigation/edit', + array( + 'name' => $item->name, + 'type' => $item->type, + 'owner' => $item->owner, + 'referrer' => 'shared' + ), + array( + 'title' => sprintf($this->translate('Edit shared navigation item %s'), $item->name) + ) + ); ?>type && isset($types[$item->type]) + ? $this->escape($types[$item->type]) + : $this->escape($this->translate('Unknown')); ?>escape($item->owner); ?>icon( + 'block', + sprintf( + $this->translate( + 'This is a child of the navigation item %1$s. You can' + . ' only unshare this item by unsharing %1$s' + ), + $item->parent + ) + ); ?>setDefault('name', $item->name) + ->setAction(Url::fromPath( + 'navigation/unshare', + array('type' => $item->type, 'owner' => $item->owner) + )); ?>
+ +
diff --git a/application/views/scripts/pivottablePagination.phtml b/application/views/scripts/pivottablePagination.phtml new file mode 100644 index 0000000..ce18014 --- /dev/null +++ b/application/views/scripts/pivottablePagination.phtml @@ -0,0 +1,48 @@ +count() <= 1 && $yAxisPaginator->count() <= 1) { + return; // Display this pagination only if there are multiple pages +} + +$fromTo = t('%s: %d to %d of %d (on the %s-axis)'); +$xAxisPages = $xAxisPaginator->getPages('all'); +$yAxisPages = $yAxisPaginator->getPages('all'); + +?> + +
+ + + +pagesInRange as $yAxisPage): ?> + +pagesInRange as $xAxisPage): ?> + current && $yAxisPage === $yAxisPages->current ? ' class="active"' : ''; ?>> +current || $yAxisPage !== $yAxisPages->current): ?> + + + + + + + +
+
diff --git a/application/views/scripts/role/list.phtml b/application/views/scripts/role/list.phtml new file mode 100644 index 0000000..352e3e2 --- /dev/null +++ b/application/views/scripts/role/list.phtml @@ -0,0 +1,65 @@ +
+ + paginator ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?> +
+
+ qlink( + $this->translate('Create a New Role') , + 'role/add', + null, + array( + 'class' => 'button-link', + 'data-base-target' => '_next', + 'icon' => 'plus', + 'title' => $this->translate('Create a new role') + ) + ) ?> +hasResult()): ?> +

translate('No roles found.') ?>

+ + + + + + + + + + + + + $role): /** @var object $role */ ?> + + + + + + + + + +
translate('Name') ?>translate('Users') ?>translate('Groups') ?>translate('Inherits From') ?>
+ qlink( + $name, + 'role/edit', + array('role' => $name), + array('title' => sprintf($this->translate('Edit role %s'), $name)) + ) ?> + escape($role->users) ?>escape($role->groups) ?>escape($role->parent) ?> + qlink( + '', + 'role/remove', + array('role' => $name), + array( + 'class' => 'action-link', + 'icon' => 'cancel', + 'title' => sprintf($this->translate('Remove role %s'), $name) + ) + ) ?> +
+
diff --git a/application/views/scripts/search/hint.phtml b/application/views/scripts/search/hint.phtml new file mode 100644 index 0000000..d54c0b2 --- /dev/null +++ b/application/views/scripts/search/hint.phtml @@ -0,0 +1,8 @@ +
+

translate("I'm ready to search, waiting for your input") ?>

+

translate('Hint') ?>: translate( + 'Please use the asterisk (*) as a placeholder for wildcard searches.' + . " For convenience I'll always add a wildcard in front and after your" + . ' search string.' +) ?>

+
diff --git a/application/views/scripts/search/index.phtml b/application/views/scripts/search/index.phtml new file mode 100644 index 0000000..321597e --- /dev/null +++ b/application/views/scripts/search/index.phtml @@ -0,0 +1,7 @@ +
+dashboard->getTabs() ?> +
+ +
+dashboard ?> +
diff --git a/application/views/scripts/showConfiguration.phtml b/application/views/scripts/showConfiguration.phtml new file mode 100644 index 0000000..682b349 --- /dev/null +++ b/application/views/scripts/showConfiguration.phtml @@ -0,0 +1,27 @@ +
+

translate('Saving Configuration Failed'); ?>

+

+ translate('The file %s couldn\'t be stored. (Error: "%s")'), + $this->escape($filePath), + $this->escape($errorMessage) + ); ?> +
+ translate('This could have one or more of the following reasons:'); ?> +

+
    +
  • translate('You don\'t have file-system permissions to write to the file'); ?>
  • +
  • translate('Something went wrong while writing the file'); ?>
  • +
  • translate('There\'s an application error preventing you from persisting the configuration'); ?>
  • +
+
+

+ translate('Details can be found in the application log. (If you don\'t have access to this log, call your administrator in this case)'); ?> +
+ translate('In case you can access the file by yourself, you can open it and insert the config manually:'); ?> +

+

+

+    escape($configString); ?>
+  
+

diff --git a/application/views/scripts/simple-form.phtml b/application/views/scripts/simple-form.phtml new file mode 100644 index 0000000..9bcba74 --- /dev/null +++ b/application/views/scripts/simple-form.phtml @@ -0,0 +1,6 @@ +
+ +
+
+ create()->setTitle(null) // @TODO(el): create() has to be called because the UserForm is setting the title there ?> +
diff --git a/application/views/scripts/user/form.phtml b/application/views/scripts/user/form.phtml new file mode 100644 index 0000000..cbf0659 --- /dev/null +++ b/application/views/scripts/user/form.phtml @@ -0,0 +1,6 @@ +
+ showOnlyCloseButton(); ?> +
+
+ +
\ No newline at end of file diff --git a/application/views/scripts/user/list.phtml b/application/views/scripts/user/list.phtml new file mode 100644 index 0000000..bdb5f1a --- /dev/null +++ b/application/views/scripts/user/list.phtml @@ -0,0 +1,90 @@ +compact): ?> +
+ tabs ?> + paginator ?> +
+ limiter ?> + sortBox ?> +
+ backendSelection ?> + filterEditor ?> +
+ +
+translate('No backend found which is able to list users') . '
'; + return; +} else { + $extensible = $this->hasPermission('config/access-control/users') && $backend instanceof Extensible; + $reducible = $this->hasPermission('config/access-control/users') && $backend instanceof Reducible; +} +?> + + + qlink( + $this->translate('Add a New User') , + 'user/add', + array('backend' => $backend->getName()), + array( + 'class' => 'button-link', + 'data-base-target' => '_next', + 'icon' => 'plus' + ) + ) ?> + + +hasResult()): ?> +

translate('No users found matching the filter') ?>

+ + + + + + + + + + + + + + + + + + + + + + +
translate('Username') ?>translate('Remove') ?>
qlink( + $user->user_name, + 'user/show', + array( + 'backend' => $backend->getName(), + 'user' => $user->user_name + ), + array( + 'title' => sprintf($this->translate('Show detailed information about %s'), $user->user_name) + ) + ) ?>qlink( + null, + 'user/remove', + array( + 'backend' => $backend->getName(), + 'user' => $user->user_name + ), + array( + 'class' => 'action-link', + 'icon' => 'cancel', + 'title' => sprintf($this->translate('Remove user %s'), $user->user_name) + ) + ) ?>
+ diff --git a/application/views/scripts/user/show.phtml b/application/views/scripts/user/show.phtml new file mode 100644 index 0000000..b19c15a --- /dev/null +++ b/application/views/scripts/user/show.phtml @@ -0,0 +1,138 @@ + +
+compact): ?> + + +

escape($user->user_name) ?>

+ hasPermission('config/access-control/users') && $backend instanceof Updatable) { + echo $this->qlink( + $this->translate('Edit User'), + 'user/edit', + array( + 'backend' => $backend->getName(), + 'user' => $user->user_name + ), + array( + 'class' => 'button-link', + 'icon' => 'edit', + 'title' => sprintf($this->translate('Edit user %s'), $user->user_name) + ) + ); + } + ?> + + + + + + + + + + + + + + + + + +
translate('State'); ?>is_active === null ? '-' : ($user->is_active ? $this->translate('Active') : $this->translate('Inactive')); ?>
translate('Created at'); ?>created_at === null ? '-' : $this->formatDateTime($user->created_at); ?>
translate('Last modified'); ?>last_modified === null ? '-' : $this->formatDateTime($user->last_modified); ?>
translate('Role Memberships'); ?> + getRoles(); ?> + +
    + +
  • + allowedToEditRoles): ?> + qlink( + $role->getName(), + 'role/edit', + ['role' => $role->getName()], + ['title' => sprintf($this->translate('Edit role %s'), $role->getName())] + ); + $role === end($roles) ? print '' : print ', '; ?> + + getName() ?> + +
  • + +
+ +

translate('No memberships found'); ?>

+ +
+compact): ?> +

translate('Group Memberships'); ?>

+
+ limiter; ?> + paginator; ?> + sortBox; ?> +
+ filterEditor; ?> + +
+
+ + qlink( + $this->translate('Create New Membership'), + 'user/createmembership', + array( + 'backend' => $backend->getName(), + 'user' => $user->user_name + ), + array( + 'icon' => 'plus', + 'class' => 'button-link' + ) + ) ?> + + +hasResult()): ?> +

translate('No memberships found matching the filter'); ?>

+
+ + + + + + + + + + + + + + + + + +
translate('Group'); ?>translate('Cancel', 'group.membership'); ?>
+ hasPermission('config/access-control/groups') && $membership->backend instanceof Selectable): ?> + qlink($membership->group_name, 'group/show', array( + 'backend' => $membership->backend->getName(), + 'group' => $membership->group_name + ), array( + 'title' => sprintf($this->translate('Show detailed information for group %s'), $membership->group_name) + )); ?> + + escape($membership->group_name); ?> + + + backend instanceof Reducible): ?> + setAction($this->url('group/removemember', array( + 'backend' => $membership->backend->getName(), + 'group' => $membership->group_name + ))); ?> + + - + +
+ -- cgit v1.2.3