echo '<div class="well sidebar-nav">'; echo $left; echo '</div>'; echo '</div>'; } } echo '<div class=" test span' . ($left === false ? '12' : '9') . '" style="padding-bottom:15px;">'; echo str_replace('--COMMANDS--', $commands, mosMainBody()); echo '</div>'; ?> </div> </div> <div class="templatefooter"> <?php echo mosLoadModules('footer'); ?> </div> <?php jsInclude("clib/bootstrap-wysiwyg/wysihtml5-0.3.0.min.js"); jsInclude("templates/{$template}/bootstrap/js/bootstrap.min.js"); jsInclude("clib/bootstrap-wysiwyg/bootstrap-wysihtml5.js"); jsInclude("clib/bootstrap-wysiwyg/prettify.js"); jsInclude("templates/{$template}/bootstrap/datepicker/js/bootstrap-datepicker.js"); jsInclude("clib/androLib.js"); jsInclude("clib/androLibDeprecated.js"); jsInclude("clib/x4.js"); include 'androHTMLFoot.php'; ?> </body> </html>
# # Output the title # # ===================================================================== echo "\n<title>" . vgfGet('pageTitle') . "</title>\n"; # ===================================================================== # # The jQuery libraries always come first # # NOTICE! Andromeda has its own mini-fication system, # so do not fear all of these individual files! # # ===================================================================== # The jQuery library always comes first jsInclude('clib/jquery-1.8.3.min.js', 'JQuery is distributed under the GPL license, written by a team of programmers led by John Resig, more info at http://www.jquery.com', 'Y'); $xpath = arr($_COOKIE, 'altjs', 'clib/'); $configJS = trim(configGet('js_css_debug', 'N')); if ($deprecated == 'Y') { $styles = ElementImplode('styles'); if ($styles != '') { ?> <style type="text/css"> <?php echo $styles; ?> </style> <?php } ob_start();
function index_hidden_x6Dispatch($x6page, $x6file, $x6yaml, $x6profile, $x6plugin, $x6action) { # 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()); vgfSet('x6', true); # KFD 12/10/08, allow dynamic lookups. # if (gp('x6select', false)) { $table_id = gp('x6page'); $gpletters = gp('gpletters'); # KFD 4/11/09 Sourceforge 2753358 do real matches $matches = aFromGp('mtch_'); $rows = RowsForSelect($table_id, $gpletters, $matches, '', true); foreach ($rows as $idx => $row) { unset($rows[$idx]['skey']); foreach ($row as $col => $val) { if ($col != 'skey') { $rows[$idx][$col] = trim($val); } } } x6Data('x6select', $rows); echo json_encode_safe($GLOBALS['AG']['x4']); return; } # Make hidden variables for x6page and module hidden('x6page', $x6page); hidden('x6module', gp('x6module', 'X')); # This little bit of magic loads up the CSS information # for the current template and skin, allowing downstream # code to determine how much space they have to work with # $x6skin = arr($_COOKIE, 'x6skin', 'Default.Gray.1024'); setCookie('x6skin', $x6skin); if ($x6skin != '') { $filename = fsDirTop() . "templates/x6/skinsphp/x6skin.{$x6skin}.ser.txt"; if (file_exists($filename)) { $serialized = file_get_contents($filename); $GLOBALS['AG']['x6skin'] = unserialize($serialized); } } # If they have already defined MPPages in applib, we will # pick it up here with this global declaration. # # MPPages lists pages that may be accessed w/o login global $MPPages; if (!is_array($MPPages)) { $MPPages = array(); } $MPPages['x_home'] = 'Home Page'; $MPPages['x_login'] = '******'; $MPPages['x_noauth'] = 'Authorization Required'; $MPPages['x_password'] = "******"; $MPPages['x_mpassword'] = "******"; $MPPages['x_paypalipn'] = 'Paypal IPN'; # Session timeouts. Need to code for basic page access # and code for ajax timeouts. if (!LoggedIn() && !in_array($x6page, array_keys($MPPages))) { if (gpExists('json')) { x4Script("window.location='index.php?gp_page=x_login'"); echo json_encode($GLOBALS['AG']['x4']); } else { echo "<script>window.location='index.php?gp_page=x_login&x2=1'</script>"; } return; } # Include the basic x6 class, and set a default for # the class and the method call include 'androX6.php'; $x6class = 'androX6'; $x6method = 'x6main'; # This is the core resolution where we figure out what class # to use and what method to call. It is a little complicated # because we support 3 different kinds of pages (yaml, profile # and custom) plus calls from plugins to refresh, plus JSON # calls to do database stuff. if ($x6plugin != '') { # DEFUNCT. We don't use plugins, they were an early # idea, but profiles and androHTML classes # made them unecessary. # A plugin always wins. A call to a plugin assumes that # x6action is also specified. We are going to instantiate # the plugin and call the method named by x6action. #$x6file = ''; #$x6class = 'x6plugin'.$x6plugin; #$x6method= $x6action; #include($x6class.'.php'); } else { # No plugin means we are either using the base andromeda # class androX6, or using a custom class. We only use # a custom class if the programmer has supplied a file. # So if that file exists we load that and use it. if ($x6file != '') { $x6class = 'x6' . $x6page; include $x6class . '.php'; } # The next major decision is whether we are calling some # specific action, or loading a page. If an action was # specified that wins. if ($x6action != '') { $x6method = $x6action; } else { # KFD 12/22/08. Support for androPage! Extremely important! if (file_exists("application/{$x6page}.page.yaml")) { $x6class = 'androPage'; $x6method = 'x6main'; include 'androPage.php'; } else { # Now we must be loading a page, because no plugin was # specified and no action. At this point all that is # left to figure out is whether we load a profile or # go for the default "x6main" routine. if ($x6profile != '') { $x6method = 'profile_' . $x6profile; } else { $x6method = 'x6main'; } } # If we are loading a page, we need the x6 javascript # and the first command in jqDocReady should be to # initialize the objects so downstrem code can make # them visible. # KFD 12/23/08, see if they set a cookie for an # alternate location. # KFD 1/22/09 , Yikes! Don't do this if JSON was passed if (gp('json', '') != '1') { $xpath = arr($_COOKIE, 'altjs', 'clib/'); jsInclude($xpath . 'x6.js'); #jsInclude('clib/jquery.maskedinput-1.1.4.js'); jqDocReady('x6.init()'); } } } # Final trap. If the class is androX6 and the method # is x6main, this means an unprogrammed page: there is # no custom program file and no profile in the yaml. # So we default to the conventional profile. # # KFD 2/17/09 Sourceforge 2546056 # This means that bad page requests go to # profile_conventional(), so that is where # we trap for them. See androX6::profile_conventional() if ($x6method == 'x6main' && $x6class == 'androX6') { $x6method = 'profile_conventional'; # KFD 2/2/09. Allow fallback to x2 processing. If the # app is set for it, and a file exists, call # that instead if (configGet('x6_x2', 'N') == 'Y') { if (file_exists(fsDirTop() . 'application/' . $x6page . '.php')) { include_once 'x_table2.php'; include_once $x6page . '.php'; $x6class = $x6page; $x6method = "main"; } } } # Now everything is resolved. We know what class to instantiate # and what method to call, so go for it. ob_start(); $obj = new $x6class(); # KFD 3/30/09 Sourceforge 2697962 Do this here, so it # does not matter if androX6 or androPage $obj->hld = aFromGp('hld_'); $obj->dd = ddTable($x6page); $obj->x6page = $x6page; $obj->view = arr($obj->dd, 'viewname', ''); $obj->{$x6method}(); $HTML = ob_get_clean(); # KFD 3/20/09 Sourceforge 2697962 # Make sure programmer never has to send out # hold variables, they should go automatically if (gp('json') != 1) { if (isset($obj->hld)) { foreach ($obj->hld as $name => $value) { # KFD 3/20/09 Sourceforge 2697962 # Put out as hidden instead hidden('hld_' . $name, $value); #$inp = $top->h('input'); #$inp->hp['type'] = 'hidden'; #$inp->hp['name'] = $inp->hp['id'] = 'hld_'.$name; #$inp->hp['value'] = $value; } } } # Now if they made a "main" call, see if they want us to # send back some script as well if ($x6method == 'x6main') { if (method_exists($obj, 'x6script')) { ob_start(); $obj->x6script(); x6script(ob_get_clean()); } } # And again see if they are sending out any popups if ($x6method == 'x6main') { if (method_exists($obj, 'x6modals')) { ob_start(); $obj->x6modals(); $HTML .= ob_get_clean(); } } x6HTML('*MAIN*', $HTML); # Put errors in that were reported by database operations if (Errors()) { $errs = errorsGet(); foreach ($errs as $err) { x4Error($err); } } # CODE BELOW HERE WAS TAKEN FROM X4 UNCHANGED. # 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 { # Don't need a form in x6 mode vgaSet('NOFORM', true); # Put things where the template expects to find them vgfSet('HTML', $GLOBALS['AG']['x4']['html']['*MAIN*']); # If there was some script, add that in foreach ($GLOBALS['AG']['x4']['script'] as $script) { jqDocReady($script); } # Just before the absolute very last command is the # firing of our (currently) one and only queue jqDocReady('x6events.fireQueue("afterInit")'); # The absolute very last command is the fade in $fadeIn = "\$('.fadein').fadeIn('slow',function() { x6.initFocus(); });"; jqDocReady($fadeIn); # 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; }
function mainLayout(&$container) { # load the javascript jsInclude("clib/androX4Menu.js"); # Set focus if requested if (($focus = gp('x4Focus')) != '') { x4Script("\$('#x4Menu')[0].lastFocusId = 'x4menu_{$focus}'"); } # Other miscellaneous commands vgfSet('suppress_hidden', true); //vgfSet('show_menu',false); # Fetch some text $h1 = configGet("x4menutitle", "Extended Desktop Menu"); $text = configGet("x4menutext", ""); ob_start(); ?> <div id="x4Menu" class="x4Pane x4Menu"> <center> <h1><?php echo $h1; ?> </h1> <?php echo $text; ?> </center> <br/> <?php $table = html('table'); $table->hp['class'] = 'tab100'; $tr = html('tr', $table); $array = SessionGet('AGMENU'); $first = true; $letters = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); $col = 0; $grid = array(); foreach ($array as $module => $modinfo) { if (!$first) { $td = html('td', $tr); $td->hp['style'] = 'width: 10px'; } $first = false; $td = html('td', $tr); $td->hp['class'] = 'style1'; $h3 = html('h3', $td); $h3->setHtml($letters[$col] . ') ' . $modinfo['description']); $row = 0; foreach ($modinfo['items'] as $page => $info) { // Add the link $a = html('a', $td); $a->hp['id'] = 'x4menu_' . $page; $a->hp['href'] = "?x4Return=menu&x4Page={$page}"; $a->setHTML($row . ') ' . $info['description']); $a->hp['onkeyup'] = "return \$a.byId('x4Menu').x4KeyUp(event,{$col},{$row})"; $a->hp['onkeydown'] = "return false;"; $a->hp['onmouseover'] = '$(this).focus()'; $a->hp['onfocus'] = "this.className = 'x4MenuOn'"; $a->hp['onblur'] = "this.className = ''"; $grid[$col][$row] = 'x4menu_' . $page; $row++; // Add a BR html('br', $td); } $col++; } $table->render(); echo "</div>"; # put out the grid and set the HTML x4data('grid', $grid); $container->setHTML(ob_get_clean()); }