2014-09-29 12:26:54 +02:00
|
|
|
<?php
|
2015-02-04 10:46:36 +01:00
|
|
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
2014-09-29 12:26:54 +02:00
|
|
|
|
2014-11-14 11:01:16 +01:00
|
|
|
namespace Icinga\Module\Setup\Forms;
|
2014-09-29 12:26:54 +02:00
|
|
|
|
|
|
|
use Icinga\Web\Form;
|
2015-03-09 09:05:56 +01:00
|
|
|
use Icinga\Module\Setup\RequirementSet;
|
2014-09-29 12:26:54 +02:00
|
|
|
|
|
|
|
/**
|
2014-11-10 10:30:52 +01:00
|
|
|
* Wizard page to list setup requirements
|
2014-09-29 12:26:54 +02:00
|
|
|
*/
|
|
|
|
class RequirementsPage extends Form
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The requirements to list
|
|
|
|
*
|
2015-03-09 09:05:56 +01:00
|
|
|
* @var RequirementSet
|
2014-09-29 12:26:54 +02:00
|
|
|
*/
|
2015-03-09 09:05:56 +01:00
|
|
|
protected $set;
|
2014-09-29 12:26:54 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize this page
|
|
|
|
*/
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
$this->setName('setup_requirements');
|
|
|
|
$this->setViewScript('form/setup-requirements.phtml');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the requirements to list
|
|
|
|
*
|
2015-03-09 09:05:56 +01:00
|
|
|
* @param RequirementSet $set
|
2014-09-29 12:26:54 +02:00
|
|
|
*
|
|
|
|
* @return self
|
|
|
|
*/
|
2015-03-09 09:05:56 +01:00
|
|
|
public function setRequirements(RequirementSet $set)
|
2014-09-29 12:26:54 +02:00
|
|
|
{
|
2015-03-09 09:05:56 +01:00
|
|
|
$this->set = $set;
|
2014-09-29 12:26:54 +02:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the requirements to list
|
|
|
|
*
|
2015-03-09 09:05:56 +01:00
|
|
|
* @return RequirementSet
|
2014-09-29 12:26:54 +02:00
|
|
|
*/
|
|
|
|
public function getRequirements()
|
|
|
|
{
|
2015-03-09 09:05:56 +01:00
|
|
|
return $this->set;
|
2014-09-29 12:26:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
}
|
|
|
|
|
2015-03-09 09:05:56 +01:00
|
|
|
return $this->set->fulfilled();
|
2014-09-29 12:26:54 +02:00
|
|
|
}
|
|
|
|
}
|