<?php return function ($user) { $form = new Kirby\Panel\Form(array('username' => array('label' => 'users.delete.headline', 'type' => 'text', 'readonly' => true, 'icon' => false, 'default' => $user->username(), 'help' => $user->email()))); $form->style('delete'); $form->cancel($user, 'edit'); return $form; };
<?php return function ($page, $textarea) { $form = new Kirby\Panel\Form(array('address' => array('label' => 'editor.email.address.label', 'type' => 'email', 'placeholder' => 'editor.email.address.placeholder', 'autofocus' => 'true', 'required' => 'true'), 'text' => array('label' => 'editor.email.text.label', 'type' => 'text', 'help' => 'editor.email.text.help', 'icon' => 'font'))); $form->data('textarea', 'form-field-' . $textarea); $form->style('editor'); $form->cancel($page); return $form; };
<?php return function ($problems) { $form = new Kirby\Panel\Form(array('info' => array('type' => 'info'))); if (count($problems) > 1) { $info = new Brick('ol'); foreach ($problems as $problem) { $info->append('<li>' . $problem . '</li>'); } } else { $info = new Brick('p'); foreach ($problems as $problem) { $info->append($problem); } } // add the list of problems to the info field $form->fields->info->text = (string) $info; // setup the retry button $form->buttons->submit->value = l('installation.check.retry'); $form->buttons->submit->autofocus = true; $form->style('centered'); $form->alert(l('installation.check.text')); return $form; };