diff options
Diffstat (limited to 'theme/admin/html/post/form.php')
-rw-r--r-- | theme/admin/html/post/form.php | 27 |
1 files changed, 26 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> |