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
112
views/html/quests/create.tpl
Normal file
112
views/html/quests/create.tpl
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
<?=$moodpic?>
|
||||
<?=$questgroupshierarchypath?>
|
||||
|
||||
<h1><?=_('Create Quest')?></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 '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" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Picture')?></legend>
|
||||
<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>
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input id="title" type="text" name="title" value="<?=$title?>" placeholder="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<label for="xps"><?=_('XPs')?>:</label>
|
||||
<input id="xps" type="number" 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?> /><br />
|
||||
<label for="questtype"><?=('Questtype')?>:</label>
|
||||
<select id="questtype" name="questtype">
|
||||
<?php foreach($questtypes as &$questtype) : ?>
|
||||
<option value="<?=$questtype['url']?>" <?php if($questtype['selected']) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($questtype['classname']) {
|
||||
case null: echo _('Questtype Empty');
|
||||
break;
|
||||
case 'bossfight': echo _('Questtype bossfight');
|
||||
break;
|
||||
case 'choiceinput': echo _('Questtype choiceinput');
|
||||
break;
|
||||
case 'crossword': echo _('Questtype crossword');
|
||||
break;
|
||||
case 'dragndrop': echo _('Questtype dragndrop');
|
||||
break;
|
||||
case 'multiplechoice': echo _('Questtype multiplechoice');
|
||||
break;
|
||||
case 'submit': echo _('Questtype submit');
|
||||
break;
|
||||
case 'textinput': echo _('Questtype textinput');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="entrytext"><?=_('Entry text')?>:</label><br />
|
||||
<textarea id="entrytext" name="entrytext" placeholder="<?=_('Entry text')?>"><?=$entryText?></textarea><br />
|
||||
<label for="task"><?=_('Task')?>:</label><br />
|
||||
<textarea id="task" name="task" placeholder="<?=('Task')?>"><?=$task?></textarea><br />
|
||||
<label for="wrongtext"><?=_('Wrong text')?>:</label><br />
|
||||
<textarea id="wrongtext" name="wrongtext" placeholder="<?=_('Wrong text')?>"><?=$wrongText?></textarea><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#entrytext").markItUp(mySettings);
|
||||
$("#task").markItUp(mySettings);
|
||||
$("#wrongtext").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
9
views/html/quests/delete.tpl
Normal file
9
views/html/quests/delete.tpl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?=$moodpic?>
|
||||
<?=$questgroupshierarchypath?>
|
||||
|
||||
<h1><?=_('Delete Quest')?></h1>
|
||||
<?=sprintf(_('Should the Quest “%s” really be deleted?'), $quest['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
118
views/html/quests/edit.tpl
Normal file
118
views/html/quests/edit.tpl
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
<?=$moodpic?>
|
||||
<?=$questgroupshierarchypath?>
|
||||
|
||||
<h1><?=_('Edit Quest')?></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 '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" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<?php if(!is_null($media)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>"><img style="width:10em; display:block;" src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" /></a>
|
||||
<?php endif ?>
|
||||
<legend><?=_('Picture')?></legend>
|
||||
<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>
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input id="title" type="text" name="title" value="<?=$title?>" placeholder="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<label for="xps"><?=_('XPs')?>:</label>
|
||||
<input id="xps" type="number" 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?> /><br />
|
||||
<label for="questtype"><?=('Questtype')?>:</label>
|
||||
<select id="questtype" name="questtype">
|
||||
<?php foreach($questtypes as &$questtype) : ?>
|
||||
<option value="<?=$questtype['url']?>" <?php if($questtype['selected']) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($questtype['classname']) {
|
||||
case null: echo _('Questtype Empty');
|
||||
break;
|
||||
case 'bossfight': echo _('Questtype bossfight');
|
||||
break;
|
||||
case 'choiceinput': echo _('Questtype choiceinput');
|
||||
break;
|
||||
case 'crossword': echo _('Questtype crossword');
|
||||
break;
|
||||
case 'dragndrop': echo _('Questtype dragndrop');
|
||||
break;
|
||||
case 'multiplechoice': echo _('Questtype multiplechoice');
|
||||
break;
|
||||
case 'submit': echo _('Questtype submit');
|
||||
break;
|
||||
case 'textinput': echo _('Questtype textinput');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="entrytext"><?=_('Entry text')?>:</label><br />
|
||||
<textarea id="entrytext" name="entrytext" placeholder="<?=_('Entry text')?>"><?=$entryText?></textarea><br />
|
||||
<label for="task"><?=_('Task')?>:</label><br />
|
||||
<textarea id="task" name="task" placeholder="<?=('Task')?>"><?=$task?></textarea><br />
|
||||
<label for="wrongtext"><?=_('Wrong text')?>:</label><br />
|
||||
<textarea id="wrongtext" name="wrongtext" placeholder="<?=_('Wrong text')?>"><?=$wrongText?></textarea><br />
|
||||
</fieldset>
|
||||
<?php if(!is_null($quest['type']['classname'])) : ?>
|
||||
<input type="submit" name="edit-task" value="<?=_('edit task')?>" />
|
||||
<?php endif ?>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#entrytext").markItUp(mySettings);
|
||||
$("#task").markItUp(mySettings);
|
||||
$("#wrongtext").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
7
views/html/quests/edittask.tpl
Normal file
7
views/html/quests/edittask.tpl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?=$moodpic?>
|
||||
<?=$questgroupshierarchypath?>
|
||||
|
||||
<h1><?=_('Edit Quest task')?></h1>
|
||||
<?php if(!is_null($task)) : ?>
|
||||
<?=$task?>
|
||||
<?php endif ?>
|
||||
73
views/html/quests/edittexts.tpl
Normal file
73
views/html/quests/edittexts.tpl
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<?=$moodpic?>
|
||||
<?=$questgroupshierarchypath?>
|
||||
|
||||
<h1><?=_('Edit Quest texts')?></h1>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<?php foreach($questtexttypes as &$type) : ?>
|
||||
<fieldset>
|
||||
<legend><?=$type['type']?></legend>
|
||||
<?php if(array_key_exists($type['url'], $validations) && $validations[$type['url']] !== true) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validations[$type['url']] as $textId => &$validation) : ?>
|
||||
<?php if($validation !== true) : ?>
|
||||
<?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;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<ul class="admnql">
|
||||
<?php foreach($type['texts'] as &$text) : ?>
|
||||
<li class="cf">
|
||||
<?php if(array_key_exists('media', $text)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$text['media']['url']))?>"><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$text['media']['url']))?>" /></a><br />
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<input type="file" name="media[<?=$type['url']?>][<?=$text['id']?>]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
|
||||
<textarea id="questtexts-<?=$type['url']?>-<?=$text['id']?>" name="questtexts[<?=$type['url']?>][<?=$text['id']?>]"><?=$text['text']?></textarea><br />
|
||||
<input id="deletes[<?=$type['url']?>][<?=$text['id']?>]" type="checkbox" name="deletes[<?=$type['url']?>][<?=$text['id']?>]" />
|
||||
<label for="deletes[<?=$type['url']?>][<?=$text['id']?>]"><?=_('delete text')?></label>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#questtexts-<?=$type['url']?>-<?=$text['id']?>").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
<li class="cf">
|
||||
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
|
||||
<input type="file" name="media[<?=$type['url']?>][new]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
|
||||
<textarea id="questtexts-<?=$type['url']?>-new" name="questtexts[<?=$type['url']?>][new]" placeholder="<?=_('New Questgroup text')?>"></textarea>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#questtexts-<?=$type['url']?>-new").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php endforeach ?>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
131
views/html/quests/index.tpl
Normal file
131
views/html/quests/index.tpl
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
<h1><?=_('Quests')?></h1>
|
||||
|
||||
<form method="get" class="logreg admnqf">
|
||||
<fieldset>
|
||||
<legend><?=_('Filters')?></legend>
|
||||
<label for="questgroup"><?=_('Questgroup')?>:</label>
|
||||
<select id="questgroup" name="questgroup">
|
||||
<option value=""><?=_('all')?></option>
|
||||
<?php foreach($questgroups as &$questgroup) : ?>
|
||||
<option value="<?=$questgroup['id']?>" <?php if($questgroup['id'] == $selectedQuestgroup) : ?>selected="selected"<?php endif ?>><?=$questgroup['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select><br />
|
||||
<label for="questtype"><?=_('Questtype')?>:</label>
|
||||
<select id="questtype" name="questtype">
|
||||
<option value=""><?=_('all')?></option>
|
||||
<?php foreach($questtypes as &$questtype) : ?>
|
||||
<option value="<?=$questtype['id']?>" <?php if($questtype['id'] == $selectedQuesttype) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($questtype['classname']) {
|
||||
case null: echo _('Questtype Empty');
|
||||
break;
|
||||
case 'bossfight': echo _('Questtype bossfight');
|
||||
break;
|
||||
case 'choiceinput': echo _('Questtype choiceinput');
|
||||
break;
|
||||
case 'crossword': echo _('Questtype crossword');
|
||||
break;
|
||||
case 'dragndrop': echo _('Questtype dragndrop');
|
||||
break;
|
||||
case 'multiplechoice': echo _('Questtype multiplechoice');
|
||||
break;
|
||||
case 'submit': echo _('Questtype submit');
|
||||
break;
|
||||
case 'textinput': echo _('Questtype textinput');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" value="<?=$selectedTitle?>" />
|
||||
</fieldset>
|
||||
<input type="submit" value="<?=_('Apply filters')?>" />
|
||||
</form>
|
||||
|
||||
<ul id="questlist" class="admnql">
|
||||
<?php foreach($quests as &$quest) : ?>
|
||||
<li>
|
||||
<p class="fwb"><a href="<?=$linker->link(array('quest',$seminary['url'],$quest['questgroup_url'],$quest['url']),1)?>"><?=$quest['title']?></a><span><a href="<?=$linker->link(array('submissions',$seminary['url'],$quest['questgroup_url'],$quest['url']),1)?>"><?=$quest['opensubmissionscount']?> <?=_('open submissions')?></a></span></p>
|
||||
<p><small>
|
||||
<?php switch($quest['questtype']['classname']) {
|
||||
case null: echo _('Questtype Empty');
|
||||
break;
|
||||
case 'bossfight': echo _('Questtype bossfight');
|
||||
break;
|
||||
case 'choiceinput': echo _('Questtype choiceinput');
|
||||
break;
|
||||
case 'crossword': echo _('Questtype crossword');
|
||||
break;
|
||||
case 'dragndrop': echo _('Questtype dragndrop');
|
||||
break;
|
||||
case 'multiplechoice': echo _('Questtype multiplechoice');
|
||||
break;
|
||||
case 'submit': echo _('Questtype submit');
|
||||
break;
|
||||
case 'textinput': echo _('Questtype textinput');
|
||||
break;
|
||||
} ?>, <?=sprintf(_('%d XPs'), $quest['xps'])?></small></p>
|
||||
<p><small><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$quest['questgroup_url']))?>"><?=$quest['questgroup_title']?></a></small></p>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php if(is_null($all) && ($page*$limit) < $questsCount) : ?>
|
||||
<nav class="admin">
|
||||
<li><a id="show-more" href="<?=$linker->link(null,3,true,array('page'=>$page+1,'questgroup'=>$selectedQuestgroup,'questtype'=>$selectedQuesttype,'title'=>$selectedTitle))?>"><?=_('Show more')?></a></li>
|
||||
<li><a id="show-all" href="<?=$linker->link('all',3,true,array('questgroup'=>$selectedQuestgroup,'questtype'=>$selectedQuesttype,'title'=>$selectedTitle))?>"><?=_('Show all')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<script>
|
||||
var page = 1;
|
||||
var request;
|
||||
var linkSubmissions = "<?=$linker->link(array('submissions','SEMINARY','QUESTGROUP','QUEST'),1)?>";
|
||||
var linkQuestgroup = "<?=$linker->link(array('questgroups','questgroup','SEMINARY','QUESTGROUP'))?>";
|
||||
var linkQuest = "<?=$linker->link(array('quest','SEMINARY','QUESTGROUP','QUEST'),1)?>";
|
||||
var linkPage = "<?=$linker->link(null,3,true,array('page'=>'PAGE','questgroup'=>$selectedQuestgroup,'questtype'=>$selectedQuesttype,'title'=>$selectedTitle))?>";
|
||||
|
||||
$("#show-more").click(function(event) {
|
||||
if(request) {
|
||||
request.abort();
|
||||
}
|
||||
|
||||
page++;
|
||||
request = $.getJSON(linkPage.replace('PAGE', page), function(data) {
|
||||
linkSubmissions = linkSubmissions.replace('SEMINARY', data['seminary']['url']);
|
||||
linkQuestgroup = linkQuestgroup.replace('SEMINARY', data['seminary']['url']);
|
||||
linkQuest = linkQuest.replace('SEMINARY', data['seminary']['url']);
|
||||
$.each(data['quests'], function(key, val) {
|
||||
var urlSubmissions = linkSubmissions.replace('QUESTGROUP', val['questgroup_url']).replace('QUEST', val['url']);
|
||||
var urlQuestgroup = linkQuestgroup.replace('QUESTGROUP', val['questgroup_url']);
|
||||
var urlQuest = linkQuest.replace('QUESTGROUP', val['questgroup_url']).replace('QUEST', val['url']);
|
||||
$("#questlist").append(
|
||||
"<li>" +
|
||||
"<p class=\"fwb\"><a href=\"" + urlQuest + "\">" + val['title'] + "</a><span><a href=\"" + urlSubmissions + "\">" + val['opensubmissionscount'] + " <?=_('open submissions')?></a></span></p>" +
|
||||
"<p><small>" + val['questtype']['title'] + ", " + val['xps'] + "</small></p>" +
|
||||
"<p><small><a href=\"" + urlQuestgroup + "\">" + val['questgroup_title'] + "</a></small></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>
|
||||
175
views/html/quests/quest.tpl
Normal file
175
views/html/quests/quest.tpl
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
<?=$moodpic?>
|
||||
<?=$questgroupshierarchypath?>
|
||||
<h1><?=$quest['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('edit', 5)?>"><?=_('Edit Quest')?></a></li>
|
||||
<li><a href="<?=$linker->link('edittexts', 5)?>"><?=_('Edit Quest texts')?></a></li>
|
||||
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
|
||||
<li><a href="<?=$linker->link('delete', 5)?>"><?=_('Delete Quest')?></a></li>
|
||||
<?php endif ?>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<?php if(array_key_exists('Prolog', $questtexts) && count($questtexts['Prolog']) > 0) : ?>
|
||||
<section>
|
||||
<h1 id="questtext"><?=_('Prolog')?></h1>
|
||||
<div class="qtextbox">
|
||||
<?php $mediaShown = false; ?>
|
||||
<?php foreach($questtexts['Prolog'] as &$questtext) : ?>
|
||||
<p class="qtext cf">
|
||||
<?php if(array_key_exists('media', $questtext)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$questtext['media']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$questtext['media']['url'], 'quest'))?>" />
|
||||
</a>
|
||||
<?php if(!empty($questtext['media']['sourceurl'])) : ?>
|
||||
<span class="source">
|
||||
<a href="<?=$questtext['media']['sourceurl']?>" target="_blank" title="<?=_('Image source')?>" rel="nofollow">
|
||||
<i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
<?php elseif(!is_null($media) && !$mediaShown) : ?>
|
||||
<?php $mediaShown = true; ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url'],'quest'))?>" />
|
||||
</a>
|
||||
<?php if(!empty($media['sourceurl'])) : ?>
|
||||
<span class="source">
|
||||
<a href="<?=$media['sourceurl']?>" target="_blank" title="<?=_('Image source')?>" rel="nofollow">
|
||||
<i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<?=str_replace('<p>', '', str_replace('</p>', '', $t->t($questtext['text'])))?>
|
||||
</p>
|
||||
<?php if(count($questtext['relatedQuestsgroups']) > 0 || !empty($questtext['abort_text'])) : ?>
|
||||
<ul>
|
||||
<?php foreach($questtext['relatedQuestsgroups'] as &$relatedQuestgroup) : ?>
|
||||
<li><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$relatedQuestgroup['url']))?>"><?=$relatedQuestgroup['entry_text']?></a></li>
|
||||
<?php endforeach ?>
|
||||
<?php if(!empty($questtext['abort_text'])) : ?>
|
||||
<li><a href="<?=$linker->link(array('quest',$seminary['url'],$relatedquesttext['quest']['questgroup_url'],$relatedquesttext['quest']['url'],$relatedquesttext['type_url']),1)?>"><?=$questtext['abort_text']?></a></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(!is_null($task)) : ?>
|
||||
<section class="task">
|
||||
<h1 id="task"><?=_('Task')?></h1>
|
||||
<?php if(!is_null($queststatus)) : ?>
|
||||
<?php if($queststatus == 'solved') : ?>
|
||||
<div class="success">
|
||||
<p class="fwb"><i class="fa fa-check-circle fa-fw"></i><?=_('solved')?></p>
|
||||
<p><small><?=_('Quest completed.')?> <?php if($quest['xps'] > 0): ?><?=sprintf(_('You have earned %d XPs.'), $quest['xps'])?><?php endif ?></small></p>
|
||||
</div>
|
||||
<?php elseif($queststatus == 'unsolved') : ?>
|
||||
<div class="error">
|
||||
<p class="fwb"><i class="fa fa-times-circle fa-fw"></i><?=_('unsolved')?></p>
|
||||
<p><small><?=$t->t($quest['wrong_text'])?></small></p>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if($queststatus != 'solved') : ?>
|
||||
<div>
|
||||
<?=$t->t($quest['task'])?>
|
||||
<?=$task?>
|
||||
</div>
|
||||
|
||||
<?php if($solved && empty($queststatus)) : ?>
|
||||
<div class="solvdmsg">
|
||||
<p><?=_('Task already successfully solved')?>:
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(null,0,false,array('show-answer'=>'true'),true,'task')?>"><?=_('Show answer')?></a></li>
|
||||
</nav>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(array_key_exists('Epilog', $questtexts) && count($questtexts['Epilog']) > 0) : ?>
|
||||
<section <?php if(count($nextquests) == 0 && is_null($nextquestgroup)) : ?>class="gameover"<?php endif ?>>
|
||||
<?php if(count($nextquests) == 0 && is_null($nextquestgroup)) : ?>
|
||||
<h1><?=_('Game over')?></h1>
|
||||
<?php else : ?>
|
||||
<h1 id="questtext"><?=_('Epilog')?></h1>
|
||||
<?php endif ?>
|
||||
<div class="qtextbox">
|
||||
<?php foreach($questtexts['Epilog'] as &$questtext) : ?>
|
||||
<p class="qtext cf">
|
||||
<?php if(array_key_exists('media', $questtext)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$questtext['media']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$questtext['media']['url'],'quest'))?>" />
|
||||
</a>
|
||||
<?php if(!empty($questtext['media']['sourceurl'])) : ?>
|
||||
<span class="source">
|
||||
<a href="<?=$questtext['media']['sourceurl']?>" target="_blank" title="<?=_('Image source')?>" rel="nofollow">
|
||||
<i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<?=str_replace('<p>', '', str_replace('</p>', '', $t->t($questtext['text'])))?>
|
||||
</p>
|
||||
<?php if(count($questtext['relatedQuestsgroups']) > 0 || !empty($questtext['abort_text'])) : ?>
|
||||
<ul>
|
||||
<?php foreach($questtext['relatedQuestsgroups'] as &$relatedQuestgroup) : ?>
|
||||
<li><p><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$relatedQuestgroup['url']))?>"><?=$relatedQuestgroup['entry_text']?></a></p></li>
|
||||
<?php endforeach ?>
|
||||
<?php if(!empty($questtext['abort_text'])) : ?>
|
||||
<li><p><a href="<?=$linker->link(array('quest',$seminary['url'],$relatedquesttext['quest']['questgroup_url'],$relatedquesttext['quest']['url'],$relatedquesttext['type_url']),1)?>"><?=$questtext['abort_text']?></a></p></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<section>
|
||||
<?php if(count($nextquests) > 0 || !is_null($nextquestgroup)) : ?>
|
||||
<h1><?=_('Continuation')?></h1>
|
||||
<?php if(count($nextquests) > 0) : ?>
|
||||
<ul>
|
||||
<?php foreach($nextquests as &$nextquest) : ?>
|
||||
<?php if($nextquest['id'] == $relatedquesttext['quest']['id']) : ?>
|
||||
<li>
|
||||
<p>
|
||||
<?=_('Quest')?>:
|
||||
<?php if($nextquest['entered'] || !$charactedHasChoosenNextQuest) : ?>
|
||||
<a href="<?=$linker->link(array($nextquest['questgroup_url'],$nextquest['url'],$relatedquesttext['type_url']),3)?>"><?=$nextquest['title']?></a>
|
||||
<?php else : ?>
|
||||
<?=$nextquest['title']?>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
</li>
|
||||
<?php else : ?>
|
||||
<li>
|
||||
<?php if(!empty($nextquest['entry_text'])) : ?>
|
||||
<i><?=$nextquest['entry_text']?></i>
|
||||
<?php if($nextquest['entered'] || !$charactedHasChoosenNextQuest) : ?>
|
||||
<p><a class="cta orange" href="<?=$linker->link(array($nextquest['questgroup_url'],$nextquest['url']),3)?>"><?=_('Choose')?></a></p>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<p><?=_('Quest')?>: <a href="<?=$linker->link(array($nextquest['questgroup_url'],$nextquest['url']),3)?>"><?=$nextquest['title']?></a></p>
|
||||
<?php if($nextquest['entered'] || !$charactedHasChoosenNextQuest) : ?>
|
||||
<p><a class="cta orange" href="<?=$linker->link(array($nextquest['questgroup_url'],$nextquest['url']),3)?>"><?=_('Go on')?></a></p>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php elseif(!is_null($nextquestgroup)) : ?>
|
||||
<p><?=$nextquestgroup['hierarchy']['title_singular']?> <?=$nextquestgroup['hierarchy']['questgroup_pos']?>: <a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$nextquestgroup['url']))?>"><?=$nextquestgroup['title']?></a></p>
|
||||
<p><a class="cta orange" href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$nextquestgroup['url']))?>"><?=_('Let’s go')?></a></p>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
8
views/html/quests/submission.tpl
Normal file
8
views/html/quests/submission.tpl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?=$moodpic?>
|
||||
<?=$questgroupshierarchypath?>
|
||||
<h1><?=$quest['title']?></h1>
|
||||
|
||||
<h3><?=sprintf(_('Submission of %s'),$character['name'])?></h3>
|
||||
<section>
|
||||
<?=$output?>
|
||||
</section>
|
||||
35
views/html/quests/submissions.tpl
Normal file
35
views/html/quests/submissions.tpl
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?=$moodpic?>
|
||||
<?=$questgroupshierarchypath?>
|
||||
<h1><?=$quest['title']?> (<?=_('Submissions')?>)</h1>
|
||||
|
||||
<section>
|
||||
<h1><?=_('submitted')?></h1>
|
||||
<ol class="cglist">
|
||||
<?php foreach($submittedSubmissionCharacters as &$character) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('submission',$seminary['url'],$questgroup['url'],$quest['url'],$character['url']),1)?>"><?=$character['name']?></a>
|
||||
<span class="xp"><small><?=sprintf(_('submitted at %s on %s h'), $dateFormatter->format(new \DateTime($character['submission_created'])), $timeFormatter->format(new \DateTime($character['submission_created'])))?></small></span>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
</ol>
|
||||
|
||||
<h1><?=_('unsolved')?></h1>
|
||||
<ol class="cglist">
|
||||
<?php foreach($unsolvedSubmissionCharacters as &$character) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('submission',$seminary['url'],$questgroup['url'],$quest['url'],$character['url']),1)?>"><?=$character['name']?></a>
|
||||
<span class="xp"><small><?=sprintf(_('submitted at %s on %s h'), $dateFormatter->format(new \DateTime($character['submission_created'])), $timeFormatter->format(new \DateTime($character['submission_created'])))?></small></span>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
</ol>
|
||||
|
||||
<h1><?=_('solved')?></h1>
|
||||
<ol class="cglist">
|
||||
<?php foreach($solvedSubmissionCharacters as &$character) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('submission',$seminary['url'],$questgroup['url'],$quest['url'],$character['url']),1)?>"><?=$character['name']?></a>
|
||||
<span class="xp"><small><?=sprintf(_('submitted at %s on %s h'), $dateFormatter->format(new \DateTime($character['submission_created'])), $timeFormatter->format(new \DateTime($character['submission_created'])))?></small></span>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
</ol>
|
||||
</section>
|
||||
Loading…
Add table
Add a link
Reference in a new issue