icingaweb2/modules/setup/application/forms/RequirementsPage.php

70 lines
1.4 KiB
PHP
Raw Normal View History

2014-09-29 12:26:54 +02:00
<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Setup\Forms;
2014-09-29 12:26:54 +02:00
use Icinga\Web\Form;
use Icinga\Module\Setup\Requirements;
2014-09-29 12:26:54 +02:00
/**
* Wizard page to list setup requirements
2014-09-29 12:26:54 +02:00
*/
class RequirementsPage extends Form
{
/**
* The requirements to list
*
* @var Requirements
*/
protected $requirements;
/**
* Initialize this page
*/
public function init()
{
$this->setName('setup_requirements');
$this->setViewScript('form/setup-requirements.phtml');
}
/**
* Set the requirements to list
*
* @param Requirements $requirements
*
* @return self
*/
public function setRequirements(Requirements $requirements)
{
$this->requirements = $requirements;
return $this;
}
/**
* Return the requirements to list
*
* @return Requirements
*/
public function getRequirements()
{
return $this->requirements;
}
/**
* Validate the given form data and check whether the requirements are fulfilled
*
* @param array $data The data to validate
*
* @return bool
*/
public function isValid($data)
{
if (false === parent::isValid($data)) {
return false;
}
return $this->requirements->fulfilled();
}
}