You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
666 B
39 lines
666 B
<?php
|
|
|
|
namespace App;
|
|
|
|
class Engine
|
|
{
|
|
protected $_config, $_driver;
|
|
|
|
public function __construct(\App\Configuration $config, \App\ILayoutDriver $driver)
|
|
{
|
|
$this->_config = $config;
|
|
$this->_driver = $driver;
|
|
}
|
|
|
|
public function layout()
|
|
{
|
|
foreach ($this->_config->getLayouts() as $layout_name=>$layout)
|
|
{
|
|
$screens = $layout->getScreenNames();
|
|
$all_screens = true;
|
|
foreach ($screens as $screen_name)
|
|
{
|
|
if (!$this->_config->getScreen($screen_name)->isConnected())
|
|
{
|
|
$all_screens = false;
|
|
break;
|
|
}
|
|
}
|
|
if (!$all_screens)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
$layout->execute($this->_config, $this->_driver);
|
|
break;
|
|
}
|
|
|
|
}
|
|
}
|
|
|