diff --git a/application/controllers/JobsController.php b/application/controllers/JobsController.php index 132d6216..1caf4ee2 100644 --- a/application/controllers/JobsController.php +++ b/application/controllers/JobsController.php @@ -22,6 +22,12 @@ class JobsController extends CompatController public function indexAction() { $this->addTitleTab($this->translate('Jobs')); + $this->getTabs()->add('sni', [ + 'title' => $this->translate('Configure SNI'), + 'label' => $this->translate('SNI'), + 'url' => 'x509/sni', + 'baseTarget' => '_main' + ]); $jobs = X509Job::on($this->getDb()); if ($this->hasPermission('config/x509')) { diff --git a/application/controllers/SniController.php b/application/controllers/SniController.php index 786e7297..cde48074 100644 --- a/application/controllers/SniController.php +++ b/application/controllers/SniController.php @@ -7,17 +7,34 @@ use Icinga\Exception\NotFoundError; use Icinga\Module\X509\Forms\Config\SniConfigForm; use Icinga\Module\X509\SniIniRepository; -use Icinga\Web\Controller; -use Icinga\Web\Url; +use ipl\Html\HtmlString; +use ipl\Web\Compat\CompatController; +use ipl\Web\Url; +use ipl\Web\Widget\ButtonLink; -class SniController extends Controller +class SniController extends CompatController { /** * List all maps */ public function indexAction() { - $this->view->tabs = $this->Module()->getConfigTabs()->activate('sni'); + $this->getTabs()->add('jobs', [ + 'title' => $this->translate('Configure Jobs'), + 'label' => $this->translate('Jobs'), + 'url' => 'x509/jobs', + 'baseTarget' => '_main' + + ]); + $this->addTitleTab($this->translate('SNI')); + + $this->addControl( + (new ButtonLink($this->translate('New SNI Map'), Url::fromPath('x509/sni/new'), 'plus')) + ->openInModal() + ); + $this->controls->getAttributes()->add('class', 'default-layout'); + + $this->view->controls = $this->controls; $repo = new SniIniRepository(); @@ -29,11 +46,13 @@ public function indexAction() */ public function newAction() { + $this->addTitleTab($this->translate('New SNI Map')); + $form = $this->prepareForm()->add(); $form->handleRequest(); - $this->renderForm($form, $this->translate('New SNI Map')); + $this->addContent(new HtmlString($form->render())); } /** diff --git a/application/forms/Config/SniConfigForm.php b/application/forms/Config/SniConfigForm.php index 23d398ec..27a48231 100644 --- a/application/forms/Config/SniConfigForm.php +++ b/application/forms/Config/SniConfigForm.php @@ -35,7 +35,6 @@ protected function createInsertElements(array $formData) ] ]); - $this->setTitle($this->translate('Create a New SNI Map')); $this->setSubmitLabel($this->translate('Create')); } diff --git a/application/views/scripts/sni/index.phtml b/application/views/scripts/sni/index.phtml index 09c4de89..2be52804 100644 --- a/application/views/scripts/sni/index.phtml +++ b/application/views/scripts/sni/index.phtml @@ -1,20 +1,5 @@ -
- -
+controls->render() ?>
-
- qlink( - $this->translate('Create a New SNI Map') , - 'x509/sni/new', - null, - [ - 'class' => 'button-link', - 'data-base-target' => '_next', - 'icon' => 'plus', - 'title' => $this->translate('Create a New SNI Map') - ] - ) ?> -
hasResult()): ?>

escape($this->translate('No SNI maps configured yet.')) ?>

diff --git a/configuration.php b/configuration.php index 9930753a..c7adad4b 100644 --- a/configuration.php +++ b/configuration.php @@ -20,10 +20,10 @@ 'priority' => 20 )); -$section->add(N_('Jobs'), [ +$section->add(N_('Configuration'), [ 'url' => 'x509/jobs', 'priority' => 100, - 'description' => $this->translate('Configure the scan jobs') + 'description' => $this->translate('Configure the scan jobs and SNI map') ]); $this->provideConfigTab('backend', array( @@ -31,9 +31,3 @@ 'label' => $this->translate('Backend'), 'url' => 'config/backend' )); - -$this->provideConfigTab('sni', array( - 'title' => $this->translate('Configure SNI'), - 'label' => $this->translate('SNI'), - 'url' => 'sni' -));