0) { $f = fopen($file, "a"); ob_start(); echo date("Y/m/d H:i:s") . " (" . gettype($var) . ") " . $more_info . "\n"; print_r($var); echo "\n\n"; $output = ob_get_clean(); fprintf($f,"%s",$output); fclose($f); } else { echo "
" . date("Y/m/d H:i:s") . " (" . gettype($var) . ") " . $more_info . ""; echo "
";print_r($var);echo ""; } } public function createPage($title = null, $page_name = null) { if (!isset($title)) { $this->title = __('Pandora FMS mobile'); } else { $this->title = $title; } if (!isset($page_name)) { $this->page_name = 'main_page'; } else { $this->page_name = $page_name; } $this->html = ''; $this->endHeader = false; $this->header = array(); $this->endContent = false; $this->content = array(); $this->noFooter = false; $this->endFooter = false; $this->footer = array(); $this->form = array(); $this->grid = array(); $this->collapsible = array(); $this->endForm = true; $this->endGrid = true; $this->endCollapsible = true; $this->dialog = ''; $this->dialogs = array(); } public function showFooter($show = true) { $this->noFooter = !$show; } public function beginHeader() { $this->header = array(); $this->header['button_left'] = ''; $this->header['button_right'] = ''; $this->header['title'] = __('Pandora FMS mobile'); $this->endHeader = false; } public function endHeader() { $this->endHeader = true; } public function createHeader($title = null, $buttonLeft = null, $buttonRight = null) { $this->beginHeader(); $this->headerTitle($title); $this->headerAddButtonLeft($buttonLeft); $this->headerAddButtonRight($buttonRight); $this->endHeader(); } public function headerTitle($title = null) { if (isset($title)) { $this->header['title'] = $title; } } public function headerAddButtonLeft($button = null) { if (isset($button)) { $this->header['button_left'] = $button; } } public function headerAddButtonRight($button = null) { if (isset($button)) { $this->header['button_right'] = $button; } } public function createHeaderButton($options) { return $this->createButton($options); } public function createDefaultHeader($title = false) { if ($title === false) { $title = __('Pandora FMS mobile'); } $this->createHeader( $title, $this->createHeaderButton( array('icon' => 'back', 'pos' => 'left', 'text' => __('Logout'), 'href' => 'index.php?action=logout')), $this->createHeaderButton( array('icon' => 'home', 'pos' => 'right', 'text' => __('Home'), 'href' => 'index.php?page=home'))); } public function createButton($options) { $return = 'footer = array(); $this->endFooter = false; } public function endFooter() { $this->endFooter = true; } public function createFooter($text = "") { $this->footerText($text); } public function footerText($text = null) { if (!isset($text)) { $this->footer['text'] = ''; } else { $this->footer['text'] = $text; } $this->endFooter(); } public function defaultFooter() { global $pandora_version, $build_version; if (isset($_SERVER['REQUEST_TIME'])) { $time = $_SERVER['REQUEST_TIME']; } else { $time = get_system_time (); } return " "; } public function beginContent() { $this->content = array(); $this->endContent = false; } public function endContent() { $this->endContent = true; } public function contentAddHtml($html) { $this->content[] = $html; } public function contentBeginGrid($mode = 'responsive') { $this->endGrid = false; $this->grid = array(); $this->grid['mode'] = $mode; $this->grid['cells'] = array(); } public function contentGridAddCell($html, $key = false) { $k = uniqid('cell_'); if ($key !== false) { $k = $key; } $this->grid['cells'][$k] = $html; } public function contentEndGrid() { $this->endGrid = true; //TODO Make others modes, only responsible mode $convert_columns_jquery_grid = array( 2 => 'a', 3 => 'b', 4 => 'c', 5 => 'd'); $convert_cells_jquery_grid = array('a', 'b', 'c', 'd', 'e'); $html = "
\n"; foreach ($this->head as $head) { $html .= " | " . $head . " | \n"; } $html .= "||
---|---|---|---|
" . $this->row_heads[$key] . " | \n"; } elseif ($this->row_keys_as_head_row) { $html .= "" . $key . " | \n"; } else { $html .= "\n"; } foreach ($row as $key_cell => $cell) { $html .= " | " . $cell . " | \n"; } $html .= "