Skip to content
Permalink
0b6cd7b04b
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
182 lines (161 sloc) 6.21 KB
<?php
/**
* COmanage Match Default Layout
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @package match
* @since COmanage Match v1.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
declare(strict_types = 1);
// As a general rule, all Match pages are post-login and so shouldn't be cached
header("Expires: Thursday, 10-Jan-69 00:00:00 GMT");
header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
header("Pragma: no-cache");
// Add X-UA-Compatible header for IE
if(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
header('X-UA-Compatible: IE=edge,chrome=1');
}
?>
<!DOCTYPE html>
<html lang="<?= __('match.meta.lang'); ?>">
<head>
<?= $this->Html->meta('viewport', 'width=device-width, initial-scale=1.0') . "\n"; ?>
<?= $this->Html->charset(); ?>
<title><?= (!empty($vv_title) ? $vv_title : __('match.meta.match')); ?></title>
<!-- <?php
// Include version number, but only if logged in
if(!empty($vv_user)) {
print __('match.meta.version', [chop(file_get_contents(CONFIG . DS . "VERSION"))]);
}
?> -->
<!-- favicon.ico -->
<?= $this->Html->meta('favicon.ico', '/favicon.ico', array('type' => 'icon')) . "\n"; ?>
<!-- Load CSS -->
<?= $this->Html->css([
'bootstrap/bootstrap-4.4.1.min',
'jquery/jquery-ui-1.12.1.custom/jquery-ui.min',
'co-color',
'co-base',
'co-responsive'
]) . "\n"; ?>
<!-- Include external files and scripts -->
<?= $this->fetch('meta') ?>
<?= $this->fetch('css') ?>
<?= $this->fetch('script') ?>
</head>
<?php
// cleanse the controller and action strings and insert them into the body classes
$controller_stripped = preg_replace('/[^a-zA-Z0-9\-_]/', '', strtolower($this->request->getParam('controller')));
$action_stripped = preg_replace('/[^a-zA-Z0-9\-_]/', '', strtolower($this->request->getParam('action')));
$bodyClasses = $controller_stripped . ' ' .$action_stripped;
// add further body classes as needed
if($this->getRequest()->getSession()->check('Auth.User') != NULL) {
$bodyClasses .= ' logged-in';
} else {
$bodyClasses .= ' logged-out';
}
?>
<body class="<?= $bodyClasses ?>" onload="js_onload_call_hooks()">
<div id="skip-to-content-box">
<a href="#content-start" id="skip-to-content"><?= __('match.op.skip_to_content') ?></a>
</div>
<!-- Primary layout -->
<div id="comanage-wrapper">
<div id="top-bar">
<?php if(!empty($vv_user) && !empty($vv_cur_mg)): ?>
<div id="co-hamburger"><em class="material-icons">menu</em></div>
<?php endif; // vv_user ?>
<nav id="top-menu">
<?php print $this->element('menuTop'); ?>
</nav>
</div>
<header id="banner">
<div id="siteTitle">
<?php if(!empty($vv_cur_mg)): ?>
<?= $this->Html->link(
__('match.ti.matchgrid',[$vv_cur_mg['table_name']]),
['controller' => 'Matchgrids',
'action' => 'manage',
$vv_cur_mg->id],
['escape' => false]);
// XXX Insert quick matchgrid selector here.
?>
<?php else: ?>
<?= $this->Html->link(__('match.meta.match'), '/'); ?>
<?php endif; ?>
</div>
<div id="logo">
<?=
$this->Html->image(
"COmanage-Logo-LG-onGreen.png",
array(
'alt' => __('match.meta.logo')
)
);
?>
</div>
</header>
<div id="main-wrapper">
<?php if(!empty($vv_user && !empty($vv_cur_mg))): ?>
<div id="navigation-drawer">
<nav id="navigation" aria-label="main menu">
<?= $this->element('menuMain'); ?>
</nav>
</div>
<?php endif ?>
<main id="main">
<div id="content">
<div id="content-inner">
<?php if(!($controller_stripped == 'matchgrids' && $action_stripped == 'select')): ?>
<!-- insert breadcrumbs on all but the front (select matchgrid) page -->
<div id="breadcrumbs">
<?= $this->element('breadcrumbs'); ?>
</div>
<?php endif; ?>
<!-- insert the anchor that is the target of accessible "skip to content" link -->
<a id="content-start"></a>
<!-- insert the page internal content -->
<?= $this->fetch('content'); ?>
</div>
</div>
</main>
</div>
<footer id="co-footer">
<!-- XXX we appear to need the footer (or the error) to get everything else to render? -->
<?= $this->element('footer'); ?>
</footer>
</div>
<!-- Load Javascript -->
<?= $this->Html->script([
'jquery/jquery-3.6.0.min.js',
'bootstrap/bootstrap-4.6.0.bundle.min.js',
'jquery/jquery-ui-1.12.1.custom/jquery-ui.min.js',
'js-cookie/js.cookie-2.1.3.min.js',
'jquery/spin/spin.min.js',
'jquery/noty/jquery.noty.js',
'jquery/noty/layouts/topCenter.js',
'jquery/noty/themes/comanage.js',
'comanage.js'
]) . "\n"; ?>
<!-- COmanage JavaScript onload scripts -->
<?= $this->element('javascript'); ?>
</body>
</html>