From 52b077a48c743ba4d08ac00520a0bf1ef6deef5f Mon Sep 17 00:00:00 2001
From: Thomas Lange <code@nerdmind.de>
Date: Fri, 24 Feb 2017 21:27:59 +0100
Subject: Initial commit.

---
 template/admin/html/post/delete.php |  4 ++
 template/admin/html/post/form.php   | 91 +++++++++++++++++++++++++++++++++++++
 template/admin/html/post/index.php  | 10 ++++
 template/admin/html/post/insert.php |  4 ++
 template/admin/html/post/item.php   | 16 +++++++
 template/admin/html/post/update.php |  4 ++
 6 files changed, 129 insertions(+)
 create mode 100644 template/admin/html/post/delete.php
 create mode 100644 template/admin/html/post/form.php
 create mode 100644 template/admin/html/post/index.php
 create mode 100644 template/admin/html/post/insert.php
 create mode 100644 template/admin/html/post/item.php
 create mode 100644 template/admin/html/post/update.php

(limited to 'template/admin/html/post')

diff --git a/template/admin/html/post/delete.php b/template/admin/html/post/delete.php
new file mode 100644
index 0000000..9be4566
--- /dev/null
+++ b/template/admin/html/post/delete.php
@@ -0,0 +1,4 @@
+<h1><i class="fa fa-trash-o"></i><?=$Language->text('delete_post')?></h1>
+<p><?=$Language->template('delete_post_desc')?></p>
+
+<?=$HTML?>
\ No newline at end of file
diff --git a/template/admin/html/post/form.php b/template/admin/html/post/form.php
new file mode 100644
index 0000000..cba4aa8
--- /dev/null
+++ b/template/admin/html/post/form.php
@@ -0,0 +1,91 @@
+<?php if(isset($FORM['INFO'])): ?>
+	<?php foreach($FORM['INFO'] as $message): ?>
+		<div class="red"><?=$message?></div>
+	<?php endforeach; ?>
+<?php endif; ?>
+
+<form action="" method="POST">
+	<input type="hidden" name="token" value="<?=$FORM['TOKEN']?>" />
+
+<?php if($FORM['TYPE'] !== 'DELETE'): ?>
+	<section class="flex flex-responsive">
+		<section>
+			<div class="form-icon-flex"><i class="fa fa-database"></i></div>
+			<div class="form-label-flex"><label for="L_ID">ID</label></div>
+			<div class="form-field-flex"><input<?=($FORM['TYPE'] === 'UPDATE') ? ' disabled="disabled"' : '';?> id="L_ID" name="id" placeholder="[AUTO_INCREMENT]" value="<?=escapeHTML($FORM['DATA']['ID'])?>" /></div>
+		</section>
+		<section>
+			<div class="form-icon-flex"><i class="fa fa-user"></i></div>
+			<div class="form-label-flex"><label for="L_USER"><?=$Language->template('LABEL_USER')?></label></div>
+			<div class="form-field-flex">
+				<select id="L_USER" name="user">
+					<?php foreach($FORM['USER_LIST'] as $user): ?>
+						<option value="<?=$user['ID']?>"<?=($FORM['DATA']['USER'] === $user['ID']) ? ' selected' : '' ?>><?=escapeHTML($user['FULLNAME'])?> [<?=$user['USERNAME']?>]</option>
+					<?php endforeach; ?>
+				</select>
+			</div>
+		</section>
+	</section>
+	<section class="flex flex-responsive">
+		<section>
+			<div class="form-icon-flex"><i class="fa fa-newspaper-o"></i></div>
+			<div class="form-label-flex"><label for="L_NAME"><?=$Language->template('LABEL_NAME')?></label></div>
+			<div class="form-field-flex"><input id="L_NAME" name="name" value="<?=escapeHTML($FORM['DATA']['NAME'])?>" /></div>
+		</section>
+		<section>
+			<div class="form-icon-flex"><i class="fa fa-link"></i></div>
+			<div class="form-label-flex"><label for="L_SLUG"><?=$Language->template('LABEL_SLUG')?></label></div>
+			<div class="form-field-flex"><input id="L_SLUG" name="slug" value="<?=escapeHTML($FORM['DATA']['SLUG'])?>" /></div>
+		</section>
+	</section>
+	<section class="flex flex-responsive">
+		<section>
+			<div class="form-icon-flex"><i class="fa fa-clock-o"></i></div>
+			<div class="form-label-flex"><label for="L_TIME_INSERT"><?=$Language->template('LABEL_INSERT')?></label></div>
+			<div class="form-field-flex"><input id="L_TIME_INSERT" name="time_insert" placeholder="[YYYY-MM-DD HH:II:SS]" value="<?=escapeHTML($FORM['DATA']['TIME_INSERT'])?>" /></div>
+		</section>
+		<section>
+			<div class="form-icon-flex"><i class="fa fa-clock-o"></i></div>
+			<div class="form-label-flex"><label for="L_TIME_UPDATE"><?=$Language->template('LABEL_UPDATE')?></label></div>
+			<div class="form-field-flex"><input id="L_TIME_UPDATE" name="time_update" placeholder="<?=escapeHTML($FORM['DATA']['TIME_UPDATE'] ? $FORM['DATA']['TIME_UPDATE'] : '[CURRENT_TIMESTAMP]')?>" value="" /></div>
+		</section>
+	</section>
+	<section class="flex flex-padding">
+		<textarea id="content-editor" name="body" placeholder="[…]"><?=escapeHTML($FORM['DATA']['BODY'])?></textarea>
+	</section>
+	<section class="flex flex-padding background flex-emoticons">
+		<ul class="button-list emoticons">
+			<?php foreach(getEmoticons() as $emoticon => $data):?>
+				<li onmousedown="emoticonReplace('<?=$emoticon?>')" title="<?=$data[1]?>"><?=$data[0]?></li>
+			<?php endforeach; ?>
+		</ul>
+	</section>
+	<section class="flex flex-padding background">
+		<ul class="button-list markdown">
+			<li onmousedown="markdownReplace('bold');" class="fa fa-bold" title="Bold"></li>
+			<li onmousedown="markdownReplace('italic');" class="fa fa-italic" title="Italic"></li>
+			<li onmousedown="markdownReplace('header');" class="fa fa-header" title="Heading"></li>
+			<li onmousedown="markdownReplace('link');" class="fa fa-link" title="Link"></li>
+			<li onmousedown="markdownReplace('image');" class="fa fa-picture-o" title="Image"></li>
+			<li onmousedown="markdownReplace('code');" class="fa fa-code" title="Code"></li>
+			<li onmousedown="markdownReplace('quote');" class="fa fa-quote-right" title="Quote"></li>
+			<li onmousedown="markdownReplace('list_ul');" class="fa fa-list-ul" title="List [unordered]"></li>
+			<li onmousedown="markdownReplace('list_ol');" class="fa fa-list-ol" title="List [ordered]"></li>
+		</ul>
+	</section>
+<?php else: ?>
+	<section class="flex flex-padding background flex-direction-column">
+		<?=$HTML?>
+	</section>
+<?php endif; ?>
+
+	<section class="flex flex-padding background">
+		<?php if($FORM['TYPE'] === 'INSERT'): ?>
+			<input type="submit" name="insert" value="<?=$Language->text('insert')?>" />
+		<?php elseif($FORM['TYPE'] === 'UPDATE'): ?>
+			<input type="submit" name="update" value="<?=$Language->text('update')?>" />
+		<?php elseif($FORM['TYPE'] === 'DELETE'): ?>
+			<input type="submit" name="delete" value="<?=$Language->text('delete')?>" onclick="return confirm('<?=$Language->template('sure')?>')" />
+		<?php endif; ?>
+	</section>
+</form>
\ No newline at end of file
diff --git a/template/admin/html/post/index.php b/template/admin/html/post/index.php
new file mode 100644
index 0000000..481cafe
--- /dev/null
+++ b/template/admin/html/post/index.php
@@ -0,0 +1,10 @@
+<h1><i class="fa fa-newspaper-o"></i><?=$Language->text('post_overview')?><a class="brackets" href="<?=Application::getAdminURL("post/insert.php")?>"><?=$Language->text('insert')?></a></h1>
+<p><?=$Language->template('overview_post_desc')?></p>
+
+<ul class="item-list">
+	<?php foreach($LIST['POSTS'] as $post): ?>
+		<?php echo $post; ?>
+	<?php endforeach; ?>
+</ul>
+
+<?=$PAGINATION['HTML']?>
\ No newline at end of file
diff --git a/template/admin/html/post/insert.php b/template/admin/html/post/insert.php
new file mode 100644
index 0000000..df4b26d
--- /dev/null
+++ b/template/admin/html/post/insert.php
@@ -0,0 +1,4 @@
+<h1><i class="fa fa-newspaper-o"></i><?=$Language->text('insert_post')?></h1>
+<p><?=$Language->template('insert_post_desc')?></p>
+
+<?=$HTML?>
\ No newline at end of file
diff --git a/template/admin/html/post/item.php b/template/admin/html/post/item.php
new file mode 100644
index 0000000..1b942bd
--- /dev/null
+++ b/template/admin/html/post/item.php
@@ -0,0 +1,16 @@
+<li class="content">
+	<header>
+		<h2><i class="fa fa-newspaper-o"></i><?=escapeHTML($POST['ATTR']['NAME'])?><span>#<?=$POST['ID']?></span></h2>
+		<div><a class="brackets" href="<?=Application::getAdminURL("user/update.php?id={$USER['ID']}")?>"><?=escapeHTML($USER['ATTR']['FULLNAME'])?></a></div>
+	</header>
+	<article>
+		<p><?=excerpt($POST['BODY']['HTML'])?></p>
+	</article>
+	<footer>
+		<ul>
+			<li><a href="<?=$POST['URL']?>" target="_blank" title="<?=$Language->text('select_post')?>"><i class="fa fa-external-link"></i></a></li>
+			<li><a href="<?=Application::getAdminURL("post/update.php?id={$POST['ID']}")?>" title="<?=$Language->text('update_post')?>"><i class="fa fa-pencil-square-o"></i></a></li>
+			<li><a href="<?=Application::getAdminURL("post/delete.php?id={$POST['ID']}")?>" title="<?=$Language->text('delete_post')?>"><i class="fa fa-trash-o"></i></a></li>
+		</ul>
+	</footer>
+</li>
\ No newline at end of file
diff --git a/template/admin/html/post/update.php b/template/admin/html/post/update.php
new file mode 100644
index 0000000..baa119e
--- /dev/null
+++ b/template/admin/html/post/update.php
@@ -0,0 +1,4 @@
+<h1><i class="fa fa-newspaper-o"></i><?=$Language->text('update_post')?></h1>
+<p><?=$Language->template('update_post_desc')?></p>
+
+<?=$HTML?>
\ No newline at end of file
-- 
cgit v1.2.3