diff --git a/src/Factory/MenuFactory.php b/src/Factory/MenuFactory.php index 30605ae5..5c73f923 100644 --- a/src/Factory/MenuFactory.php +++ b/src/Factory/MenuFactory.php @@ -4,6 +4,8 @@ namespace PhpSchool\PhpWorkshop\Factory; +use PhpSchool\CliMenu\Action\ExitAction; +use PhpSchool\CliMenu\MenuItem\SelectableItem; use PhpSchool\CliMenu\Style\SelectableStyle; use PhpSchool\Terminal\Terminal; use Psr\Container\ContainerInterface; @@ -74,7 +76,7 @@ function (CliMenu $menu) use ($exerciseRenderer, $eventDispatcher, $exercise) { ->addLineBreak() ->addItem('HELP', new MenuCommandInvoker($c->get(HelpCommand::class))) ->addItem('CREDITS', new MenuCommandInvoker($c->get(CreditsCommand::class))) - ->setExitButtonText('EXIT') + ->disableDefaultItems() ->setBackgroundColour($c->get('bgColour')) ->setForegroundColour($c->get('fgColour')) ->setMarginAuto() @@ -110,6 +112,14 @@ function (CliMenu $menu) use ($exerciseRenderer, $eventDispatcher, $exercise) { }) ->addLineBreak(); + $builder->addMenuItem(new SelectableItem('EXIT', new ExitAction())); + + if (PHP_OS_FAMILY === 'Darwin') { + $builder->addLineBreak(); + $builder->addItem('www.phpschool.io', function () { + exec('open https://www.phpschool.io'); + }); + } if (null !== $c->get('workshopTitle')) { $builder->setTitle($c->get('workshopTitle'));