Skip to content
Permalink
01ce3fbff7
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
108 lines (102 sloc) 4.1 KB
<?php
/*
* COmanage Match Secondary Menu Bar
* Displayed above all pages when logged in
*
* 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)
*/
?>
<?php if(!empty($vv_user)): ?>
<ul>
<?php if($vv_menu_permissions['gridroles']): ?>
<li id="top-menu-platform">
<a class="dropdown-toggle" href="#" role="button" id="platform-dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="top-menu-link-text">
<?= __('match.op.platform'); ?>
</span>
<em class="material-icons">settings</em>
</a>
<div class="dropdown-menu" aria-labelledby="platform-dropdown-toggle">
<?php
$models = [
'matchgrids' => 'grid_on',
'permissions' => 'lock',
'api_users' => 'vpn_key'
];
foreach($models as $model => $icon) {
if($vv_menu_permissions[$model]) {
$linkContent = '<em class="material-icons" aria-hidden="true">' . $icon . '</em><span class="menu-title">'
. __('match.ct.'.\Cake\Utility\Inflector::camelize($model), [99])
. '</span>';
print $this->Html->link(
$linkContent,
['plugin' => null,
'controller' => $model,
'action' => 'index'],
['escape' => false,'class' => 'dropdown-item']
);
}
}
?>
</div>
</li>
<?php endif; ?>
<li id="top-menu-user">
<a class="dropdown-toggle" href="#" role="button" id="user-panel-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="top-menu-link-text">
<?= $vv_user['username']; ?>
</span>
<em class="material-icons icon-adjust">person</em>
</a>
<!-- Account Dropdown -->
<div id="user-panel" aria-expanded="false" style="display: none;">
<div id="logout-in-panel">
<?php
print $this->Html->link(__('match.op.logout'),
'/auth/logout/logout.php',
['escape' => false,
'class' => 'btn']);
?>
</div>
<div id="user-panel-user-info">
<em class="material-icons">person</em>
<div id="user-panel-cn"><?= $vv_user['username']; ?></div>
<div id="user-panel-id"><?php print $this->getRequest()->getSession()->read('Auth.User.username'); ?></div>
</div>
</div>
</li>
</ul>
<?php endif; ?>
<?php if(!isset($noLoginLogout) || !$noLoginLogout) : ?>
<?php
if(!$vv_user) {
print $this->Html->link(__('match.op.login'),
['controller' => 'matchgrids',
'action' => 'select',
'plugin' => false],
['escape' => false,
'id' => 'login',
'class' => '']);
}
?>
<?php endif; ?>