1
0
mirror of https://github.com/typecho/typecho.git synced 2025-03-22 10:59:41 +01:00

给页面增加自定义字段

This commit is contained in:
joyqi 2013-11-27 11:12:59 +08:00
parent baa324c639
commit ee9958def5
2 changed files with 5 additions and 2 deletions

@ -1,7 +1,7 @@
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php
$fields = isset($post) ? $post->getFieldItems() : $page->getFieldItems();
$defaultFields = isset($post) ? $post->getDefaultFieldItems() : $post->getDefaultFieldItems();
$defaultFields = isset($post) ? $post->getDefaultFieldItems() : $page->getDefaultFieldItems();
?>
<section id="custom-field" class="typecho-post-option<?php if (empty($defaultFields) && empty($fields)): ?> fold<?php endif; ?>">
<label id="custom-field-expand" class="typecho-label"><i class="i-caret-right"></i> <?php _e('自定义字段'); ?></label>

@ -38,7 +38,7 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
<textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text" name="text" class="w-100 mono"><?php echo htmlspecialchars($page->text); ?></textarea>
</p>
<?php Typecho_Plugin::factory('admin/write-page.php')->content($page); ?>
<?php include 'custom-fields.php'; ?>
<p class="submit clearfix">
<span class="right">
<input type="hidden" name="cid" value="<?php $page->cid(); ?>" />
@ -49,6 +49,8 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
<?php endif; ?>
</span>
</p>
<?php Typecho_Plugin::factory('admin/write-page.php')->content($page); ?>
</div>
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
<ul class="typecho-option-tabs clearfix">
@ -141,6 +143,7 @@ if (!$plugged) {
}
include 'file-upload-js.php';
include 'custom-fields-js.php';
Typecho_Plugin::factory('admin/write-page.php')->bottom($page);
include 'footer.php';
?>