New upstream version 0.6.27
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
<?php defined('SYSPATH') OR die('No direct access allowed.');
|
||||
<?php
|
||||
|
||||
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
defined('SYSPATH') or die('No direct access allowed.');
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
|
||||
|
||||
/**
|
||||
* Mobile controller.
|
||||
*
|
||||
@@ -6,12 +13,12 @@
|
||||
* @author Joerg Linge
|
||||
* @license GPL
|
||||
*/
|
||||
class Mobile_Controller extends System_Controller {
|
||||
|
||||
class Mobile_Controller extends System_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->session->set('classic-ui',0);
|
||||
$this->session->set('classic-ui', 0);
|
||||
$this->template = $this->add_view('mobile');
|
||||
}
|
||||
|
||||
@@ -28,17 +35,17 @@ class Mobile_Controller extends System_Controller {
|
||||
$this->template->overview = $this->add_view('mobile_overview');
|
||||
$this->template->overview->hosts = $this->data->getHosts();
|
||||
}
|
||||
public function host($host=NULL)
|
||||
public function host($host = null)
|
||||
{
|
||||
$this->template->host = $this->add_view('mobile_host');
|
||||
$this->is_authorized = $this->auth->is_authorized($host);
|
||||
$this->template->host->hostname = $host;
|
||||
$this->template->host->services = $this->data->getServices($host);
|
||||
}
|
||||
public function graph($host=NULL, $service=NULL)
|
||||
public function graph($host = null, $service = null)
|
||||
{
|
||||
$this->template->graph = $this->add_view('mobile_graph');
|
||||
$this->data->buildDataStruct($host,$service,$this->view);
|
||||
$this->data->buildDataStruct($host, $service, $this->view);
|
||||
$this->is_authorized = $this->auth->is_authorized($this->data->MACRO['AUTH_HOSTNAME'], $this->data->MACRO['AUTH_SERVICEDESC']);
|
||||
}
|
||||
public function search()
|
||||
@@ -46,48 +53,48 @@ class Mobile_Controller extends System_Controller {
|
||||
$this->template->query = $this->add_view('mobile_search');
|
||||
$query = pnp::clean($this->input->post('term'));
|
||||
$result = array();
|
||||
if(strlen($query)>=1) {
|
||||
if (strlen($query) >= 1) {
|
||||
$hosts = $this->data->getHosts();
|
||||
foreach($hosts as $host){
|
||||
if(preg_match("/$query/i",$host['name'])){
|
||||
array_push($result,$host['name']);
|
||||
foreach ($hosts as $host) {
|
||||
if (preg_match("/$query/i", $host['name'])) {
|
||||
array_push($result, $host['name']);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->result = $result;
|
||||
}
|
||||
public function pages($page=NULL)
|
||||
public function pages($page = null)
|
||||
{
|
||||
$this->is_authorized=TRUE;
|
||||
if($this->view == ""){
|
||||
$this->is_authorized = true;
|
||||
if ($this->view == "") {
|
||||
$this->view = $this->config->conf['overview-range'];
|
||||
}
|
||||
|
||||
$this->page = $page;
|
||||
if(is_null($this->page) ){
|
||||
if (is_null($this->page)) {
|
||||
$this->template->pages = $this->add_view('mobile_pages');
|
||||
$this->template->pages->pages = $this->data->getPages();
|
||||
return;
|
||||
}
|
||||
$this->data->buildPageStruct($this->page,$this->view);
|
||||
$this->data->buildPageStruct($this->page, $this->view);
|
||||
$this->template->pages = $this->add_view('mobile_graph');
|
||||
}
|
||||
public function special($tpl=NULL)
|
||||
public function special($tpl = null)
|
||||
{
|
||||
$this->tpl = $tpl;
|
||||
if(is_null($this->tpl) ){
|
||||
if (is_null($this->tpl)) {
|
||||
$this->template->special = $this->add_view('mobile_special');
|
||||
$this->template->special->templates = $this->data->getSpecialTemplates();
|
||||
return;
|
||||
}
|
||||
$this->data->buildDataStruct('__special',$this->tpl,$this->view);
|
||||
$this->data->buildDataStruct('__special', $this->tpl, $this->view);
|
||||
$this->template->special = $this->add_view('mobile_graph_special');
|
||||
}
|
||||
public function go($goto=FALSE)
|
||||
public function go($goto = false)
|
||||
{
|
||||
if($goto == 'classic'){
|
||||
$this->session->set('classic-ui',1);
|
||||
url::redirect("graph");
|
||||
if ($goto == 'classic') {
|
||||
$this->session->set('classic-ui', 1);
|
||||
url::redirect("graph");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user