今天就搞到这里,要去陪睡了
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php
|
||||
$fields = isset($post) ? $post->getFieldItems() : $page->getFieldItems();
|
||||
$defaultFields = isset($post) ? $post->getDefaultFieldItems() : $post->getDefaultFieldItems();
|
||||
?>
|
||||
<section id="custom-field" class="typecho-post-option fold">
|
||||
<label class="typecho-label"><?php _e('自定义字段'); ?></label>
|
||||
<table class="typecho-list-table mono">
|
||||
<colgroup>
|
||||
<col width="25%"/>
|
||||
<col width="10%"/>
|
||||
<col width=""/>
|
||||
<col width="10%"/>
|
||||
</colgroup>
|
||||
<?php foreach ($defaultFields as $field): ?>
|
||||
<?php list ($label, $input) = $field; ?>
|
||||
<tr>
|
||||
<td><?php $label->render(); ?></td>
|
||||
<td colspan="3"><?php $input->render(); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($fields as $field): ?>
|
||||
<tr>
|
||||
<td><input type="text" name="fieldNames[]" value="<?php echo htmlspecialchars($field['name']); ?>" class="text-s w-100"></td>
|
||||
<td>
|
||||
<select name="fieldTypes[]" id="">
|
||||
<option value="str"<?php if ('str' == $field['type']): ?> selected<?php endif; ?>><?php _e('字符'); ?></option>
|
||||
<option value="int"<?php if ('int' == $field['type']): ?> selected<?php endif; ?>><?php _e('整数'); ?></option>
|
||||
<option value="float"<?php if ('float' == $field['type']): ?> selected<?php endif; ?>><?php _e('小数'); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td><textarea name="fieldValues[]" class="text-s w-100" rows="2"><?php echo htmlspecialchars($field['value']); ?></textarea></td>
|
||||
<td>
|
||||
<button type="button" class="btn-xs"><?php _e('删除'); ?></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php if (empty($defaultFields) && empty($fields)): ?>
|
||||
<tr>
|
||||
<td><input type="text" name="fieldNames[]" placeholder="<?php _e('字段名称'); ?>" class="text-s w-100"></td>
|
||||
<td>
|
||||
<select name="fieldTypes[]" id="">
|
||||
<option value="str"><?php _e('字符'); ?></option>
|
||||
<option value="int"><?php _e('整数'); ?></option>
|
||||
<option value="float"><?php _e('小数'); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td><textarea name="fieldValues[]" placeholder="<?php _e('字段值'); ?>" class="text-s w-100" rows="2"></textarea></td>
|
||||
<td>
|
||||
<button type="button" class="btn-xs"><?php _e('删除'); ?></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<p class="description">
|
||||
<button type="button" class="btn-xs"><?php _e('+添加字段'); ?></button>
|
||||
<?php _e('自定义字段可以扩展你的模板功能, 使用方法参见 <a href="">帮助文档</a>'); ?>
|
||||
</p>
|
||||
</section>
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $content = !empty($post) ? $post : $page; if ($options->markdown && (!$content->have() || $content->isMarkdown)): ?>
|
||||
<script src="<?php $options->adminUrl('js/marked.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminUrl('js/pagedown.js?v=' . $suffixVersion); ?>"></script>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<script>
|
||||
(function () {
|
||||
$(document).ready(function () {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<script>
|
||||
(function () {
|
||||
$(document).ready(function () {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php Typecho_Plugin::factory('admin/write-js.php')->write(); ?>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Tag_Cloud', 'sort=count&desc=1&limit=200')->to($tags); ?>
|
||||
|
||||
|
||||
+1
-30
@@ -48,36 +48,7 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
|
||||
</div> -->
|
||||
|
||||
<?php include 'file-upload.php'; ?>
|
||||
|
||||
<section id="custom-field" class="typecho-post-option fold">
|
||||
<label class="typecho-label"><?php _e('自定义字段'); ?></label>
|
||||
<table class="mono">
|
||||
<tr>
|
||||
<th width="25%"><?php _e('KEY'); ?></th>
|
||||
<th width="10%"><?php _e('TYPE'); ?></th>
|
||||
<th><?php _e('VALUE'); ?></th>
|
||||
<th width="10%"></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" class="text-s w-100"></td>
|
||||
<td>
|
||||
<select name="" id="">
|
||||
<option value=""><?php _e('varchar'); ?></option>
|
||||
<option value=""><?php _e('int'); ?></option>
|
||||
<option value=""><?php _e('float'); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td><textarea class="text-s w-100" rows="2"></textarea></td>
|
||||
<td>
|
||||
<button type="button" class="btn-xs"><?php _e('删除'); ?></button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="description">
|
||||
<button type="button" class="btn-xs"><?php _e('+添加字段'); ?></button>
|
||||
<?php _e('自定义字段可以扩展你的模板功能, 使用方法参见 <a href="">帮助文档</a>'); ?>
|
||||
</p>
|
||||
</section>
|
||||
<?php include 'custom-fields.php'; ?>
|
||||
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->content($post); ?>
|
||||
<p class="submit clearfix">
|
||||
|
||||
Reference in New Issue
Block a user