implement Character registration
This commit is contained in:
parent
723ea4f750
commit
b88d39b3c0
6 changed files with 343 additions and 11 deletions
72
views/html/characters/register.tpl
Normal file
72
views/html/characters/register.tpl
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php if(!is_null($media)) : ?>
|
||||
<div class="moodpic">
|
||||
<img src="<?=$linker->link(array('media','index',$media['url']))?>">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<h1><?=$seminary['title']?></h1>
|
||||
<h2><?=_('Create Character')?></h2>
|
||||
|
||||
<form method="post" action="">
|
||||
<?php if($validation !== true) : ?>
|
||||
<ul>
|
||||
<?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;
|
||||
default: echo _('Character name invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<fieldset>
|
||||
<legend><?=_('Character properties')?></legend>
|
||||
<label for="charactername"><?=_('Character name')?>:</label>
|
||||
<input type="text" name="charactername" placeholder="<?=_('Character name')?>" required="required" value="<?=$charactername?>" /><br />
|
||||
<label for="type"><?=_('Character type')?>:</label>
|
||||
<select name="type" required="required">
|
||||
<?php foreach($types as &$type) : ?>
|
||||
<option value="<?=$type['url']?>" <?php if(array_key_exists('selected', $type) && $type['selected']) : ?>selected="selected"<?php endif ?>><?=$type['name']?></option>
|
||||
<?php endforeach ?>
|
||||
</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><?=_('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($field['required']) : ?>required="required"<?php endif ?>/>
|
||||
<?php break;
|
||||
case 'Text': ?>
|
||||
<textarea name="fields[<?=$field['url']?>]"></textarea>
|
||||
<?php break;
|
||||
} ?>
|
||||
<?php endforeach ?>
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue