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 = __('%s mobile', get_product_name()); } 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 = []; $this->endContent = false; $this->content = []; $this->noFooter = false; $this->endFooter = false; $this->footer = []; $this->form = []; $this->grid = []; $this->collapsible = []; $this->endForm = true; $this->endGrid = true; $this->endCollapsible = true; $this->dialog = ''; $this->dialogs = []; } public function showFooter($show=true) { $this->noFooter = !$show; } public function beginHeader() { $this->header = []; $this->header['button_left'] = ''; $this->header['button_right'] = ''; $this->header['title'] = ''; $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, $left_button=false) { if ($title === false) { $title = __('%s : Mobile', get_product_name()); } if ($left_button === false) { $left_button = $this->createHeaderButton( [ 'icon' => 'ui-icon-back', 'pos' => 'left', 'text' => __('Logout'), 'href' => 'index.php?action=logout', 'class' => 'header-button-left', ] ); } $this->createHeader( $title, $left_button, $this->createHeaderButton( [ 'icon' => 'ui-icon-home', 'pos' => 'right', 'text' => __('Home'), 'href' => 'index.php?page=home', 'class' => 'header-button-right', ] ) ); } public function createButton($options) { $return = 'footer = []; $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 = []; $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 = []; $this->grid['mode'] = $mode; $this->grid['cells'] = []; } 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 = [ 2 => 'a', 3 => 'b', 4 => 'c', 5 => 'd', ]; $convert_cells_jquery_grid = [ 'a', 'b', 'c', 'd', 'e', ]; $html = "
"; foreach ($this->head as $head) { $html .= " | ".$head.' | '; } $html .= '
---|---|
".$cell.' | '; } $html .= '