AutorÃa | Ultima modificación | Ver Log |
<?php
use LeadersLinked\Library\Functions;
$request_uri = $_SERVER['REQUEST_URI'];
$patron = '/^\/my-company/';
$company_id = 0;
if(preg_match($patron, $request_uri)) {
$parts = explode('/', substr($request_uri, 1));
if(count($parts) >= 1) {
$company_id = $parts[1];
}
}
$currentUser = $this->currentUserHelper();
$user_id = $currentUser->getUserId();
$roleName = $currentUser->getUserTypeId();
$acl = $this->viewModel()->getCurrent()->getVariable('acl');
$allowProfile = $acl->isAllowed($roleName, 'my-company/profile');
$allowFollower = $acl->isAllowed($roleName, 'my-company/follower');
$allowUser = $acl->isAllowed($roleName, 'my-company/user');
$allowFeed = $acl->isAllowed($roleName, 'my-company/feed');
$allowJob = $acl->isAllowed($roleName, 'my-company/job');
$allowCompany = $allowFeed || $allowFollower || $allowJob || $allowProfile || $allowUser;
/*
<?php if($acl->isAllowed($roleName, 'my-company/setting')) : ?>
<li>
<a href="<?php echo $this->url('my-company/setting',['id' => $company_id]) ;?>" title="">
<span><i class="fa fa-diamond"></i></span>LABEL_SETTINGS
</a>
</li>
<?php endif; ?>
*/
?>
<?php if($allowCompany) : ?>
<li class="list-inline-item">
<div class="dropdown">
<button class="btn btn-link dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span><i class="fa fa-building"></i></span>LABEL_GENERAL
</button>
<div class="dropdown-menu my-company-dropdown" aria-labelledby="dropdownMenu1">
<?php if($allowJob) : ?>
<a class="text-submenu dropdown-item w-100" href="<?php echo $this->url('my-company/job',['id' => $company_id]) ;?>" title="">LABEL_JOBS</a>
<?php endif;?>
<?php if($allowProfile) : ?>
<a class="text-submenu dropdown-item w-100" href="<?php echo $this->url('my-company/profile',['id' => $company_id]) ;?>" title="">LABEL_PROFILE</a>
<?php endif;?>
<?php if($allowFeed) : ?>
<a class="text-submenu dropdown-item w-100" href="<?php echo $this->url('my-company/feed',['id' => $company_id]) ;?>" title="">LABEL_FEEDS</a>
<?php endif;?>
<?php if($allowFollower) : ?>
<a class="text-submenu dropdown-item w-100" href="<?php echo $this->url('my-company/follower',['id' => $company_id]) ;?>" title="">LABEL_FOLLOWERS</a>
<?php endif;?>
</div>
</div>
</li>
<?php endif; ?>
<?php
if($acl->isAllowed($roleName, 'my-company/microlearning')) :
?>
<li class="list-inline-item">
<div class="dropdown">
<button class="btn btn-link dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span><i class="fa fa-building"></i></span>LABEL_MICROLEARNING
</button>
<div class="dropdown-menu my-company-dropdown" aria-labelledby="dropdownMenu2">
<?php if($acl->isAllowed($roleName, 'my-company/microlearning/quiz')) : ?>
<a class="text-submenu dropdown-item w-100" href="<?php echo $this->url('my-company/microlearning/quiz',['id' => $company_id]) ;?>" title="">LABEL_QUIZZES</a>
<?php endif;?>
<?php if($acl->isAllowed($roleName, 'my-company/microlearning/topic')) : ?>
<a class="text-submenu dropdown-item w-100" href="<?php echo $this->url('my-company/microlearning/topic',['id' => $company_id]) ;?>" title="">LABEL_TOPICS</a>
<?php endif;?>
<?php if($acl->isAllowed($roleName, 'my-company/microlearning/device')) : ?>
<a class="text-submenu dropdown-item w-100" href="<?php echo $this->url('my-company/microlearning/device',['id' => $company_id]) ;?>" title="">LABEL_DEVICES</a>
<?php endif;?>
</div>
</div>
</li>
<?php endif; ?>
<?php
if($acl->isAllowed($roleName, 'my-company/self-evaluation')) : ?>
<li class="list-inline-item">
<div class="dropdown">
<button class="btn btn-link dropdown-toggle" type="button" id="dropdownMenu3" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span><i class="fa fa-pencil"></i></span>LABEL_SELF_EVALUATION
</button>
<div class="dropdown-menu my-company-dropdown" aria-labelledby="dropdownMenu3">
<?php if($acl->isAllowed($roleName, 'my-company/self-evaluation/form')) : ?>
<a class="text-submenu dropdown-item w-100" href="<?php echo $this->url('my-company/self-evaluation/form',['id' => $company_id]) ;?>" title="">LABEL_FORMS</a>
<?php endif;?>
</div>
</div>
</li>
<?php endif; ?>