2014-10-02 17:11:00 +02:00
|
|
|
<?php
|
2015-02-04 10:46:36 +01:00
|
|
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
2014-10-02 17:11:00 +02:00
|
|
|
|
2014-11-14 11:01:16 +01:00
|
|
|
namespace Icinga\Module\Setup\Forms;
|
2014-10-02 17:11:00 +02:00
|
|
|
|
2015-01-21 11:44:44 +01:00
|
|
|
use LogicException;
|
2014-10-02 17:11:00 +02:00
|
|
|
use Icinga\Web\Form;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Wizard page that displays a summary of what is going to be "done"
|
|
|
|
*/
|
|
|
|
class SummaryPage extends Form
|
|
|
|
{
|
2014-10-27 14:11:24 +01:00
|
|
|
/**
|
2014-11-10 10:30:52 +01:00
|
|
|
* The title of what is being set up
|
2014-10-27 14:11:24 +01:00
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $title;
|
|
|
|
|
2014-10-02 17:11:00 +02:00
|
|
|
/**
|
|
|
|
* The summary to show
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $summary;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize this page
|
|
|
|
*/
|
|
|
|
public function init()
|
|
|
|
{
|
2015-01-21 11:44:44 +01:00
|
|
|
if ($this->getName() === $this->filterName(get_class($this))) {
|
|
|
|
throw new LogicException(
|
|
|
|
'When utilizing ' . get_class($this) . ' it is required to set a unique name by using the form options'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-10-02 17:11:00 +02:00
|
|
|
$this->setViewScript('form/setup-summary.phtml');
|
|
|
|
}
|
|
|
|
|
2014-10-27 14:11:24 +01:00
|
|
|
/**
|
2014-11-10 10:30:52 +01:00
|
|
|
* Set the title of what is being set up
|
2014-10-27 14:11:24 +01:00
|
|
|
*
|
|
|
|
* @param string $title
|
|
|
|
*/
|
|
|
|
public function setSubjectTitle($title)
|
|
|
|
{
|
|
|
|
$this->title = $title;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-11-10 10:30:52 +01:00
|
|
|
* Return the title of what is being set up
|
2014-10-27 14:11:24 +01:00
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getSubjectTitle()
|
|
|
|
{
|
|
|
|
return $this->title;
|
|
|
|
}
|
|
|
|
|
2014-10-02 17:11:00 +02:00
|
|
|
/**
|
|
|
|
* Set the summary to show
|
|
|
|
*
|
|
|
|
* @param array $summary
|
|
|
|
*
|
2015-04-07 14:23:26 +02:00
|
|
|
* @return $this
|
2014-10-02 17:11:00 +02:00
|
|
|
*/
|
|
|
|
public function setSummary(array $summary)
|
|
|
|
{
|
|
|
|
$this->summary = $summary;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the summary to show
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getSummary()
|
|
|
|
{
|
|
|
|
return $this->summary;
|
|
|
|
}
|
|
|
|
}
|