set solved-status for all Questgroups and add CSS-class
This commit is contained in:
parent
0bf5253fc4
commit
3d1e6b792e
2 changed files with 10 additions and 2 deletions
|
|
@ -94,10 +94,12 @@
|
|||
// Get additional data
|
||||
foreach($hierarchy['questgroups'] as $i => &$group)
|
||||
{
|
||||
$group['solved'] = $this->Questgroups->hasCharacterSolvedQuestgroup($group['id'], $character['id']);
|
||||
|
||||
// Check permission of Questgroups
|
||||
if($i >= 1 && count(array_intersect(array('admin','moderator'), IntermediateController::$user['seminaryroles'])) == 0)
|
||||
{
|
||||
if(!$this->Questgroups->hasCharacterSolvedQuestgroup($hierarchy['questgroups'][$i-1]['id'], $character['id']))
|
||||
if(!$hierarchy['questgroups'][$i-1]['solved'])
|
||||
{
|
||||
$hierarchy['questgroups'] = array_slice($hierarchy['questgroups'], 0, $i);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,13 @@
|
|||
<ul class="qg">
|
||||
<?php foreach($hierarchy['questgroups'] as &$group) : ?>
|
||||
<li class="cf">
|
||||
<span class="qgicon"><i class="fa fa-check-square-o"></i></span>
|
||||
<span class="qgicon">
|
||||
<?php if($group['solved']) : ?>
|
||||
<i class="fa fa-check-square-o"></i>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-square-o"></i>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
<div class="qgtitle"><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$group['url']))?>"><?=$group['title']?></a></div>
|
||||
<div class="qgprogress cf">
|
||||
<p class="xpinfo">Fortschritt:</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue