hide map for Character groups Quest Stations when there are no stations
This commit is contained in:
commit
df14dfafc3
4371 changed files with 1220224 additions and 0 deletions
1
views/ajax/ajax.tpl
Normal file
1
views/ajax/ajax.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$intermediate?>
|
||||
55
views/ajax/charactergroupsqueststations/index.tpl
Normal file
55
views/ajax/charactergroupsqueststations/index.tpl
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
$features = array();
|
||||
$coordinates = array();
|
||||
|
||||
// Add points
|
||||
foreach($stations as &$station)
|
||||
{
|
||||
if(!is_null($station['longitude']) && !is_null($station['latitude'])) {
|
||||
$coordinate = array(
|
||||
floatval($station['longitude']),
|
||||
floatval($station['latitude'])
|
||||
);
|
||||
$coordinates[] = $coordinate;
|
||||
// Marker
|
||||
$features[] = array(
|
||||
'type' => 'Feature',
|
||||
'id' => $station['id'],
|
||||
'geometry' => array(
|
||||
'type' => 'Point',
|
||||
'coordinates' => $coordinate
|
||||
)
|
||||
);
|
||||
// Label
|
||||
$features[] = array(
|
||||
'type' => 'Feature',
|
||||
'id' => $station['id'].'-label',
|
||||
'properties' => array(
|
||||
'name' => $station['title'],
|
||||
),
|
||||
'geometry' => array(
|
||||
'type' => 'Point',
|
||||
'coordinates' => $coordinate
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Add lines between points
|
||||
if($hasgroup) {
|
||||
$features[] = array(
|
||||
'type' => 'Feature',
|
||||
'name' => 'Line',
|
||||
'geometry' => array(
|
||||
'type' => 'LineString',
|
||||
'coordinates' => $coordinates
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
<?=json_encode(array(
|
||||
'type' => 'FeatureCollection',
|
||||
'features' => $features
|
||||
))?>
|
||||
25
views/ajax/characters/index.tpl
Normal file
25
views/ajax/characters/index.tpl
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
foreach($characters as &$character)
|
||||
{
|
||||
// Role translation
|
||||
foreach($character['characterroles'] as &$role)
|
||||
{
|
||||
switch($role)
|
||||
{
|
||||
case 'admin': $role = _('Admin');
|
||||
break;
|
||||
case 'moderator': $role = _('Moderator');
|
||||
break;
|
||||
case 'user': $role = _('User');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<?=json_encode(array(
|
||||
'seminary' => $seminary,
|
||||
'characters' => $characters,
|
||||
'more' => (($page*$limit) < $charactersCount)
|
||||
))?>
|
||||
37
views/ajax/quests/index.tpl
Normal file
37
views/ajax/quests/index.tpl
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
foreach($quests as &$quest)
|
||||
{
|
||||
// Questtype translation
|
||||
$questtype = $quest['questtype']['title'];
|
||||
switch($quest['questtype']['classname'])
|
||||
{
|
||||
case null: $questtype = _('Questtype Empty');
|
||||
break;
|
||||
case 'bossfight': $questtype = _('Questtype bossfight');
|
||||
break;
|
||||
case 'choiceinput': $questtype = _('Questtype choiceinput');
|
||||
break;
|
||||
case 'crossword': $questtype = _('Questtype crossword');
|
||||
break;
|
||||
case 'dragndrop': $questtype = _('Questtype dragndrop');
|
||||
break;
|
||||
case 'multiplechoice': $questtype = _('Questtype multiplechoice');
|
||||
break;
|
||||
case 'submit': $questtype = _('Questtype submit');
|
||||
break;
|
||||
case 'textinput': $questtype = _('Questtype textinput');
|
||||
break;
|
||||
}
|
||||
$quest['questtype']['title'] = $questtype;
|
||||
|
||||
// XPs translation
|
||||
$quest['xps'] = sprintf(_('%d XPs'), $quest['xps']);
|
||||
}
|
||||
|
||||
?>
|
||||
<?=json_encode(array(
|
||||
'seminary' => $seminary,
|
||||
'quests' => $quests,
|
||||
'more' => (($page*$limit) < $questsCount)
|
||||
))?>
|
||||
27
views/ajax/users/index.tpl
Normal file
27
views/ajax/users/index.tpl
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
foreach($users as &$user)
|
||||
{
|
||||
// Role translation
|
||||
foreach($user['roles'] as &$role)
|
||||
{
|
||||
switch($role)
|
||||
{
|
||||
case 'admin': $role = _('Admin');
|
||||
break;
|
||||
case 'moderator': $role = _('Moderator');
|
||||
break;
|
||||
case 'user': $role = _('User');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Date formattieng
|
||||
$user['created'] = sprintf(_('registered on %s'), $dateFormatter->format(new \DateTime($user['created'])));
|
||||
}
|
||||
|
||||
?>
|
||||
<?=json_encode(array(
|
||||
'users' => $users,
|
||||
'more' => (($page*$limit) < $usersCount)
|
||||
))?>
|
||||
1
views/binary/binary.tpl
Normal file
1
views/binary/binary.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$intermediate?>
|
||||
1
views/binary/error/index.tpl
Normal file
1
views/binary/error/index.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=_('Error')?>: <?=$code?>: <?=$string?>
|
||||
1
views/binary/media/achievement.tpl
Normal file
1
views/binary/media/achievement.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/media/avatar.tpl
Normal file
1
views/binary/media/avatar.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/media/charactergroup.tpl
Normal file
1
views/binary/media/charactergroup.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/media/charactergroupsachievement.tpl
Normal file
1
views/binary/media/charactergroupsachievement.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/media/charactergroupsquest.tpl
Normal file
1
views/binary/media/charactergroupsquest.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/media/charactergroupsqueststation.tpl
Normal file
1
views/binary/media/charactergroupsqueststation.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/media/index.tpl
Normal file
1
views/binary/media/index.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/media/seminary.tpl
Normal file
1
views/binary/media/seminary.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/media/seminarymap.tpl
Normal file
1
views/binary/media/seminarymap.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/media/seminarymoodpic.tpl
Normal file
1
views/binary/media/seminarymoodpic.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/qrcodes/achievement.tpl
Normal file
1
views/binary/qrcodes/achievement.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/qrcodes/charactergroupsachievements.tpl
Normal file
1
views/binary/qrcodes/charactergroupsachievements.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/qrcodes/charactergroupsqueststation.tpl
Normal file
1
views/binary/qrcodes/charactergroupsqueststation.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/qrcodes/charactertitle.tpl
Normal file
1
views/binary/qrcodes/charactertitle.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/uploads/charactergroup.tpl
Normal file
1
views/binary/uploads/charactergroup.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
1
views/binary/uploads/seminary.tpl
Normal file
1
views/binary/uploads/seminary.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
||||
27
views/error.tpl
Normal file
27
views/error.tpl
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Questlab</title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/desktop.css" media="all" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<nav class="cf">
|
||||
<div id="home">
|
||||
<a href="/">Questlab</a>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<article class="wrap">
|
||||
<div class="moodpic">
|
||||
<img src="/grafics/questlab.jpg" />
|
||||
</div>
|
||||
<h1>Service Unavailable</h1>
|
||||
<p>Die Anwendung steht zur Zeit leider nicht zur Verfügung.</p>
|
||||
</article>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
2
views/fault/error/index.tpl
Normal file
2
views/fault/error/index.tpl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<h1>Fehler</h1>
|
||||
<p class="error"><?=$code?>: <?=$string?></p>
|
||||
16
views/fault/fault.tpl
Normal file
16
views/fault/fault.tpl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Questlab</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Questlab</h1>
|
||||
<article>
|
||||
<?=$intermediate?>
|
||||
</article>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
153
views/html/achievements/conditions.tpl
Normal file
153
views/html/achievements/conditions.tpl
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('achievements','index',$seminary['url']))?>"><?=_('Achievements')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit Achievement conditions')?></h1>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<legend><?=_('Conditions')?></legend>
|
||||
<ul>
|
||||
<?php foreach($conditions as &$condition) : ?>
|
||||
<li>
|
||||
<?php if($achievement['condition'] == 'date') : ?>
|
||||
<label for="condition-<?=$condition['id']?>-select"><?=_('Date')?>:</label>
|
||||
<input id="condition-<?=$condition['id']?>-select" type="text" name="conditions[<?=$condition['id']?>][select]" placeholder="SELECT" value="<?=$condition['select']?>" />
|
||||
<?php elseif($achievement['condition'] == 'character') : ?>
|
||||
<label for="condition-<?=$condition['id']?>-value"><?=_('Field')?>:</label>
|
||||
<select id="condition-<?=$condition['id']?>-field" name="conditions[<?=$condition['id']?>][field]">
|
||||
<?php foreach($characterFields as &$field) : ?>
|
||||
<option value="<?=$field?>" <?php if($condition['field'] == $field) : ?>selected="selected"<?php endif ?>><?=$field?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<label for="condition-<?=$condition['id']?>-value"><?=_('Value')?>:</label>
|
||||
<input id="condition-<?=$condition['id']?>-value" type="text" name="conditions[<?=$condition['id']?>][value]" placeholder="<?=_('Value')?>" value="<?=$condition['value']?>" />
|
||||
<?php elseif($achievement['condition'] == 'quest') : ?>
|
||||
<label for="condition-<?=$condition['id']?>-value"><?=_('Field')?>:</label>
|
||||
<select id="condition-<?=$condition['id']?>-field" name="conditions[<?=$condition['id']?>][field]">
|
||||
<?php foreach($questFields as &$field) : ?>
|
||||
<option value="<?=$field?>" <?php if($condition['field'] == $field) : ?>selected="selected"<?php endif ?>><?=$field?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<input id="condition-<?=$condition['id']?>-count" type="checkbox" name="conditions[<?=$condition['id']?>][count]" <?php if($condition['count']) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="condition-<?=$condition['id']?>-count"><?=_('Count')?></label><br />
|
||||
<label for="condition-<?=$condition['id']?>-value"><?=_('Value')?>:</label>
|
||||
<input id="condition-<?=$condition['id']?>-value" type="text" name="conditions[<?=$condition['id']?>][value]" placeholder="<?=_('Value')?>" value="<?=$condition['value']?>" /><br />
|
||||
<label for="condition-<?=$condition['id']?>-quest"><?=_('Quest')?>:</label>
|
||||
<select id="condition-<?=$condition['id']?>-quest" name="conditions[<?=$condition['id']?>][quest]">
|
||||
<option value="" <?php if(is_null($condition['quest_id'])) : ?>selected="selected"<?php endif ?>><?=_('unset')?><option>
|
||||
<?php foreach($quests as &$quest) : ?>
|
||||
<option value="<?=$quest['url']?>" <?php if($condition['quest_id'] == $quest['id']) : ?>selected="selected"<?php endif ?>><?=$quest['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<label for="condition-<?=$condition['id']?>-status"><?=_('Status')?>:</label>
|
||||
<select id="condition-<?=$condition['id']?>-status" name="conditions[<?=$condition['id']?>][status]">
|
||||
<option value="" <?php if(is_null($condition['status'])) : ?>selected="selected"<?php endif ?>><?=_('unset')?></option>
|
||||
<option value="0" <?php if(!is_null($condition['status']) && $condition['status'] == 0) : ?>selected="selected"<?php endif ?>><?=_('entered')?></option>
|
||||
<option value="1" <?php if($condition['status'] == 1) : ?>selected="selected"<?php endif ?>><?=_('submitted')?></option>
|
||||
<option value="2" <?php if($condition['status'] == 2) : ?>selected="selected"<?php endif ?>><?=_('unsolved')?></option>
|
||||
<option value="3" <?php if($condition['status'] == 3) : ?>selected="selected"<?php endif ?>><?=_('solved')?></option>
|
||||
</select><br />
|
||||
<label for="condition-<?=$condition['id']?>-groupby"><?=_('Group by')?>:</label>
|
||||
<input id="condition-<?=$condition['id']?>-groupby" type="text" name="conditions[<?=$condition['id']?>][groupby]" placeholder="<?=_('Group by')?>" value="<?=$condition['groupby']?>" />
|
||||
<?php elseif($achievement['condition'] == 'achievement') : ?>
|
||||
<label for="condition-<?=$condition['id']?>-value"><?=_('Field')?>:</label>
|
||||
<select id="condition-<?=$condition['id']?>-field" name="conditions[<?=$condition['id']?>][field]">
|
||||
<?php foreach($achievementFields as &$field) : ?>
|
||||
<option value="<?=$field?>" <?php if($condition['field'] == $field) : ?>selected="selected"<?php endif ?>><?=$field?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<input id="condition-<?=$condition['id']?>-count" type="checkbox" name="conditions[<?=$condition['id']?>][count]" <?php if($condition['count']) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="condition-<?=$condition['id']?>-count"><?=_('Count')?></label><br />
|
||||
<label for="condition-<?=$condition['id']?>-value"><?=_('Value')?>:</label>
|
||||
<input id="condition-<?=$condition['id']?>-value" type="text" name="conditions[<?=$condition['id']?>][value]" placeholder="<?=_('Value')?>" value="<?=$condition['value']?>" /><br />
|
||||
<label for="condition-<?=$condition['id']?>-achievement"><?=_('Achievement')?>:</label>
|
||||
<select id="condition-<?=$condition['id']?>-achievement" name="conditions[<?=$condition['id']?>][achievement]">
|
||||
<option value="" <?php if(is_null($condition['meta_achievement_id'])) : ?>selected="selected"<?php endif ?>><?=_('unset')?><option>
|
||||
<?php foreach($achievements as &$a) : ?>
|
||||
<option value="<?=$a['url']?>" <?php if($condition['meta_achievement_id'] == $a['id']) : ?>selected="selected"<?php endif ?>><?=$a['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<label for="condition-<?=$condition['id']?>-groupby"><?=_('Group by')?>:</label>
|
||||
<input id="condition-<?=$condition['id']?>-groupby" type="text" name="conditions[<?=$condition['id']?>][groupby]" placeholder="<?=_('Group by')?>" value="<?=$condition['groupby']?>" />
|
||||
<?php elseif($achievement['condition'] == 'qrcode') : ?>
|
||||
<a href="<?=$linker->link(array('qrcodes','achievement',$seminary['url'],$achievement['url'],50))?>">
|
||||
<img src="<?=$linker->link(array('qrcodes','achievement',$seminary['url'],$achievement['url'],10))?>" />
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<br />
|
||||
<input id="delete-<?=$condition['id']?>" type="checkbox" name="deletes[<?=$condition['id']?>]" <?php if(array_key_exists($condition['id'], $deletes)) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="delete-<?=$condition['id']?>"><?=_('delete')?></label>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
<li>
|
||||
<?php if($achievement['condition'] == 'date') : ?>
|
||||
<label for="condition-new-select"><?=_('Date')?>:</label>
|
||||
<input id="condition-new-select" type="text" name="conditions[new][select]" placeholder="<?=_('New condition')?>" value="" />
|
||||
<?php elseif($achievement['condition'] == 'character') : ?>
|
||||
<label for="condition-new-field"><?=_('Field')?>:</label>
|
||||
<select id="condition-new-field" name="conditions[new][field]">
|
||||
<?php foreach($characterFields as &$field) : ?>
|
||||
<option value="<?=$field?>"><?=$field?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<label for="condition-new-value"><?=_('Value')?>:</label>
|
||||
<input id="condition-new-value" type="text" name="conditions[new][value]" placeholder="<?=_('New condition')?>" value="" />
|
||||
<?php elseif($achievement['condition'] == 'quest') : ?>
|
||||
<label for="condition-new-field"><?=_('Field')?>:</label>
|
||||
<select id="condition-new-field" name="conditions[new][field]">
|
||||
<?php foreach($questFields as &$field) : ?>
|
||||
<option value="<?=$field?>"><?=$field?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<input id="condition-new-count" type="checkbox" name="conditions[new][count]" />
|
||||
<label for="condition-new-count"><?=_('Count')?></label><br />
|
||||
<label for="condition-value"><?=_('Value')?>:</label>
|
||||
<input id="condition-new-value" type="number" name="conditions[new][value]" placeholder="<?=_('Value')?>" value="" /><br />
|
||||
<label for="condition-new-quest"><?=_('Quest')?>:</label>
|
||||
<select id="condition-new-quest" name="conditions[new][quest]">
|
||||
<option value=""><?=_('unset')?><option>
|
||||
<?php foreach($quests as &$quest) : ?>
|
||||
<option value="<?=$quest['url']?>"><?=$quest['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<label for="condition-new-status"><?=_('Status')?>:</label>
|
||||
<select id="condition-new-status" name="conditions[new][status]">
|
||||
<option value=""><?=_('unset')?></option>
|
||||
<option value="0"><?=_('entered')?></option>
|
||||
<option value="1"><?=_('submitted')?></option>
|
||||
<option value="2"><?=_('unsolved')?></option>
|
||||
<option value="3"><?=_('solved')?></option>
|
||||
</select><br />
|
||||
<label for="condition-new-groupby"><?=_('Group by')?>:</label>
|
||||
<input id="condition-new-groupby" type="text" name="conditions[new][groupby]" placeholder="<?=_('Group by')?>" value="" />
|
||||
<?php elseif($achievement['condition'] == 'achievement') : ?>
|
||||
<label for="condition-new-field"><?=_('Field')?>:</label>
|
||||
<select id="condition-new-field" name="conditions[new][field]">
|
||||
<?php foreach($achievementFields as &$field) : ?>
|
||||
<option value="<?=$field?>"><?=$field?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<input id="condition-new-count" type="checkbox" name="conditions[new][count]" />
|
||||
<label for="condition-new-count"><?=_('Count')?></label><br />
|
||||
<label for="condition-new-value"><?=_('Value')?>:</label>
|
||||
<input id="condition-new-value" type="number" name="conditions[new][value]" placeholder="<?=_('Value')?>" value="" /><br />
|
||||
<label for="condition-new-achievement"><?=_('Achievement')?>:</label>
|
||||
<select id="condition-new-achievement" name="conditions[new][achievement]">
|
||||
<option value=""><?=_('unset')?><option>
|
||||
<?php foreach($achievements as &$a) : ?>
|
||||
<option value="<?=$a['url']?>"><?=$a['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<label for="condition-new-groupby"><?=_('Group by')?>:</label>
|
||||
<input id="condition-new-groupby" type="text" name="conditions[new][groupby]" placeholder="<?=_('Group by')?>" value="" />
|
||||
<?php elseif($achievement['condition'] == 'qrcode') : ?>
|
||||
<input id="condition-new-qrcode" type="checkbox" name="conditions[new][qrcode]" />
|
||||
<label for="condition-new-qrcode"><?=_('create new QR-Code')?></label><br />
|
||||
<?php endif ?>
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
107
views/html/achievements/create.tpl
Normal file
107
views/html/achievements/create.tpl
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('achievements','index',$seminary['url']))?>"><?=_('Achievements')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Create Achievement')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'media':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during picture upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Picture exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Picture invalid');
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
case 'deadline':
|
||||
switch($setting) {
|
||||
case 'regex': echo _('Deadline has wrong format');
|
||||
break;
|
||||
default: echo _('Deadline invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Images')?></legend>
|
||||
<label for="unachievedImage"><?=_('Unachieved')?></label>
|
||||
<input id="unachievedImage" type="file" name="unachieved_image" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
|
||||
<label for="achievedImage"><?=_('Achieved')?></label>
|
||||
<input id="achievedImage" type="file" name="achieved_image" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input id="title" type="text" name="title" placeholder="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<label for="description"><?=_('Description')?>:</label>
|
||||
<textarea id="description" name="description"><?=$description?></textarea><br />
|
||||
<input id="progress" type="checkbox" name="progress" <?php if($progress) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="progress"><?=_('Show progress')?></label><br />
|
||||
<input id="hidden" type="checkbox" name="hidden" <?php if($hidden) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="hidden"><?=_('Secret Achievement')?></label><br />
|
||||
<input id="onlyOnce" type="checkbox" name="only_once" <?php if($onlyOnce) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="onlyOnce"><?=_('Only achieveable by one Character')?></label><br />
|
||||
<input id="allConditions" type="checkbox" name="all_conditions" <?php if($allConditions) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="allConditions"><?=_('All conditions')?></label><br />
|
||||
<label for="deadline"><?=_('Deadline')?>:</label>
|
||||
<input id="deadline" type="datetime" name="deadline" placeholder="YYYY-MM-DD HH:MM:SS" pattern="<?=substr($validationSettings['deadline']['regex'],1,strrpos($validationSettings['deadline']['regex'],$validationSettings['deadline']['regex'][0])-1)?>" value="<?=$deadline?>" <?=(array_key_exists('deadline', $validation)) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Conditions')?></legend>
|
||||
<select name="condition">
|
||||
<?php foreach($conditions as &$c) : ?>
|
||||
<option value="<?=$c['condition']?>" <?php if($c['condition'] == $condition) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($c['condition']) {
|
||||
case 'date': echo _('Achievement conditions date');
|
||||
break;
|
||||
case 'character': echo _('Achievement conditions Character');
|
||||
break;
|
||||
case 'quest': echo _('Achievement conditions Quest');
|
||||
break;
|
||||
case 'achievement': echo _('Achievement conditions Achievement');
|
||||
break;
|
||||
case 'qrcode': echo _('QR-Code');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('save and edit conditions')?>" />
|
||||
</form>
|
||||
12
views/html/achievements/delete.tpl
Normal file
12
views/html/achievements/delete.tpl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('achievements','index',$seminary['url']))?>"><?=_('Achievements')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Delete Achievement')?></h1>
|
||||
<?=sprintf(_('Should the Achievement “%s” really be deleted?'), $achievement['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
115
views/html/achievements/edit.tpl
Normal file
115
views/html/achievements/edit.tpl
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('achievements','index',$seminary['url']))?>"><?=_('Achievements')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit Achievement')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'media':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during picture upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Picture exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Picture invalid');
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
case 'deadline':
|
||||
switch($setting) {
|
||||
case 'regex': echo _('Deadline has wrong format');
|
||||
break;
|
||||
default: echo _('Deadline invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Images')?></legend>
|
||||
<?php if(!is_null($achievement['unachieved_achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url'],'locked'))?>" />
|
||||
<?php endif ?>
|
||||
<label for="unachievedImage"><?=_('Unachieved')?></label>
|
||||
<input id="unachievedImage" type="file" name="unachieved_image" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
|
||||
<?php if(!is_null($achievement['achieved_achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<label for="achievedImage"><?=_('Achieved')?></label>
|
||||
<input id="achievedImage" type="file" name="achieved_image" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input id="title" type="text" name="title" placeholder="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<label for="description"><?=_('Description')?>:</label>
|
||||
<textarea id="description" name="description"><?=$description?></textarea><br />
|
||||
<input id="progress" type="checkbox" name="progress" <?php if($progress) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="progress"><?=_('Show progress')?></label><br />
|
||||
<input id="hidden" type="checkbox" name="hidden" <?php if($hidden) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="hidden"><?=_('Secret Achievement')?></label><br />
|
||||
<input id="onlyOnce" type="checkbox" name="only_once" <?php if($onlyOnce) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="onlyOnce"><?=_('Only achieveable by one Character')?></label><br />
|
||||
<input id="allConditions" type="checkbox" name="all_conditions" <?php if($allConditions) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="allConditions"><?=_('All conditions')?></label><br />
|
||||
<label for="deadline"><?=_('Deadline')?>:</label>
|
||||
<input id="deadline" type="datetime" name="deadline" placeholder="YYYY-MM-DD HH:MM:SS" pattern="<?=substr($validationSettings['deadline']['regex'],1,strrpos($validationSettings['deadline']['regex'],$validationSettings['deadline']['regex'][0])-1)?>" value="<?=$deadline?>" <?=(array_key_exists('deadline', $validation)) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Condition')?></legend>
|
||||
<select name="condition">
|
||||
<?php foreach($conditions as &$c) : ?>
|
||||
<option value="<?=$c['condition']?>" <?php if($c['condition'] == $condition) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($c['condition']) {
|
||||
case 'date': echo _('Achievement conditions date');
|
||||
break;
|
||||
case 'character': echo _('Achievement conditions Character');
|
||||
break;
|
||||
case 'quest': echo _('Achievement conditions Quest');
|
||||
break;
|
||||
case 'achievement': echo _('Achievement conditions Achievement');
|
||||
break;
|
||||
case 'qrcode': echo _('QR-Code');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<i><?=_('Changing the condition will delete all current conditions')?>.</i>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit-conditions" value="<?=_('edit conditions')?>" />
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
93
views/html/achievements/index.tpl
Normal file
93
views/html/achievements/index.tpl
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link('create', 3)?>"><?=_('Create new Achievement')?></a></li>
|
||||
<li><a href="<?=$linker->link('manage', 3)?>"><?=_('Manage Achievements')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<h1><i class="fa fa-trophy fa-fw"></i><?=_('Achievements')?></h1>
|
||||
<p><?=_('Achievement description')?></p>
|
||||
<div class="cf">
|
||||
<section class="rare">
|
||||
<h2><?=_('Seldom Achievements')?></h2>
|
||||
<ol>
|
||||
<?php foreach($seldomAchievements as &$achievement) : ?>
|
||||
<li class="cf">
|
||||
<?php if($achievement['achieved'] !== false) : ?>
|
||||
<?php if(!is_null($achievement['achieved_achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<?php if(!is_null($achievement['unachieved_achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url'],'locked'))?>" />
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<p class="fwb"><?=(!$achievement['hidden']) ? $achievement['title'] : _('Secret Achievement')?></p>
|
||||
<p><small><?=sprintf(_('Achievement has been achieved only %d times'), $achievement['c'])?></small></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="rare hunter">
|
||||
<h2><?=_('Most successful collectors')?></h2>
|
||||
<ol>
|
||||
<?php foreach($successfulCharacters as $successfulCharacter) : ?>
|
||||
<li class="cf">
|
||||
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$successfulCharacter['charactertype_url'],$successfulCharacter['xplevel'],'portrait'))?>" />
|
||||
<p class="fwb"><?=$successfulCharacter['name']?></p>
|
||||
<p><small>
|
||||
<?php if($successfulCharacter['c'] == 1) : ?>
|
||||
<?=sprintf(_('Character has achieved %d Achievement'), $successfulCharacter['c'])?>
|
||||
<?php else : ?>
|
||||
<?=sprintf(_('Character has achieved %d Achievements'), $successfulCharacter['c'])?>
|
||||
<?php endif ?>
|
||||
</small></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</section>
|
||||
</div>
|
||||
<h2><?=_('Personal Achievements')?></h2>
|
||||
<div class="libindxpr cf">
|
||||
<p><small><?=sprintf(_('Own progress: %d %%'), ($achievementsCount > 0 ? round(count($achievedAchievements) / $achievementsCount * 100) : 0))?></small></p>
|
||||
<div class="xpbar">
|
||||
<span style="width:<?=($achievementsCount > 0) ? round(count($achievedAchievements) / $achievementsCount * 100) : 0?>%"></span>
|
||||
</div>
|
||||
</div>
|
||||
<p><small><b><?=$character['rank']?>. <?=_('Rank')?>:</b> <?=sprintf(_('You achieved %d of %d Achievements so far'), count($achievedAchievements), $achievementsCount)?>.</small></p>
|
||||
<ul class="achmnts">
|
||||
<?php foreach($achievedAchievements as &$achievement) : ?>
|
||||
<li class="cf">
|
||||
<?php if(!is_null($achievement['achieved_achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<h3 id="<?=$achievement['url']?>"><?=$achievement['title']?><span class="unlcked"><?=sprintf(_('achieved at: %s'), $dateFormatter->format(new \DateTime($achievement['created'])))?></span></h3>
|
||||
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
<?php foreach($unachievedAchievements as &$achievement) : ?>
|
||||
<li class="cf">
|
||||
<?php if(!is_null($achievement['unachieved_achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url'],'locked'))?>" />
|
||||
<?php endif ?>
|
||||
<h3 id="<?=$achievement['url']?>"><?=(!$achievement['hidden']) ? $achievement['title'] : _('Secret Achievement')?></h3>
|
||||
<?php if(!$achievement['hidden']) : ?>
|
||||
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
|
||||
<?php else : ?>
|
||||
<p class="desc"><?=_('Continue playing to unlock this secret Achievement')?></p>
|
||||
<?php endif ?>
|
||||
<?php if(array_key_exists('characterProgress', $achievement)) : ?>
|
||||
<div class="prgrss cf">
|
||||
<div class="xpbar">
|
||||
<span style="width:<?=round($achievement['characterProgress']*100)?>%"></span>
|
||||
</div>
|
||||
<p class="xpnumeric"><?=round($achievement['characterProgress']*100)?>%</p>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
</ul>
|
||||
27
views/html/achievements/manage.tpl
Normal file
27
views/html/achievements/manage.tpl
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('achievements','index',$seminary['url']))?>"><?=_('Achievements')?></a></li>
|
||||
</ul>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('create', $seminary['url']), 1)?>"><?=_('Create new Achievement')?></a></li>
|
||||
</nav>
|
||||
|
||||
<h1><i class="fa fa-trophy fa-fw"></i><?=_('Manage Achievements')?></h1>
|
||||
<ul class="achmnts">
|
||||
<?php foreach($achievements as $index => &$achievement) : ?>
|
||||
<li class="cf">
|
||||
<?php if(!is_null($achievement['achieved_achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<h3 id="<?=$achievement['url']?>"><?=$achievement['title']?></h3>
|
||||
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
|
||||
<ul class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$achievement['url']),1)?>"><?=_('edit')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$achievement['url']),1)?>"><?=_('delete')?></a></li>
|
||||
<?php if($index > 0) : ?><li><a href="<?=$linker->link(array('moveup',$seminary['url'],$achievement['url']),1)?>">↑</a></li><?php endif ?>
|
||||
<?php if($index < count($achievements)-1) : ?><li><a href="<?=$linker->link(array('movedown',$seminary['url'],$achievement['url']),1)?>">↓</a></li><?php endif ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
</ul>
|
||||
0
views/html/achievements/movedown.tpl
Normal file
0
views/html/achievements/movedown.tpl
Normal file
0
views/html/achievements/moveup.tpl
Normal file
0
views/html/achievements/moveup.tpl
Normal file
74
views/html/charactergroups/creategroup.tpl
Normal file
74
views/html/charactergroups/creategroup.tpl
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('groupsgroup',$seminary['url'],$groupsgroup['url']),1)?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('New %s Character group'), $groupsgroup['name'])?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'icon':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during icon upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Icon has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Icon exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Icon invalid');
|
||||
}
|
||||
break;
|
||||
case 'charactergroupname':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Name is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Name is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Name contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Name already exists');
|
||||
break;
|
||||
default: echo _('Name invalid');
|
||||
}
|
||||
break;
|
||||
case 'motto':
|
||||
switch($setting) {
|
||||
case 'maxlength': printf(_('Motto is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
default: echo _('Motto invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" action="" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="charactergroupname"><?=_('Name')?>:</label>
|
||||
<input type="text" id="charactergroupname" name="charactergroupname" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactergroupname']['maxlength']?>" value="<?=$charactergroupname?>" <?=(array_key_exists('charactergroupname', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<label for="motto"><?=_('Motto')?>:</label>
|
||||
<input type="text" id="motto" name="motto" placeholder="<?=_('Motto')?>" title="<?=_('Motto')?>" maxlength="<?=$validationSettings['motto']['maxlength']?>" value="<?=$motto?>" <?=(array_key_exists('motto', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
47
views/html/charactergroups/creategroupsgroup.tpl
Normal file
47
views/html/charactergroups/creategroupsgroup.tpl
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('New Character groups-group')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'charactergroupsgroupname':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Name is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Name is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Name contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Name already exists');
|
||||
break;
|
||||
default: echo _('Name invalid');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo $exception->getMessage();
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" action="" class="logreg">
|
||||
<fieldset>
|
||||
<label for="charactergroupsgroupname"><?=_('Name')?>:</label>
|
||||
<input type="text" name="charactergroupsgroupname" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactergroupsgroupname']['maxlength']?>" value="<?=$charactergroupsgroupname?>" <?=(array_key_exists('charactergroupsgroupname', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<div class="inlbl"><input type="checkbox" id="preferred" name="preferred" <?php if($preferred) : ?>checked="checked"<?php endif ?> /><label for="preferred"><?=_('preferred')?></label></div>
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
13
views/html/charactergroups/deletegroup.tpl
Normal file
13
views/html/charactergroups/deletegroup.tpl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('groupsgroup',$seminary['url'],$groupsgroup['url']),1)?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
<h1><?=sprintf(_('Delete %s Character group'), $groupsgroup['name'])?></h1>
|
||||
|
||||
<?=sprintf(_('Should the %s Character group “%s” really be deleted?'), $groupsgroup['name'], $group['name'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
12
views/html/charactergroups/deletegroupsgroup.tpl
Normal file
12
views/html/charactergroups/deletegroupsgroup.tpl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
</ul>
|
||||
<h1><?=_('Delete Character groups-group')?></h1>
|
||||
|
||||
<?=sprintf(_('Should the Character groups-group “%s” really be deleted?'), $groupsgroup['name'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
80
views/html/charactergroups/editgroup.tpl
Normal file
80
views/html/charactergroups/editgroup.tpl
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('groupsgroup',$seminary['url'],$groupsgroup['url']),1)?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('Edit %s Character group'), $groupsgroup['name'])?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'icon':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during icon upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Icon has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Icon exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Icon invalid');
|
||||
}
|
||||
break;
|
||||
case 'charactergroupname':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Name is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Name is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Name contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Name already exists');
|
||||
break;
|
||||
default: echo _('Name invalid');
|
||||
}
|
||||
break;
|
||||
case 'motto':
|
||||
switch($setting) {
|
||||
case 'maxlength': printf(_('Motto is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
default: echo _('Motto invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<img src="<?=$linker->link(array('media','charactergroup',$seminary['url'],$groupsgroup['url'],$group['url']))?>" class="gbanner"><br />
|
||||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="charactergroupname"><?=_('Name')?>:</label>
|
||||
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<input type="text" id="charactergroupname" name="charactergroupname" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactergroupname']['maxlength']?>" value="<?=$charactergroupname?>" <?=(array_key_exists('charactergroupname', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<?php else : ?>
|
||||
<input type="text" id="charactergroupname" name="charactergroupname" disabled="disabled" value="<?=$charactergroupname?>" <?=(array_key_exists('charactergroupname', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<input type="hidden" name="charactergroupname" value="<?=$charactergroupname?>" />
|
||||
<?php endif ?>
|
||||
<label for="motto"><?=_('Motto')?>:</label>
|
||||
<input type="text" id="motto" name="motto" placeholder="<?=_('Motto')?>" title="<?=_('Motto')?>" maxlength="<?=$validationSettings['motto']['maxlength']?>" value="<?=$motto?>" <?=(array_key_exists('motto', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('edit')?>" />
|
||||
</form>
|
||||
47
views/html/charactergroups/editgroupsgroup.tpl
Normal file
47
views/html/charactergroups/editgroupsgroup.tpl
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit Character groups-group')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'charactergroupsgroupname':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Name is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Name is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Name contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Name already exists');
|
||||
break;
|
||||
default: echo _('Name invalid');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo $exception->getMessage();
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" action="" class="logreg">
|
||||
<fieldset>
|
||||
<label for="charactergroupsgroupname"><?=_('Name')?>:</label>
|
||||
<input type="text" name="charactergroupsgroupname" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactergroupsgroupname']['maxlength']?>" value="<?=$charactergroupsgroupname?>" <?=(array_key_exists('charactergroupsgroupname', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<div class="inlbl"><input type="checkbox" id="preferred" name="preferred" <?php if($preferred) : ?>checked="checked"<?php endif ?> /><label for="preferred"><?=_('preferred')?></label></div>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('edit')?>" />
|
||||
</form>
|
||||
93
views/html/charactergroups/group.tpl
Normal file
93
views/html/charactergroups/group.tpl
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('groupsgroup',$seminary['url'],$groupsgroup['url']),1)?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0 || in_array(\hhu\z\controllers\SeminaryController::$character['id'], array_map(function($c) { return $c['id']; }, $group['characters']))) : ?>
|
||||
<nav class="admin">
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0 || in_array(\hhu\z\controllers\SeminaryController::$character['id'], array_map(function($c) { return $c['id']; }, $group['characters']))) : ?>
|
||||
<li><a href="<?=$linker->link(array('editgroup',$seminary['url'],$groupsgroup['url'],$group['url']),1)?>"><?=sprintf(_('Edit %s Character group'), $groupsgroup['name'])?></a></li>
|
||||
<?php endif ?>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<li><a href="<?=$linker->link(array('deletegroup',$seminary['url'],$groupsgroup['url'],$group['url']),1)?>"><?=sprintf(_('Delete %s Character group'), $groupsgroup['name'])?></a></li>
|
||||
<li><a href="<?=$linker->link(array('managegroup',$seminary['url'],$groupsgroup['url'],$group['url']),1)?>"><?=sprintf(_('Manage %s Character group'), $groupsgroup['name'])?></a></li>
|
||||
<?php endif ?>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="gbanner cf">
|
||||
<img src="<?=$linker->link(array('media','charactergroup',$seminary['url'],$groupsgroup['url'],$group['url']))?>" class="gbanner">
|
||||
<h1><?=$group['name']?></h1>
|
||||
<?php if(!empty($group['motto'])) : ?>
|
||||
<p>"<?=$group['motto']?>"</p>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<ul class="gdata cf">
|
||||
<li><?=$group['rank']?>. <?=_('Rank')?></li>
|
||||
<li><?=sprintf(_('%d XPs'), $group['xps'])?></li>
|
||||
<li><?=count($group['characters'])?> <?=(count($group['characters']) == 0 || count($group['characters']) > 1) ? _('Members') : _('Member')?></li>
|
||||
</ul>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-users fa-fw"></i><?=_('Characters')?></h1>
|
||||
<ul class="gchars cf">
|
||||
<?php foreach($group['characters'] as &$character) : ?>
|
||||
<li>
|
||||
<?php if(array_key_exists('small_avatar', $character)) : ?>
|
||||
<p><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$character['small_avatar']['url']))?>"></p>
|
||||
<?php endif ?>
|
||||
<p class="ctitle">
|
||||
<?php if(array_key_exists('title', $character)) : ?>
|
||||
<?=$character['title']?>
|
||||
<?php else : ?>
|
||||
|
||||
<?php endif ?>
|
||||
</p>
|
||||
<p><a href="<?=$linker->link(array('characters','character',$seminary['url'],$character['url']))?>"><?=$character['name']?></a></p>
|
||||
<p><small><?=sprintf(_('%d XPs'), $character['xps'])?></small></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-pencil-square-o fa-fw"></i><?=sprintf(_('%s-Quests'),$groupsgroup['name'])?></h1>
|
||||
<ul class="gquests">
|
||||
<?php foreach($quests as &$quest) : ?>
|
||||
<li class="cf">
|
||||
<p>
|
||||
<span class="date"><?=$dateFormatter->format(new \DateTime($quest['created']))?></span>
|
||||
<a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" class="fwb"><?=$quest['title']?></a>
|
||||
<span class="xp"><?=$quest['group_xps']?> / <?=$quest['xps']?> <?=_('XPs')?></span>
|
||||
</p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<?php if(!empty($achievements) || count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<section>
|
||||
<h1 id="achievements"><i class="fa fa-trophy fa-fw"></i><?=_('Achievements')?></a></h1>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('charactergroupsachievements','manage',$seminary['url'],$groupsgroup['url']))?>"><?=sprintf(_('Manage %s-Achievements'), $groupsgroup['name'])?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<ul class="achmnts">
|
||||
<?php foreach($achievements as &$achievement) : ?>
|
||||
<li class="cf">
|
||||
<?php if(!is_null($achievement['achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','charactergroupsachievement',$seminary['url'],$groupsgroup['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<h3 id="<?=$achievement['url']?>">
|
||||
<?=$achievement['title']?>
|
||||
<span class="unlcked"><?=sprintf(_('achieved at: %s'), $dateFormatter->format(new \DateTime($achievement['created'])))?></span>
|
||||
</h3>
|
||||
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
</ul>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
68
views/html/charactergroups/groupsgroup.tpl
Normal file
68
views/html/charactergroups/groupsgroup.tpl
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
</ul>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('editgroupsgroup',$seminary['url'],$groupsgroup['url']), 1)?>"><?=_('Edit Character groups-group')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('deletegroupsgroup',$seminary['url'],$groupsgroup['url']), 1)?>"><?=_('Delete Character groups-group')?></a></li>
|
||||
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<h1><?=$groupsgroup['name']?></h1>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('creategroup',$seminary['url'],$groupsgroup['url']), 1)?>"><?=sprintf(_('Create new %s Character group'), $groupsgroup['name'])?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<ol class="cglist rnkng">
|
||||
<?php foreach($groups as $index => &$group) : ?>
|
||||
<li>
|
||||
<?php if($index < 3) : ?>
|
||||
<img src="<?=$linker->link(array('media','charactergroup',$seminary['url'],$groupsgroup['url'],$group['url']))?>" class="gbanner">
|
||||
<?php endif ?>
|
||||
<p><a href="<?=$linker->link(array('group',$seminary['url'],$groupsgroup['url'],$group['url']),1)?>"><?=$group['name']?></a><span class="xp"><?=$group['xps']?> XP</span></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
|
||||
|
||||
<h2><?=sprintf(_('%s-Quests'),$groupsgroup['name'])?></h2>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('charactergroupsquests','create',$seminary['url'],$groupsgroup['url']))?>"><?=sprintf(_('Create new %s-Quest'), $groupsgroup['name'])?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<ul class="cgqlist cf">
|
||||
<?php foreach($quests as &$quest) : ?>
|
||||
<?php if($quest['public'] || count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<li class="cf">
|
||||
<img src="<?=$linker->link(array('media','charactergroupsquest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" />
|
||||
<p><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></p>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<h2 id="achievements"><i class="fa fa-trophy fa-fw"></i><?=sprintf(_('%s-Achievements'),$groupsgroup['name'])?></a></h2>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('charactergroupsachievements','create',$seminary['url'],$groupsgroup['url']))?>"><?=sprintf(_('Create new %s-Achievement'), $groupsgroup['name'])?></a></li>
|
||||
<li><a href="<?=$linker->link(array('charactergroupsachievements','manage',$seminary['url'],$groupsgroup['url']))?>"><?=sprintf(_('Manage %s-Achievements'), $groupsgroup['name'])?></a></li>
|
||||
</nav>
|
||||
<ul class="achmnts">
|
||||
<?php foreach($achievements as &$achievement) : ?>
|
||||
<li class="cf">
|
||||
<?php if(!is_null($achievement['achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','charactergroupsachievement',$seminary['url'],$groupsgroup['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<h3 id="<?=$achievement['url']?>"><?=$achievement['title']?></h3>
|
||||
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
17
views/html/charactergroups/index.tpl
Normal file
17
views/html/charactergroups/index.tpl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
<h1><?=_('Character Groups')?></h1>
|
||||
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('creategroupsgroup',$seminary['url']),1)?>"><?=_('Create new Character groups-group')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<ul class="cglist">
|
||||
<?php foreach($groupsgroups as &$group) : ?>
|
||||
<li><a href="<?=$linker->link(array('groupsgroup',$seminary['url'],$group['url']),1)?>"><?=$group['name']?></a></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
107
views/html/charactergroups/managegroup.tpl
Normal file
107
views/html/charactergroups/managegroup.tpl
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('groupsgroup',$seminary['url'],$groupsgroup['url']),1)?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="gbanner cf">
|
||||
<img src="<?=$linker->link(array('media','charactergroup',$seminary['url'],$groupsgroup['url'],$group['url']))?>" class="gbanner">
|
||||
<h1><?=$group['name']?></h1>
|
||||
<?php if(!empty($group['motto'])) : ?>
|
||||
<p>"<?=$group['motto']?>"</p>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<ul class="gdata cf">
|
||||
<li><?=$group['rank']?>. <?=_('Rank')?></li>
|
||||
<li><?=$group['xps']?> XP</li>
|
||||
<li><?=count($group['characters'])?> <?=(count($group['characters']) > 1) ? _('Members') : _('Member')?></li>
|
||||
</ul>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-users fa-fw"></i><?=_('Characters')?></h1>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<ul class="gchars cf">
|
||||
<?php foreach($group['characters'] as &$character) : ?>
|
||||
<li>
|
||||
<input type="checkbox" id="characters-<?=$character['id']?>" name="characters[]" value="<?=$character['id']?>" <?php if($character['id'] == \hhu\z\controllers\SeminaryController::$character['id']) : ?>disabled="disabled"<?php endif ?>/>
|
||||
<label for="characters-<?=$character['id']?>">
|
||||
<?php if(array_key_exists('small_avatar', $character)) : ?>
|
||||
<p><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$character['small_avatar']['url']))?>"></p>
|
||||
<?php endif ?>
|
||||
<p><a href="<?=$linker->link(array('characters','character',$seminary['url'],$character['url']))?>"><?=$character['name']?></a></p>
|
||||
<p><small><?=$character['xps']?> XP</small></p>
|
||||
</label>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="submit" name="actions[removecharacters]" value="<?=_('Remove Characters')?>" />
|
||||
</fieldset>
|
||||
<fieldset class="filter add">
|
||||
<p class="fwb"><small>Charaktere der Gruppe hinzufügen:</small></p>
|
||||
<input type="text" id="filter_input" placeholder="<?=_('Filter Characters')?>" />
|
||||
<select id="characters" name="characters[]" size="10" multiple="multiple">
|
||||
<?php foreach($characters as &$character) : ?>
|
||||
<option value="<?=$character['id']?>"><?=$character['name']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<input type="submit" name="actions[addcharacters]" value="<?=_('Add Characters')?>" />
|
||||
</fieldset>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-pencil-square-o fa-fw"></i><?=_('Quests')?></h1>
|
||||
<ul class="gquests">
|
||||
<?php foreach($quests as &$quest) : ?>
|
||||
<li class="cf">
|
||||
<p>
|
||||
<span class="date"><?=$dateFormatter->format(new \DateTime($quest['created']))?></span>
|
||||
<a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" class="fwb"><?=$quest['title']?></a>
|
||||
<span class="xp"><?=$quest['group_xps']?> / <?=$quest['xps']?> XP</span>
|
||||
</p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
/**
|
||||
* Hide select elements that include the value string from the given input
|
||||
* element.
|
||||
*
|
||||
* @author Lessan Vaezi (http://stackoverflow.com/a/6647367)
|
||||
*/
|
||||
jQuery.fn.filterByText = function(textbox) {
|
||||
return this.each(function() {
|
||||
var select = this;
|
||||
var options = [];
|
||||
$(select).find('option').each(function() {
|
||||
options.push({value: $(this).val(), text: $(this).text()});
|
||||
});
|
||||
$(select).data('options', options);
|
||||
|
||||
$(textbox).bind('change keyup', function() {
|
||||
var options = $(select).empty().data('options');
|
||||
var search = $.trim($(this).val());
|
||||
var regex = new RegExp(search,"gi");
|
||||
|
||||
$.each(options, function(i) {
|
||||
var option = options[i];
|
||||
if(option.text.match(regex) !== null) {
|
||||
$(select).append(
|
||||
$('<option>').text(option.text).val(option.value)
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
$('#characters').filterByText($('#filter_input'));
|
||||
});
|
||||
</script>
|
||||
29
views/html/charactergroupsachievements/achievement.tpl
Normal file
29
views/html/charactergroupsachievements/achievement.tpl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=$achievement['title']?></h1>
|
||||
<ul class="achmnts">
|
||||
<li class="cf">
|
||||
<?php if(!is_null($achievement['achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','charactergroupsachievement',$seminary['url'],$groupsgroup['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form method="post" action="<?=$linker->link(null, 5, true)?>">
|
||||
<fieldset>
|
||||
<label for="charactergroup"><?=sprintf(_('%s-Group to show'), $groupsgroup['name'])?>:</label>
|
||||
<br />
|
||||
<select id="charactergroup" name="charactergroup">
|
||||
<?php foreach($charactergroups as &$group) : ?>
|
||||
<option value="<?=$group['id']?>"><?=$group['name']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</fieldset>
|
||||
<input type="submit" value="<?=_('proceed')?>" />
|
||||
</form>
|
||||
67
views/html/charactergroupsachievements/create.tpl
Normal file
67
views/html/charactergroupsachievements/create.tpl
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('Create %s-Achievement'), $groupsgroup['name'])?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'icon':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during icon upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Icon has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Icon exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Icon invalid');
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input id="title" type="text" name="title" placeholder="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<label for="description"><?=_('Description')?>:</label>
|
||||
<textarea id="description" name="description"><?=$description?></textarea><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
13
views/html/charactergroupsachievements/delete.tpl
Normal file
13
views/html/charactergroupsachievements/delete.tpl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('Delete %s-Achievement'), $groupsgroup['name'])?></h1>
|
||||
<?=sprintf(_('Should the %s-Achievement “%s” really be deleted?'), $groupsgroup['name'], $achievement['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
70
views/html/charactergroupsachievements/edit.tpl
Normal file
70
views/html/charactergroupsachievements/edit.tpl
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('Edit %s-Achievement'), $groupsgroup['name'])?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'icon':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during icon upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Icon has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Icon exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Icon invalid');
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<?php if(!is_null($achievement['achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','charactergroupsachievement',$seminary['url'],$groupsgroup['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input id="title" type="text" name="title" placeholder="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<label for="description"><?=_('Description')?>:</label>
|
||||
<textarea id="description" name="description"><?=$description?></textarea><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
36
views/html/charactergroupsachievements/manage.tpl
Normal file
36
views/html/charactergroupsachievements/manage.tpl
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('create', $seminary['url'], $groupsgroup['url']), 1)?>"><?=sprintf(_('Create new %s-Achievement'), $groupsgroup['name'])?></a></li>
|
||||
</nav>
|
||||
|
||||
<h1><i class="fa fa-trophy fa-fw"></i><?=sprintf(_('Manage %s-Achievements'), $groupsgroup['name'])?></h1>
|
||||
<ul class="achmnts">
|
||||
<?php foreach($achievements as $index => &$achievement) : ?>
|
||||
<li class="cf">
|
||||
<?php if(!is_null($achievement['achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','charactergroupsachievement',$seminary['url'],$groupsgroup['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<h3 id="<?=$achievement['url']?>"><?=$achievement['title']?></h3>
|
||||
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
|
||||
<ul class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$groupsgroup['url'],$achievement['url']),1)?>"><?=_('edit')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$groupsgroup['url'],$achievement['url']),1)?>"><?=_('delete')?></a></li>
|
||||
<?php if($index > 0) : ?><li><a href="<?=$linker->link(array('moveup',$seminary['url'],$groupsgroup['url'],$achievement['url']),1)?>">↑</a></li><?php endif ?>
|
||||
<?php if($index < count($achievements)-1) : ?><li><a href="<?=$linker->link(array('movedown',$seminary['url'],$groupsgroup['url'],$achievement['url']),1)?>">↓</a></li><?php endif ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('achievement',$seminary['url'],$groupsgroup['url'],$achievement['hash']),1)?>"><?=_('assign manually')?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('qrcodes','charactergroupsachievements',$seminary['url'],$groupsgroup['url'],$achievement['url'],'50'))?>">
|
||||
<i class="fa fa-qrcode"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
</ul>
|
||||
0
views/html/charactergroupsachievements/movedown.tpl
Normal file
0
views/html/charactergroupsachievements/movedown.tpl
Normal file
0
views/html/charactergroupsachievements/moveup.tpl
Normal file
0
views/html/charactergroupsachievements/moveup.tpl
Normal file
90
views/html/charactergroupsquests/create.tpl
Normal file
90
views/html/charactergroupsquests/create.tpl
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('New %s-Quest'), $groupsgroup['name'])?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'icon':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during icon upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Icon has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Icon exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Icon invalid');
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
case 'xps':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('XPs not set'), $value);
|
||||
break;
|
||||
case 'regex': echo _('XPs contain illegal characters');
|
||||
break;
|
||||
default: echo _('XPs invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" action="" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="xps"><?=_('XPs')?>:</label>
|
||||
<input type="xps" id="xps" name="xps" placeholder="<?=_('XPs')?>" title="<?=_('XPs')?>" pattern="<?=substr($validationSettings['xps']['regex'],1,strrpos($validationSettings['xps']['regex'],$validationSettings['xps']['regex'][0])-1)?>" value="<?=$xps?>" <?=(array_key_exists('xps', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="questgroup"><?=_('Questgroup')?></label>
|
||||
<select id="questgroup" name="questgroup">
|
||||
<?php foreach($questgroups as &$questgroup) : ?>
|
||||
<option value="<?=$questgroup['url']?>" <?php if(array_key_exists('selected', $questgroup) && $questgroup['selected']) : ?>selected="selected"<?php endif ?>><?=$questgroup['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<label for="description"><?=_('Description')?>:</label>
|
||||
<textarea id="description" name="description" placeholder="<?=_('Description')?>"><?=$description?></textarea>
|
||||
<label for="rules"><?=_('Rules')?>:</label>
|
||||
<textarea id="rules" name="rules" placeholder="<?=_('Rules')?>"><?=$rules?></textarea>
|
||||
<label for="wonText"><?=_('Won-text')?>:</label>
|
||||
<textarea id="wonText" name="wonText" placeholder="<?=_('Won-text')?>"><?=$wonText?></textarea>
|
||||
<label for="lostText"><?=_('Lost-text')?>:</label>
|
||||
<textarea id="lostText" name="lostText" placeholder="<?=_('Lost-text')?>"><?=$lostText?></textarea>
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
13
views/html/charactergroupsquests/delete.tpl
Normal file
13
views/html/charactergroupsquests/delete.tpl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('Delete %s-Quest'), $groupsgroup['name'])?></h1>
|
||||
<?=sprintf(_('Should the %s-Quest “%s” really be deleted?'), $groupsgroup['name'], $quest['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
101
views/html/charactergroupsquests/edit.tpl
Normal file
101
views/html/charactergroupsquests/edit.tpl
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('Edit %s-Quest'), $groupsgroup['name'])?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'icon':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during icon upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Icon has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Icon exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Icon invalid');
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
case 'xps':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('XPs not set'), $value);
|
||||
break;
|
||||
case 'regex': echo _('XPs contain illegal characters');
|
||||
break;
|
||||
default: echo _('XPs invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" action="" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<img src="<?=$linker->link(array('media','charactergroupsquest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" /><br />
|
||||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<input type="checkbox" id="public" name="public" <?php if($public) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="public"><?=_('public')?></label>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="xps"><?=_('XPs')?>:</label>
|
||||
<input type="number" id="xps" name="xps" placeholder="<?=_('XPs')?>" title="<?=_('XPs')?>" pattern="<?=substr($validationSettings['xps']['regex'],1,strrpos($validationSettings['xps']['regex'],$validationSettings['xps']['regex'][0])-1)?>" value="<?=$xps?>" <?=(array_key_exists('xps', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="questgroup"><?=_('Questgroup')?></label>
|
||||
<select id="questgroup" name="questgroup">
|
||||
<?php foreach($questgroups as &$questgroup) : ?>
|
||||
<option value="<?=$questgroup['url']?>" <?php if(array_key_exists('selected', $questgroup) && $questgroup['selected']) : ?>selected="selected"<?php endif ?>><?=$questgroup['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<label for="description"><?=_('Description')?>:</label>
|
||||
<textarea id="description" name="description" placeholder="<?=_('Description')?>"><?=$description?></textarea>
|
||||
<label for="rules"><?=_('Rules')?>:</label>
|
||||
<textarea id="rules" name="rules" placeholder="<?=_('Rules')?>"><?=$rules?></textarea>
|
||||
<label for="wonText"><?=_('Won-text')?>:</label>
|
||||
<textarea id="wonText" name="wonText" placeholder="<?=_('Won-text')?>"><?=$wonText?></textarea>
|
||||
<label for="lostText"><?=_('Lost-text')?>:</label>
|
||||
<textarea id="lostText" name="lostText" placeholder="<?=_('Lost-text')?>"><?=$lostText?></textarea>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('edit')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#description").markItUp(mySettings);
|
||||
$("#rules").markItUp(mySettings);
|
||||
$("#wonText").markItUp(mySettings);
|
||||
$("#lostText").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
94
views/html/charactergroupsquests/manage.tpl
Normal file
94
views/html/charactergroupsquests/manage.tpl
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="gbanner cf">
|
||||
<?php if(!is_null($media)) : ?>
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" class="grpqimg" />
|
||||
<?php else : ?>
|
||||
<img src="<?=$linker->link(array('grafics','charactergroup.jpg'))?>" class="gbanner">
|
||||
<?php endif ?>
|
||||
<h1><?=$quest['title']?></h1>
|
||||
</div>
|
||||
<ul class="gdata cf">
|
||||
<li><span class="fwb"><?=sprintf(_('%d XPs'), $quest['xps'])?></span></li>
|
||||
<li><?php if($questgroup['entered']) : ?><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$questgroup['url']))?>"><?=$questgroup['title']?></a><?php else : ?><?=$questgroup['title']?><?php endif ?></li>
|
||||
</ul>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-picture-o fa-fw"></i><?=_('Media')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'media':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during file upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('File has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('File exceeds size maximum');
|
||||
break;
|
||||
default: echo _('File invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form class="mng" method="post" enctype="multipart/form-data">
|
||||
<ul class="gqgllry mnglst">
|
||||
<?php foreach($uploads as &$upload) : ?>
|
||||
<li>
|
||||
<input type="checkbox" id="upload_<?=$upload['upload']['id']?>" name="uploads[]" value="<?=$upload['upload']['id']?>" />
|
||||
<br />
|
||||
<label for="upload_<?=$upload['upload']['id']?>">
|
||||
<a href="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url']))?>">
|
||||
<img src="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url'],'thumbnail'))?>" />
|
||||
</a>
|
||||
<label>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="submit" name="deletemedia" value="<?=_('delete selected')?>" />
|
||||
</form>
|
||||
<form class="mng" method="post" enctype="multipart/form-data">
|
||||
<input type="file" name="media" /><br />
|
||||
<p><?=_('Allowed file types')?>: <?php foreach($mimetypes as &$mimetype) : ?><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB) <?php endif ?><?php endforeach ?></p>
|
||||
<input type="submit" name="setmedia" value="<?=_('upload')?>" />
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-users fa-fw"></i><?=$groupsgroup['name']?></h1>
|
||||
<form method="post">
|
||||
<ul class="grpqlist">
|
||||
<?php foreach($groups as &$group) : ?>
|
||||
<li>
|
||||
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
|
||||
<span class="xp">
|
||||
<?=sprintf(_('%d Stations'), count($group['stations']))?>,
|
||||
<select name="xps[<?=$group['url']?>]">
|
||||
<option value="null" <?php if(is_null($group['quest_group'])) : ?>selected="selected"<?php endif ?>><?=_('Not attended')?></option>
|
||||
<?php for($i=0; $i<=$quest['xps']; $i++) : ?>
|
||||
<option value="<?=$i?>" <?php if(!is_null($group['quest_group']) && $group['quest_group']['xps'] == $i) : ?>selected="selected"<?php endif ?>><?=sprintf(_('%d XPs'), $i)?></option>
|
||||
<?php endfor ?>
|
||||
</select>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="submit" name="setxps" value="<?=_('Set XPs')?>" />
|
||||
</form>
|
||||
</section>
|
||||
279
views/html/charactergroupsquests/quest.tpl
Normal file
279
views/html/charactergroupsquests/quest.tpl
Normal file
|
|
@ -0,0 +1,279 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
</ul>
|
||||
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$groupsgroup['url'],$quest['url']),1)?>"><?=sprintf(_('Edit %s-Quest'), $groupsgroup['name'])?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$groupsgroup['url'],$quest['url']),1)?>"><?=sprintf(_('Delete %s-Quest'), $groupsgroup['name'])?></a></li>
|
||||
<li><a href="<?=$linker->link(array('manage',$seminary['url'],$groupsgroup['url'],$quest['url']),1)?>"><?=sprintf(_('Manage %s-Quest'), $groupsgroup['name'])?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="gbanner cf">
|
||||
<img src="<?=$linker->link(array('media','charactergroupsquest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" class="grpqimg" />
|
||||
<h1><?=$quest['title']?></h1>
|
||||
</div>
|
||||
<ul class="gdata cf">
|
||||
<li><span class="fwb"><?=sprintf(_('%d XPs'), $quest['xps'])?></span></li>
|
||||
<li><?php if($questgroup['entered']) : ?><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$questgroup['url']))?>"><?=$questgroup['title']?></a><?php else : ?><?=$questgroup['title']?><?php endif ?></li>
|
||||
</ul>
|
||||
|
||||
<?php if(count($uploads) > 0) : ?>
|
||||
<section>
|
||||
<h1><i class="fa fa-picture-o fa-fw"></i><?=_('Media')?></h1>
|
||||
<ul class="gqgllry">
|
||||
<?php foreach($uploads as &$upload) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url']))?>">
|
||||
<img src="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url'],'thumbnail'))?>" />
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-envelope fa-fw"></i><?=_('Description')?></h1>
|
||||
<div class="qtextbox">
|
||||
<p class="qtext"><?=$t->t($quest['description'])?></p>
|
||||
</div>
|
||||
<?php if(!empty($quest['rules'])) : ?>
|
||||
<h1><i class="fa fa-exclamation-triangle fa-fw"></i><?=_('Rules')?></h1>
|
||||
<div class="qtextbox">
|
||||
<p class="qtext"><?=$t->t($quest['rules'])?></p>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
|
||||
<?php if(!empty($quest['won_text'])) : ?>
|
||||
<section>
|
||||
<h1><i class="fa fa-thumbs-up fa-fw"></i><?=_('Won Quest')?></h1>
|
||||
<div class="qtextbox">
|
||||
<p class="qtext"><?=$t->t($quest['won_text'])?></p>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
<?php if(!empty($quest['lost_text'])) : ?>
|
||||
<section>
|
||||
<h1><i class="fa fa-thumbs-down fa-fw"></i><?=_('Lost Quest')?></h1>
|
||||
<div class="qtextbox">
|
||||
<p class="qtext"><?=$t->t($quest['lost_text'])?></p>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<section>
|
||||
<h1 id="stations"><i class="fa fa-map-signs fa-fw"></i><?=_('Character Groups Quest Stations')?></h1>
|
||||
<?php if(count($stations) > 0) : ?>
|
||||
<?php if($stationsDiscovered || count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<div id="map" class="map"></div>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<ul>
|
||||
<li><a href="<?=$linker->link(array('charactergroupsqueststations','create',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=_('Create new station')?></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<?php if(count($stationgroups) > 1) : ?>
|
||||
<form method="get" action="<?=$linker->link(null, 5, true, null, true, 'stations')?>">
|
||||
<label for="stationgroup"><?=sprintf(_('%s-Group to show'), $groupsgroup['name'])?>:</label>
|
||||
<select id="stationgroup" name="stationgroup" onchange="this.form.submit();">
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<option><?=sprintf(_('Select %s-Group'), $groupsgroup['name'])?></option>
|
||||
<?php endif ?>
|
||||
<?php foreach($stationgroups as &$group) : ?>
|
||||
<option value="<?=$group['id']?>" <?php if($group['id'] == $stationgroup['id']) : ?>selected="selected"<?php endif ?>><?=$group['name']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
<ol class="grpqlist">
|
||||
<?php foreach($stations as &$station) : ?>
|
||||
<li>
|
||||
<span class="group">
|
||||
<?php if(!array_key_exists('entered', $station) || $station['entered']) : ?>
|
||||
<?php if(!is_null($stationgroup)) : ?>
|
||||
<a href="<?=$linker->link(array('charactergroupsqueststations','station',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),0,true,array('stationgroup'=>$stationgroup['id']))?>"><?=$station['title']?></a>
|
||||
<?php else : ?>
|
||||
<a href="<?=$linker->link(array('charactergroupsqueststations','station',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>"><?=$station['title']?></a>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<?=_('Station not yet discovered')?>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
<?php if(array_key_exists('entered', $station) && $station['entered']) : ?>
|
||||
<span class="xp">
|
||||
<?php if($station['tried']) : ?>
|
||||
<?php if($station['solved']) : ?>
|
||||
<i class="fa fa-check-circle fa-fw"></i>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-times-circle fa-fw"></i>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-globe fa-fw"></i>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
|
||||
<ol class="grpqslist">
|
||||
<?php foreach($stations as &$station) : ?>
|
||||
<li>
|
||||
<?php if(array_key_exists('entered', $station) && $station['entered']) : ?>
|
||||
<a href="<?=$linker->link(array('charactergroupsqueststations','station',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>">
|
||||
<?php if($station['tried']) : ?>
|
||||
<?php if($station['solved']) : ?>
|
||||
<?php if(!is_null($station['stationpicture_id'])) : ?>
|
||||
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>" />
|
||||
<?php else : ?>
|
||||
<i class="fa fa-circle"></i>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-times-circle"></i>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),0,true,array('stationgroup'=>$stationgroup['id']))?>" />
|
||||
<?php endif ?>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<div>
|
||||
<i class="fa fa-question-circle"></i>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-users fa-fw"></i><?=$groupsgroup['name']?></h1>
|
||||
<ol class="grpqlist">
|
||||
<?php foreach($groups as &$group) : ?>
|
||||
<li>
|
||||
<span class="date"><?=$dateFormatter->format(new \DateTime($group['created']))?></span>
|
||||
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
|
||||
<span class="xp">
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<?=sprintf(_('%d Stations'), count($group['stations']))?>,
|
||||
<?php endif ?>
|
||||
<?=sprintf(_('%d XPs'), $group['xps'])?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
var markersSource = new ol.source.Vector({
|
||||
<?php if(!is_null($stationgroup)) : ?>
|
||||
url: '<?=$linker->link(array('charactergroupsqueststations','index',$seminary['url'],$groupsgroup['url'],$quest['url']), 0, true, array('stationgroup'=>$stationgroup['id']))?>',
|
||||
<?php else : ?>
|
||||
url: '<?=$linker->link(array('charactergroupsqueststations','index',$seminary['url'],$groupsgroup['url'],$quest['url']))?>',
|
||||
<?php endif ?>
|
||||
format: new ol.format.GeoJSON()
|
||||
});
|
||||
markersSource.on('change', function(e) {
|
||||
map.getView().fit(
|
||||
markersSource.getExtent(),
|
||||
map.getSize(), {
|
||||
padding: [10, 10, 10, 10]
|
||||
}
|
||||
);
|
||||
});
|
||||
var styleFunction = function(feature, resolution) {
|
||||
var styles = [];
|
||||
var geometry = feature.getGeometry();
|
||||
if(geometry instanceof ol.geom.Point) {
|
||||
var name = feature.get('name');
|
||||
if(name) {
|
||||
// Label styling
|
||||
styles.push(
|
||||
new ol.style.Style({
|
||||
text: new ol.style.Text({
|
||||
text: name,
|
||||
textBaseline: 'Bottom',
|
||||
offsetY: 14,
|
||||
scale: 1.2
|
||||
})
|
||||
})
|
||||
);
|
||||
}
|
||||
else {
|
||||
// Point styling
|
||||
styles.push(
|
||||
new ol.style.Style({
|
||||
text: new ol.style.Text({
|
||||
//text: '\uf041',
|
||||
text: '\uf276',
|
||||
font: 'normal 28px FontAwesome',
|
||||
textBaseline: 'Bottom',
|
||||
fill: new ol.style.Fill({
|
||||
color: '#0F373C'
|
||||
})
|
||||
})
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
else if(geometry instanceof ol.geom.LineString) {
|
||||
// Line styling
|
||||
styles.push(
|
||||
new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#50A4AB',
|
||||
width: 3
|
||||
})
|
||||
})
|
||||
);
|
||||
// Add arrows
|
||||
geometry.forEachSegment(function(start, end) {
|
||||
var dx = end[0] - start[0];
|
||||
var dy = end[1] - start[1];
|
||||
var rotation = Math.atan2(dy, dx);
|
||||
var cx = (start[0] + end[0]) / 2;
|
||||
var cy = (start[1] + end[1]) / 2;
|
||||
styles.push(new ol.style.Style({
|
||||
geometry: new ol.geom.Point([cx, cy]),
|
||||
text: new ol.style.Text({
|
||||
text: '\uf178',
|
||||
font: 'normal 28px FontAwesome',
|
||||
fill: new ol.style.Fill({
|
||||
color: '#0F373C'
|
||||
}),
|
||||
rotation: -rotation
|
||||
})
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
return styles;
|
||||
};
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Vector({
|
||||
source: markersSource,
|
||||
style: styleFunction
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 19,
|
||||
maxZoom: 19
|
||||
})
|
||||
});
|
||||
</script>
|
||||
205
views/html/charactergroupsqueststations/create.tpl
Normal file
205
views/html/charactergroupsqueststations/create.tpl
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('New Station')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'icon':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during icon upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Icon has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Icon exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Icon invalid');
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
case 'rightimage':
|
||||
case 'rightav':
|
||||
case 'wrongimage':
|
||||
case 'wrongav':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during file upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('File has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('File exceeds size maximum');
|
||||
break;
|
||||
default: echo _('File invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" action="" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($iconMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Location')?></legend>
|
||||
<div id="map" class="map"></div>
|
||||
<input id="longitude" name="longitude" type="hidden" value="<?=$longitude?>" />
|
||||
<input id="latitude" name="latitude" type="hidden" value="<?=$latitude?>" />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Basic data')?></legend>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validation !== true && array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="stationtype"><?=('Stationtype')?>:</label>
|
||||
<select id="stationtype" name="stationtype">
|
||||
<?php foreach($stationtypes as &$stationtype) : ?>
|
||||
<option value="<?=$stationtype['url']?>" <?php if($stationtype['selected']) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($stationtype['classname']) {
|
||||
case null: echo _('Stationttype Empty');
|
||||
break;
|
||||
case 'singlechoice': echo _('Stationtype singlechoice');
|
||||
break;
|
||||
case 'multiplechoice': echo _('Stationtype multiplechoice');
|
||||
break;
|
||||
case 'keyword': echo _('Stationtype keyword');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<label for="prolog"><?=_('Prolog')?>:</label><br />
|
||||
<textarea id="prolog" name="prolog" placeholder="<?=_('Prolog')?>" style="width:100%; height:10em;"><?=$prolog?></textarea><br />
|
||||
<label for="task"><?=_('Task')?>:</label><br />
|
||||
<textarea id="task" name="task" placeholder="<?=_('Task')?>" style="width:100%; height:10em;"><?=$task?></textarea><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Correctly solved')?></legend>
|
||||
<input type="file" name="rightimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="file" name="rightav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="rightText"><?=('Right text')?>:</label><br />
|
||||
<textarea id="rightText" name="rightText" placeholder="<?=_('Right text')?>" style="width:100%; height:10em;"><?=$righttext?></textarea><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Incorreclty solved')?></legend>
|
||||
<input type="file" name="wrongimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="file" name="wrongav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="wrongText"><?=_('Wrong text')?>:</label><br />
|
||||
<textarea id="wrongText" name="wrongText" placeholder="<?=_('Wrong text')?>" style="width:100%; height:10em;"><?=$wrongtext?></textarea><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#prolog").markItUp(mySettings);
|
||||
$("#task").markItUp(mySettings);
|
||||
$("#rightText").markItUp(mySettings);
|
||||
$("#wrongText").markItUp(mySettings);
|
||||
});
|
||||
|
||||
var drawSource = new ol.source.Vector({
|
||||
wrapX: false
|
||||
});
|
||||
var drawLayer = new ol.layer.Vector({
|
||||
source: drawSource,
|
||||
style: new ol.style.Style({
|
||||
text: new ol.style.Text({
|
||||
//text: '\uf041',
|
||||
text: '\uf276',
|
||||
font: 'normal 28px FontAwesome',
|
||||
textBaseline: 'Bottom',
|
||||
fill: new ol.style.Fill({
|
||||
color: '#0F373C'
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
drawLayer
|
||||
],
|
||||
controls: ol.control.defaults(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
<?php if(!is_null($seminary['latitude']) && !is_null($seminary['longitude'])) : ?>
|
||||
center: ol.proj.transform([<?=$seminary['longitude']?>, <?=$seminary['latitude']?>], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 15,
|
||||
<?php else : ?>
|
||||
center: [0, 0],
|
||||
zoom: 0,
|
||||
<?php endif ?>
|
||||
maxZoom: 19
|
||||
})
|
||||
});
|
||||
var draw = new ol.interaction.Draw({
|
||||
source: drawSource,
|
||||
type: 'Point',
|
||||
maxPoints: 1,
|
||||
});
|
||||
map.addInteraction(draw);
|
||||
|
||||
// Wire events
|
||||
drawSource.on('addfeature', function(event) {
|
||||
var coordinates = event.feature.getGeometry().getCoordinates();
|
||||
coordinates = ol.proj.transform(coordinates, 'EPSG:3857', 'EPSG:4326');
|
||||
$('#longitude').val(coordinates[0]);
|
||||
$('#latitude').val(coordinates[1]);
|
||||
});
|
||||
draw.on('drawstart', function() {
|
||||
drawSource.clear();
|
||||
});
|
||||
</script>
|
||||
14
views/html/charactergroupsqueststations/delete.tpl
Normal file
14
views/html/charactergroupsqueststations/delete.tpl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Delete Station')?></h1>
|
||||
<?=sprintf(_('Should the Station “%s” really be deleted?'), $station['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
254
views/html/charactergroupsqueststations/edit.tpl
Normal file
254
views/html/charactergroupsqueststations/edit.tpl
Normal file
|
|
@ -0,0 +1,254 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit Station')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'icon':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during icon upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Icon has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Icon exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Icon invalid');
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
case 'rightimage':
|
||||
case 'rightav':
|
||||
case 'wrongimage':
|
||||
case 'wrongav':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during file upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('File has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('File exceeds size maximum');
|
||||
break;
|
||||
default: echo _('File invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" action="" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($iconMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Location')?></legend>
|
||||
<div id="map" class="map"></div>
|
||||
<input id="longitude" name="longitude" type="hidden" value="<?=$longitude?>" />
|
||||
<input id="latitude" name="latitude" type="hidden" value="<?=$latitude?>" />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Basic data')?></legend>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validation !== true && array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="stationtype"><?=('Stationtype')?>:</label>
|
||||
<select id="stationtype" name="stationtype">
|
||||
<?php foreach($stationtypes as &$stationtype) : ?>
|
||||
<option value="<?=$stationtype['url']?>" <?php if($stationtype['selected']) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($stationtype['classname']) {
|
||||
case null: echo _('Stationttype Empty');
|
||||
break;
|
||||
case 'singlechoice': echo _('Stationtype singlechoice');
|
||||
break;
|
||||
case 'multiplechoice': echo _('Stationtype multiplechoice');
|
||||
break;
|
||||
case 'keyword': echo _('Stationtype keyword');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<label for="prolog"><?=_('Prolog')?>:</label><br />
|
||||
<textarea id="prolog" name="prolog" placeholder="<?=_('Prolog')?>" style="width:100%; height:10em;"><?=$prolog?></textarea><br />
|
||||
<label for="task"><?=_('Task')?>:</label><br />
|
||||
<textarea id="task" name="task" placeholder="<?=_('Task')?>" style="width:100%; height:10em;"><?=$task?></textarea><br />
|
||||
<fieldset>
|
||||
<legend><?=_('Correctly solved')?></legend>
|
||||
<?php if(array_key_exists('rightimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<br />
|
||||
<input type="file" name="rightimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php if(array_key_exists('rightav', $station)) : ?>
|
||||
<?php if(strpos($station['rightav']['mimetype'], 'audio') !== false) : ?>
|
||||
<audio controls="controls" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url']))?>"></audio>
|
||||
<?php else : ?>
|
||||
<video controls="controls" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url']))?>"></video>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-film fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<input type="file" name="rightav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="rightText"><?=('Right text')?>:</label><br />
|
||||
<textarea id="rightText" name="rightText" placeholder="<?=_('Right text')?>" style="width:100%; height:10em;"><?=$righttext?></textarea><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Incorreclty solved')?></legend>
|
||||
<?php if(array_key_exists('wrongimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<br />
|
||||
<input type="file" name="wrongimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php if(array_key_exists('wrongav', $station)) : ?>
|
||||
<?php if(strpos($station['wrongav']['mimetype'], 'audio') !== false) : ?>
|
||||
<audio controls="controls" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url']))?>"></audio>
|
||||
<?php else : ?>
|
||||
<video controls="controls" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url']))?>"></video>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-film fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<input type="file" name="wrongav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="wrongText"><?=_('Wrong text')?>:</label><br />
|
||||
<textarea id="wrongText" name="wrongText" placeholder="<?=_('Wrong text')?>" style="width:100%; height:10em;"><?=$wrongtext?></textarea><br />
|
||||
</fieldset>
|
||||
<?php if(!is_null($stationtype['classname'])) : ?>
|
||||
<input type="submit" name="edit-task" value="<?=_('edit task')?>" />
|
||||
<?php endif ?>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#prolog").markItUp(mySettings);
|
||||
$("#task").markItUp(mySettings);
|
||||
$("#rightText").markItUp(mySettings);
|
||||
$("#wrongText").markItUp(mySettings);
|
||||
});
|
||||
|
||||
var drawSource = new ol.source.Vector({
|
||||
wrapX: false
|
||||
});
|
||||
var drawLayer = new ol.layer.Vector({
|
||||
source: drawSource,
|
||||
style: new ol.style.Style({
|
||||
text: new ol.style.Text({
|
||||
//text: '\uf041',
|
||||
text: '\uf276',
|
||||
font: 'normal 28px FontAwesome',
|
||||
textBaseline: 'Bottom',
|
||||
fill: new ol.style.Fill({
|
||||
color: '#0F373C'
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
drawLayer
|
||||
],
|
||||
controls: ol.control.defaults(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
<?php if(!is_null($latitude) && !is_null($longitude)) : ?>
|
||||
center: ol.proj.transform([<?=$longitude?>, <?=$latitude?>], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 17,
|
||||
<?php else : ?>
|
||||
center: [0, 0],
|
||||
zoom: 0,
|
||||
<?php endif ?>
|
||||
maxZoom: 19
|
||||
})
|
||||
});
|
||||
var draw = new ol.interaction.Draw({
|
||||
source: drawSource,
|
||||
type: 'Point',
|
||||
maxPoints: 1,
|
||||
});
|
||||
map.addInteraction(draw);
|
||||
|
||||
// Add existing point
|
||||
var longitude = $('#longitude').val();
|
||||
var latitude = $('#latitude').val();
|
||||
if(longitude && latitude) {
|
||||
drawSource.addFeature(
|
||||
new ol.Feature({
|
||||
geometry: new ol.geom.Point(
|
||||
ol.proj.transform([parseFloat(longitude), parseFloat(latitude)], 'EPSG:4326', 'EPSG:3857')
|
||||
)
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// Wire events
|
||||
drawSource.on('addfeature', function(event) {
|
||||
var coordinates = event.feature.getGeometry().getCoordinates();
|
||||
coordinates = ol.proj.transform(coordinates, 'EPSG:3857', 'EPSG:4326');
|
||||
$('#longitude').val(coordinates[0]);
|
||||
$('#latitude').val(coordinates[1]);
|
||||
});
|
||||
draw.on('drawstart', function() {
|
||||
drawSource.clear();
|
||||
});
|
||||
</script>
|
||||
12
views/html/charactergroupsqueststations/edittask.tpl
Normal file
12
views/html/charactergroupsqueststations/edittask.tpl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit Station task')?></h1>
|
||||
<?php if(!is_null($task)) : ?>
|
||||
<?=$task?>
|
||||
<?php endif ?>
|
||||
223
views/html/charactergroupsqueststations/station.tpl
Normal file
223
views/html/charactergroupsqueststations/station.tpl
Normal file
|
|
@ -0,0 +1,223 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="grpqsicon">
|
||||
<?php if($entered) : ?>
|
||||
<?php if($tried) : ?>
|
||||
<?php if($solved) : ?>
|
||||
<?php if($station['stationpicture_id']) : ?>
|
||||
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>" />
|
||||
<?php else : ?>
|
||||
<i class="fa fa-circle"></i>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-times-circle"></i>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<?php if(!is_null($stationgroup)) : ?>
|
||||
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),0,true,array('stationgroup'=>$stationgroup['id']))?>" />
|
||||
<?php else : ?>
|
||||
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),0,true)?>" />
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-question-circle"></i>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<h1><?=$station['title']?></h1>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),1)?>"><?=_('edit')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),1)?>"><?=_('delete')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<ul class="gdata cf">
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('qrcodes','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url'],'50'))?>">
|
||||
<i class="fa fa-qrcode"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<?php if(count($stationgroups) > 1) : ?>
|
||||
<form method="get">
|
||||
<select id="stationgroup" name="stationgroup" onchange="this.form.submit();">
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<option><?=sprintf(_('Select %s-Group'), $groupsgroup['name'])?></option>
|
||||
<?php endif ?>
|
||||
<?php foreach($stationgroups as &$group) : ?>
|
||||
<option value="<?=$group['id']?>" <?php if($group['id'] == $stationgroup['id']) : ?>selected="selected"<?php endif ?>><?=$group['name']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if($entered) : ?>
|
||||
<li>
|
||||
<?php if($tried) : ?>
|
||||
<?php if($solved) : ?>
|
||||
<i class="fa fa-check-circle fa-fw"></i>
|
||||
<?=$dateFormatter->format(new \DateTime($solved))?>
|
||||
<?=$timeFormatter->format(new \DateTime($solved))?>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-times-circle fa-fw"></i>
|
||||
<?=$dateFormatter->format(new \DateTime($tried))?>
|
||||
<?=$timeFormatter->format(new \DateTime($tried))?>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-globe fa-fw"></i>
|
||||
<?=$dateFormatter->format(new \DateTime($entered))?>
|
||||
<?=$timeFormatter->format(new \DateTime($entered))?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
|
||||
<?php if(!empty($station['longitude']) && !empty($station['latitude'])) : ?>
|
||||
<section>
|
||||
<div id="map" class="map"></div>
|
||||
<script type="text/javascript">
|
||||
var center = ol.proj.transform([<?=$station['longitude']?>, <?=$station['latitude']?>], 'EPSG:4326', 'EPSG:3857');
|
||||
|
||||
var markersSource = new ol.source.Vector();
|
||||
markersSource.addFeature(
|
||||
new ol.Feature({
|
||||
geometry: new ol.geom.Point(
|
||||
ol.proj.transform([<?=$station['longitude']?>, <?=$station['latitude']?>], 'EPSG:4326', 'EPSG:3857')
|
||||
),
|
||||
name: '<?=$station['title']?>'
|
||||
})
|
||||
);
|
||||
var markersStyle = new ol.style.Style({
|
||||
text: new ol.style.Text({
|
||||
//text: '\uf041',
|
||||
text: '\uf276',
|
||||
font: 'normal 28px FontAwesome',
|
||||
textBaseline: 'Bottom',
|
||||
fill: new ol.style.Fill({
|
||||
color: '#0F373C'
|
||||
})
|
||||
})
|
||||
});
|
||||
var markersLayer = new ol.layer.Vector({
|
||||
source: markersSource,
|
||||
style: markersStyle
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
markersLayer
|
||||
],
|
||||
controls: ol.control.defaults(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: center,
|
||||
zoom: 18,
|
||||
maxZoom: 19
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(!empty($groups)) : ?>
|
||||
<section>
|
||||
<h1><?=_('Character Groups')?></h1>
|
||||
<ol class="grpqlist">
|
||||
<?php foreach($groups as &$group) : ?>
|
||||
<li>
|
||||
<span class="date">
|
||||
<?=$dateFormatter->format(new \DateTime($group['created']))?>
|
||||
<?=$timeFormatter->format(new \DateTime($group['created']))?>
|
||||
</span>
|
||||
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
|
||||
<span class="xp">
|
||||
<?php if($group['tried']) : ?>
|
||||
<?php if($group['solved']) : ?>
|
||||
<?=sprintf(_('solved at %s'), $timeFormatter->format(new \DateTime($group['solved'])))?>
|
||||
<i class="fa fa-check-circle fa-fw"></i>
|
||||
<?php else : ?>
|
||||
<?=sprintf(_('failed at %s'), $timeFormatter->format(new \DateTime($group['solved'])))?>
|
||||
<i class="fa fa-times-circle fa-fw"></i>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-globe fa-fw"></i>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(!empty($station['prolog'])) : ?>
|
||||
<section>
|
||||
<div class="qtextbox">
|
||||
<p class="qtext cf">
|
||||
<?=str_replace('<p>', '', str_replace('</p>', '', $t->t($station['prolog'])))?>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<section class="task">
|
||||
<?php if(!is_null($task)) : ?>
|
||||
<h1 id="task"><?=_('Task')?></h1>
|
||||
|
||||
<?php if($solved) : ?>
|
||||
<div class="success">
|
||||
<p class="fwb"><i class="fa fa-check-circle fa-fw"></i><?=_('solved')?></p>
|
||||
<p><small><?=$t->t($station['righttext'])?></small></p>
|
||||
<?php if(array_key_exists('rightimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a><br />
|
||||
<?php endif ?>
|
||||
<?php if(array_key_exists('rightav', $station)) : ?>
|
||||
<?php if(strpos($station['rightav']['mimetype'], 'audio') !== false) : ?>
|
||||
<audio controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url']))?>"></audio>
|
||||
<?php else : ?>
|
||||
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url']))?>"></video>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php elseif($tried) : ?>
|
||||
<div class="error">
|
||||
<p class="fwb"><i class="fa fa-times-circle fa-fw"></i><?=_('unsolved')?></p>
|
||||
<p><small><?=$t->t($station['wrongtext'])?></small></p>
|
||||
<?php if(array_key_exists('wrongimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a><br />
|
||||
<?php endif ?>
|
||||
<?php if(array_key_exists('wrongav', $station)) : ?>
|
||||
<?php if(strpos($station['wrongav']['mimetype'], 'audio') !== false) : ?>
|
||||
<audio controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url']))?>"></audio>
|
||||
<?php else : ?>
|
||||
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url']))?>"></video>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<div>
|
||||
<?=$t->t($station['task'])?>
|
||||
<?=$task?>
|
||||
</div>
|
||||
<?php if($tried) : ?>
|
||||
<p><a class="cta orange" href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=_('Back to overview')?></a></p>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<p><a class="cta orange" href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=_('Back to overview')?></a></p>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
173
views/html/characters/character.tpl
Normal file
173
views/html/characters/character.tpl
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li>
|
||||
<i class="fa fa-chevron-right fa-fw"></i>
|
||||
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<a href="<?=$linker->link(array('index',$seminary['url']), 1)?>"><?=_('Characters')?></a>
|
||||
<?php else : ?>
|
||||
<?=_('Characters')?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php if(array_key_exists('title', $character)) : ?>
|
||||
<p class="ctitle"><?=$character['title']?></p>
|
||||
<?php endif ?>
|
||||
<h1><i class="fa fa-user fa-fw"></i><?=$character['name']?></h1>
|
||||
<nav class="admin">
|
||||
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0 || $character['id'] == \hhu\z\controllers\SeminaryController::$character['id']) : ?>
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$character['url']),1)?>"><?=_('Edit Character')?></a></li>
|
||||
<?php endif ?>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$character['url']),1)?>"><?=_('Delete Character')?></a></li>
|
||||
<?php endif ?>
|
||||
</nav>
|
||||
|
||||
<section class="cf">
|
||||
<div class="cinfo">
|
||||
<div class="cdata">
|
||||
<div class="xpbar">
|
||||
<span style="width:<?=($seminary['achievable_xps'] > 0) ? round($character['quest_xps']*100/$seminary['achievable_xps']) : 0?>%"></span>
|
||||
</div>
|
||||
<p><small><?=_('Total progress')?>: <?=($seminary['achievable_xps'] > 0) ? round($character['quest_xps']*100/$seminary['achievable_xps']) : 0?>%</small></p>
|
||||
</div>
|
||||
<?php if(array_key_exists('xplevel', $character) && !is_null($character['xplevel'])) : ?>
|
||||
<div class="cdata square">
|
||||
<p class="value"><?=$character['xplevel']['level']?></p>
|
||||
<p><small><?=_('Level')?></small></p>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<div class="cdata square">
|
||||
<p class="value"><?=$character['xps']?></p>
|
||||
<p><small>XP</small></p>
|
||||
</div>
|
||||
<div class="cdata square blue">
|
||||
<p class="value"><?=$character['rank']?>.</p>
|
||||
<p><small><?=_('Rank')?></small></p>
|
||||
</div>
|
||||
<h2><i class="fa fa-bookmark fa-fw"></i><?=_('Milestones')?></h2>
|
||||
<ul class="crewards">
|
||||
<?php foreach($milestones as &$milestone) : ?>
|
||||
<li>
|
||||
<?php if($milestone['achieved']) : ?>
|
||||
<p class="unlocked fwb"><i class="fa fa-check-circle fa-fw"></i><?=$milestone['title']?></p>
|
||||
<?php elseif($milestone['deadline'] < date('Y-m-d H:i:s')) : ?>
|
||||
<p class="passed fwb"><i class="fa fa-times-circle fa-fw"></i><?=$milestone['title']?></p>
|
||||
<?php else : ?>
|
||||
<p class="fwb"><i class="fa fa-lock fa-fw"></i><?=$milestone['title']?></p>
|
||||
<?php endif ?>
|
||||
<p><?=\hhu\z\Utils::t($milestone['description'])?></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if(array_key_exists('xplevel', $character) && !is_null($character['xplevel'])) : ?>
|
||||
<div class="cportrait">
|
||||
<?php if(array_key_exists('avatar', $character) && !is_null($character['avatar']['avatarpicture_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$character['charactertype_url'],$character['xplevel']['level']))?>" />
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
|
||||
<div class="cf">
|
||||
<section class="fll48">
|
||||
<h2><i class="fa fa-list fa-fw"></i><?=_('Ranking')?></h2>
|
||||
<ul class="cranks">
|
||||
<?php foreach($ranking['superior'] as $index => &$rankCharacter) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link($rankCharacter['url'],3)?>"><img src="<?=$linker->link(array('media','avatar',$seminary['url'],$rankCharacter['charactertype_url'],$rankCharacter['xplevel'],'portrait'))?>"></a>
|
||||
<p>
|
||||
<?=$character['rank']-count($ranking['superior'])+$index?>.
|
||||
<?php if(array_key_exists('title', $rankCharacter)) : ?>
|
||||
<span class="ctitle"><?=$rankCharacter['title']?></span>
|
||||
<?php endif ?>
|
||||
<a href="<?=$linker->link($rankCharacter['url'],3)?>"><?=$rankCharacter['name']?></a>
|
||||
</p>
|
||||
<p><small>
|
||||
<?php if(array_key_exists('xplevel', $rankCharacter) && !is_null($rankCharacter['xplevel'])) : ?>
|
||||
<?=_('Level')?> <?=$rankCharacter['xplevel']?> (<?=sprintf(_('%d XPs'), $rankCharacter['xps'])?>)
|
||||
<?php else : ?>
|
||||
<?=sprintf(_('%d XPs'), $rankCharacter['xps'])?>
|
||||
<?php endif ?>
|
||||
</small></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
<li>
|
||||
<?php if(array_key_exists('avatar', $character) && !is_null($character['avatar']['avatarpicture_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$character['charactertype_url'],$character['xplevel']['level'],'portrait'))?>">
|
||||
<?php endif ?>
|
||||
<p class="fwb">
|
||||
<?=$character['rank']?>.
|
||||
<?php if(array_key_exists('title', $character)) : ?>
|
||||
<span class="ctitle"><?=$character['title']?></span>
|
||||
<?php endif ?>
|
||||
<?=$character['name']?>
|
||||
</p>
|
||||
<p><small>
|
||||
<?php if(array_key_exists('xplevel', $character) && !is_null($character['xplevel'])) : ?>
|
||||
<?=_('Level')?> <?=$character['xplevel']['level']?> (<?=sprintf(_('%d XPs'), $character['xps'])?>)
|
||||
<?php else : ?>
|
||||
<?=sprintf(_('%d XPs'), $character['xps'])?>
|
||||
<?php endif ?>
|
||||
</small></p>
|
||||
</li>
|
||||
<?php foreach($ranking['inferior'] as $index => &$rankCharacter) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link($rankCharacter['url'],3)?>"><img src="<?=$linker->link(array('media','avatar',$seminary['url'],$rankCharacter['charactertype_url'],$rankCharacter['xplevel'],'portrait'))?>"></a>
|
||||
<p>
|
||||
<?=$character['rank']+$index+1?>.
|
||||
<?php if(array_key_exists('title', $rankCharacter)) : ?>
|
||||
<span class="ctitle"><?=$rankCharacter['title']?></span>
|
||||
<?php endif ?>
|
||||
<a href="<?=$linker->link($rankCharacter['url'],3)?>"><?=$rankCharacter['name']?></a>
|
||||
</p>
|
||||
<p><small>
|
||||
<?php if(array_key_exists('xplevel', $rankCharacter) && !is_null($rankCharacter['xplevel'])) : ?>
|
||||
<?=_('Level')?> <?=$rankCharacter['xplevel']?> (<?=sprintf(_('%d XPs'), $rankCharacter['xps'])?>)
|
||||
<?php else : ?>
|
||||
<?=sprintf(_('%d XPs'), $rankCharacter['xps'])?>
|
||||
<?php endif ?>
|
||||
</small></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="flr48">
|
||||
<h2><i class="fa fa-users fa-fw"></i><?=_('Character Groups')?></h2>
|
||||
<ul class="cranks">
|
||||
<?php foreach($groups as &$group) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$group['charactergroupsgroup_url'],$group['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','charactergroup',$seminary['url'],$group['groupsgroup']['url'],$group['url']))?>" class="gbanner">
|
||||
</a>
|
||||
<p><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$group['charactergroupsgroup_url'],$group['url']))?>"><?=$group['name']?></a></p>
|
||||
<p><small><?=sprintf(_('%d XPs'), $group['xps'])?></small></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<?php if(!is_null($lastQuest)) : ?>
|
||||
<section>
|
||||
<h2><i class="fa fa-share-square fa-fw"></i><?=_('Last Quest')?></h2>
|
||||
<p><i class="fa fa-pencil-square-o fa-fw"></i><a href="<?=$linker->link(array('quests','quest',$seminary['url'],$lastQuest['questgroup']['url'],$lastQuest['url']))?>"><?=$lastQuest['title']?></a></p>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<section>
|
||||
<h2><i class="fa fa-book fa-fw"></i><?=_('Topic progress')?></h2>
|
||||
<ul class="ctopics cf">
|
||||
<?php foreach($questtopics as &$topic) : ?>
|
||||
<li>
|
||||
<p><small><a href="<?=$linker->link(array('library','topic',$seminary['url'],$topic['url']))?>"><?=$topic['title']?></a> (<?=$topic['characterQuestcount']?>/<?=$topic['questcount']?>)</small></p>
|
||||
<div class="xpbar">
|
||||
<span style="width:<?=round($topic['characterQuestcount']/$topic['questcount']*100)?>%"></span>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
15
views/html/characters/delete.tpl
Normal file
15
views/html/characters/delete.tpl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li>
|
||||
<i class="fa fa-chevron-right fa-fw"></i>
|
||||
<a href="<?=$linker->link(array('characters','index',$seminary['url']))?>"><?=_('Characters')?></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Delete Character')?></h1>
|
||||
<?=sprintf(_('Should the Character “%s” of user “%s” (%s) really be deleted?'), $character['name'], $user['username'], $user['email'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
132
views/html/characters/edit.tpl
Normal file
132
views/html/characters/edit.tpl
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li>
|
||||
<i class="fa fa-chevron-right fa-fw"></i>
|
||||
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<a href="<?=$linker->link(array('index',$seminary['url']), 1)?>"><?=_('Characters')?></a>
|
||||
<?php else : ?>
|
||||
<?=_('Characters')?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit Character')?></h1>
|
||||
<form method="post" action="" class="logreg">
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'charactername':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Character name is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Character name is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Character name contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Character name already exists');
|
||||
break;
|
||||
default: echo _('Character name invalid');
|
||||
}
|
||||
break;
|
||||
case 'gender':
|
||||
switch($setting) {
|
||||
case 'correct': echo _('Please select a gender');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<fieldset>
|
||||
<legend class="fwb"><?=_('Character properties')?></legend>
|
||||
<label for="charactername"><?=_('Character name')?>:</label>
|
||||
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<input type="text" name="charactername" placeholder="<?=_('Character name')?>" required="required" value="<?=$charactername?>" maxlength="<?=$validationSettings['charactername']['maxlength']?>" <?=(array_key_exists('charactername', $validation)) ? 'class="invalid"' : null ?>/>
|
||||
<?php else : ?>
|
||||
<input type="text" name="charactername" placeholder="<?=_('Character name')?>" disabled="disabled" value="<?=$charactername?>" />
|
||||
<input type="hidden" name="charactername" value="<?=$charactername?>" />
|
||||
<?php endif ?><br />
|
||||
<ul class="avatar">
|
||||
<?php foreach($types as &$type) : ?>
|
||||
<li>
|
||||
<label for="type-<?=$type['id']?>">
|
||||
<p><?=$type['name']?></p>
|
||||
<img id="avatar" src="<?=$linker->link(array('media','avatar',$seminary['url'],$type['url'],$xplevels[0]['level'],'portrait'))?>" />
|
||||
</label>
|
||||
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<input id="type-<?=$type['id']?>" name="type" type="radio" value="<?=$type['url']?>" <?php if(array_key_exists('selected', $type) && $type['selected']) : ?>checked="checked"<?php endif ?> />
|
||||
<?php else : ?>
|
||||
<input id="type-<?=$type['id']?>" name="type" type="radio" disabled="disabled" value="<?=$type['url']?>" <?php if(array_key_exists('selected', $type) && $type['selected']) : ?>checked="checked"<?php endif ?> />
|
||||
<?php if(array_key_exists('selected', $type) && $type['selected']) : ?>
|
||||
<input name="type" type="hidden" value="<?=$type['url']?>" />
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="gender"><?=_('Gender')?>:</label>
|
||||
<select id="gender" name="gender">
|
||||
<option value=""><?=_('Select gender')?></option>
|
||||
<option value="0" <?php if($gender === 0) : ?>selected="selected"<?php endif ?>><?=_('Female')?></option>
|
||||
<option value="1" <?php if($gender === 1) : ?>selected="selected"<?php endif ?>><?=_('Male')?></option>
|
||||
</select>
|
||||
</fieldset>
|
||||
|
||||
<?php if(count($titles) > 0) : ?>
|
||||
<fieldset>
|
||||
<legend><?=_('Display settings')?></legend>
|
||||
<?php if(count($titles) > 0) : ?>
|
||||
<label><?=_('Charactertitle')?></label>
|
||||
<select id="title" name="title">
|
||||
<option value="" <?php if(is_null($charactertitle)) : ?>selected="selected"<?php endif ?>><?=_('no title')?></option>
|
||||
<?php foreach($titles as &$title) : ?>
|
||||
<option value="<?=$title['id']?>" <?php if(!is_null($charactertitle) && $title['id'] == $charactertitle['id']) : ?>selected="selected"<?php endif ?>><?=($gender) ? $title['title_male'] : $title['title_female']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<?php endif ?>
|
||||
</fieldset>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if($fieldsValidation !== true) : ?>
|
||||
<ul>
|
||||
<?php foreach($fieldsValidation as $field => &$settings) : ?>
|
||||
<li><?=sprintf(_('The Seminary field “%s” is invalid'), $field)?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<fieldset>
|
||||
<legend class="fwb"><?=_('Seminary fields')?></legend>
|
||||
<?php foreach($fields as &$field) : ?>
|
||||
<label for="fields[<?=$field['url']?>]"><?=$field['title']?>:</label>
|
||||
<?php switch($field['type_title']) {
|
||||
case 'Number':
|
||||
case 'Varchar': ?>
|
||||
<input type="text" name="fields[<?=$field['url']?>]" pattern="<?=(!empty($field['regex'])) ? substr($field['regex'],1,strrpos($field['regex'],$field['regex'][0])-1) : ''?>" <?php if(array_key_exists('uservalue', $field)) : ?>value="<?=$field['uservalue']?>"<?php endif ?> <?php if($field['required']) : ?>required="required"<?php endif ?>/>
|
||||
<?php break;
|
||||
case 'Text': ?>
|
||||
<textarea name="fields[<?=$field['url']?>]"><?=(array_key_exists('uservalue', $field) ? $field['uservalue'] : null)?></textarea>
|
||||
<?php break;
|
||||
case 'List': ?>
|
||||
<select name="fields[<?=$field['url']?>]">
|
||||
<?php foreach(explode('|', substr($field['regex'],1,strrpos($field['regex'],$field['regex'][0])-1)) as $option) : ?>
|
||||
<option value="<?=mb_eregi_replace('\\\\','',$option)?>" <?php if(array_key_exists('uservalue', $field) && $field['uservalue'] == mb_eregi_replace('\\\\','',$option)) : ?>selected="selected"<?php endif ?>><?=mb_eregi_replace('\\\\','',$option)?></option>
|
||||
<?php endforeach?>
|
||||
</select>
|
||||
<?php break;
|
||||
} ?>
|
||||
<br />
|
||||
<?php endforeach ?>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('edit')?>" />
|
||||
</form>
|
||||
114
views/html/characters/index.tpl
Normal file
114
views/html/characters/index.tpl
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
<h1><?=_('Characters')?></h1>
|
||||
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('xplevels','manage',$seminary['url']))?>"><?=_('Manage XP-levels')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('charactertypes','index',$seminary['url']))?>"><?=_('Manage Charactertypes')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('charactertitles','index',$seminary['url']))?>"><?=_('Manage Charactertitles')?></a></li>
|
||||
</nav>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('manage',$seminary['url']),1)?>"><?=_('Manage Characters')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<form method="get" class="logreg admnqf">
|
||||
<fieldset>
|
||||
<legend><?=_('Filters')?></legend>
|
||||
<small><?=_('Sortorder')?>:</small>
|
||||
<select name="sortorder" onchange="this.form.submit();">
|
||||
<option value="name" <?php if($sortorder == 'name') : ?>selected="selected"<?php endif ?>><?=_('Character name')?></option>
|
||||
<option value="xps" <?php if($sortorder == 'xps') : ?>selected="selected"<?php endif ?>><?=_('XPs')?></option>
|
||||
<option value="role" <?php if($sortorder == 'role') : ?>selected="selected"<?php endif ?>><?=_('Role')?></option>
|
||||
<option value="created" <?php if($sortorder == 'created') : ?>selected="selected"<?php endif ?>><?=_('Date of registration')?></option>
|
||||
<?php foreach($characterfields as &$characterfield) : ?>
|
||||
<option value="<?=$characterfield['url']?>" <?php if($sortorder == $characterfield['url']) : ?>selected="selected"<?php endif ?>><?=$characterfield['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<label for="charactername"><?=_('Character name')?>:</label>
|
||||
<input id="charactername" type="text" name="charactername" placeholder="<?=_('Character name')?>" value="<?=$charactername?>" />
|
||||
</fieldset>
|
||||
<input type="submit" value="<?=_('Apply filters')?>" />
|
||||
</form>
|
||||
|
||||
<ul id="characterlist" class="admnql">
|
||||
<?php foreach($characters as &$character) : ?>
|
||||
<li class="cf">
|
||||
<?php if(array_key_exists('avatar', $character) && !is_null($character['avatar']['small_avatarpicture_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$character['charactertype_url'],$character['xplevel']['level'],'portrait'))?>">
|
||||
<?php endif ?>
|
||||
<p><a href="<?=$linker->link(array('characters','character',$seminary['url'],$character['url']))?>"><?=$character['name']?></a><span><?=$character['xps']?> XP</span></p>
|
||||
<p><small><a href="<?=$linker->link(array('users','user',$character['user']['url']))?>"><?=$character['user']['username']?></a></small>
|
||||
<?php if(in_array('admin', $character['characterroles'])) : ?><small>(<?=_('Admin')?>)</small><?php endif ?>
|
||||
<?php if(in_array('moderator', $character['characterroles'])) : ?><small>(<?=_('Moderator')?>)</small><?php endif ?>
|
||||
<?php if(in_array('user', $character['characterroles'])) : ?><small>(<?=_('User')?>)</small><?php endif ?>
|
||||
</p>
|
||||
<?php foreach($character['characterfields'] as &$characterfield) : ?>
|
||||
<p class="chrflds"><?=$characterfield['value']?></p>
|
||||
<?php endforeach ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
<?php if(is_null($all) && ($page*$limit) < $charactersCount) : ?>
|
||||
<nav class="admin">
|
||||
<li><a id="show-more" href="<?=$linker->link(null,3,true,array('page'=>$page+1,'sortorder'=>$sortorder))?>"><?=_('Show more')?></a></li>
|
||||
<li><a id="show-all" href="<?=$linker->link('all',3,true,array('sortorder'=>$sortorder))?>"><?=_('Show all')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<script>
|
||||
var page = 1;
|
||||
var request;
|
||||
var linkAvatar = "<?=$linker->link(array('media','avatar','SEMINARY','CHARACTERTYPE','XPLEVEL','portrait'))?>";
|
||||
var linkCharacter = "<?=$linker->link(array('character','SEMINARY','CHARACTER'),1)?>";
|
||||
var linkUser = "<?=$linker->link(array('users','user','USER'))?>";
|
||||
var linkPage = "<?=$linker->link(null,3,true,array('page'=>'PAGE','sortorder'=>$sortorder))?>";
|
||||
|
||||
$("#show-more").click(function(event) {
|
||||
if(request) {
|
||||
request.abort();
|
||||
}
|
||||
|
||||
page++;
|
||||
request = $.getJSON(linkPage.replace('PAGE', page), function(data) {
|
||||
linkAvatar = linkAvatar.replace('SEMINARY', data['seminary']['url']);
|
||||
linkCharacter = linkCharacter.replace('SEMINARY', data['seminary']['url']);
|
||||
$.each(data['characters'], function(key, character) {
|
||||
var urlAvatar = linkAvatar.replace('CHARACTERTYPE', character['charactertype_url']).replace('XPLEVEL', character['xplevel']['level']);
|
||||
var urlCharacter = linkCharacter.replace('CHARACTER', character['url']);
|
||||
var urlUser = linkUser.replace('USER', character['user']['url']);
|
||||
$("#characterlist").append(
|
||||
"<li class=\"cf\">" +
|
||||
"<img src=\"" + urlAvatar + "\" />" +
|
||||
"<p><a href=\"" + urlCharacter + "\">" + character['name'] + "</a><span>" + character['xps'] + " <?=_('XPs')?></span></p>" +
|
||||
"<p>" +
|
||||
"<small><a href=\"" + urlUser + "\">" + character['user']['username'] + "</a></small>\n" +
|
||||
(character['characterroles'].length > 0 ? "<small>(" + character['characterroles'].join(', ') + ")</small>" : '') +
|
||||
"</p>" +
|
||||
"<p class=\"chrflds\">" + $.map(character['characterfields'], function(val, i) {
|
||||
return val['value'];
|
||||
}).join('</p>\n<p class="chrflds">') + "</p>" +
|
||||
"</li>"
|
||||
);
|
||||
});
|
||||
if(data['more']) {
|
||||
$("#show-more").attr('href', linkPage.replace('PAGE', page+1));
|
||||
}
|
||||
else {
|
||||
$("#show-more").remove();
|
||||
$("#show-all").remove();
|
||||
}
|
||||
});
|
||||
request.fail(function (jqXHR, textStatus, errorThrown) {
|
||||
window.location.href = linkPage.replace('PAGE', page);
|
||||
});
|
||||
|
||||
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
61
views/html/characters/manage.tpl
Normal file
61
views/html/characters/manage.tpl
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('characters','index',$seminary['url']))?>"><?=_('Characters')?></a></li>
|
||||
</ul>
|
||||
<h1><?=_('Manage Characters')?></h1>
|
||||
|
||||
<form method="post">
|
||||
<fieldset class="filter">
|
||||
<p><small>Sortierung:</small></p>
|
||||
<select name="sortorder" onchange="this.form.submit();">
|
||||
<option value="name" <?php if($sortorder == 'charactername') : ?>selected="selected"<?php endif ?>><?=_('Character name')?></option>
|
||||
<option value="xps" <?php if($sortorder == 'xps') : ?>selected="selected"<?php endif ?>><?=_('XPs')?></option>
|
||||
<option value="role" <?php if($sortorder == 'role') : ?>selected="selected"<?php endif ?>><?=_('Role')?></option>
|
||||
<option value="created" <?php if($sortorder == 'date') : ?>selected="selected"<?php endif ?>><?=_('Date of registration')?></option>
|
||||
<?php foreach($characterfields as &$characterfield) : ?>
|
||||
<option value="<?=$characterfield['url']?>" <?php if($sortorder == $characterfield['url']) : ?>selected="selected"<?php endif ?>><?=$characterfield['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<noscript><input type="submit" value="<?=_('Sort list')?>" /></noscript>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<ul class="admnql">
|
||||
<?php foreach($characters as &$character) : ?>
|
||||
<li class="cf">
|
||||
<input type="checkbox" id="characters-<?=$character['id']?>" name="characters[]" value="<?=$character['id']?>" <?php if(in_array($character['id'], $selectedCharacters)) : ?>checked="checked"<?php endif ?> <?php if($character['id'] == \hhu\z\controllers\SeminaryController::$character['id']) : ?>disabled="disabled"<?php endif ?>/>
|
||||
<label for="characters-<?=$character['id']?>">
|
||||
<?php if(array_key_exists('avatar', $character) && !is_null($character['avatar']['small_avatarpicture_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$character['charactertype_url'],$character['xplevel']['level'],'portrait'))?>">
|
||||
<?php endif ?>
|
||||
<p><a href="<?=$linker->link(array('characters','character',$seminary['url'],$character['url']))?>"><?=$character['name']?></a><span><?=$character['xps']?> XP</span></p>
|
||||
<p><small><a href="<?=$linker->link(array('users','user',$character['user']['url']))?>"><?=$character['user']['username']?></a></small>
|
||||
<?php if(in_array('admin', $character['characterroles'])) : ?><small>(<?=_('Admin')?>)</small><?php endif ?>
|
||||
<?php if(in_array('moderator', $character['characterroles'])) : ?><small>(<?=_('Moderator')?>)</small><?php endif ?>
|
||||
<?php if(in_array('user', $character['characterroles'])) : ?><small>(<?=_('User')?>)</small><?php endif ?>
|
||||
</p>
|
||||
<?php foreach($character['characterfields'] as &$characterfield) : ?>
|
||||
<p class="chrflds"><?=$characterfield['value']?></p>
|
||||
<?php endforeach ?>
|
||||
</label>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Add role')?></legend>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) > 0 || !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
|
||||
<input type="submit" name="actions[addrole]" value="<?=_('Admin')?>" />
|
||||
<input type="submit" name="actions[addrole]" value="<?=_('Moderator')?>" />
|
||||
<?php endif ?>
|
||||
<input type="submit" name="actions[addrole]" value="<?=_('User')?>" />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Remove role')?></legend>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) > 0 || !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
|
||||
<input type="submit" name="actions[removerole]" value="<?=_('Admin')?>" />
|
||||
<input type="submit" name="actions[removerole]" value="<?=_('Moderator')?>" />
|
||||
<?php endif ?>
|
||||
<input type="submit" name="actions[removerole]" value="<?=_('User')?>" />
|
||||
</fieldset>
|
||||
</form>
|
||||
105
views/html/characters/register.tpl
Normal file
105
views/html/characters/register.tpl
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><?=$seminary['title']?></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><?=_('Characters')?></li>
|
||||
</ul>
|
||||
<h1><?=_('Create Character')?></h1>
|
||||
<form method="post" action="" class="logreg">
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'charactername':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Character name is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Character name is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Character name contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Character name already exists');
|
||||
break;
|
||||
default: echo _('Character name invalid');
|
||||
}
|
||||
break;
|
||||
case 'type':
|
||||
switch($setting) {
|
||||
case 'exist': echo _('Please choose an avatar');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'gender':
|
||||
switch($setting) {
|
||||
case 'correct': echo _('Please select a gender');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<fieldset>
|
||||
<legend class="fwb"><?=_('Character properties')?></legend>
|
||||
<label for="charactername"><?=_('Character name')?>:</label>
|
||||
<input type="text" name="charactername" placeholder="<?=_('Character name')?>" required="required" value="<?=$charactername?>" /><br />
|
||||
<ul class="avatar">
|
||||
<?php foreach($types as &$type) : ?>
|
||||
<li>
|
||||
<label for="type-<?=$type['id']?>">
|
||||
<p><?=$type['name']?></p>
|
||||
<?php if(array_key_exists('avatar', $type) && !is_null($type['avatar']['small_avatarpicture_id'])) : ?>
|
||||
<img id="avatar" src="<?=$linker->link(array('media','avatar',$seminary['url'],$type['url'],$xplevels[0]['level'],'portrait'))?>" />
|
||||
<?php endif ?>
|
||||
</label>
|
||||
<input id="type-<?=$type['id']?>" name="type" type="radio" value="<?=$type['url']?>" <?php if(array_key_exists('selected', $type) && $type['selected']) : ?>checked="checked"<?php endif ?> />
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="gender"><?=_('Gender')?>:</label>
|
||||
<select id="gender" name="gender">
|
||||
<option value=""><?=_('Select gender')?></option>
|
||||
<option value="0"><?=_('Female')?></option>
|
||||
<option value="1"><?=_('Male')?></option>
|
||||
</select>
|
||||
</fieldset>
|
||||
|
||||
<?php if($fieldsValidation !== true) : ?>
|
||||
<ul>
|
||||
<?php foreach($fieldsValidation as $field => &$settings) : ?>
|
||||
<li><?=sprintf(_('The Seminary field “%s” is invalid'), $field)?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<fieldset>
|
||||
<legend class="fwb"><?=_('Seminary fields')?></legend>
|
||||
<?php foreach($fields as &$field) : ?>
|
||||
<label for="fields[<?=$field['url']?>]"><?=$field['title']?>:</label>
|
||||
<?php switch($field['type_title']) {
|
||||
case 'Number':
|
||||
case 'Varchar': ?>
|
||||
<input type="text" name="fields[<?=$field['url']?>]" pattern="<?=(!empty($field['regex'])) ? substr($field['regex'],1,strrpos($field['regex'],$field['regex'][0])-1) : ''?>" <?php if(array_key_exists('uservalue', $field)) : ?>value="<?=$field['uservalue']?>"<?php endif ?> <?php if($field['required']) : ?>required="required"<?php endif ?>/>
|
||||
<?php break;
|
||||
case 'Text': ?>
|
||||
<textarea name="fields[<?=$field['url']?>]"><?=(array_key_exists('uservalue', $field) ? $field['uservalue'] : null)?></textarea>
|
||||
<?php break;
|
||||
case 'List': ?>
|
||||
<select name="fields[<?=$field['url']?>]">
|
||||
<?php foreach(explode('|', substr($field['regex'],1,strrpos($field['regex'],$field['regex'][0])-1)) as $option) : ?>
|
||||
<option value="<?=mb_eregi_replace('\\\\','',$option)?>" <?php if(array_key_exists('uservalue', $field) && $field['uservalue'] == mb_eregi_replace('\\\\','',$option)) : ?>selected="selected"<?php endif ?>><?=mb_eregi_replace('\\\\','',$option)?></option>
|
||||
<?php endforeach?>
|
||||
</select>
|
||||
<?php break;
|
||||
} ?>
|
||||
<br />
|
||||
<?php endforeach ?>
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
55
views/html/charactertitles/create.tpl
Normal file
55
views/html/charactertitles/create.tpl
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Charactertitles')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Create new Charactertitle')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'title_male':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Male title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Male title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'exist': echo _('Male title already exists');
|
||||
break;
|
||||
default: echo _('Male title invalid');
|
||||
}
|
||||
break;
|
||||
case 'title_female':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Female title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Female title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'exist': echo _('Female title already exists');
|
||||
break;
|
||||
default: echo _('Female title invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<label for="title_male"><?=_('Male title')?>:</label>
|
||||
<input id="title_male" type="text" name="title_male" placeholder="<?=_('Male title')?>" title="<?=_('Male title')?>" required="required" maxlength="<?=$validationSettings['title_male']['maxlength']?>" value="<?=$titleMale?>" <?=($validation !== true && array_key_exists('title_male', $validation)) ? 'class="invalid"' : null?> />
|
||||
<br />
|
||||
<label for="title_female"><?=_('Female title')?>:</label>
|
||||
<input id="title_female" type="text" name="title_female" placeholder="<?=_('Female title')?>" title="<?=_('Female title')?>" required="required" maxlength="<?=$validationSettings['title_female']['maxlength']?>" value="<?=$titleFemale?>" <?=($validation !== true && array_key_exists('title_female', $validation)) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
12
views/html/charactertitles/delete.tpl
Normal file
12
views/html/charactertitles/delete.tpl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Charactertitles')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Delete Charactertitle')?></h1>
|
||||
<?=sprintf(_('Should the Charactertitle “%s/%s” really be deleted?'), $title['title_male'], $title['title_female'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
55
views/html/charactertitles/edit.tpl
Normal file
55
views/html/charactertitles/edit.tpl
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Charactertypes')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit Charactertype')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'title_male':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Male title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Male title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'exist': echo _('Male title already exists');
|
||||
break;
|
||||
default: echo _('Male title invalid');
|
||||
}
|
||||
break;
|
||||
case 'title_female':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Female title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Female title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'exist': echo _('Female title already exists');
|
||||
break;
|
||||
default: echo _('Female title invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<label for="title_male"><?=_('Male title')?>:</label>
|
||||
<input id="title_male" type="text" name="title_male" placeholder="<?=_('Male title')?>" title="<?=_('Male title')?>" required="required" maxlength="<?=$validationSettings['title_male']['maxlength']?>" value="<?=$titleMale?>" <?=($validation !== true && array_key_exists('title_male', $validation)) ? 'class="invalid"' : null?> />
|
||||
<br />
|
||||
<label for="title_female"><?=_('Female title')?>:</label>
|
||||
<input id="title_female" type="text" name="title_female" placeholder="<?=_('Female title')?>" title="<?=_('Female title')?>" required="required" maxlength="<?=$validationSettings['title_female']['maxlength']?>" value="<?=$titleFemale?>" <?=($validation !== true && array_key_exists('title_female', $validation)) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
27
views/html/charactertitles/index.tpl
Normal file
27
views/html/charactertitles/index.tpl
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Charactertitles')?></h1>
|
||||
<?php if($seminary['created_user_id'] == \hhu\z\controllers\IntermediateController::$user['id'] || (!is_null(\hhu\z\controllers\SeminaryController::$character) && in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles']))) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('create',$seminary['url']),1)?>"><?=_('Create new Charactertitle')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<ul>
|
||||
<?php foreach($titles as &$title) : ?>
|
||||
<li>
|
||||
<p><?=$title['title_male']?>/<?=$title['title_female']?></p>
|
||||
<ul class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$title['hash']),1)?>"><?=_('edit')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$title['hash']),1)?>"><?=_('delete')?></a></li>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('qrcodes','charactertitle',$seminary['url'],$title['hash'],'50'))?>">
|
||||
<i class="fa fa-qrcode"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
41
views/html/charactertypes/create.tpl
Normal file
41
views/html/charactertypes/create.tpl
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Charactertypes')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Create new Charactertype')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'charactertypename':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Name is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Name is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'exist': echo _('Name already exists');
|
||||
break;
|
||||
default: echo _('Name invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<label for="name"><?=_('Name')?>:</label>
|
||||
<input id="name" type="text" name="charactertypename" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactertypename']['maxlength']?>" value="<?=$name?>" <?=($validation !== true && array_key_exists('name', $validation)) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
12
views/html/charactertypes/delete.tpl
Normal file
12
views/html/charactertypes/delete.tpl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Charactertypes')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Delete Charactertype')?></h1>
|
||||
<?=sprintf(_('Should the Characterytpe “%s” really be deleted?'), $charactertype['name'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
139
views/html/charactertypes/edit.tpl
Normal file
139
views/html/charactertypes/edit.tpl
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Charactertypes')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit Charactertype')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'charactertypename':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Name is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Name is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'exist': echo _('Name already exists');
|
||||
break;
|
||||
default: echo _('Name invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<label for="name"><?=_('Name')?>:</label>
|
||||
<input id="name" type="text" name="charactertypename" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactertypename']['maxlength']?>" value="<?=$name?>" <?=($validation !== true && array_key_exists('name', $validation)) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Avatars')?></legend>
|
||||
<table class="avatars">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Level</th>
|
||||
<th>Portrait</th>
|
||||
<th>Avatar</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($xplevels as &$xplevel) : ?>
|
||||
<?php if($avatarsValidation !== true && array_key_exists($xplevel['id'], $avatarsValidation)) : ?>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<?php if(array_key_exists('portrait', $avatarsValidation[$xplevel['id']])) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($avatarsValidation[$xplevel['id']]['portrait'] as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'avatar':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during avatar portrait upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Avatar portrait has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Avatar portrait exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Avatar portrait invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<?php if(array_key_exists('avatar', $avatarsValidation[$xplevel['id']])) : ?>
|
||||
<?php foreach($avatarsValidation[$xplevel['id']]['avatar'] as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'avatar':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during avatar upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Avatar has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Avatar exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Avatar invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
<tr>
|
||||
<!--<th><?=_('Level')?> <?=$xplevel['level']?>:</th>-->
|
||||
<th><?=$xplevel['level']?></th>
|
||||
<td>
|
||||
<!--<label for="avatar-<?=$xplevel['id']?>-portrait"><?=_('Protrait')?>:</label><br />-->
|
||||
<?php if(array_key_exists('avatar', $xplevel) && !is_null($xplevel['avatar']['small_avatarpicture_id'])) : ?>
|
||||
<img id="avatar" src="<?=$linker->link(array('media','avatar',$seminary['url'],$charactertype['url'],$xplevel['level'],'portrait'))?>" />
|
||||
<?php endif ?>
|
||||
<input id="avatar-<?=$xplevel['id']?>-portrait" type="file" name="avatars[<?=$xplevel['id']?>][portrait]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
|
||||
</td>
|
||||
<td>
|
||||
<!--<label for="avatar-<?=$xplevel['id']?>-avatar"><?=_('Avatar')?>:</label><br />-->
|
||||
<?php if(array_key_exists('avatar', $xplevel) && !is_null($xplevel['avatar']['avatarpicture_id'])) : ?>
|
||||
<img id="avatar" src="<?=$linker->link(array('media','avatar',$seminary['url'],$charactertype['url'],$xplevel['level']))?>" />
|
||||
<?php endif ?>
|
||||
<input id="avatar-<?=$xplevel['id']?>-avatar" type="file" name="avatars[<?=$xplevel['id']?>][avatar]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
25
views/html/charactertypes/index.tpl
Normal file
25
views/html/charactertypes/index.tpl
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Charactertypes')?></h1>
|
||||
<?php if($seminary['created_user_id'] == \hhu\z\controllers\IntermediateController::$user['id'] || (!is_null(\hhu\z\controllers\SeminaryController::$character) && in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles']))) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('create',$seminary['url']),1)?>"><?=_('Create new Character type')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<ul class="avatar">
|
||||
<?php foreach($charactertypes as &$type) : ?>
|
||||
<li>
|
||||
<p><?=$type['name']?></p>
|
||||
<?php if(array_key_exists('avatar', $type) && !is_null($type['avatar']['small_avatarpicture_id'])) : ?>
|
||||
<img id="avatar" src="<?=$linker->link(array('media','avatar',$seminary['url'],$type['url'],$xplevels[0]['level'],'portrait'))?>" />
|
||||
<?php endif ?>
|
||||
<ul class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$type['url']),1)?>"><?=_('edit')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$type['url']),1)?>"><?=_('delete')?></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
17
views/html/error/index.tpl
Normal file
17
views/html/error/index.tpl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<h1><?=_('Error')?></h1>
|
||||
<p class="error"><?=$code?>: <?=$string?></p>
|
||||
|
||||
<?php if($code == 403 && $userId <= 0) : ?>
|
||||
<h2><?=_('Login')?></h2>
|
||||
<form method="post" action="<?=$linker->link(array('users','login'))?>" class="logreg">
|
||||
<fieldset>
|
||||
<label for="username"><?=_('Username')?>:</label>
|
||||
<input name="username" type="text" placeholder="<?=_('Username')?>" title="<?=_('Username')?>" required="required" autofocus="autofocus" /><br />
|
||||
<label for="password"><?=_('Password')?>:</label>
|
||||
<input name="password" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" /><br />
|
||||
</fieldset>
|
||||
<input type="hidden" name="referrer" value="<?=$linker->link(null, null, false)?>" />
|
||||
<input type="submit" name="login" class="cta" value="<?=_('Login')?>" />
|
||||
<?=_('or')?> <a href="<?=$linker->link(array('users','register'))?>"><?=_('register yourself')?></a>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
146
views/html/html.tpl
Normal file
146
views/html/html.tpl
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="robots" content="noindex,follow">
|
||||
<title><?=(isset($title)) ? $title : \nre\configs\AppConfig::$app['name']?></title>
|
||||
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
||||
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
|
||||
<link href="//netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.css" rel="stylesheet">
|
||||
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('markitup','skins','markitup','style.css'))?>" media="all" />
|
||||
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('markitup','sets','textile','style.css'))?>" media="all" />
|
||||
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('css','desktop.css'))?>" media="all" />
|
||||
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('css','ol.css'))?>" media="all" />
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="<?=$linker->link(array('js','jquery-ui.min.js'))?>"></script>
|
||||
<script type="text/javascript" src="<?=$linker->link(array('js','jquery.nicescroll.min.js'))?>"></script>
|
||||
<script type="text/javascript" src="<?=$linker->link(array('js','ol.js'))?>"></script>
|
||||
<script type="text/javascript" src="<?=$linker->link(array('js','imagelightbox.min.js'))?>"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
|
||||
<![endif]-->
|
||||
<script type="text/javascript" src="<?=$linker->link(array('markitup','jquery.markitup.js'))?>"></script>
|
||||
<script type="text/javascript" src="<?=$linker->link(array('markitup','sets','textile','set.js'))?>"></script>
|
||||
<script type="text/javascript" src="<?=$linker->link(array('js','scripts.js'))?>"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<nav class="cf">
|
||||
<input type="checkbox" id="toggle">
|
||||
<label for="toggle" class="toggle" onclick><i class="fa fa-bars"></i>Menü</label>
|
||||
<div id="home">
|
||||
<a href="<?=$linker->link(array(), 0, true, array(), true)?>"><?=\nre\configs\AppConfig::$app['name']?></a>
|
||||
<?php if(!empty($mailcontact)) : ?>
|
||||
<a class="contact" href="mailto:<?=$mailcontact?>"><?=$mailcontact?></a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php if(!is_null($loggedUser)) : ?>
|
||||
<div id="profile" class="cf">
|
||||
<?php if(!is_null($loggedCharacter)) : ?>
|
||||
<a href="<?=$linker->link(array('characters','character',$loggedSeminary['url'],$loggedCharacter['url']))?>">
|
||||
<?php if(array_key_exists('avatar', $loggedCharacter) && !is_null($loggedCharacter['avatar']['small_avatarpicture_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','avatar',$loggedSeminary['url'],$loggedCharacter['charactertype_url'],$loggedCharacter['xplevel']['level'],'portrait'))?>" />
|
||||
<?php endif ?>
|
||||
<?php if(array_key_exists('title', $loggedCharacter)) : ?>
|
||||
<span class="ctitle"><?=$loggedCharacter['title']?></span>
|
||||
<?php endif ?>
|
||||
<span><?=$loggedCharacter['name']?></span><span class="lvlname">Level <?=$loggedCharacter['xplevel']['level']?></span>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<a href="<?=$linker->link(array('users',$loggedUser['url']))?>"><?=$loggedUser['username']?><span class="lvlname"><?=$loggedUser['prename']?> <?=$loggedUser['surname']?></span></a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<div id="mainmenu">
|
||||
<ul>
|
||||
<?=$menu?>
|
||||
</ul>
|
||||
<div id="promoLogo" class="promo">
|
||||
<a href="http://www.questlab.zone">
|
||||
<img src="<?=$linker->link(array('grafics','questlab-logo.svg'))?>" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="promoText" class="promo">
|
||||
<a href="http://www.questlab.zone">
|
||||
<img src="<?=$linker->link(array('grafics','questlab-text.svg'))?>" />
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<article class="wrap">
|
||||
<?php if(count($notifications) > 0) : ?>
|
||||
<ul class="notify">
|
||||
<?php foreach($notifications as &$notification) : ?>
|
||||
<?php if($notification['type'] == \hhu\z\controllers\components\NotificationComponent::TYPE_ACHIEVEMENT) : ?>
|
||||
<li class="cf">
|
||||
<?php if(!is_null($notification['image'])) : ?>
|
||||
<img src="<?=$notification['image']?>" />
|
||||
<?php endif ?>
|
||||
<p class="announce"><i class="fa fa-trophy fa-fw"></i><?=_('Achievement')?>:<i class="fa fa-times fa-fw"></i></p>
|
||||
<?php if(!is_null($notification['link'])) : ?>
|
||||
<p class="fwb"><a href="<?=$notification['link']?>"><?=$notification['message']?></a></p>
|
||||
<?php else : ?>
|
||||
<p class="fwb"><?=$notification['message']?></p>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php elseif($notification['type'] == \hhu\z\controllers\components\NotificationComponent::TYPE_CHARACTERGROUPSACHIEVEMENT) : ?>
|
||||
<li class="cf">
|
||||
<?php if(!is_null($notification['image'])) : ?>
|
||||
<img src="<?=$notification['image']?>" />
|
||||
<?php endif ?>
|
||||
<p class="announce"><i class="fa fa-trophy fa-fw"></i><?=_('Achievement')?>:<i class="fa fa-times fa-fw"></i></p>
|
||||
<?php if(!is_null($notification['link'])) : ?>
|
||||
<p class="fwb"><a href="<?=$notification['link']?>"><?=$notification['message']?></a></p>
|
||||
<?php else : ?>
|
||||
<p class="fwb"><?=$notification['message']?></p>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php elseif($notification['type'] == \hhu\z\controllers\components\NotificationComponent::TYPE_CHARACTERTITLE) : ?>
|
||||
<li class="cf">
|
||||
<p class="announce"><i class="fa fa-trophy fa-fw"></i><?=_('Charactertitle')?>:<i class="fa fa-times fa-fw"></i></p>
|
||||
<p class="fwb"><?=$notification['message']?></p>
|
||||
</li>
|
||||
<?php else : ?>
|
||||
<li class="cf">
|
||||
<img src="<?=$linker->link(array('grafics','lvlup.jpg'))?>">
|
||||
<p class="announce"><i class="fa fa-arrow-up fa-fw"></i><?=_('Level-up')?>:<i class="fa fa-times fa-fw"></i></p>
|
||||
<?php if(!is_null($notification['link'])) : ?>
|
||||
<p class="fwb"><a href="<?=$notification['link']?>"><?=sprintf(_('You have reached level %d'), $notification['message'])?></a></p>
|
||||
<?php else : ?>
|
||||
<p class="fwb"><?=sprintf(_('You have reached level %d'), $notification['message'])?></p>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<audio id="notify-sound" preload="auto" src="<?=$linker->link(array('sounds','notification.mp3'))?>"></audio>
|
||||
<?php endif ?>
|
||||
<?=$intermediate?>
|
||||
</article>
|
||||
<aside>
|
||||
<?php if(!is_null($loggedCharacter) && count($loggedCharacter['characterroles']) > 0) : ?>
|
||||
<?=$seminarybar?>
|
||||
<?php endif ?>
|
||||
</aside>
|
||||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://" + document.location.hostname + "/analytics/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', 1]);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
|
||||
g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<noscript><p><img src="/analytics/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
18
views/html/introduction/edit.tpl
Normal file
18
views/html/introduction/edit.tpl
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<div class="moodpic">
|
||||
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
|
||||
</div>
|
||||
|
||||
<h1><?=\nre\configs\AppConfig::$app['name']?></h1>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<legend><?=_('Introduction text')?></legend>
|
||||
<textarea id="text" name="text" placeholder="<?=_('Please enter an introduction text')?>"><?=$text?></textarea>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
<input type="submit" name="cancel" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#text").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
38
views/html/introduction/index.tpl
Normal file
38
views/html/introduction/index.tpl
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<div class="moodpic">
|
||||
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
|
||||
</div>
|
||||
<?php if(is_null($userId)) : ?>
|
||||
<form method="post" action="<?=$linker->link(array('users','login'))?>" class="logreg front">
|
||||
<fieldset>
|
||||
<p>
|
||||
<label for="username"><?=_('Username')?>:</label>
|
||||
<input id="username" name="username" type="text" placeholder="<?=_('Username')?>" title="<?=_('Username')?>" required="required" autofocus="autofocus" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="password"><?=_('Password')?>:</label>
|
||||
<input id="password" name="password" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" />
|
||||
</p>
|
||||
<input type="submit" name="login" class="cta" value="<?=_('Login')?>" />
|
||||
</fieldset>
|
||||
<p class="register"><?=_('or')?> <a href="<?=$linker->link(array('users','register'))?>"><?=_('register yourself')?></a></p>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
<?php if(!is_null(\hhu\z\controllers\IntermediateController::$user) && in_array('admin',\hhu\z\controllers\IntermediateController::$user['roles'])) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link('edit', 1)?>"><?=_('edit')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<h1><?=\nre\configs\AppConfig::$app['name']?></h1>
|
||||
<?php if(!empty($text)) : ?>
|
||||
<div class="text">
|
||||
<?=$t->t($text)?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<hr />
|
||||
<p><?=sprintf(
|
||||
_('This application is powered by %s and is licensed under the %s'),
|
||||
'<a href="http://www.questlab.zone">Questlab</a>',
|
||||
'<a rel="license" href="http://www.gnu.org/licenses/gpl.html">GPL</a>'
|
||||
)?>.</p>
|
||||
43
views/html/library/create.tpl
Normal file
43
views/html/library/create.tpl
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Library')?></a></li>
|
||||
</ul>
|
||||
<h1><i class="fa fa-book fa-fw"></i><?=_('New Questtopic')?></h1>
|
||||
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input id="title" type="text" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
12
views/html/library/delete.tpl
Normal file
12
views/html/library/delete.tpl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Library')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><i class="fa fa-book fa-fw"></i><?=_('Delete Questtopic')?></h1>
|
||||
<?=sprintf(_('Should the Questtopic “%s” really be deleted?'), $questtopic['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
121
views/html/library/edit.tpl
Normal file
121
views/html/library/edit.tpl
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Library')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><i class="fa fa-book fa-fw"></i><?=_('Edit Questtopic')?></h1>
|
||||
<?php if($validations['edit'] !== true) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validations['edit'] as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input id="title" type="text" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$questtopicTitle?>" <?=($validations['edit'] !== true && array_key_exists('title', $validations['edit'])) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
|
||||
<h2><?=_('Edit Questsubtopics')?></h2>
|
||||
<form method="post">
|
||||
<?php foreach($subtopicsTitles as $subtopicId => &$title) : ?>
|
||||
<?php if($validations['edit-subtopics'] !== true && array_key_exists($subtopicId, $validations['edit-subtopics']) && $validations['edit-subtopics'][$subtopicId] !== true) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validations['edit-subtopics'][$subtopicId] as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<input id="subtopic-<?=$subtopicId?>" type="text" name="subtopics[<?=$subtopicId?>]" placeholder="<?=$title?>" title="<?=$title?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validations['edit-subtopics'] !== true && array_key_exists($subtopicId, $validations['edit-subtopics']) && $validations['edit-subtopics'][$subtopicId] !== true && array_key_exists('title', $validations['edit-subtopics'][$subtopicId])) ? 'class="invalid"' : null?>/>
|
||||
<input id="subtopic-<?=$subtopicId?>-delete" type="checkbox" name="delete-subtopics[<?=$subtopicId?>]" <?php if(!is_null($deleteSubtopics) && array_key_exists($subtopicId, $deleteSubtopics)) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="subtopic-<?=$subtopicId?>-delete"><?=_('delete')?></label><br />
|
||||
<?php endforeach ?>
|
||||
|
||||
<input type="submit" name="edit-subtopics" value="<?=_('save')?>" />
|
||||
</form>
|
||||
|
||||
<h2><?=_('Create new Questsubtopic')?></h2>
|
||||
<?php if($validations['create-subtopic'] !== true) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validations['create-subtopic'] as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<label for="subtopictitle"><?=_('Title')?>:</legend>
|
||||
<input id="subtopictitle" type="text" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$subtopicTitle?>" <?=($validations['create-subtopic'] !== true && array_key_exists('title', $validations['create-subtopic'])) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<input type="submit" name="create-subtopic" value="<?=_('create')?>" />
|
||||
</form>
|
||||
29
views/html/library/index.tpl
Normal file
29
views/html/library/index.tpl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
<h1><i class="fa fa-book fa-fw"></i><?=_('Library')?></h1>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('create',$seminary['url']),1)?>"><?=_('Create new Questtopic')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<p><?=sprintf(_('Library description, %s, %s'), $seminary['course'], $seminary['title'])?></p>
|
||||
<div class="libindxpr cf">
|
||||
<p><small><?=sprintf(_('Total progress: %d %%'), ($totalQuestcount > 0) ? round($totalCharacterQuestcount/$totalQuestcount*100) : 0) ?></small></p>
|
||||
<div class="xpbar">
|
||||
<span style="width:<?=($totalQuestcount > 0) ? round($totalCharacterQuestcount/$totalQuestcount*100) : 0 ?>%"></span>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="libindx cf">
|
||||
<?php foreach($questtopics as &$topic) : ?>
|
||||
<li class="cf">
|
||||
<i class="fa fa-file-o"></i>
|
||||
<p class="ltopc"><a href="<?=$linker->link(array('library','topic',$seminary['url'],$topic['url']))?>"><?=$topic['title']?></a></p>
|
||||
<p><small>Fortschritt: <?=$topic['characterQuestcount']?> / <?=$topic['questcount']?></small></p>
|
||||
<div class="xpbar">
|
||||
<span style="width:<?=($topic['questcount'] > 0) ? round($topic['characterQuestcount']/$topic['questcount']*100) : 0?>%"></span>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
36
views/html/library/manage.tpl
Normal file
36
views/html/library/manage.tpl
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Library')?></a></li>
|
||||
</ul>
|
||||
<h1><i class="fa fa-book fa-fw"></i><?=$questtopic['title']?></h1>
|
||||
|
||||
<h2>Quests zu diesem Thema:</h2>
|
||||
<form method="post">
|
||||
<ul class="libtop">
|
||||
<?php foreach($quests as &$quest) : ?>
|
||||
<li>
|
||||
<p><a href="<?=$linker->link(array('quests','quest',$seminary['url'],$quest['questgroup_url'],$quest['url']))?>"><?=$quest['title']?></a></p>
|
||||
<?php foreach($questsubtopics as &$subtopic) : ?>
|
||||
<input id="subtopic-<?=$quest['id']?>-<?=$subtopic['id']?>" type="checkbox" name="questsubtopics[<?=$quest['id']?>][<?=$subtopic['id']?>]" <?php if(in_array($subtopic['id'], $quest['subtopics'])) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="subtopic-<?=$quest['id']?>-<?=$subtopic['id']?>"><?=$subtopic['title']?></label><br />
|
||||
<?php endforeach ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
<li>
|
||||
<p>
|
||||
<select name="addquest">
|
||||
<option value=""><?=_('Add Quest')?></option>
|
||||
<?php foreach($allQuests as &$quest) : ?>
|
||||
<option value="<?=$quest['id']?>"><?=$quest['title']?></opiton>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</p>
|
||||
<?php foreach($questsubtopics as &$subtopic) : ?>
|
||||
<input id="subtopic-new-<?=$subtopic['id']?>" type="checkbox" name="questsubtopics[addquest][<?=$subtopic['id']?>]" />
|
||||
<label for="subtopic-new-<?=$subtopic['id']?>"><?=$subtopic['title']?></label><br />
|
||||
<?php endforeach ?>
|
||||
</li>
|
||||
</ul>
|
||||
<input type="submit" value="<?=_('Manage')?>" />
|
||||
</form>
|
||||
33
views/html/library/topic.tpl
Normal file
33
views/html/library/topic.tpl
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Library')?></a></li>
|
||||
</ul>
|
||||
<h1><i class="fa fa-book fa-fw"></i><?=$questtopic['title']?></h1>
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$questtopic['url']),1)?>"><?=_('Edit Questtopic')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$questtopic['url']),1)?>"><?=_('Delete Questtopic')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('manage',$seminary['url'],$questtopic['url']),1)?>"><?=_('Manage Questtopic')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<div class="libindxpr cf">
|
||||
<p><small>Themenfortschritt: <?=$questtopic['characterQuestcount']?> / <?=$questtopic['questcount']?></small></p>
|
||||
<div class="xpbar">
|
||||
<span style="width:<?=($questtopic['questcount'] > 0) ? round($questtopic['characterQuestcount']/$questtopic['questcount']*100) : 0?>%"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Quests zu diesem Thema:</h2>
|
||||
<ul class="libtop">
|
||||
<?php foreach($quests as &$quest) : ?>
|
||||
<li>
|
||||
<p><a href="<?=$linker->link(array('quests','quest',$seminary['url'],$quest['questgroup_url'],$quest['url']))?>"><?=$quest['title']?></a></p>
|
||||
<ul class="addon">
|
||||
<?php foreach($quest['subtopics'] as &$subtopic) : ?>
|
||||
<li><?=$subtopic['title']?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
47
views/html/map/edit.tpl
Normal file
47
views/html/map/edit.tpl
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('index',$seminary['url']),1)?>"><?=_('Map')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><i class="fa fa-map-marker fa-fw"></i><?=_('Edit Map')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'media':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during file upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('File has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('File exceeds size maximum');
|
||||
break;
|
||||
default: echo _('File invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<input type="file" name="media" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
46
views/html/map/index.tpl
Normal file
46
views/html/map/index.tpl
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
<h1><i class="fa fa-map-marker fa-fw"></i><?=_('Map')?></h1>
|
||||
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url']), 1)?>"><?=_('Edit Map')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<div id="map" class="map" style="background-image:url('<?=$linker->link(array('grafics','paper.jpg'))?>')"></div>
|
||||
<script type="text/javascript">
|
||||
var extent = [0, 0, <?=$map['width']?>, <?=$map['height']?>];
|
||||
var projection = new ol.proj.Projection({
|
||||
code: 'pixel',
|
||||
units: 'pixels',
|
||||
extent: extent
|
||||
});
|
||||
var map;
|
||||
$(document).ready(function() {
|
||||
map = new ol.Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageStatic({
|
||||
url: '<?=$linker->link(array('media','seminarymap',$seminary['url']))?>',
|
||||
projection: projection,
|
||||
imageExtent: extent
|
||||
})
|
||||
})
|
||||
],
|
||||
controls: ol.control.defaults().extend([
|
||||
new ol.control.OverviewMap({
|
||||
collapsed: true,
|
||||
})
|
||||
]),
|
||||
view: new ol.View({
|
||||
projection: projection,
|
||||
center: ol.extent.getCenter(extent),
|
||||
zoom: 1,
|
||||
extent: extent
|
||||
}),
|
||||
});
|
||||
});
|
||||
</script>
|
||||
21
views/html/menu/index.tpl
Normal file
21
views/html/menu/index.tpl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<li><a href="<?=$linker->link(array(), 0, true, array(), true)?>"><?=\nre\configs\AppConfig::$app['name']?></a></li>
|
||||
<?php if(!is_null($loggedUser) && count(array_intersect(array('admin','moderator'),$loggedUser['roles'])) > 0) : ?>
|
||||
<li><a href="<?=$linker->link('users')?>"><?=_('Users')?></a></li>
|
||||
<?php endif ?>
|
||||
<?php if(!is_null($loggedUser)) : ?>
|
||||
<li><a href="<?=$linker->link('seminaries')?>"><?=_('Seminaries')?></a></li>
|
||||
<?php endif ?>
|
||||
<?php if(!is_null($loggedCharacter) && count($loggedCharacter['characterroles']) > 0) : ?>
|
||||
<?=$seminarymenu?>
|
||||
<?php endif ?>
|
||||
<?php if(!is_null($loggedUser) && in_array('admin',$loggedUser['roles'])) : ?>
|
||||
<li><a href="<?=$linker->link('pages')?>"><?=_('Pages')?></a></li>
|
||||
<?php endif ?>
|
||||
<?php foreach($pages as &$page) : ?>
|
||||
<li><a href="<?=$linker->link(array('pages','page',$page['url']))?>"><?=$page['title']?></a></li>
|
||||
<?php endforeach ?>
|
||||
<?php if(is_null($loggedUser)) : ?>
|
||||
<li><a href="<?=$linker->link(array('users','login'))?>"><?=_('Login')?></a></li>
|
||||
<?php else : ?>
|
||||
<li><a href="<?=$linker->link(array('users','logout'))?>"><?=_('Logout')?></a></li>
|
||||
<?php endif ?>
|
||||
5
views/html/moodpic/index.tpl
Normal file
5
views/html/moodpic/index.tpl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<div class="moodpic">
|
||||
<div>
|
||||
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
|
||||
</div>
|
||||
</div>
|
||||
16
views/html/moodpic/questgroup.tpl
Normal file
16
views/html/moodpic/questgroup.tpl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<div class="moodpic">
|
||||
<div>
|
||||
<?php if(!is_null($medium)) : ?>
|
||||
<img src="<?=$medium['url']?>" <?php if(!empty($medium['title'])) : ?>title="<?=$medium['title']?>"<?php endif ?> <?php if(!empty($medium['description'])) : ?>alt="<?=$medium['description']?>"<?php endif ?>/>
|
||||
<?php if(!empty($medium['sourceurl'])) : ?>
|
||||
<span class="source">
|
||||
<a href="<?=$medium['sourceurl']?>" target="_blank" title="<?=_('Image source')?>" rel="nofollow">
|
||||
<i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
16
views/html/moodpic/seminary.tpl
Normal file
16
views/html/moodpic/seminary.tpl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<div class="moodpic">
|
||||
<div>
|
||||
<?php if(!is_null($medium)) : ?>
|
||||
<img src="<?=$medium['url']?>" <?php if(!empty($medium['title'])) : ?>title="<?=$medium['title']?>"<?php endif ?> <?php if(!empty($medium['description'])) : ?>alt="<?=$medium['description']?>"<?php endif ?>/>
|
||||
<?php if(!empty($medium['sourceurl'])) : ?>
|
||||
<span class="source">
|
||||
<a href="<?=$medium['sourceurl']?>" target="_blank" title="<?=_('Image source')?>" rel="nofollow">
|
||||
<i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
47
views/html/pages/create.tpl
Normal file
47
views/html/pages/create.tpl
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<div class="moodpic">
|
||||
<img src="<?=$linker->hardlink('/grafics/questlab.jpg')?>" />
|
||||
</div>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link('index',1)?>"><?=_('Pages')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Create page')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo $exception->getMessage();
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" class="logreg">
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input id="title" name="title" type="text" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
13
views/html/pages/delete.tpl
Normal file
13
views/html/pages/delete.tpl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<div class="moodpic">
|
||||
<img src="<?=$linker->hardlink('/grafics/questlab.jpg')?>" />
|
||||
</div>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(null,3)?>"><?=$page['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Delete page')?></h1>
|
||||
<?=sprintf(_('Should the page “%s” really be deleted?'), $page['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
56
views/html/pages/edit.tpl
Normal file
56
views/html/pages/edit.tpl
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<div class="moodpic">
|
||||
<img src="<?=$linker->hardlink('/grafics/questlab.jpg')?>" />
|
||||
</div>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(null,3)?>"><?=$page['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit page')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo $exception->getMessage();
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input id="title" name="title" type="text" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Text')?></legend>
|
||||
<textarea id="text" name="text"><?=$text?></textarea>
|
||||
</fieldset>
|
||||
<input type="submit" name="save" value="<?=_('save')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#text").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
20
views/html/pages/index.tpl
Normal file
20
views/html/pages/index.tpl
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<div class="moodpic">
|
||||
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
|
||||
</div>
|
||||
|
||||
<h1><?=_('Pages')?></h1>
|
||||
<ul>
|
||||
<?php foreach($pages as &$page) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('page',$page['url']),1)?>">
|
||||
<?=$page['title']?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
<li>
|
||||
<form method="post" action="<?=$linker->link('create',1)?>">
|
||||
<input type="text" name="title" placeholder="<?=_('New page')?>" />
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
12
views/html/pages/page.tpl
Normal file
12
views/html/pages/page.tpl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<div class="moodpic">
|
||||
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
|
||||
</div>
|
||||
<?php if(in_array('admin', \hhu\z\controllers\IntermediateController::$user['roles'])) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$page['url']),1)?>"><?=_('Edit page')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$page['url']),1)?>"><?=_('Delete page')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<h1><?=$page['title']?></h1>
|
||||
<?=$t->t($page['text'])?>
|
||||
0
views/html/qr/a.tpl
Normal file
0
views/html/qr/a.tpl
Normal file
0
views/html/qr/cga.tpl
Normal file
0
views/html/qr/cga.tpl
Normal file
0
views/html/qr/cgqs.tpl
Normal file
0
views/html/qr/cgqs.tpl
Normal file
0
views/html/qr/ct.tpl
Normal file
0
views/html/qr/ct.tpl
Normal file
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue