add additional pages and handle introduction page as ?system? page
This commit is contained in:
parent
02e7665fb7
commit
8c5c7e0b13
15 changed files with 812 additions and 44 deletions
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'])?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue