* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team */ // {{{ICINGA_LICENSE_HEADER}}} use \Icinga\Web\Controller\ActionController; /** * Displays aggregations collections of multiple objects. */ class Monitoring_MultiController extends ActionController { public function init() { $this->view->objects = $this->getDetailQueries(); } public function hostAction() { $this->view->hosts = $this->_getAllParams(); } public function servicesAction() { } public function notificationsAction() { } public function historyAction() { } /** * Fetch all queries from the 'detail' parameter and prepare * them for further processing. * * @return array An array containing all requests and their filter values. */ private function getDetailQueries() { $details = $this->_getAllParams(); $objects = array(); foreach ($details as $property => $values) { if (!is_array($values)) { continue; } foreach ($values as $index => $value) { if (!array_key_exists($index, $objects)) { $objects[$index] = array(); } $objects[$index][$property] = $value; } } return $objects; } }