aboutsummaryrefslogtreecommitdiffstats
path: root/theme/admin/html/post
diff options
context:
space:
mode:
Diffstat (limited to 'theme/admin/html/post')
-rw-r--r--theme/admin/html/post/form.php27
-rw-r--r--theme/admin/html/post/item.php3
2 files changed, 29 insertions, 1 deletions
diff --git a/theme/admin/html/post/form.php b/theme/admin/html/post/form.php
index 346d6f4..4ae07bd 100644
--- a/theme/admin/html/post/form.php
+++ b/theme/admin/html/post/form.php
@@ -1,3 +1,18 @@
+<?php
+function categorySelectList($category_tree, $selected = NULL, $prefix = '') {
+ foreach($category_tree as $category) {
+ $option = '<option value="%s"%s>%s%s [%d]</option>';
+ $select = ($category['ID'] == $selected) ? ' selected' : '';
+
+ printf($option, $category['ID'], $select, $prefix, escapeHTML($category['NAME']), $category['ID']);
+
+ if(isset($category['CHILDS'])) {
+ # If there are children, call self and pass children array.
+ (__FUNCTION__)($category['CHILDS'], $selected, $prefix.'– ');
+ }
+ }
+}
+?>
<?php if($FORM['INFO']): ?>
<div id="message-list-wrapper">
<ul id="message-list">
@@ -16,7 +31,7 @@
<label for="form_name">
<i class="fa fa-newspaper-o"></i><?=$Language->text('label_name')?></label>
- <div class="form-grid-item first">
+ <div class="form-grid-item">
<input id="form_name" name="name" value="<?=escapeHTML($FORM['DATA']['NAME'])?>" />
</div>
@@ -27,6 +42,16 @@
<input id="form_slug" name="slug" value="<?=escapeHTML($FORM['DATA']['SLUG'])?>" />
</div>
+ <label for="form_category">
+ <i class="fa fa-tag"></i><?=$Language->text('label_category')?></label>
+
+ <div class="form-grid-item">
+ <select id="form_category" name="category">
+ <option value="">[ –– <?=$Language->text('label_category')?> –– ]</option>
+ <?=categorySelectList($FORM['CATEGORY_TREE'], $FORM['DATA']['CATEGORY']);?>
+ </select>
+ </div>
+
<label for="form_user">
<i class="fa fa-user"></i><?=$Language->text('label_user')?></label>
diff --git a/theme/admin/html/post/item.php b/theme/admin/html/post/item.php
index ae06752..41991d5 100644
--- a/theme/admin/html/post/item.php
+++ b/theme/admin/html/post/item.php
@@ -4,6 +4,9 @@
<div>
<span class="brackets item-id">#<?=$POST['ATTR']['ID']?></span>
<a class="brackets" href="<?=Application::getAdminURL("user/update.php?id={$USER['ATTR']['ID']}")?>" title="<?=$Language->text('update_user')?>"><?=escapeHTML($USER['ATTR']['FULLNAME'])?></a>
+ <?php if($CATEGORY): ?>
+ <a class="brackets" href="<?=Application::getAdminURL("category/update.php?id={$CATEGORY['ATTR']['ID']}")?>" title="<?=$Language->text('update_category')?>"><?=escapeHTML($CATEGORY['ATTR']['NAME'])?></a>
+ <?php endif ?>
<time class="brackets" datetime="<?=$POST['ATTR']['TIME_INSERT']?>"><?=parseDatetime($POST['ATTR']['TIME_INSERT'], $Language->text('date_format'))?></time>
</div>
</header>