fix labels and text editors for Quest creation
This commit is contained in:
commit
476c18b6a9
4278 changed files with 1196345 additions and 0 deletions
148
views/html/achievements/conditions.tpl
Normal file
148
views/html/achievements/conditions.tpl
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
<?=$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 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 else : ?>
|
||||
hallo
|
||||
<?php endif ?>
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
105
views/html/achievements/create.tpl
Normal file
105
views/html/achievements/create.tpl
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<?=$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;
|
||||
} ?>
|
||||
</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>
|
||||
113
views/html/achievements/edit.tpl
Normal file
113
views/html/achievements/edit.tpl
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
<?=$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;
|
||||
} ?>
|
||||
</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
Loading…
Add table
Add a link
Reference in a new issue