Permalink
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?
match/app/templates/layout/default.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…to v5.1 (#34, CO-1900)
184 lines (161 sloc)
6.13 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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.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" class="nospin"><?= __('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"> | |
<?= $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"> | |
<?= $this->element('footer'); ?> | |
</footer> | |
</div> | |
<!-- loading animation --> | |
<div id="co-loading"><span></span><span></span><span></span></div> | |
<!-- modal dialog box --> | |
<?= $this->element('dialog'); ?> | |
<!-- Load Javascript --> | |
<?= $this->Html->script([ | |
'jquery/jquery.min.js', | |
'bootstrap/bootstrap.bundle.min.js', | |
'js-cookie/js.cookie-2.1.3.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> |