function x4HtmlDump($parm1) { ob_start(); hprint_r($parm1); x4HTML('*MAIN*', ob_get_clean()); }
function index_hidden_x4Dispatch() { # This is everything that *might* go back, make a place # for all of it $GLOBALS['AG']['x4'] = array('error' => array(), 'debug' => array(), 'notice' => array(), 'html' => array(), 'script' => array()); # EXPERIMENTAL. # KFD 8/18/08. Having any gp vars might be screwing things # up, remove them. Specifically it is screwing # up the gp_command # KFD 9/10/08. This belonged in gp_command processing, # moved it to there. #gpUnsetPrefix('gpx'); #gpUnsetPrefix('gp_'); #gpUnsetPrefix('x2t_'); #gpUnset('gpContext'); # If they are not logged in, or have timed out, # send a redirection command to the login page # if (!LoggedIn()) { if (gpExists('json')) { x4Script("window.location='index.php?gp_page=x_login'"); echo json_encode_safe($GLOBALS['AG']['x4']); } else { echo "<script>window.location='index.php?gp_page=x_login'</script>"; } return; } // Determine the library to open. If the page exists, open // it, otherwise use default // $x4Page = gp('x4Page'); hidden('x4Page', $x4Page); # makes form submits come back here if (gpExists('db')) { index_hidden_x4DB(); } else { if (file_exists("application/{$x4Page}.page.yaml")) { include 'androPage.php'; $obj_page = new androPage(); if ($obj_page->flag_buffer) { ob_start(); } $obj_page->main($x4Page); if ($obj_page->flag_buffer) { x4HTML("*MAIN*", ob_get_clean()); } } else { $object = x4Object($x4Page); # Determine method and invoke it. Notice any # direct output is considered an error $method = gp('x4Action', 'main'); ob_start(); $object->{$method}(); $errors = ob_get_clean(); if ($errors != '') { x4Error($errors); } } } # Put errors in that were reported by database operations if (Errors()) { $errs = errorsGet(); foreach ($errs as $err) { x4Error($err); } } # if the "json" flag is set, we return all output as JSON, # otherwise we package it up with the normal template and # return it as main content if (gp('json') == 1) { echo json_encode_safe($GLOBALS['AG']['x4']); } else { # Tell the client-side library to initialize the # 'inert' HTML that it received from us. # x4Script("x4.main()"); # Don't need a form in x4 mode vgaSet('NOFORM', true); # Put things where the template expects to find them vgfSet('HTML', $GLOBALS['AG']['x4']['html']['*MAIN*']); foreach ($GLOBALS['AG']['x4']['script'] as $script) { jqDocReady($script); } # DUPLICATE ALERT: This code copied from # index_hidden_page() below index_hidden_template('x4'); global $J; $mainframe = $J['mainframe']; $my = $J['my']; $mosConfig_absolute_path = $J['mC_absolute_path']; $mosConfig_live_site = $J['mC_live_site']; $template_color = $J['template_color']; $template_color = 'red'; $file = $GLOBALS['AG']['dirs']['root'] . '/templates/' . $mainframe->GetTemplate() . "/index.php"; include $file; } return; }