40 Commits

Author SHA1 Message Date
Copilot
4079a64a88 修复 PHP 8.5 中 curl_close() 弃用警告 (#1924)
* Initial plan

* 移除 curl_close() 调用以修复 PHP 8.5 弃用警告

Co-authored-by: joyqi <59437+joyqi@users.noreply.github.com>

* 使用 PHP 版本检查兼容 PHP 7.4 的 curl_close 处理

Co-authored-by: joyqi <59437+joyqi@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: joyqi <59437+joyqi@users.noreply.github.com>
2025-11-27 11:37:42 +08:00
猫东东
9364388035 修复 PHP 8.4+ 中 PDO::MYSQL_ATTR_USE_BUFFERED_QUERY 的弃用警告 (#1922) 2025-11-27 09:05:18 +08:00
Luffy
7a3c86a110 Support connect to mysql using socket (#1749)
* Support connect to mysql using socket

* pgsql can also use unix_socket

fix Deprecated: pg_escape_string(): Automatic fetching of PostgreSQL connection

* Update install.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update var/Typecho/Db/Adapter/Mysqli.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix quoteValue method to correctly escape single quotes in strings

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-20 23:55:43 +08:00
Luffy
15967ea059 Fix login failed when username contains @ (#1894)
* Fix login failed when username contains @

* Update var/Widget/User.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-20 17:17:31 +08:00
Luffy
570f982709 Add 'NOT' to query keywords (#1903) 2025-11-19 22:28:13 +08:00
Luffy
6dbcdf7eae Fix explicitly declare nullable type for $rules parameter (#1908) 2025-08-08 12:09:21 +08:00
joyqi
5e7e10969e fix default theme's i18n problem https://github.com/typecho/languages/issues/49 2025-08-05 11:01:31 +08:00
joyqi
3d261e08b9 fix: don't send ping back to self 2025-08-01 18:04:18 +08:00
joyqi
546470b2de update hyperdown 2025-07-04 15:10:18 +08:00
joyqi
23cdc89441 fix #1882 (#1883) 2025-06-27 11:12:45 +08:00
Luffy
d9d0be334d Update canonical link condition (#1881) 2025-06-11 16:39:39 +08:00
joyqi
ba4e4134ad fix form validate error 2025-06-05 15:10:47 +08:00
joyqi
7ef2c08a96 fix validate error 2025-06-05 15:09:03 +08:00
joyqi
db8a3f7f3e fix nullable parameter error 2025-06-05 14:34:22 +08:00
joyqi
5ef475b73f feat: validate via regexp (#1877) 2025-05-12 23:40:38 +08:00
joyqi
917a763811 Feat/improve styles (#1868)
* improve css

* fix table

* fix write page

* improve header nav

* fix menu

* fix menu

* fix menu

* add flex grid system

* fix

* fix flex

* fix draft version

* using main html element to replace div

* improve css

* add input type number

* fix custom-fields

* fix screen
2025-05-09 16:12:56 +08:00
Robert Silén
50d572a0af Add MariaDB to README.md (#1827) 2025-02-19 10:50:05 +08:00
Luffy
752fc6b0ad Fix missing nameExists and mailExists (#1854) 2025-02-03 10:47:29 +08:00
Luffy
95f6e7b4f5 Remove debug output from category selection in Archive widget (#1852) 2025-02-03 10:40:12 +08:00
Pomelo_Official
67a830f86b fix typo "稍侯" to "稍候" (#1850)
fix typo "稍侯" to "稍候"
2025-01-31 13:35:15 +08:00
Luffy
8ff55f5266 Fix #1846 (#1847) 2025-01-14 21:56:48 +08:00
joyqi
8035b22347 fix #1843 (#1844)
* fix #1843
Remove categroy name-exists detecting

* detect category-exists only in the same level
2025-01-13 16:48:46 +08:00
joyqi
b989f24c5b Fix/1754 (#1842)
* add deprecated methods

* fix #1754
2025-01-11 17:51:29 +08:00
joyqi
23724c4193 fix #1830 (#1841) 2025-01-10 14:53:47 +08:00
joyqi
6ddf1c1a23 fix #1816 (#1839)
* fix #1816

* fix call stack

* fix typo error
2025-01-07 19:42:15 +08:00
Luffy
7d51b210c9 Fix manage comments failed (#1838) 2025-01-04 12:45:16 +08:00
Mr. Chip
91876b42aa Fix: fix preg_match parameter#2 $subject is null deprecated issue (#1798) 2024-09-23 10:49:47 +08:00
Luffy
5783cb0d01 fix sendPingHandle warning (#1808) 2024-09-23 10:48:19 +08:00
ZShijun
87d479dd57 Update Login.php (#1804)
修复勾选下次自动登录,但重启浏览器不生效的bug
2024-09-11 10:59:32 +08:00
Luffy
ef9ef2ce45 Require PHP 7.4.0 or higher (#1785) 2024-07-24 15:51:19 +08:00
陆之岇
31f5192c9d Fix timezone error in XmlRpc (#1758)
Signed-off-by: Kraity <kraity@krait.cn>
2024-06-20 11:22:51 +08:00
Luffy
4ce9cdefc2 Fix TypeError: Typed property Typecho\Feed::$subTitle must be string (#1779) 2024-06-12 10:47:06 +08:00
Luffy
0b0476e565 Fix missing WidgetException error message (#1730) 2024-04-19 12:11:39 +08:00
Fen
71c6381b15 fix: nav menu active style (#1752) 2024-03-29 11:38:30 +08:00
Fen
fa107ffa51 update picocss to 2.0 (#1751) 2024-03-28 15:37:19 +08:00
Luffy
d84e261f7b Fix missing get date (#1740) 2024-02-28 10:57:47 +08:00
Luffy
3933a23ad7 Fix assign null to property Widget\Archive::$archiveKeywords (#1738)
* Fix assign null to property Widget\Archive::$archiveKeywords

* Fix
2024-02-26 11:52:17 +08:00
fen
0a40b1e7ee improve: comment color 2024-01-29 16:32:38 +08:00
Lu Fei
bda7541682 Limit build execution (#1723) 2024-01-29 12:05:30 +08:00
joyqi
f3a5336c1a Remove comment link if status is not approved (#1712)
* remove comment link if status is not approved

* fix stack

* fix: remove link in admin panel when comment status is not approved

* fix: comments page nav

* fix comment redirect url

* fix comment anchor

* fix waiting comment display

* fix: convert waiting to unapproved
2024-01-25 14:24:47 +08:00
113 changed files with 3084 additions and 2936 deletions

View File

@@ -30,7 +30,7 @@ jobs:
build:
name: Typecho Build
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'skip ci') && github.event_name != 'pull_request' }}
if: ${{ !contains(github.event.head_commit.message, 'skip ci') && github.event_name != 'pull_request' && github.repository == 'typecho/typecho' }}
needs:
- php
steps:

0
.gitmodules vendored
View File

View File

@@ -6,7 +6,7 @@ Typecho is released under the GNU General Public License 2.0.
## Main Features
* Multiple databases support (MySQL, SQLite, PostgreSQL)
* Multiple databases support (MariaDB, MySQL, SQLite, PostgreSQL)
* Markdown Support
* Plugin Support
* Theme Support
@@ -15,9 +15,9 @@ Typecho is released under the GNU General Public License 2.0.
## Requirements
* PHP 7.2.0 or higher
* Database (MySQL, SQLite, PostgreSQL)
* MySQL 5.5.3 or higher
* PHP 7.4.0 or higher
* Database (MariaDB, MySQL, SQLite, PostgreSQL)
* MariaDB or MySQL 5.5.3 or higher
* SQLite 3.7.11 or higher
* PostgreSQL 9.1 or higher

View File

@@ -10,7 +10,7 @@ $actionUrl = $security->getTokenUrl(
$backupFiles = \Widget\Backup::alloc()->listFiles();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
@@ -31,7 +31,7 @@ $backupFiles = \Widget\Backup::alloc()->listFiles();
<div id="backup-secondary" class="col-mb-12 col-tb-4" role="form">
<h3><?php _e('恢复数据'); ?></h3>
<ul class="typecho-option-tabs clearfix">
<ul class="typecho-option-tabs">
<li class="active w-50"><a href="#from-upload"><?php _e('上传'); ?></a></li>
<li class="w-50"><a href="#from-server"><?php _e('从服务器'); ?></a></li>
</ul>
@@ -79,7 +79,7 @@ $backupFiles = \Widget\Backup::alloc()->listFiles();
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -25,31 +25,10 @@
if (head.length > 0) {
p.insertAfter(head);
offset = head.outerHeight();
} else {
p.prependTo(document.body);
}
function checkScroll () {
if ($(window).scrollTop() >= offset) {
p.css({
'position' : 'fixed',
'top' : 0
});
} else {
p.css({
'position' : 'absolute',
'top' : offset
});
}
}
$(window).scroll(function () {
checkScroll();
});
checkScroll();
p.slideDown(function () {
var t = $(this), color = '#C6D880';
@@ -75,50 +54,6 @@
}
})();
// 导航菜单 tab 聚焦时展开下拉菜单
const menuBar = $('.menu-bar').click(function () {
const nav = $(this).next('#typecho-nav-list');
if (!$(this).toggleClass('focus').hasClass('focus')) {
nav.removeClass('expanded noexpanded');
}
});
$('.main, .typecho-foot').on('click touchstart', function () {
if (menuBar.hasClass('focus')) {
menuBar.trigger('click');
}
});
$('#typecho-nav-list ul.root').each(function () {
const ul = $(this), nav = ul.parent();
let focused = false;
ul.on('click touchend', '.parent a', function (e) {
nav.removeClass('noexpanded').addClass('expanded');
if ($(window).width() < 576 && e.type == 'click') {
return false;
}
}).find('.child')
.append($('<li class="return"><a><?php _e('返回'); ?></a></li>').click(function () {
nav.removeClass('expanded').addClass('noexpanded');
return false;
}));
$('a', ul).focus(function () {
ul.addClass('expanded');
focused = true;
}).blur(function () {
focused = false;
setTimeout(function () {
if (!focused) {
ul.removeClass('expanded');
}
});
});
});
if ($('.typecho-login').length == 0) {
$('a').each(function () {
var t = $(this), href = t.attr('href');

View File

@@ -1,5 +1,5 @@
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
<div class="typecho-foot" role="contentinfo">
<footer class="typecho-foot" role="contentinfo">
<div class="copyright">
<a href="https://typecho.org" class="i-logo-s">Typecho</a>
<p><?php _e('由 <a href="https://typecho.org">%s</a> 强力驱动, 版本 %s', $options->software, $options->version); ?></p>
@@ -10,4 +10,4 @@
<a href="https://github.com/typecho/typecho/issues"><?php _e('报告错误'); ?></a> &bull;
<a href="https://typecho.org/download"><?php _e('资源下载'); ?></a>
</nav>
</div>
</footer>

File diff suppressed because one or more lines are too long

View File

@@ -11,6 +11,7 @@
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-moz-text-size-adjust: 100%; /* 2 */
}
/* Sections

File diff suppressed because one or more lines are too long

View File

@@ -2,21 +2,10 @@
<script>
$(document).ready(function () {
// 自定义字段
$('#custom-field-expand').click(function() {
var btn = $('i', this);
if (btn.hasClass('i-caret-right')) {
btn.removeClass('i-caret-right').addClass('i-caret-down');
} else {
btn.removeClass('i-caret-down').addClass('i-caret-right');
}
$(this).parent().toggleClass('fold');
return false;
});
function attachDeleteEvent (el) {
$('button.btn-xs', el).click(function () {
if (confirm('<?php _e('确认要删除此字段吗?'); ?>')) {
$(this).parents('tr').fadeOut(function () {
$(this).parents('li').fadeOut(function () {
$(this).remove();
});
@@ -25,20 +14,21 @@ $(document).ready(function () {
});
}
$('#custom-field table tbody tr').each(function () {
$('#custom-field .fields .field').each(function () {
attachDeleteEvent(this);
});
$('#custom-field button.operate-add').click(function () {
var html = '<tr><td><input type="text" name="fieldNames[]" placeholder="<?php _e('字段名称'); ?>" pattern="^[_a-zA-Z][_a-zA-Z0-9]*$" oninput="this.reportValidity()" class="text-s w-100"></td>'
+ '<td><select name="fieldTypes[]" id="">'
var html = '<li class="field"><div class="field-name"><input type="text" name="fieldNames[]" placeholder="<?php _e('字段名称'); ?>" pattern="^[_a-zA-Z][_a-zA-Z0-9]*$" oninput="this.reportValidity()" class="text-s w-100">'
+ '<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 btn-xs"><?php _e('删除'); ?></button></td></tr>',
el = $(html).hide().appendTo('#custom-field table tbody').fadeIn();
+ '<option value="json"><?php _e('JSON 结构'); ?></option>'
+ '</select></div>'
+ '<div class="field-value"><textarea name="fieldValues[]" placeholder="<?php _e('字段值'); ?>" class="text-s w-100" rows="2"></textarea>'
+ '<button type="button" class="btn btn-xs"><?php _e('删除'); ?></button></div></li>',
el = $(html).hide().appendTo('#custom-field .fields').fadeIn();
attachDeleteEvent(el);
});

View File

@@ -3,32 +3,23 @@
$fields = isset($post) ? $post->getFieldItems() : $page->getFieldItems();
$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"><a href="##"><i
class="i-caret-right"></i> <?php _e('自定义字段'); ?></a></label>
<table class="typecho-list-table mono">
<colgroup>
<col width="20%"/>
<col width="15%"/>
<col width="55%"/>
<col width="10%"/>
</colgroup>
<details id="custom-field"
class="typecho-post-option" <?php if (!empty($defaultFields) || !empty($fields)): ?>open<?php endif; ?>>
<summary><?php _e('自定义字段'); ?></summary>
<ul class="fields mono">
<?php foreach ($defaultFields as $field): ?>
<?php [$label, $input] = $field; ?>
<tr>
<td><?php $label->render(); ?></td>
<td colspan="3"><?php $input->render(); ?></td>
</tr>
<li class="field">
<div class="field-name"><?php $label->render(); ?></div>
<div class="field-value"><?php $input->render(); ?></div>
</li>
<?php endforeach; ?>
<?php foreach ($fields as $field): ?>
<tr>
<td>
<li class="field">
<div class="field-name">
<label for="fieldname" class="sr-only"><?php _e('字段名称'); ?></label>
<input type="text" name="fieldNames[]" value="<?php echo htmlspecialchars($field['name']); ?>"
id="fieldname" pattern="^[_a-zA-Z][_a-zA-Z0-9]*$" oninput="this.reportValidity()" class="text-s w-100">
</td>
<td>
<label for="fieldtype" class="sr-only"><?php _e('字段类型'); ?></label>
<select name="fieldTypes[]" id="fieldtype">
<option
@@ -40,45 +31,42 @@ $defaultFields = isset($post) ? $post->getDefaultFieldItems() : $page->getDefaul
<option
value="json"<?php if ('json' == $field['type']): ?> selected<?php endif; ?>><?php _e('JSON 结构'); ?></option>
</select>
</td>
<td>
</div>
<div class="field-value">
<label for="fieldvalue" class="sr-only"><?php _e('字段值'); ?></label>
<textarea name="fieldValues[]" id="fieldvalue" class="text-s w-100"
rows="2"><?php echo htmlspecialchars($field[($field['type'] == 'json' ? 'str' : $field['type']) . '_value']); ?></textarea>
</td>
<td>
<button type="button" class="btn btn-xs"><?php _e('删除'); ?></button>
</td>
</tr>
</div>
</li>
<?php endforeach; ?>
<?php if (empty($defaultFields) && empty($fields)): ?>
<tr>
<td>
<li class="field">
<div class="field-name">
<label for="fieldname" class="sr-only"><?php _e('字段名称'); ?></label>
<input type="text" name="fieldNames[]" placeholder="<?php _e('字段名称'); ?>" id="fieldname"
class="text-s w-100" pattern="^[_a-zA-Z][_a-zA-Z0-9]*$" oninput="this.reportValidity()">
</td>
<td>
<label for="fieldtype" class="sr-only"><?php _e('字段类型'); ?></label>
<select name="fieldTypes[]" id="fieldtype">
<option value="str"><?php _e('字符'); ?></option>
<option value="int"><?php _e('整数'); ?></option>
<option value="float"><?php _e('小数'); ?></option>
<option value="json"><?php _e('JSON 结构'); ?></option>
</select>
</td>
<td>
</div>
<div class="field-value">
<label for="fieldvalue" class="sr-only"><?php _e('字段值'); ?></label>
<textarea name="fieldValues[]" placeholder="<?php _e('字段值'); ?>" id="fieldvalue"
class="text-s w-100" rows="2"></textarea>
</td>
<td>
<button type="button" class="btn btn-xs"><?php _e('删除'); ?></button>
</td>
</tr>
</div>
</li>
<?php endif; ?>
</table>
<div class="description clearfix">
</ul>
<div class="add">
<button type="button" class="btn btn-xs operate-add"><?php _e('+添加字段'); ?></button>
<?php _e('自定义字段可以扩展你的模板功能, 使用方法参见 <a href="https://docs.typecho.org/help/custom-fields">帮助文档</a>'); ?>
<div class="description kit-hidden-mb">
<?php _e('自定义字段可以扩展你的模板功能, 使用方法参见 <a href="https://docs.typecho.org/help/custom-fields">帮助文档</a>'); ?>
</div>
</div>
</section>
</details>

View File

@@ -214,7 +214,7 @@ $(document).ready(function () {
};
// 编辑预览切换
const edittab = $('.editor').prepend('<div class="wmd-edittab"><a href="#wmd-editarea" class="active"><?php _e('撰写'); ?></a><a href="#wmd-preview"><?php _e('预览'); ?></a></div>'),
const edittab = $('.editor').append('<div class="wmd-edittab"><a href="#wmd-editarea" class="active"><?php _e('撰写'); ?></a><a href="#wmd-preview"><?php _e('预览'); ?></a></div>'),
editarea = $(textarea.parent()).attr("id", "wmd-editarea");
$(".wmd-edittab a").click(function() {

View File

@@ -8,7 +8,7 @@ $header = '<link rel="stylesheet" href="' . $options->adminStaticUrl('css', 'nor
<link rel="stylesheet" href="' . $options->adminStaticUrl('css', 'style.css', true) . '">';
/** 注册一个初始化插件 */
$header = \Typecho\Plugin::factory('admin/header.php')->call('header', $header);
$header = \Typecho\Plugin::factory('admin/header.php')->filter('header', $header);
?><!DOCTYPE HTML>
<html>

View File

@@ -5,7 +5,7 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
?>
<div class="main">
<main class="main">
<div class="container typecho-dashboard">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main">
@@ -14,7 +14,7 @@ $stat = \Widget\Stat::alloc();
$stat->myPublishedPostsNum, $stat->myPublishedCommentsNum, $stat->categoriesNum); ?>
<br><?php _e('点击下面的链接快速开始:'); ?></p>
<ul id="start-link" class="clearfix">
<ul id="start-link">
<?php if ($user->pass('contributor', true)): ?>
<li><a href="<?php $options->adminUrl('write-post.php'); ?>"><?php _e('撰写新文章'); ?></a></li>
<?php if ($user->pass('editor', true) && 'on' == $request->get('__typecho_all_comments') && $stat->waitingCommentsNum > 0): ?>
@@ -102,7 +102,7 @@ $stat = \Widget\Stat::alloc();
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,7 @@ include 'menu.php';
\Widget\Metas\Category\Admin::alloc()->to($categories);
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main manage-metas">
@@ -14,7 +14,7 @@ include 'menu.php';
<div class="col-mb-12" role="main">
<form method="post" name="manage_categories" class="operate-form">
<div class="typecho-list-operate clearfix">
<div class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
@@ -44,77 +44,74 @@ include 'menu.php';
</div>
</div>
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="20" class="kit-hidden-mb"/>
<col width=""/>
<col width="15%" class="kit-hidden-mb"/>
<col width="25%"/>
<col width="15%"/>
<col width="10%" class="kit-hidden-mb"/>
</colgroup>
<thead>
<tr class="nodrag">
<th class="kit-hidden-mb"></th>
<th><?php _e('名称'); ?></th>
<th><?php _e('子分类'); ?></th>
<th class="kit-hidden-mb"><?php _e('缩略名'); ?></th>
<th></th>
<th class="kit-hidden-mb"><?php _e('文章数'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($categories->have()): ?>
<?php while ($categories->next()): ?>
<tr id="mid-<?php $categories->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox"
value="<?php $categories->mid(); ?>"
name="mid[]"/></td>
<td>
<a href="<?php $options->adminUrl('category.php?mid=' . $categories->mid); ?>"><?php $categories->name(); ?></a>
<a href="<?php $categories->permalink(); ?>"
title="<?php _e('浏览 %s', $categories->name); ?>"><i class="i-exlink"></i></a>
</td>
<td>
<table class="typecho-list-table">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width=""/>
<col width="15%" class="kit-hidden-mb"/>
<col width="20%"/>
<col width="15%"/>
<col width="15%" class="kit-hidden-mb"/>
</colgroup>
<thead>
<tr class="nodrag">
<th class="kit-hidden-mb"></th>
<th><?php _e('名称'); ?></th>
<th><?php _e('子分类'); ?></th>
<th class="kit-hidden-mb"><?php _e('缩略名'); ?></th>
<th></th>
<th class="kit-hidden-mb"><?php _e('文章数'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($categories->have()): ?>
<?php while ($categories->next()): ?>
<tr id="mid-<?php $categories->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox"
value="<?php $categories->mid(); ?>"
name="mid[]"/></td>
<td>
<a href="<?php $options->adminUrl('category.php?mid=' . $categories->mid); ?>"><?php $categories->name(); ?></a>
<a href="<?php $categories->permalink(); ?>"
title="<?php _e('浏览 %s', $categories->name); ?>"><i class="i-exlink"></i></a>
</td>
<td>
<?php if (count($categories->children) > 0): ?>
<a href="<?php $options->adminUrl('manage-categories.php?parent=' . $categories->mid); ?>"><?php echo _n('一个分类', '%d个分类', count($categories->children)); ?></a>
<?php else: ?>
<a href="<?php $options->adminUrl('category.php?parent=' . $categories->mid); ?>"><?php echo _e('新增'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><?php $categories->slug(); ?></td>
<td>
<?php if ($options->defaultCategory == $categories->mid): ?>
<?php _e('默认'); ?>
<?php else: ?>
<a class="hidden-by-mouse"
href="<?php $security->index('/action/metas-category-edit?do=default&mid=' . $categories->mid); ?>"
title="<?php _e('设为默认'); ?>"><?php _e('默认'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><a
class="balloon-button left size-<?php echo \Typecho\Common::splitByCount($categories->count, 1, 10, 20, 50, 100); ?>"
href="<?php $options->adminUrl('manage-posts.php?category=' . $categories->mid); ?>"><?php $categories->count(); ?></a>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何分类'); ?></h6>
<?php if (count($categories->children) > 0): ?>
<a href="<?php $options->adminUrl('manage-categories.php?parent=' . $categories->mid); ?>"><?php echo _n('一个分类', '%d个分类', count($categories->children)); ?></a>
<?php else: ?>
<a href="<?php $options->adminUrl('category.php?parent=' . $categories->mid); ?>"><?php echo _e('新增'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><?php $categories->slug(); ?></td>
<td>
<?php if ($options->defaultCategory == $categories->mid): ?>
<?php _e('默认'); ?>
<?php else: ?>
<a class="hidden-by-mouse"
href="<?php $security->index('/action/metas-category-edit?do=default&mid=' . $categories->mid); ?>"
title="<?php _e('设为默认'); ?>"><?php _e('默认'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><a
class="balloon-button left size-<?php echo \Typecho\Common::splitByCount($categories->count, 1, 10, 20, 50, 100); ?>"
href="<?php $options->adminUrl('manage-posts.php?category=' . $categories->mid); ?>"><?php $categories->count(); ?></a>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何分类'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -7,18 +7,12 @@ $stat = \Widget\Stat::alloc();
$comments = \Widget\Comments\Admin::alloc();
$isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Typecho\Cookie::get('__typecho_all_comments'));
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12 typecho-list">
<div class="clearfix">
<ul class="typecho-option-tabs right">
<?php if($user->pass('editor', true) && !isset($request->cid)): ?>
<li class="<?php if($isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=on'); ?>"><?php _e('所有'); ?></a></li>
<li class="<?php if(!$isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=off'); ?>"><?php _e('我的'); ?></a></li>
<?php endif; ?>
</ul>
<div class="typecho-list-operate">
<ul class="typecho-option-tabs">
<li<?php if(!isset($request->status) || 'approved' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-comments.php'
. (isset($request->cid) ? '?cid=' . $request->filter('encode')->cid : '')); ?>"><?php _e('已通过'); ?></a></li>
@@ -43,50 +37,54 @@ $isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Ty
<?php endif; ?>
</a></li>
</ul>
<?php if($user->pass('editor', true) && !isset($request->cid)): ?>
<ul class="typecho-option-tabs">
<li class="<?php if($isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=on'); ?>"><?php _e('所有'); ?></a></li>
<li class="<?php if(!$isAllComments): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_comments=off'); ?>"><?php _e('我的'); ?></a></li>
</ul>
<?php endif; ?>
</div>
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a href="<?php $security->index('/action/comments-edit?do=approved'); ?>"><?php _e('通过'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=waiting'); ?>"><?php _e('待审核'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=spam'); ?>"><?php _e('标记垃圾'); ?></a></li>
<li><a lang="<?php _e('你确认要删除这些评论吗?'); ?>" href="<?php $security->index('/action/comments-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
</ul>
<?php if('spam' == $request->get('status')): ?>
<button lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="btn btn-s btn-warn btn-operate" href="<?php $security->index('/action/comments-edit?do=delete-spam'); ?>"><?php _e('删除所有垃圾评论'); ?></button>
<?php endif; ?>
</div>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a href="<?php $security->index('/action/comments-edit?do=approved'); ?>"><?php _e('通过'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=waiting'); ?>"><?php _e('待审核'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=spam'); ?>"><?php _e('标记垃圾'); ?></a></li>
<li><a lang="<?php _e('你确认要删除这些评论吗?'); ?>" href="<?php $security->index('/action/comments-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
</ul>
<?php if('spam' == $request->get('status')): ?>
<button lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="btn btn-s btn-warn btn-operate" href="<?php $security->index('/action/comments-edit?do=delete-spam'); ?>"><?php _e('删除所有垃圾评论'); ?></button>
<?php endif; ?>
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords || '' != $request->category): ?>
<a href="<?php $options->adminUrl('manage-comments.php'
. (isset($request->status) || isset($request->cid) ? '?' .
(isset($request->status) ? 'status=' . $request->filter('encode')->status : '') .
(isset($request->cid) ? (isset($request->status) ? '&' : '') . 'cid=' . $request->filter('encode')->cid : '') : '')); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo $request->filter('html')->keywords; ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<?php if(isset($request->status)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->status; ?>" name="status" />
<?php endif; ?>
<?php if(isset($request->cid)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->cid; ?>" name="cid" />
<?php endif; ?>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
</div><!-- end .typecho-list-operate -->
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords || '' != $request->category): ?>
<a href="<?php $options->adminUrl('manage-comments.php'
. (isset($request->status) || isset($request->cid) ? '?' .
(isset($request->status) ? 'status=' . $request->filter('encode')->status : '') .
(isset($request->cid) ? (isset($request->status) ? '&' : '') . 'cid=' . $request->filter('encode')->cid : '') : '')); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo $request->filter('html')->keywords; ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<?php if(isset($request->status)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->status; ?>" name="status" />
<?php endif; ?>
<?php if(isset($request->cid)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->cid; ?>" name="cid" />
<?php endif; ?>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
<form method="post" name="manage_comments" class="operate-form">
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb" />
<col width="6%" class="kit-hidden" />
<col width="20%"/>
<col width="71%"/>
</colgroup>
@@ -117,7 +115,7 @@ $isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Ty
<td valign="top" class="kit-hidden-mb">
<input type="checkbox" value="<?php $comments->coid(); ?>" name="coid[]"/>
</td>
<td valign="top" class="kit-hidden-mb">
<td valign="top" class="kit-hidden">
<div class="comment-avatar">
<?php if ('comment' == $comments->type): ?>
<?php $comments->gravatar(40, null, true); ?>
@@ -175,46 +173,43 @@ $isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Ty
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="4"><h6 class="typecho-list-table-title"><?php _e('没有评论') ?></h6></td>
<td colspan="4" class="none"><?php _e('没有评论') ?></td>
</tr>
<?php endif; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</div><!-- end .typecho-table-wrap -->
<?php if(isset($request->cid)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->cid; ?>" name="cid" />
<?php endif; ?>
</form><!-- end .operate-form -->
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a href="<?php $security->index('/action/comments-edit?do=approved'); ?>"><?php _e('通过'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=waiting'); ?>"><?php _e('待审核'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=spam'); ?>"><?php _e('标记垃圾'); ?></a></li>
<li><a lang="<?php _e('你确认要删除这些评论吗?'); ?>" href="<?php $security->index('/action/comments-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
</ul>
<?php if('spam' == $request->get('status')): ?>
<button lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="btn btn-s btn-warn btn-operate" href="<?php $security->index('/action/comments-edit?do=delete-spam'); ?>"><?php _e('删除所有垃圾评论'); ?></button>
<?php endif; ?>
</div>
</div>
<?php if($comments->have()): ?>
<ul class="typecho-pager">
<?php $comments->pageNav(); ?>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a href="<?php $security->index('/action/comments-edit?do=approved'); ?>"><?php _e('通过'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=waiting'); ?>"><?php _e('待审核'); ?></a></li>
<li><a href="<?php $security->index('/action/comments-edit?do=spam'); ?>"><?php _e('标记垃圾'); ?></a></li>
<li><a lang="<?php _e('你确认要删除这些评论吗?'); ?>" href="<?php $security->index('/action/comments-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
</ul>
<?php if('spam' == $request->get('status')): ?>
<button lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="btn btn-s btn-warn btn-operate" href="<?php $security->index('/action/comments-edit?do=delete-spam'); ?>"><?php _e('删除所有垃圾评论'); ?></button>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
</div>
</div>
<?php if($comments->have()): ?>
<ul class="typecho-pager">
<?php $comments->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</div>
</main>
<?php
include 'copyright.php';
include 'common-js.php';

View File

@@ -6,135 +6,128 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
$attachments = \Widget\Contents\Attachment\Admin::alloc();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12">
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文件吗?'); ?>"
href="<?php $security->index('/action/contents-attachment-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
<button class="btn btn-s btn-warn btn-operate"
href="<?php $security->index('/action/contents-attachment-edit?do=clear'); ?>"
lang="<?php _e('您确认要清理未归档的文件吗?'); ?>"><?php _e('清理未归档文件'); ?></button>
</div>
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-medias.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
</div><!-- end .typecho-list-operate -->
<form method="post" name="manage_medias" class="operate-form">
<div class="typecho-table-wrap">
<table class="typecho-list-table draggable">
<colgroup>
<col width="20" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="30%"/>
<col width="" class="kit-hidden-mb"/>
<col width="30%" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('文件名'); ?></th>
<th class="kit-hidden-mb"><?php _e('上传者'); ?></th>
<th class="kit-hidden-mb"><?php _e('所属文章'); ?></th>
<th><?php _e('发布日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($attachments->have()): ?>
<?php while ($attachments->next()): ?>
<?php $mime = \Typecho\Common::mimeIconType($attachments->attachment->mime); ?>
<tr id="<?php $attachments->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox"
value="<?php $attachments->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . $attachments->cid); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($attachments->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $attachments->commentsNum(); ?></a>
</td>
<td>
<i class="mime-<?php echo $mime; ?>"></i>
<a href="<?php $options->adminUrl('media.php?cid=' . $attachments->cid); ?>"><?php $attachments->title(); ?></a>
<a href="<?php $attachments->permalink(); ?>"
title="<?php _e('浏览 %s', $attachments->title); ?>"><i
class="i-exlink"></i></a>
</td>
<td class="kit-hidden-mb"><?php $attachments->author(); ?></td>
<td class="kit-hidden-mb">
<?php if ($attachments->parentPost->cid): ?>
<a href="<?php $options->adminUrl('write-' . (0 === strpos($attachments->parentPost->type, 'post') ? 'post' : 'page') . '.php?cid=' . $attachments->parentPost->cid); ?>"><?php $attachments->parentPost->title(); ?></a>
<?php else: ?>
<span class="description"><?php _e('未归档'); ?></span>
<?php endif; ?>
</td>
<td><?php $attachments->dateWord(); ?></td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何文件'); ?></h6>
</td>
</tr>
<?php endif; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</div><!-- end .typecho-table-wrap -->
</form><!-- end .operate-form -->
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文件吗?'); ?>"
href="<?php $security->index('/action/contents-attachment-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
</div>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文件吗?'); ?>"
href="<?php $security->index('/action/contents-attachment-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
<button class="btn btn-s btn-warn btn-operate"
href="<?php $security->index('/action/contents-attachment-edit?do=clear'); ?>"
lang="<?php _e('您确认要清理未归档的文件吗?'); ?>"><?php _e('清理未归档文件'); ?></button>
</div>
<?php if ($attachments->have()): ?>
<ul class="typecho-pager">
<?php $attachments->pageNav(); ?>
</ul>
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-medias.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
<form method="post" name="manage_medias" class="operate-form">
<table class="typecho-list-table draggable">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="30%"/>
<col width="" class="kit-hidden-mb"/>
<col width="30%" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('文件名'); ?></th>
<th class="kit-hidden-mb"><?php _e('上传者'); ?></th>
<th class="kit-hidden-mb"><?php _e('所属文章'); ?></th>
<th><?php _e('发布日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($attachments->have()): ?>
<?php while ($attachments->next()): ?>
<?php $mime = \Typecho\Common::mimeIconType($attachments->attachment->mime); ?>
<tr id="<?php $attachments->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox"
value="<?php $attachments->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . $attachments->cid); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($attachments->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $attachments->commentsNum(); ?></a>
</td>
<td>
<i class="mime-<?php echo $mime; ?>"></i>
<a href="<?php $options->adminUrl('media.php?cid=' . $attachments->cid); ?>"><?php $attachments->title(); ?></a>
<a href="<?php $attachments->permalink(); ?>"
title="<?php _e('浏览 %s', $attachments->title); ?>"><i
class="i-exlink"></i></a>
</td>
<td class="kit-hidden-mb"><?php $attachments->author(); ?></td>
<td class="kit-hidden-mb">
<?php if ($attachments->parentPost->cid): ?>
<a href="<?php $options->adminUrl('write-' . (0 === strpos($attachments->parentPost->type, 'post') ? 'post' : 'page') . '.php?cid=' . $attachments->parentPost->cid); ?>"><?php $attachments->parentPost->title(); ?></a>
<?php else: ?>
<span class="description"><?php _e('未归档'); ?></span>
<?php endif; ?>
</td>
<td><?php $attachments->dateWord(); ?></td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何文件'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</form><!-- end .operate-form -->
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文件吗?'); ?>"
href="<?php $security->index('/action/contents-attachment-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
</div>
<button class="btn btn-s btn-warn btn-operate"
href="<?php $security->index('/action/contents-attachment-edit?do=clear'); ?>"
lang="<?php _e('您确认要清理未归档的文件吗?'); ?>"><?php _e('清理未归档文件'); ?></button>
</div>
<?php if ($attachments->have()): ?>
<ul class="typecho-pager">
<?php $attachments->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div>
</div><!-- end .typecho-page-main -->
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -6,134 +6,129 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
$pages = \Widget\Contents\Page\Admin::alloc();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12 typecho-list">
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些页面吗?'); ?>"
href="<?php $security->index('/action/contents-page-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-page-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-page-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
</ul>
</div>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些页面吗?'); ?>"
href="<?php $security->index('/action/contents-page-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-page-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-page-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
</ul>
</div>
</div>
<div class="search" role="search">
<?php $pages->backLink(); ?>
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-pages.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
</div><!-- end .typecho-list-operate -->
<div class="search" role="search">
<?php $pages->backLink(); ?>
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-pages.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
<form method="post" name="manage_pages" class="operate-form">
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="20" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="30%"/>
<col width="30%"/>
<col width="" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr class="nodrag">
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('标题'); ?></th>
<th><?php _e('子页面'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th><?php _e('日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($pages->have()): ?>
<?php while ($pages->next()): ?>
<tr id="<?php $pages->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $pages->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . $pages->cid); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($pages->commentsNum, 1, 10, 20, 50, 100); ?>"
title="<?php $pages->commentsNum(); ?> <?php _e('评论'); ?>"><?php $pages->commentsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"><?php $pages->title(); ?></a>
<?php
if ('page_draft' == $pages->type) {
echo '<em class="status">' . _t('草稿') . '</em>';
} elseif ($pages->revision) {
echo '<em class="status">' . _t('有修订版') . '</em>';
}
<table class="typecho-list-table">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="42%"/>
<col width="18%"/>
<col width="" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr class="nodrag">
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('标题'); ?></th>
<th><?php _e('子页面'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th><?php _e('日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($pages->have()): ?>
<?php while ($pages->next()): ?>
<tr id="<?php $pages->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $pages->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . $pages->cid); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($pages->commentsNum, 1, 10, 20, 50, 100); ?>"
title="<?php $pages->commentsNum(); ?> <?php _e('评论'); ?>"><?php $pages->commentsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"><?php $pages->title(); ?></a>
<?php
if ('page_draft' == $pages->type) {
echo '<em class="status">' . _t('草稿') . '</em>';
} elseif ($pages->revision) {
echo '<em class="status">' . _t('有修订版') . '</em>';
}
if ('hidden' == $pages->status) {
echo '<em class="status">' . _t('隐藏') . '</em>';
}
?>
<a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"
title="<?php _e('编辑 %s', htmlspecialchars($pages->title)); ?>"><i
class="i-edit"></i></a>
<?php if ('page_draft' != $pages->type): ?>
<a href="<?php $pages->permalink(); ?>"
title="<?php _e('浏览 %s', htmlspecialchars($pages->title)); ?>"><i
class="i-exlink"></i></a>
<?php endif; ?>
</td>
<td>
<?php if (count($pages->children) > 0): ?>
<a href="<?php $options->adminUrl('manage-pages.php?parent=' . $pages->cid); ?>"><?php echo _n('一个页面', '%d个页面', count($pages->children)); ?></a>
<?php else: ?>
<a href="<?php $options->adminUrl('write-page.php?parent=' . $pages->cid); ?>"><?php echo _e('新增'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><?php $pages->author(); ?></td>
<td>
<?php if ('page_draft' == $pages->type || $pages->revision): ?>
<span class="description">
<?php $modifyDate = new \Typecho\Date($pages->revision ? $pages->revision['modified'] : $pages->modified); ?>
<?php _e('保存于 %s', $modifyDate->word()); ?>
</span>
<?php else: ?>
<?php $pages->dateWord(); ?>
<?php endif; ?>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何页面'); ?></h6>
if ('hidden' == $pages->status) {
echo '<em class="status">' . _t('隐藏') . '</em>';
}
?>
<a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"
title="<?php _e('编辑 %s', htmlspecialchars($pages->title)); ?>"><i
class="i-edit"></i></a>
<?php if ('page_draft' != $pages->type): ?>
<a href="<?php $pages->permalink(); ?>"
title="<?php _e('浏览 %s', htmlspecialchars($pages->title)); ?>"><i
class="i-exlink"></i></a>
<?php endif; ?>
</td>
<td>
<?php if (count($pages->children) > 0): ?>
<a href="<?php $options->adminUrl('manage-pages.php?parent=' . $pages->cid); ?>"><?php echo _n('一个页面', '%d个页面', count($pages->children)); ?></a>
<?php else: ?>
<a href="<?php $options->adminUrl('write-page.php?parent=' . $pages->cid); ?>"><?php echo _e('新增'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><?php $pages->author(); ?></td>
<td>
<?php if ('page_draft' == $pages->type || $pages->revision): ?>
<span class="description">
<?php $modifyDate = new \Typecho\Date($pages->revision ? $pages->revision['modified'] : $pages->modified); ?>
<?php _e('保存于 %s', $modifyDate->word()); ?>
</span>
<?php else: ?>
<?php $pages->dateWord(); ?>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div><!-- end .typecho-table-wrap -->
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何页面'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</form><!-- end .operate-form -->
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -7,22 +7,12 @@ $stat = \Widget\Stat::alloc();
$posts = \Widget\Contents\Post\Admin::alloc();
$isAllPosts = ('on' == $request->get('__typecho_all_posts') || 'on' == \Typecho\Cookie::get('__typecho_all_posts'));
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12 typecho-list">
<div class="clearfix">
<ul class="typecho-option-tabs right">
<?php if ($user->pass('editor', true) && !isset($request->uid)): ?>
<li class="<?php if ($isAllPosts): ?> current<?php endif; ?>"><a
href="<?php echo $request->makeUriByRequest('__typecho_all_posts=on&page=1'); ?>"><?php _e('所有'); ?></a>
</li>
<li class="<?php if (!$isAllPosts): ?> current<?php endif; ?>"><a
href="<?php echo $request->makeUriByRequest('__typecho_all_posts=off&page=1'); ?>"><?php _e('我的'); ?></a>
</li>
<?php endif; ?>
</ul>
<div class="typecho-list-operate">
<ul class="typecho-option-tabs">
<li<?php if (!isset($request->status) || 'all' == $request->get('status')): ?> class="current"<?php endif; ?>>
<a href="<?php $options->adminUrl('manage-posts.php'
@@ -51,204 +41,208 @@ $isAllPosts = ('on' == $request->get('__typecho_all_posts') || 'on' == \Typecho\
<?php endif; ?>
</a></li>
</ul>
<?php if ($user->pass('editor', true) && !isset($request->uid)): ?>
<ul class="typecho-option-tabs">
<li class="<?php if ($isAllPosts): ?> current<?php endif; ?>"><a
href="<?php echo $request->makeUriByRequest('__typecho_all_posts=on&page=1'); ?>"><?php _e('所有'); ?></a>
</li>
<li class="<?php if (!$isAllPosts): ?> current<?php endif; ?>"><a
href="<?php echo $request->makeUriByRequest('__typecho_all_posts=off&page=1'); ?>"><?php _e('我的'); ?></a>
</li>
</ul>
<?php endif; ?>
</div>
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>"
href="<?php $security->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>"
href="<?php $security->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
<?php if ($user->pass('editor', true)): ?>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<?php if ($user->pass('editor', true)): ?>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=waiting'); ?>"><?php _e('标记为<strong>%s</strong>', _t('待审核')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=private'); ?>"><?php _e('标记为<strong>%s</strong>', _t('私密')); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=waiting'); ?>"><?php _e('标记为<strong>%s</strong>', _t('待审核')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=private'); ?>"><?php _e('标记为<strong>%s</strong>', _t('私密')); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords || '' != $request->category): ?>
<a href="<?php $options->adminUrl('manage-posts.php'
. (isset($request->status) || isset($request->uid) ? '?' .
(isset($request->status) ? 'status=' . $request->filter('encode')->status : '') .
(isset($request->uid) ? (isset($request->status) ? '&' : '') . 'uid=' . $request->filter('encode')->uid : '') : '')); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<select name="category">
<option value=""><?php _e('所有分类'); ?></option>
<?php \Widget\Metas\Category\Rows::alloc()->to($category); ?>
<?php while ($category->next()): ?>
<option
value="<?php $category->mid(); ?>"<?php if ($request->get('category') == $category->mid): ?> selected="true"<?php endif; ?>><?php $category->name(); ?></option>
<?php endwhile; ?>
</select>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
<?php if (isset($request->uid)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->uid; ?>"
name="uid"/>
<?php endif; ?>
<?php if (isset($request->status)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->status; ?>"
name="status"/>
<?php endif; ?>
</div>
</form>
</div><!-- end .typecho-list-operate -->
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords || '' != $request->category): ?>
<a href="<?php $options->adminUrl('manage-posts.php'
. (isset($request->status) || isset($request->uid) ? '?' .
(isset($request->status) ? 'status=' . $request->filter('encode')->status : '') .
(isset($request->uid) ? (isset($request->status) ? '&' : '') . 'uid=' . $request->filter('encode')->uid : '') : '')); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<select name="category">
<option value=""><?php _e('所有分类'); ?></option>
<?php \Widget\Metas\Category\Rows::alloc()->to($category); ?>
<?php while ($category->next()): ?>
<option
value="<?php $category->mid(); ?>"<?php if ($request->get('category') == $category->mid): ?> selected="true"<?php endif; ?>><?php $category->name(); ?></option>
<?php endwhile; ?>
</select>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
<?php if (isset($request->uid)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->uid; ?>"
name="uid"/>
<?php endif; ?>
<?php if (isset($request->status)): ?>
<input type="hidden" value="<?php echo $request->filter('html')->status; ?>"
name="status"/>
<?php endif; ?>
</div>
</form>
<form method="post" name="manage_posts" class="operate-form">
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="20" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="45%"/>
<col width="" class="kit-hidden-mb"/>
<col width="18%" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('标题'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th class="kit-hidden-mb"><?php _e('分类'); ?></th>
<th><?php _e('日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($posts->have()): ?>
<?php while ($posts->next()): ?>
<tr id="<?php $posts->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $posts->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . ($posts->parentId ? $posts->parentId : $posts->cid)); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($posts->commentsNum, 1, 10, 20, 50, 100); ?>"
title="<?php $posts->commentsNum(); ?> <?php _e('评论'); ?>"><?php $posts->commentsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"><?php $posts->title(); ?></a>
<?php
if ('post_draft' == $posts->type) {
echo '<em class="status">' . _t('草稿') . '</em>';
} elseif ($posts->revision) {
echo '<em class="status">' . _t('有修订版') . '</em>';
}
<table class="typecho-list-table">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="45%"/>
<col width="" class="kit-hidden-mb"/>
<col width="18%" class="kit-hidden-mb"/>
<col width="16%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('标题'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th class="kit-hidden-mb"><?php _e('分类'); ?></th>
<th><?php _e('日期'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($posts->have()): ?>
<?php while ($posts->next()): ?>
<tr id="<?php $posts->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $posts->cid(); ?>"
name="cid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-comments.php?cid=' . ($posts->parentId ? $posts->parentId : $posts->cid)); ?>"
class="balloon-button size-<?php echo \Typecho\Common::splitByCount($posts->commentsNum, 1, 10, 20, 50, 100); ?>"
title="<?php $posts->commentsNum(); ?> <?php _e('评论'); ?>"><?php $posts->commentsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"><?php $posts->title(); ?></a>
<?php
if ('post_draft' == $posts->type) {
echo '<em class="status">' . _t('草稿') . '</em>';
} elseif ($posts->revision) {
echo '<em class="status">' . _t('有修订版') . '</em>';
}
if ('hidden' == $posts->status) {
echo '<em class="status">' . _t('隐藏') . '</em>';
} elseif ('waiting' == $posts->status) {
echo '<em class="status">' . _t('待审核') . '</em>';
} elseif ('private' == $posts->status) {
echo '<em class="status">' . _t('私密') . '</em>';
} elseif ($posts->password) {
echo '<em class="status">' . _t('密码保护') . '</em>';
}
?>
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"
title="<?php _e('编辑 %s', htmlspecialchars($posts->title)); ?>"><i
class="i-edit"></i></a>
<?php if ('post_draft' != $posts->type): ?>
<a href="<?php $posts->permalink(); ?>"
title="<?php _e('浏览 %s', htmlspecialchars($posts->title)); ?>"><i
class="i-exlink"></i></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-posts.php?__typecho_all_posts=off&uid=' . $posts->author->uid); ?>"><?php $posts->author(); ?></a>
</td>
<td class="kit-hidden-mb"><?php foreach($posts->categories as $index => $category): ?><!--
--><?php echo ($index > 0 ? ', ' : '') . '<a href="';
$options->adminUrl('manage-posts.php?category=' . $category['mid']
. (isset($request->uid) ? '&uid=' . $request->filter('encode')->uid : '')
. (isset($request->status) ? '&status=' . $request->filter('encode')->status : ''));
echo '">' . $category['name'] . '</a>'; ?><!--
--><?php endforeach; ?>
</td>
<td>
<?php if ('post_draft' == $posts->type || $posts->revision): ?>
<span class="description">
<?php $modifyDate = new \Typecho\Date($posts->revision ? $posts->revision['modified'] : $posts->modified); ?>
<?php _e('保存于 %s', $modifyDate->word()); ?>
</span>
<?php else: ?>
<?php $posts->dateWord(); ?>
<?php endif; ?>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何文章'); ?></h6>
if ('hidden' == $posts->status) {
echo '<em class="status">' . _t('隐藏') . '</em>';
} elseif ('waiting' == $posts->status) {
echo '<em class="status">' . _t('待审核') . '</em>';
} elseif ('private' == $posts->status) {
echo '<em class="status">' . _t('私密') . '</em>';
} elseif ($posts->password) {
echo '<em class="status">' . _t('密码保护') . '</em>';
}
?>
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"
title="<?php _e('编辑 %s', htmlspecialchars($posts->title)); ?>"><i
class="i-edit"></i></a>
<?php if ('post_draft' != $posts->type): ?>
<a href="<?php $posts->permalink(); ?>"
title="<?php _e('浏览 %s', htmlspecialchars($posts->title)); ?>"><i
class="i-exlink"></i></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-posts.php?__typecho_all_posts=off&uid=' . $posts->author->uid); ?>"><?php $posts->author(); ?></a>
</td>
<td class="kit-hidden-mb"><?php foreach($posts->categories as $index => $category): ?><!--
--><?php echo ($index > 0 ? ', ' : '') . '<a href="';
$options->adminUrl('manage-posts.php?category=' . $category['mid']
. (isset($request->uid) ? '&uid=' . $request->filter('encode')->uid : '')
. (isset($request->status) ? '&status=' . $request->filter('encode')->status : ''));
echo '">' . $category['name'] . '</a>'; ?><!--
--><?php endforeach; ?>
</td>
<td>
<?php if ('post_draft' == $posts->type || $posts->revision): ?>
<span class="description">
<?php $modifyDate = new \Typecho\Date($posts->revision ? $posts->revision['modified'] : $posts->modified); ?>
<?php _e('保存于 %s', $modifyDate->word()); ?>
</span>
<?php else: ?>
<?php $posts->dateWord(); ?>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何文章'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</form><!-- end .operate-form -->
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>"
href="<?php $security->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>"
href="<?php $security->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
<?php if ($user->pass('editor', true)): ?>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<?php if ($user->pass('editor', true)): ?>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=waiting'); ?>"><?php _e('标记为<strong>%s</strong>', _t('待审核')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=private'); ?>"><?php _e('标记为<strong>%s</strong>', _t('私密')); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
</div>
<?php if ($posts->have()): ?>
<ul class="typecho-pager">
<?php $posts->pageNav(); ?>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=waiting'); ?>"><?php _e('标记为<strong>%s</strong>', _t('待审核')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
</li>
<li>
<a href="<?php $security->index('/action/contents-post-edit?do=mark&status=private'); ?>"><?php _e('标记为<strong>%s</strong>', _t('私密')); ?></a>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
</div>
</div>
<?php if ($posts->have()): ?>
<ul class="typecho-pager">
<?php $posts->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -6,7 +6,7 @@ include 'menu.php';
\Widget\Metas\Tag\Admin::alloc()->to($tags);
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main manage-metas">
@@ -14,7 +14,7 @@ include 'menu.php';
<div class="col-mb-12 col-tb-8" role="main">
<form method="post" name="manage_tags" class="operate-form">
<div class="typecho-list-operate clearfix">
<div class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
@@ -39,8 +39,8 @@ include 'menu.php';
</div>
</div>
<ul class="typecho-list-notable tag-list clearfix">
<?php if ($tags->have()): ?>
<?php if ($tags->have()): ?>
<ul class="typecho-list-notable tag-list">
<?php while ($tags->next()): ?>
<li class="size-<?php $tags->split(5, 10, 20, 30); ?>" id="<?php $tags->theId(); ?>">
<input type="checkbox" value="<?php $tags->mid(); ?>" name="mid[]"/>
@@ -51,10 +51,12 @@ include 'menu.php';
class="i-edit"></i></a>
</li>
<?php endwhile; ?>
<?php else: ?>
<h6 class="typecho-list-table-title"><?php _e('没有任何标签'); ?></h6>
<?php endif; ?>
</ul>
</ul>
<?php else: ?>
<ul class="tag-list">
<li class="none"><?php _e('没有任何标签'); ?></li>
</ul>
<?php endif; ?>
<input type="hidden" name="do" value="delete"/>
</form>
@@ -64,7 +66,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -5,131 +5,125 @@ include 'menu.php';
$users = \Widget\Users\Admin::alloc();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12 typecho-list">
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些用户吗?'); ?>"
href="<?php $security->index('/action/users-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
</div>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些用户吗?'); ?>"
href="<?php $security->index('/action/users-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-users.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
</div><!-- end .typecho-list-operate -->
</div>
<div class="search" role="search">
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-users.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
<button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
</div>
</form>
<form method="post" name="manage_users" class="operate-form">
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="20" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="30%"/>
<col width="" class="kit-hidden-mb"/>
<col width="25%" class="kit-hidden-mb"/>
<col width="15%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('用户名'); ?></th>
<th class="kit-hidden-mb"><?php _e('昵称'); ?></th>
<th class="kit-hidden-mb"><?php _e('电子邮件'); ?></th>
<th><?php _e('用户组'); ?></th>
<table class="typecho-list-table">
<colgroup>
<col width="3%" class="kit-hidden-mb"/>
<col width="6%" class="kit-hidden-mb"/>
<col width="30%"/>
<col width="" class="kit-hidden-mb"/>
<col width="25%" class="kit-hidden-mb"/>
<col width="15%"/>
</colgroup>
<thead>
<tr>
<th class="kit-hidden-mb"></th>
<th class="kit-hidden-mb"></th>
<th><?php _e('用户名'); ?></th>
<th class="kit-hidden-mb"><?php _e('昵称'); ?></th>
<th class="kit-hidden-mb"><?php _e('电子邮件'); ?></th>
<th><?php _e('用户组'); ?></th>
</tr>
</thead>
<tbody>
<?php while ($users->next()): ?>
<tr id="user-<?php $users->uid(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $users->uid(); ?>"
name="uid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-posts.php?__typecho_all_posts=off&uid=' . $users->uid); ?>"
class="balloon-button left size-<?php echo \Typecho\Common::splitByCount($users->postsNum, 1, 10, 20, 50, 100); ?>"><?php $users->postsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('user.php?uid=' . $users->uid); ?>"><?php $users->name(); ?></a>
<a href="<?php $users->permalink(); ?>"
title="<?php _e('浏览 %s', $users->screenName); ?>"><i
class="i-exlink"></i></a>
</td>
<td class="kit-hidden-mb"><?php $users->screenName(); ?></td>
<td class="kit-hidden-mb"><?php if ($users->mail): ?><a
href="mailto:<?php $users->mail(); ?>"><?php $users->mail(); ?></a><?php else: _e('暂无'); endif; ?>
</td>
<td><?php switch ($users->group) {
case 'administrator':
_e('管理员');
break;
case 'editor':
_e('编辑');
break;
case 'contributor':
_e('贡献者');
break;
case 'subscriber':
_e('关注者');
break;
case 'visitor':
_e('访问者');
break;
default:
break;
} ?></td>
</tr>
</thead>
<tbody>
<?php while ($users->next()): ?>
<tr id="user-<?php $users->uid(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $users->uid(); ?>"
name="uid[]"/></td>
<td class="kit-hidden-mb"><a
href="<?php $options->adminUrl('manage-posts.php?__typecho_all_posts=off&uid=' . $users->uid); ?>"
class="balloon-button left size-<?php echo \Typecho\Common::splitByCount($users->postsNum, 1, 10, 20, 50, 100); ?>"><?php $users->postsNum(); ?></a>
</td>
<td>
<a href="<?php $options->adminUrl('user.php?uid=' . $users->uid); ?>"><?php $users->name(); ?></a>
<a href="<?php $users->permalink(); ?>"
title="<?php _e('浏览 %s', $users->screenName); ?>"><i
class="i-exlink"></i></a>
</td>
<td class="kit-hidden-mb"><?php $users->screenName(); ?></td>
<td class="kit-hidden-mb"><?php if ($users->mail): ?><a
href="mailto:<?php $users->mail(); ?>"><?php $users->mail(); ?></a><?php else: _e('暂无'); endif; ?>
</td>
<td><?php switch ($users->group) {
case 'administrator':
_e('管理员');
break;
case 'editor':
_e('编辑');
break;
case 'contributor':
_e('贡献者');
break;
case 'subscriber':
_e('关注者');
break;
case 'visitor':
_e('访问者');
break;
default:
break;
} ?></td>
</tr>
<?php endwhile; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</div><!-- end .typecho-table-wrap -->
<?php endwhile; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</form><!-- end .operate-form -->
<div class="typecho-list-operate clearfix">
<form method="get">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些用户吗?'); ?>"
href="<?php $security->index('/action/users-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
</div>
</div>
<?php if ($users->have()): ?>
<ul class="typecho-pager">
<?php $users->pageNav(); ?>
<form method="get" class="typecho-list-operate">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
<div class="btn-group btn-drop">
<button class="btn dropdown-toggle btn-s" type="button"><i
class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
class="i-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些用户吗?'); ?>"
href="<?php $security->index('/action/users-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
</div>
</div>
<?php if ($users->have()): ?>
<ul class="typecho-pager">
<?php $users->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -6,7 +6,7 @@ include 'menu.php';
\Widget\Contents\Attachment\Edit::alloc()->prepare()->to($attachment);
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main">
@@ -40,7 +40,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -1,18 +1,22 @@
<?php if (!defined('__TYPECHO_ADMIN__')) exit; ?>
<div class="typecho-head-nav clearfix" role="navigation">
<button class="menu-bar"><?php _e('菜单'); ?></button>
<nav id="typecho-nav-list">
<?php $menu->output(); ?>
<header class="typecho-head-nav" role="navigation">
<nav>
<details class="menu-bar">
<summary><?php _e('菜单'); ?></summary>
</details>
<menu>
<?php $menu->output(); ?>
<li class="operate">
<?php \Typecho\Plugin::factory('admin/menu.php')->call('navBar'); ?><a title="<?php
if ($user->logged > 0) {
$logged = new \Typecho\Date($user->logged);
_e('最后登录: %s', $logged->word());
}
?>" href="<?php $options->adminUrl('profile.php'); ?>" class="author"><?php $user->screenName(); ?></a><a
class="exit" href="<?php $options->logoutUrl(); ?>"><?php _e('登出'); ?></a><a
href="<?php $options->siteUrl(); ?>"><?php _e('网站'); ?></a>
</li>
</menu>
</nav>
<div class="operate">
<?php \Typecho\Plugin::factory('admin/menu.php')->call('navBar'); ?><a title="<?php
if ($user->logged > 0) {
$logged = new \Typecho\Date($user->logged);
_e('最后登录: %s', $logged->word());
}
?>" href="<?php $options->adminUrl('profile.php'); ?>" class="author"><?php $user->screenName(); ?></a><a
class="exit" href="<?php $options->logoutUrl(); ?>"><?php _e('登出'); ?></a><a
href="<?php $options->siteUrl(); ?>"><?php _e('网站'); ?></a>
</div>
</div>
</header>

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,26 +4,17 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<?php include 'theme-tabs.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12">
<ul class="typecho-option-tabs fix-tabs clearfix">
<li><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a></li>
<?php if (!defined('__TYPECHO_THEME_WRITEABLE__') || __TYPECHO_THEME_WRITEABLE__): ?>
<li><a href="<?php $options->adminUrl('theme-editor.php'); ?>"><?php _e('编辑当前外观'); ?></a></li>
<?php endif; ?>
<li class="current"><a
href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
</ul>
</div>
<div class="col-mb-12 col-tb-8 col-tb-offset-2" role="form">
<?php \Widget\Themes\Config::alloc()->config()->render(); ?>
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -1,8 +1,9 @@
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
<?php if (!defined('__TYPECHO_ADMIN__')) exit; ?>
<div class="typecho-page-title">
<h2><?php echo $menu->title; ?><?php
<h2><?php echo $menu->title; ?></h2>
<?php
if (!empty($menu->addLink)) {
echo "<a href=\"{$menu->addLink}\">" . _t("新增") . "</a>";
}
?></h2>
?>
</div>

View File

@@ -3,7 +3,7 @@ include 'common.php';
include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
@@ -11,120 +11,116 @@ include 'menu.php';
<?php \Widget\Plugins\Rows::allocWithAlias('activated', 'activated=1')->to($activatedPlugins); ?>
<?php if ($activatedPlugins->have() || !empty($activatedPlugins->activatedPlugins)): ?>
<h4 class="typecho-list-table-title"><?php _e('启用的插件'); ?></h4>
<div class="typecho-table-wrap">
<table class="typecho-list-table">
<colgroup>
<col width="25%"/>
<col width="45%"/>
<col width="8%" class="kit-hidden-mb"/>
<col width="10%" class="kit-hidden-mb"/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th><?php _e('名称'); ?></th>
<th><?php _e('描述'); ?></th>
<th class="kit-hidden-mb"><?php _e('版本'); ?></th>
<th class="kit-hidden-mb"><?php _e('作'); ?></th>
<th><?php _e('操作'); ?></th>
<table class="typecho-list-table">
<colgroup>
<col width="25%"/>
<col width="45%"/>
<col width="8%" class="kit-hidden-mb"/>
<col width="10%" class="kit-hidden-mb"/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th><?php _e('名称'); ?></th>
<th><?php _e('描述'); ?></th>
<th class="kit-hidden-mb"><?php _e('版本'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th><?php _e('作'); ?></th>
</tr>
</thead>
<tbody>
<?php while ($activatedPlugins->next()): ?>
<tr id="plugin-<?php $activatedPlugins->name(); ?>">
<td><?php $activatedPlugins->title(); ?>
<?php if (!$activatedPlugins->dependence): ?>
<i class="i-delete"
title="<?php _e('%s 无法在此版本的typecho下正常工作', $activatedPlugins->title); ?>"></i>
<?php endif; ?>
</td>
<td><?php $activatedPlugins->description(); ?></td>
<td class="kit-hidden-mb"><?php $activatedPlugins->version(); ?></td>
<td class="kit-hidden-mb"><?php echo empty($activatedPlugins->homepage) ? $activatedPlugins->author : '<a href="' . $activatedPlugins->homepage
. '">' . $activatedPlugins->author . '</a>'; ?></td>
<td>
<?php if ($activatedPlugins->activate || $activatedPlugins->deactivate || $activatedPlugins->config || $activatedPlugins->personalConfig): ?>
<?php if ($activatedPlugins->config): ?>
<a href="<?php $options->adminUrl('options-plugin.php?config=' . $activatedPlugins->name); ?>"><?php _e('设置'); ?></a>
&bull;
<?php endif; ?>
<a lang="<?php _e('你确认要禁用插件 %s 吗?', $activatedPlugins->name); ?>"
href="<?php $security->index('/action/plugins-edit?deactivate=' . $activatedPlugins->name); ?>"><?php _e('禁用'); ?></a>
<?php else: ?>
<span class="important"><?php _e('即插即用'); ?></span>
<?php endif; ?>
</td>
</tr>
</thead>
<tbody>
<?php while ($activatedPlugins->next()): ?>
<tr id="plugin-<?php $activatedPlugins->name(); ?>">
<td><?php $activatedPlugins->title(); ?>
<?php if (!$activatedPlugins->dependence): ?>
<i class="i-delete"
title="<?php _e('%s 无法在此版本的typecho下正常工作', $activatedPlugins->title); ?>"></i>
<?php endif; ?>
</td>
<td><?php $activatedPlugins->description(); ?></td>
<td class="kit-hidden-mb"><?php $activatedPlugins->version(); ?></td>
<td class="kit-hidden-mb"><?php echo empty($activatedPlugins->homepage) ? $activatedPlugins->author : '<a href="' . $activatedPlugins->homepage
. '">' . $activatedPlugins->author . '</a>'; ?></td>
<td>
<?php if ($activatedPlugins->activate || $activatedPlugins->deactivate || $activatedPlugins->config || $activatedPlugins->personalConfig): ?>
<?php if ($activatedPlugins->config): ?>
<a href="<?php $options->adminUrl('options-plugin.php?config=' . $activatedPlugins->name); ?>"><?php _e('设置'); ?></a>
&bull;
<?php endif; ?>
<a lang="<?php _e('你确认要禁用插件 %s 吗?', $activatedPlugins->name); ?>"
href="<?php $security->index('/action/plugins-edit?deactivate=' . $activatedPlugins->name); ?>"><?php _e('禁用'); ?></a>
<?php else: ?>
<span class="important"><?php _e('即插即用'); ?></span>
<?php endif; ?>
<?php endwhile; ?>
<?php if (!empty($activatedPlugins->activatedPlugins)): ?>
<?php foreach ($activatedPlugins->activatedPlugins as $key => $val): ?>
<tr>
<td><?php echo $key; ?></td>
<td colspan="3"><span
class="warning"><?php _e('此插件文件已经损坏或者被不安全移除, 强烈建议你禁用它'); ?></span></td>
<td><a lang="<?php _e('你确认要禁用插件 %s 吗?', $key); ?>"
href="<?php $security->index('/action/plugins-edit?deactivate=' . $key); ?>"><?php _e('禁用'); ?></a>
</td>
</tr>
<?php endwhile; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if (!empty($activatedPlugins->activatedPlugins)): ?>
<?php foreach ($activatedPlugins->activatedPlugins as $key => $val): ?>
<tr>
<td><?php echo $key; ?></td>
<td colspan="3"><span
class="warning"><?php _e('此插件文件已经损坏或者被不安全移除, 强烈建议你禁用它'); ?></span></td>
<td><a lang="<?php _e('你确认要禁用插件 %s 吗?', $key); ?>"
href="<?php $security->index('/action/plugins-edit?deactivate=' . $key); ?>"><?php _e('禁用'); ?></a>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</tbody>
</table>
<?php endif; ?>
<?php \Widget\Plugins\Rows::allocWithAlias('unactivated', 'activated=0')->to($deactivatedPlugins); ?>
<?php if ($deactivatedPlugins->have() || !$activatedPlugins->have()): ?>
<h4 class="typecho-list-table-title"><?php _e('禁用的插件'); ?></h4>
<div class="typecho-table-wrap">
<table class="typecho-list-table deactivate">
<colgroup>
<col width="25%"/>
<col width="45%"/>
<col width="8%" class="kit-hidden-mb"/>
<col width="10%" class="kit-hidden-mb"/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th><?php _e('名称'); ?></th>
<th><?php _e('描述'); ?></th>
<th class="kit-hidden-mb"><?php _e('版本'); ?></th>
<th class="kit-hidden-mb"><?php _e('作'); ?></th>
<th class="typecho-radius-topright"><?php _e('操作'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($deactivatedPlugins->have()): ?>
<?php while ($deactivatedPlugins->next()): ?>
<tr id="plugin-<?php $deactivatedPlugins->name(); ?>">
<td><?php $deactivatedPlugins->title(); ?></td>
<td><?php $deactivatedPlugins->description(); ?></td>
<td class="kit-hidden-mb"><?php $deactivatedPlugins->version(); ?></td>
<td class="kit-hidden-mb"><?php echo empty($deactivatedPlugins->homepage) ? $deactivatedPlugins->author : '<a href="' . $deactivatedPlugins->homepage
. '">' . $deactivatedPlugins->author . '</a>'; ?></td>
<td>
<a href="<?php $security->index('/action/plugins-edit?activate=' . $deactivatedPlugins->name); ?>"><?php _e('启用'); ?></a>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="5"><h6 class="typecho-list-table-title"><?php _e('没有安装插件'); ?></h6>
<table class="typecho-list-table deactivate">
<colgroup>
<col width="25%"/>
<col width="45%"/>
<col width="8%" class="kit-hidden-mb"/>
<col width="10%" class="kit-hidden-mb"/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th><?php _e('名称'); ?></th>
<th><?php _e('描述'); ?></th>
<th class="kit-hidden-mb"><?php _e('版本'); ?></th>
<th class="kit-hidden-mb"><?php _e('作者'); ?></th>
<th class="typecho-radius-topright"><?php _e('作'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($deactivatedPlugins->have()): ?>
<?php while ($deactivatedPlugins->next()): ?>
<tr id="plugin-<?php $deactivatedPlugins->name(); ?>">
<td><?php $deactivatedPlugins->title(); ?></td>
<td><?php $deactivatedPlugins->description(); ?></td>
<td class="kit-hidden-mb"><?php $deactivatedPlugins->version(); ?></td>
<td class="kit-hidden-mb"><?php echo empty($deactivatedPlugins->homepage) ? $deactivatedPlugins->author : '<a href="' . $deactivatedPlugins->homepage
. '">' . $deactivatedPlugins->author . '</a>'; ?></td>
<td>
<a href="<?php $security->index('/action/plugins-edit?activate=' . $deactivatedPlugins->name); ?>"><?php _e('启用'); ?></a>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="5"><h6 class="typecho-list-table-title"><?php _e('没有安装插件'); ?></h6>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -6,7 +6,7 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main">
@@ -51,7 +51,7 @@ $stat = \Widget\Stat::alloc();
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -583,44 +583,46 @@
parseBlockTable(block, key, line, state, lines) {
var align, aligns, head, j, len, matches, row, rows;
if (!!(matches = line.match(/^((?:(?:(?:\||\+)(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:[ :]*\-+[ :]*)(?:\||\+)(?:[ :]*\-+[ :]*))|(?:(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:\||\+)(?:[ :]*\-+[ :]*)))+)$/))) {
if (this.isBlock('table')) {
block[3][0].push(block[3][2]);
block[3][2] += 1;
this.setBlock(key, block[3]);
} else {
head = 0;
if ((block == null) || block[0] !== 'normal' || lines[block[2]].match(/^\s*$/)) {
this.startBlock('table', key);
if (!!(matches = line.match(/^\s*(\|?[ :]*-{2,}[ :]*(?:[\|\+][ :]*-{2,}[ :]*)*\|?)\s*$/))) {
if (matches[1].indexOf('|') >= 0 || matches[1].indexOf('+') >= 0) {
if (this.isBlock('table')) {
block[3][0].push(block[3][2]);
block[3][2] += 1;
this.setBlock(key, block[3]);
} else {
head = 1;
this.backBlock(1, 'table');
}
if (matches[1][0] === '|') {
matches[1] = matches[1].substring(1);
if (matches[1][matches[1].length - 1] === '|') {
matches[1] = matches[1].substring(0, matches[1].length - 1);
head = 0;
if ((block == null) || block[0] !== 'normal' || lines[block[2]].match(/^\s*$/)) {
this.startBlock('table', key);
} else {
head = 1;
this.backBlock(1, 'table');
}
}
rows = matches[1].split(/\+|\|/);
aligns = [];
for (j = 0, len = rows.length; j < len; j++) {
row = rows[j];
align = 'none';
if (!!(matches = row.match(/^\s*(:?)\-+(:?)\s*$/))) {
if (!!matches[1] && !!matches[2]) {
align = 'center';
} else if (!!matches[1]) {
align = 'left';
} else if (!!matches[2]) {
align = 'right';
if (matches[1][0] === '|') {
matches[1] = matches[1].substring(1);
if (matches[1][matches[1].length - 1] === '|') {
matches[1] = matches[1].substring(0, matches[1].length - 1);
}
}
aligns.push(align);
rows = matches[1].split(/\+|\|/);
aligns = [];
for (j = 0, len = rows.length; j < len; j++) {
row = rows[j];
align = 'none';
if (!!(matches = row.match(/^\s*(:?)\-+(:?)\s*$/))) {
if (!!matches[1] && !!matches[2]) {
align = 'center';
} else if (!!matches[1]) {
align = 'left';
} else if (!!matches[2]) {
align = 'right';
}
}
aligns.push(align);
}
this.setBlock(key, [[head], aligns, head + 1]);
}
this.setBlock(key, [[head], aligns, head + 1]);
return false;
}
return false;
}
return true;
}
@@ -649,7 +651,7 @@
}
parseBlockShr(block, key, line) {
if (!!(line.match(/^(\* *){3,}\s*$/))) {
if (!!(line.match(/^\*{3,}\s*$/))) {
this.startBlock('hr', key).endBlock();
return false;
}
@@ -657,7 +659,7 @@
}
parseBlockDhr(block, key, line) {
if (!!(line.match(/^(- *){3,}\s*$/))) {
if (!!(line.match(/^-{3,}\s*$/))) {
this.startBlock('hr', key).endBlock();
return false;
}

View File

@@ -2882,8 +2882,8 @@ else
text = text.replace(/^http:\/\/(https?|ftp):\/\//, '$1://');
// fix issue #552
if (!/^(?:https?|ftp):\/\//.test(text) && !/^[_a-z0-9-]+:/i.test(text))
text = 'http://' + text;
// if (!/^(?:https?|ftp):\/\//.test(text) && !/^[_a-z0-9-]+:/i.test(text))
// text = 'http://' + text;
}
dialog.parentNode.removeChild(dialog);

View File

@@ -378,7 +378,7 @@ function scrollableEditor(el, preview) {
// 表格选择插件
$.fn.tableSelectable = function (options) {
var table = this, s = $.extend({
const table = this, s = $.extend({
checkEl : null,
rowEl : null,
selectAllEl : null,
@@ -386,19 +386,13 @@ function scrollableEditor(el, preview) {
}, options);
function clickRow (t) {
var t = $(t), check = $(s.checkEl, t), checked = check.prop('checked');
const check = $(s.checkEl, t), checked = check.prop('checked');
if (!check.length) {
return;
}
check.prop('checked', !checked);
if (checked) {
t.removeClass('checked');
} else {
t.addClass('checked');
}
}
$(s.rowEl, this).each(function () {
@@ -406,9 +400,9 @@ function scrollableEditor(el, preview) {
clickRow($(this).parents(s.rowEl));
});
}).click(function (e) {
var target = $(e.toElement ? e.toElement : e.target),
const target = $(e.toElement ? e.toElement : e.target),
tagName = target.prop('tagName').toLowerCase();
if ($.inArray(tagName, ['input', 'textarea', 'a', 'button', 'i']) >= 0
&& 'checkbox' != target.attr('type')) {
e.stopPropagation();
@@ -418,27 +412,15 @@ function scrollableEditor(el, preview) {
});
$(s.selectAllEl).click(function () {
var t = $(this), checked = t.prop('checked');
if (checked) {
$(s.rowEl, table).each(function () {
var t = $(this), el = $(s.checkEl, this).prop('checked', true);
if (el.length > 0) {
t.addClass('checked');
}
});
} else {
$(s.rowEl, table).each(function () {
var t = $(this), el = $(s.checkEl, this).prop('checked', false);
if (el.length > 0) {
t.removeClass('checked');
}
});
}
const t = $(this), checked = t.prop('checked');
$(s.rowEl, table).each(function () {
$(s.checkEl, this).prop('checked', !!checked);
});
});
$(s.actionEl).click(function () {
var t = $(this), lang = t.attr('lang');
const t = $(this), lang = t.attr('lang');
if (!lang || confirm(lang)) {
table.parents('form').attr('action', t.attr('href')).submit();

View File

@@ -2,7 +2,7 @@
* Forms
*/
input[type=text], input[type=url], input[type=password], input[type=email],
input[type=text], input[type=url], input[type=password], input[type=email], input[type=number],
textarea {
background: #FFF;
border: 1px solid #D9D9D6;

View File

@@ -13,9 +13,12 @@ $color-nav-child-focus: #6DA1BB;
.typecho-head-nav {
padding: 0 10px;
background: $color-nav-bg;
position: relative;
position: sticky;
top: 0;
display: flex;
z-index: 100;
a, button.menu-bar {
a, .menu-bar summary {
padding: 0 20px;
height: 36px;
line-height: 36px;
@@ -28,192 +31,213 @@ $color-nav-child-focus: #6DA1BB;
}
}
button.menu-bar {
.menu-bar {
display: none;
}
#typecho-nav-list {
float: left;
menu {
margin: 0;
padding: 0;
list-style: none;
background: $color-nav-bg;
}
& > ul {
list-style: none;
margin: 0;
padding: 0;
nav {
width: 100%;
& > menu {
display: flex;
position: relative;
float: left;
width: 100%;
&:first-child {
border-left: $border-nav;
}
& > li {
.parent {
a {
display: inline-block;
border-right: $border-nav;
background: $color-nav-bg;
&:first-child {
border-left: $border-nav;
}
}
.child {
position: absolute;
list-style: none;
top: 36px;
display: none;
margin: 0;
padding: 0;
min-width: 160px;
max-width: 240px;
background: $color-nav-btn-hover;
z-index: 250;
> a {
display: block;
border-right: $border-nav;
li {
&.return {
display: none;
}
&:hover, &:focus {
background: $color-nav-btn-hover;
a {
overflow: hidden;
text-overflow : ellipsis;
white-space: nowrap;
display: block;
&:hover,
&:focus {
background: $color-nav-bg;
& + menu {
display: flex;
}
}
}
&.focus a {
color: $color-nav-child-focus;
&:not(.operate) {
&.focus > a {
background: $color-nav-btn-hover;
font-weight: bold;
}
&:hover > a {
background: $color-nav-btn-hover;
}
}
}
.parent a:hover,
&.focus .parent a,
&.root:hover .parent a {
background: $color-nav-btn-hover;
}
&:hover, &:focus-within, &:focus {
menu {
display: flex;
}
}
&.focus .parent a {
font-weight: bold;
}
&.root:hover .child, &.root.expanded .child {
display: block;
}
}
}
.operate {
float: right;
a {
display: inline-block;
margin-left: -1px;
border: $border-nav;
border-width: 0 1px;
&:hover {
background-color: $color-nav-btn-hover;
}
}
}
}
@media (max-width: $screen-phone - 1px) {
@keyframes out {
from {left: 0%;}
to {left: -100%;}
}
@keyframes in {
from {left: -100%;}
to {left: 0%;}
}
.typecho-head-nav {
padding: 0;
position: fixed;
bottom: 0;
width: 100%;
z-index: 10;
#typecho-nav-list {
display: none;
}
.operate {
a:last-child {
border-right-width: 0;
}
}
button.menu-bar {
display: inline-block;
border: none;
background: $color-nav-bg;
border-right: $border-nav;
&.focus {
color: $color-nav-text-hover;
& + #typecho-nav-list {
display: block;
float: none;
menu {
position: absolute;
bottom: 36px;
width: 100%;
& > ul {
float: none;
border-bottom: $border-nav;
position: static;
top: 36px;
display: none;
flex-flow: column;
min-width: 160px;
max-width: 240px;
background: $color-nav-btn-hover;
z-index: 250;
& > li {
a {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
&:hover,
&:focus {
background: $color-nav-bg;
}
}
&.focus a {
color: $color-nav-child-focus;
font-weight: bold;
}
}
}
&.operate {
flex: 1;
display: flex;
justify-content: flex-end;
a {
&:hover {
background-color: $color-nav-btn-hover;
}
&:first-child {
border-left: none;
border-left: $border-nav;
}
.parent {
a {
display: block;
border: none;
background: $color-nav-btn-hover;
}
}
}
}
}
}
@include screen(phone, max) {
padding: 0;
flex-flow: column;
.menu-bar {
display: block;
font-size: 14px;
position: sticky;
top: 0;
background: $color-nav-bg;
z-index: 10;
summary {
cursor: pointer;
}
&[open] {
summary {
border-bottom: $border-nav;
}
& ~ menu {
display: flex;
}
}
}
nav {
overflow-y: auto;
width: 100vw;
position: fixed;
top: 0;
background: $color-nav-btn-hover;
&:has(.menu-bar[open]) {
width: 70vw;
height: 100%;
}
& > menu {
display: none;
flex-flow: column;
& > li {
&:first-child {
border: none;
}
> a {
border: none !important;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&:not(.operate) {
&.focus > a {
background: $color-nav-bg;
}
.child {
position: absolute;
bottom: 0;
left: 100%;
top: auto;
z-index: 20;
width: 100%;
max-width: 100%;
min-width: auto;
li {
border-bottom: $border-nav;
&.return {
display: block;
text-align: center;
font-size: 12px;
&:hover > a {
background: $color-nav-bg;
}
a {
color: $color-nav-text-mute;
}
}
}
& > a {
pointer-events: auto;
cursor: pointer;
}
}
&.expanded {
animation: out .15s ease-out forwards;
menu {
position: static;
border: $border-nav;
border-width: 1px 0;
display: flex;
min-width: auto;
max-width: none;
}
&.noexpanded {
animation: in .15s ease-out forwards;
&.operate {
flex-flow: column;
justify-content: flex-start;
a {
background: $color-nav-btn-hover;
&:hover {
background: $color-nav-bg;
}
}
}
}
}
}
}
}
@include screen(phone, max) {
body {
padding-top: 36px;
&:has(.menu-bar[open]) {
overflow: hidden;
}
}
}

View File

@@ -30,6 +30,10 @@
}
.success a { color: #264409; }
.warning {
color: #B94A48;
}
// 气泡
.balloon {
@@ -47,3 +51,28 @@
border-radius: 20px;
}
/** 顶部消息样式 by 70 */
.popup {
display: none;
position: sticky;
margin: 0;
padding: 8px 0;
border: none;
width: 100%;
z-index: 10;
text-align: center;
border-radius: 0;
ul {
list-style: none;
margin: 0;
padding: 0;
text-align: center;
li {
display: inline-block;
margin-right: 10px;
}
}
}

View File

@@ -0,0 +1,61 @@
/**
* 典型配置选项
*/
.typecho-option {
list-style: none;
margin: 1em 0;
padding: 0;
&-submit li {
border-bottom: none;
}
label {
&.typecho-label {
display: block;
margin-bottom: .5em;
font-weight: bold;
}
&.required:after {
content: " *";
color: #B94A48;
}
}
span {
margin-right: 15px;
}
.description {
margin: .5em 0 0;
color: #999;
font-size: .92857em;
}
input.file {
width: 100%;
margin: .7em 0;
}
input.text {
width: 100%;
}
input.num {
width: 60px;
}
textarea {
width: 100%;
height: 100px;
}
.multiline {
display: block;
margin: .3em 0;
&.hidden {
display: none;
}
}
}

View File

@@ -3,34 +3,35 @@
*/
.typecho-pager {
display: flex;
align-items: center;
justify-content: flex-end;
list-style: none;
float: right;
margin: 0;
padding: 0;
line-height: 1;
text-align: center;
zoom: 1;
}
.typecho-pager li {
display: inline-block;
margin: 0 3px;
height: 28px;
line-height: 28px;
}
li {
margin: 0 3px;
height: 28px;
line-height: 28px;
.typecho-pager a {
display: block;
padding: 0 10px;
border-radius: 2px;
}
a {
display: block;
padding: 0 10px;
border-radius: 2px;
.typecho-pager a:hover {
text-decoration: none;
background: #E9E9E6;
}
&:hover {
text-decoration: none;
background: #E9E9E6;
}
}
.typecho-pager li.current a {
background: #E9E9E6;
color: #444;
&.current a {
background: #E9E9E6;
color: #444;
}
}
}

175
admin/src/scss/_table.scss Normal file
View File

@@ -0,0 +1,175 @@
/**
* 表格列表页
*/
/**
* 列表页选项
*/
.typecho-list .typecho-pager {
}
.typecho-list-operate {
display: flex;
margin: 1em 0;
& + .typecho-list-operate {
margin-top: 0;
}
input, button, select {
vertical-align: bottom;
}
input[type="checkbox"] {
vertical-align: text-top;
}
a:hover {
text-decoration: none;
}
> *:nth-child(2) {
flex: 1;
}
.operate, .search {
display: flex;
align-items: center;
}
.operate {
label {
display: flex;
}
> * {
margin-right: 5px;
}
}
> *:nth-child(2) {
justify-content: flex-end;
&.search > * {
margin-left: 5px;
}
}
@include screen(phone, max) {
& {
flex-flow: column;
> *:nth-child(2) {
margin-top: 10px;
justify-content: flex-start;
> *:first-child {
margin-left: 0;
}
}
}
}
}
.operate-delete, .operate-button-delete {
color: #B94A48;
}
.operate-edit {
color: #007700;
}
.operate-reply {
color: #545c30;
}
/**
* 列表表格
*/
/** 增加表格标题 by 70 */
.typecho-list-table-title {
margin: 1em 0;
color: #999;
text-align: center;
}
.typecho-list-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
background: #FFF;
table-layout: fixed;
border: 30px solid #FFF;
&.deactivate {
color: #999;
}
.right {
text-align: right;
}
th {
padding: 0 10px 10px;
border-bottom: 1px solid #F0F0EC;
text-align: left;
}
td {
padding: 10px;
border-top: 1px solid #F0F0EC;
word-break: break-all;
pre {
overflow: auto;
}
&.none {
color: #999;
text-align: center;
}
}
.status {
margin-left: 5px;
color: #999;
font-size: .92857em;
font-style: normal;
}
tbody tr {
&:hover {
background-color: #F6F6F3;
}
&:has(input[type="checkbox"]:checked) {
background-color: #FFF9E8;
}
}
tr td .hidden-by-mouse {
opacity: 0;
}
tr:hover td .hidden-by-mouse {
opacity: 1;
}
tr td:first-child input[type="checkbox"] {
display: block;
}
@include screen(phone, max) {
& {
border-width: 10px;
th {
padding: 0 5px 5px;
}
td {
padding: 5px;
}
}
}
}

50
admin/src/scss/_tabs.scss Normal file
View File

@@ -0,0 +1,50 @@
/**
* 标签页
*/
.typecho-option-tabs {
list-style: none;
margin: 0;
padding: 0;
font-size: 13px;
display: flex;
&.fix-tabs {
margin: 1em 0;
}
li {
&:first-child a {
border-radius: 2px 0 0 2px;
}
&:last-child a {
border-radius: 0 2px 2px 0;
}
&.current a, &.active a {
background-color: #E9E9E6;
}
a {
display: flex;
justify-content: center;
align-items: center;
margin-right: -1px;
border: 1px solid #D9D9D6;
padding: 0 15px;
height: 26px;
color: #666;
box-sizing: border-box;
> * {
margin: 0 3px;
}
&:hover {
background-color: #E9E9E6;
color: #666;
text-decoration: none;
}
}
}
}

70
admin/src/scss/_tags.scss Normal file
View File

@@ -0,0 +1,70 @@
/**
* 标签列表
*/
.tag-list {
list-style: none;
margin: 0;
padding: 20px;
background-color: #FFF;
display: flex;
flex-wrap: wrap;
.none {
color: #999;
width: 100%;
margin: 0;
text-align: center;
}
&.typecho-list-notable li {
margin: 0 5px 5px 0;
padding: 5px 5px 5px 10px;
cursor: pointer;
display: flex;
align-items: center;
.tag-edit-link {
margin-left: 3px;
visibility: hidden;
display: flex;
align-items: center;
}
&:hover {
background-color: #E9E9E6;
.tag-edit-link {
visibility: visible;
}
}
&:has(input[type="checkbox"]:checked) {
background-color: #FFFBCC;
}
&.size-5 {
font-size: 1em;
}
&.size-10 {
font-size: 1.2em;
}
&.size-20 {
font-size: 1.4em;
}
&.size-30 {
font-size: 1.6em;
}
&.size-0 {
font-size: 1.8em;
}
input {
display: none;
}
}
}

View File

@@ -11,3 +11,29 @@ $screen-phone: 576px;
$screen-tablet: 768px;
$screen-desktop: 992px;
$screen-wide: 1200px;
@function breakpoint($breakpoint) {
@if $breakpoint == 'phone' {
@return $screen-phone;
} @else if $breakpoint == 'tablet' {
@return $screen-tablet;
} @else if $breakpoint == 'desktop' {
@return $screen-desktop;
} @else if $breakpoint == 'wide' {
@return $screen-wide;
} @else {
@return $breakpoint;
}
}
@mixin screen($breakpoint, $type: min) {
@if $type == min {
@media (min-width: breakpoint($breakpoint)) {
@content;
}
} @else {
@media (max-width: breakpoint($breakpoint) - 1) {
@content;
}
}
}

212
admin/src/scss/_write.scss Normal file
View File

@@ -0,0 +1,212 @@
/**
* 编写页面
*/
.typecho-post-area {
.edit-draft-notice {
color: #999;
font-size: .92857em;
a {
color: #B94A48;
}
}
.typecho-label {
display: block;
margin: 1em 0 -0.5em;
font-weight: bold;
}
.submit {
display: flex;
justify-content: space-between;
#auto-save-message {
color: #999;
font-size: .92857em;
}
.left {
display: flex;
align-items: center;
> * {
margin-right: 8px;
}
}
.right {
display: flex;
align-items: center;
justify-content: flex-end;
> * {
margin-left: 8px;
}
}
}
input.title {
font-size: 1.17em;
font-weight: bold;
}
.url-slug {
margin-top: -0.5em;
color: #AAA;
font-size: .92857em;
word-break: break-word;
}
#slug {
padding: 2px;
border: none;
background: #FFFBCC;
color: #666;
}
#text {
resize: none;
}
.description {
margin-top: -0.5em;
color: #999;
font-size: .92857em;
}
/**
* 自定义字段
*/
#custom-field {
margin: 1em 0;
padding: 10px 15px;
background: #FFF;
summary {
font-weight: bold;
cursor: pointer;
&:hover {
color: #467B96;
}
&::marker {
color: #BBB;
}
}
.add {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
.description {
margin-top: 0;
}
}
p.description {
text-align: left;
}
.typecho-label {
margin: 0;
a {
display: block;
color: #444;
&:hover {
color: #467B96;
text-decoration: none;
}
}
}
.fields {
list-style: none;
margin: 10px 0 0 0;
padding: 0;
.field {
display: flex;
padding-bottom: 10px;
border-bottom: 1px solid #F0F0EC;
margin-bottom: 10px;
&:last-child {
margin-bottom: 0;
}
.field-name {
display: flex;
input[name="fieldNames[]"] {
height: 27px;
width: 150px;
margin-right: 10px;
}
}
.field-value {
margin-left: 10px;
flex: 1;
display: flex;
textarea[name="fieldValues[]"] {
flex: 1;
margin-right: 10px;
resize: none;
}
}
@include screen(phone, max) {
flex-flow: column;
.field-value {
margin-left: 0;
margin-top: 10px;
}
}
}
}
select { height: 27px; }
}
/**
* 侧边栏
*/
#edit-secondary {
margin-top: 1em;
.category-option ul {
list-style: none;
border: 1px solid #D9D9D6;
padding: 6px 12px;
max-height: 240px;
overflow: auto;
background-color: #FFF;
border-radius: 2px;
li {
margin: 3px 0;
}
}
#advance-panel {
summary {
line-height: 25px;
}
.visibility-option ul,
.allow-option ul {
list-style: none;
padding: 0;
}
}
}
}

View File

@@ -14,111 +14,121 @@
}
}
@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
@import "editor/*@2x.png";
@include all-editor-sprites();
#wmd-button-bar {
display: flex;
align-items: center;
@mixin editor-button-2x($name) {
&#wmd-#{$name}-button span {
@include editor-sprite(editor-#{$name})
@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
@import "editor/*@2x.png";
@include all-editor-sprites();
@mixin editor-button-2x($name) {
&#wmd-#{$name}-button span {
@include editor-sprite(editor-#{$name})
}
}
.wmd-button-row {
li {
@include editor-button-2x(bold);
@include editor-button-2x(italic);
@include editor-button-2x(link);
@include editor-button-2x(quote);
@include editor-button-2x(code);
@include editor-button-2x(image);
@include editor-button-2x(olist);
@include editor-button-2x(ulist);
@include editor-button-2x(heading);
@include editor-button-2x(hr);
@include editor-button-2x(more);
@include editor-button-2x(undo);
@include editor-button-2x(redo);
@include editor-button-2x(fullscreen);
@include editor-button-2x(exit-fullscreen);
}
}
}
.wmd-button-row {
flex: 1;
list-style: none;
margin: 0;
padding: 0;
height: 26px;
line-height: 1;
li {
@include editor-button-2x(bold);
@include editor-button-2x(italic);
@include editor-button-2x(link);
@include editor-button-2x(quote);
@include editor-button-2x(code);
@include editor-button-2x(image);
@include editor-button-2x(olist);
@include editor-button-2x(ulist);
@include editor-button-2x(heading);
@include editor-button-2x(hr);
@include editor-button-2x(more);
@include editor-button-2x(undo);
@include editor-button-2x(redo);
@include editor-button-2x(fullscreen);
@include editor-button-2x(exit-fullscreen);
display: inline-block;
margin-right: 4px;
padding: 3px;
cursor: pointer;
vertical-align: middle;
border-radius: 2px;
&:hover {
background-color: #E9E9E6;
}
&.wmd-spacer {
height: 20px;
margin: 0 10px 0 6px;
padding: 0;
width: 1px;
background: #E9E9E6;
cursor: default;
}
span {
display: block;
width: 20px;
height: 20px;
}
@include editor-button(bold);
@include editor-button(italic);
@include editor-button(link);
@include editor-button(quote);
@include editor-button(code);
@include editor-button(image);
@include editor-button(olist);
@include editor-button(ulist);
@include editor-button(heading);
@include editor-button(hr);
@include editor-button(more);
@include editor-button(undo);
@include editor-button(redo);
@include editor-button(fullscreen);
@include editor-button(exit-fullscreen);
}
}
}
.wmd-button-row {
list-style: none;
margin: 0;
padding: 0;
height: 26px;
line-height: 1;
// 撰写预览切换 tab
.wmd-edittab {
font-size: .92857em;
li {
display: inline-block;
margin-right: 4px;
padding: 3px;
cursor: pointer;
vertical-align: middle;
border-radius: 2px;
&:hover {
background-color: #E9E9E6;
}
&.wmd-spacer {
a {
display: inline-block;
padding: 0 8px;
margin-left: 5px;
height: 20px;
margin: 0 10px 0 6px;
padding: 0;
width: 1px;
background: #E9E9E6;
cursor: default;
}
span {
display: block;
width: 20px;
height: 20px;
}
line-height: 20px;
@include editor-button(bold);
@include editor-button(italic);
@include editor-button(link);
@include editor-button(quote);
@include editor-button(code);
@include editor-button(image);
@include editor-button(olist);
@include editor-button(ulist);
@include editor-button(heading);
@include editor-button(hr);
@include editor-button(more);
@include editor-button(undo);
@include editor-button(redo);
@include editor-button(fullscreen);
@include editor-button(exit-fullscreen);
&:hover {
text-decoration: none;
}
&.active {
background: #E9E9E6;
color: #999;
}
}
}
}
#btn-cancel-preview { display: none }
// 撰写预览切换 tab
.wmd-edittab {
float: right;
margin-top: 3px;
font-size: .92857em;
a {
display: inline-block;
padding: 0 8px;
margin-left: 5px;
height: 20px;
line-height: 20px;
&:hover {
text-decoration: none;
}
&.active {
background: #E9E9E6;
color: #999;
}
}
}
// 控制被隐藏的 tab全屏时显示
.wmd-hidetab {
display: none;
@@ -152,6 +162,24 @@
button { margin-right: 10px; }
}
#wmd-editarea {
/* 拖动调整 textarea 大小 */
.resize {
display: block;
margin: 2px auto 0;
padding: 2px 0;
border: 1px solid #D9D9D6;
border-width: 1px 0;
width: 60px;
cursor: row-resize;
i {
display: block;
height: 1px;
background-color: #D9D9D6;
}
}
}
/* 预览 */
#wmd-preview {
background: #FFF;
@@ -318,7 +346,7 @@
#btn-cancel-preview { display: inline-block }
}
@media (max-width: $screen-phone - 1px) {
@include screen(phone, max) {
#wmd-spacer2,
#wmd-olist-button,
#wmd-ulist-button,

View File

@@ -1,20 +1,17 @@
/*
* Bento Grid System
* Bento Grid System (Flexbox Version)
* Source: https://github.com/fenbox/bento
* Version: 1.2.8
* Update: 2013.11.25
* Version: 2.0.0
* Update: 2024.10.23
*/
@import "vars";
// Mixins
%box-sizing {
box-sizing: border-box;
}
// Container
.container {
margin-left: auto;
@@ -22,189 +19,161 @@
padding-left: $gutter-width / 2;
padding-right: $gutter-width / 2;
@extend %box-sizing;
display: flex;
flex-wrap: wrap;
}
// Column group
.row {
margin-right: $gutter-width / -2;
margin-left: $gutter-width / -2;
@extend .clearfix;
display: flex;
flex-wrap: wrap;
width: 100vw;
}
.row [class*="col-"] {
float: left;
min-height: 1px;
padding-right: $gutter-width / 2;
padding-left: $gutter-width / 2;
min-height: 1px;
flex-grow: 1;
@extend %box-sizing;
}
// Flex order replaces push and pull functionality
.row [class*="-push-"],
.row [class*="-pull-"] {
position: relative;
}
/*
* Mobile and up
*/
// Use flex-grow to simulate columns in mobile
@for $index from 1 through $columns {
.col-mb-#{$index} {
width: $column-width * $index;
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
}
}
/*
* Tablet and up
*/
@media (min-width: $screen-tablet) {
// Tablet and up
@include screen(tablet) {
.container {
max-width: $screen-tablet - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-tb-#{$index} {
width: $column-width * $index;
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
}
}
// Offset
@for $index from 0 through $columns {
.col-tb-offset-#{$index} {
margin-left: $column-width * $index;
}
}
// Pull
@for $index from 0 through $columns {
.col-tb-pull-#{$index} {
right: $column-width * $index;
order: -$index;
}
}
// Push
@for $index from 0 through $columns {
.col-tb-push-#{$index} {
left: $column-width * $index;
order: $index;
}
}
}
/*
* Desktop and up
*/
@media (min-width: $screen-desktop) {
// Desktop and up
@include screen(desktop) {
.container {
max-width: $screen-desktop - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-#{$index} {
width: $column-width * $index;
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
}
}
// Offset
@for $index from 0 through $columns {
.col-offset-#{$index} {
margin-left: $column-width * $index;
}
}
// Pull
@for $index from 0 through $columns {
.col-pull-#{$index} {
right: $column-width * $index;
order: -$index;
}
}
// Push
@for $index from 0 through $columns {
.col-push-#{$index} {
left: $column-width * $index;
order: $index;
}
}
}
/*
* Widescreen and up
*/
@media (min-width: $screen-wide) {
// Widescreen and up
@include screen(wide) {
.container {
max-width: $screen-wide - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-wd-#{$index} {
width: $column-width * $index;
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
}
}
// Offset
@for $index from 0 through $columns {
.col-wd-offset-#{$index} {
margin-left: $column-width * $index;
}
}
// Pull
@for $index from 0 through $columns {
.col-wd-pull-#{$index} {
right: $column-width * $index;
order: -$index;
}
}
// Push
@for $index from 0 through $columns {
.col-wd-push-#{$index} {
left: $column-width * $index;
order: $index;
}
}
}
/*
* Responsive kit
*/
// Hidden in mobile and down
@media (max-width: $screen-phone - 1px) {
// Responsive kit
@include screen(phone, max) {
.kit-hidden-mb {
display: none;
}
}
// Hidden in tablet and down
@media (max-width: $screen-tablet - 1px) {
@include screen(tablet, max) {
.kit-hidden-tb {
display: none;
}
}
// Hidden in descktop and down
@media (max-width: $screen-desktop - 1px) {
@include screen(desktop, max) {
.kit-hidden {
display: none;
}
}
/*
* Clearfix
*/
// Clearfix
.clearfix {
zoom: 1;
&:before, &:after {
&:before,
&:after {
content: " ";
display: table;
}

View File

@@ -19,7 +19,7 @@ html {
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;
background: #F6F6F3;
color: #444;
font-size: 87.5%;
@@ -74,38 +74,15 @@ a.button:hover, a.balloon-button:hover {
@import "buttons";
@import "messages";
@import "pagenavi";
@import "table";
@import "tabs";
@import "tags";
@import "write";
@import "options";
@import "header";
@import "footer";
/** 顶部消息样式 by 70 */
.popup {
display: none;
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 8px 0;
border: none;
width: 100%;
z-index: 10;
text-align: center;
border-radius: 0;
}
.popup ul {
list-style: none;
margin: 0;
padding: 0;
text-align: center;
}
.popup ul li {
display: inline-block;
margin-right: 10px;
}
/**
* logo 的样式
*/
@@ -120,48 +97,6 @@ a.button:hover, a.balloon-button:hover {
background: transparent url(../img/ajax-loader.gif) no-repeat left center;
}
/**
* 典型配置选项
*/
.typecho-option {
list-style: none;
margin: 1em 0;
padding: 0;
&-submit li {
border-bottom: none;
}
label {
&.typecho-label {
display: block;
margin-bottom: .5em;
font-weight: bold;
}
&.required:after {
content: " *";
color: #B94A48;
}
}
span {
margin-right: 15px;
}
.description {
margin: .5em 0 0;
color: #999;
font-size: .92857em;
}
input.file {
width: 100%;
margin: .7em 0;
}
}
.front-archive {
padding-left: 1.5em;
}
@@ -200,12 +135,17 @@ a.button:hover, a.balloon-button:hover {
margin-bottom: 25px;
padding: 0 0 35px;
border-bottom: 1px solid #ECECEC;
display: flex;
flex-wrap: wrap;
li {
float: left;
margin-right: 1.5em;
}
.balloon {
margin-top: 2px;
display: flex;
align-items: center;
.balloon {
margin-left: 5px;
}
}
}
@@ -237,43 +177,55 @@ a.button:hover, a.balloon-button:hover {
display: table;
margin: 0 auto;
height: 100%;
}
.typecho-login {
display: table-cell;
padding: 30px 0 100px;
width: 280px;
text-align: center;
vertical-align: middle;
h1 {
margin: 0 0 1em;
.typecho-login {
display: table-cell;
padding: 30px 0 100px;
width: 280px;
text-align: center;
vertical-align: middle;
h1 {
margin: 0 0 1em;
}
.more-link {
margin-top: 2em;
color: #CCC;
a {
margin: 0 3px;
}
}
}
}
.typecho-login .more-link {
margin-top: 2em;
color: #CCC;
}
.typecho-login .more-link a { margin: 0 3px; }
/**
* 标题
*/
.typecho-page-title {
}
.typecho-page-title h2 {
width: 100%;
display: flex;
align-items: center;
margin: 25px 0 10px;
font-size: 1.28571em;
}
.typecho-page-title h2 a {
margin-left: 10px;
padding: 3px 8px;
background: #E9E9E6;
font-size: .8em;
border-radius: 2px;
}
.typecho-page-title h2 a:hover {
text-decoration: none;
h2 {
margin: 0;
font-size: 1.28571em;
}
a {
padding: 3px 8px;
margin-left: 8px;
background: #E9E9E6;
font-size: .8em;
font-weight: bold;
border-radius: 2px;
&:hover {
text-decoration: none;
}
}
}
/**
@@ -285,190 +237,16 @@ a.button:hover, a.balloon-button:hover {
* 主页主体
*/
.typecho-dashboard {
}
.typecho-dashboard ul {
list-style: none;
padding: 0;
}
.typecho-dashboard li {
margin-bottom: 5px;
}
ul {
list-style: none;
padding: 0;
/**
* 标签页
*/
.typecho-option-tabs {
list-style: none;
margin: 1em 0 0;
padding: 0;
font-size: 13px;
text-align: center;
&.fix-tabs {
margin-bottom: 1em;
}
}
.typecho-option-tabs a {
display: block;
margin-right: -1px;
border: 1px solid #D9D9D6;
padding: 0 15px;
height: 26px;
line-height: 26px;
color: #666;
box-sizing: border-box;
}
.typecho-option-tabs a:hover {
background-color: #E9E9E6;
color: #666;
text-decoration: none;
}
.typecho-option-tabs li {
float: left;
&:first-child a {
border-radius: 2px 0 0 2px;
}
&:last-child a {
border-radius: 0 2px 2px 0;
}
}
.typecho-option-tabs.right {
float: right;
}
.typecho-option-tabs li.current a,
.typecho-option-tabs li.active a {
background-color: #E9E9E6;
}
/**
* 表格列表页
*/
/**
* 列表页选项
*/
.typecho-list .typecho-pager {
}
.typecho-list-operate {
margin: 1em 0;
}
.typecho-list-operate input,
.typecho-list-operate button,
.typecho-list-operate select {
vertical-align: bottom;
}
.typecho-list-operate input[type="checkbox"] {
vertical-align: text-top;
}
@media (min-width: $screen-phone) {
.typecho-list-operate {
.operate {
float: left;
}
.search {
float: right;
li {
margin-bottom: 5px;
}
}
}
.typecho-list-operate span.operate-delete, a.operate-delete,
.typecho-list-operate span.operate-button-delete, a.operate-button-delete {
color: #B94A48;
}
a.operate-edit {
color: #007700;
}
a.operate-reply {
color: #545c30;
}
.typecho-list-operate a:hover {
text-decoration: none;
}
/**
* 列表表格
*/
/** 增加表格标题 by 70 */
.typecho-list-table-title {
margin: 1em 0;
color: #999;
text-align: center;
}
.typecho-table-wrap {
padding: 30px;
background: #FFF;
}
.typecho-list-table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
&.deactivate {
color: #999;
}
.right {
text-align: right;
}
th {
padding: 0 10px 10px;
border-bottom: 2px solid #F0F0EC;
text-align: left;
}
td {
padding: 10px;
border-top: 1px solid #F0F0EC;
word-break: break-all;
pre {
overflow: auto;
}
}
.status {
margin-left: 5px;
color: #999;
font-size: .92857em;
font-style: normal;
}
tbody tr:hover td {
background-color: #F6F6F3;
}
tbody tr.checked td {
background-color: #FFF9E8;
}
tr td .hidden-by-mouse {
opacity: 0;
}
tr:hover td .hidden-by-mouse {
opacity: 1;
}
}
.warning {
color: #B94A48;
}
/**
* 评论管理
*/
@@ -504,12 +282,13 @@ a.operate-reply {
max-width: 100%;
}
@media (max-width: $screen-phone - 1px) {
@include screen(phone, max) {
.comment-edit {
display: flex;
flex-direction: column;
width: 90vw;
}
.comment-edit td:first-child { display: none; }
}
@@ -521,295 +300,57 @@ a.operate-reply {
display: none;
}
/**
* 模板列表
*/
.typecho-theme-list {
}
img {
margin: 1em 0;
max-width: 100%;
max-height: 240px;
}
.typecho-theme-list .theme-item {
}
cite {
font-style: normal;
color: #999;
}
.typecho-theme-list td {
}
.typecho-theme-list img {
margin: 1em 0;
max-width: 100%;
max-height: 240px;
}
.typecho-theme-list cite {
font-style: normal;
color: #999;
}
.typecho-theme-list tbody tr.current td {
background-color: #FFF9E8;
}
/**
* 后台配置项
*/
.typecho-page-main .typecho-option input.text {
width: 100%;
}
.typecho-page-main .typecho-option input.num {
width: 40px;
}
.typecho-page-main .typecho-option textarea {
width: 100%;
height: 100px;
}
.typecho-page-main .typecho-option .multiline {
display: block;
margin: .3em 0;
&.hidden {
display: none;
tbody tr.current td {
background-color: #FFF9E8;
}
}
/**
* 编辑模板
*/
.typecho-select-theme {
height: 25px;
line-height: 25px;
margin: 15px 0px;
}
.typecho-select-theme h5 {
color: #E47E00;
font-weight: bold;
float: left;
font-size: 14px;
width: 120px;
margin-right: 10px;
}
.typecho-select-theme select {
width: 150px;
}
/**
* 编辑模板(编辑详情)
*/
.typecho-edit-theme ul {
list-style: none;
margin: 0;
padding: 0;
}
.typecho-edit-theme li {
padding: 3px 10px;
}
.typecho-edit-theme .current {
background-color: #E6E6E3;
}
.typecho-edit-theme .current a {
color: #444;
}
.typecho-edit-theme textarea {
font-size: .92857em;
line-height: 1.2;
height: 500px;
}
/**
* 编写页面
*/
.typecho-post-area .edit-draft-notice {
color: #999;
font-size: .92857em;
}
.typecho-post-area .edit-draft-notice a { color: #B94A48; }
.typecho-post-area .typecho-label {
display: block;
margin: 1em 0 -0.5em;
font-weight: bold;
}
.typecho-post-area #auto-save-message {
display: block;
margin-top: 0.5em;
color: #999;
font-size: .92857em;
}
.typecho-post-area .submit .right button {
margin-left: 5px;
}
.typecho-post-area .right {
float: right;
}
.typecho-post-area .left {
float: left;
}
.typecho-post-area input.text {
}
.typecho-post-area .out-date {
border: 1px solid #D3DBB3;
padding: 3px;
background: #fff;
}
.typecho-post-area input.title {
font-size: 1.17em;
font-weight: bold;
}
.typecho-post-area .url-slug {
margin-top: -0.5em;
color: #AAA;
font-size: .92857em;
word-break: break-word;
}
.typecho-post-area #slug {
padding: 2px;
border: none;
background: #FFFBCC;
color: #666;
}
.typecho-post-area #text {
resize: none;
}
#advance-panel {
display: none;
}
#custom-field {
margin: 1em 0;
padding: 10px 15px;
background: #FFF;
&.fold {
table, .description { display: none; }
}
.description {
margin-top: 10px;
text-align: right;
button {
float: left;
}
}
p.description {
text-align: left;
}
.typecho-label {
.typecho-edit-theme {
ul {
list-style: none;
margin: 0;
padding: 0;
li {
padding: 3px 10px;
}
}
.current {
background-color: #E6E6E3;
a {
display: block;
color: #444;
&:hover {
color: #467B96;
text-decoration: none;
}
}
}
table {
margin-top: 10px;
}
td {
padding: 10px 5px;
textarea {
font-size: .92857em;
border-bottom: 1px solid #F0F0EC;
vertical-align: top;
label {
font-size: 1em;
font-weight: normal;
}
line-height: 1.2;
height: 500px;
}
select { height: 27px; }
}
.typecho-post-area .is-draft {
background: #FFF1A8;
}
.typecho-post-option .description {
margin-top: -0.5em;
color: #999;
font-size: .92857em;
}
.category-option ul {
list-style: none;
border: 1px solid #D9D9D6;
padding: 6px 12px;
max-height: 240px;
overflow: auto;
background-color: #FFF;
border-radius: 2px;
}
.category-option li {
margin: 3px 0;
}
.visibility-option ul,
.allow-option ul {
list-style: none;
padding: 0;
}
/**
* 标签列表
*/
.typecho-page-main ul.tag-list {
list-style: none;
margin: 0;
padding: 20px;
background-color: #FFF;
}
.typecho-page-main ul.tag-list li {
display: inline-block;
margin: 0 0 5px 0;
padding: 5px 5px 5px 10px;
cursor: pointer;
}
.typecho-page-main ul.tag-list li:hover {
background-color: #E9E9E6;
}
.typecho-page-main ul.tag-list li input {
display: none;
}
.typecho-page-main ul.tag-list li.checked {
background-color: #FFFBCC;
}
.typecho-page-main ul.tag-list li.size-5 { font-size: 1em; }
.typecho-page-main ul.tag-list li.size-10 { font-size: 1.2em; }
.typecho-page-main ul.tag-list li.size-20 { font-size: 1.4em; }
.typecho-page-main ul.tag-list li.size-30 { font-size: 1.6em; }
.typecho-page-main ul.tag-list li.size-0 { font-size: 1.8em; }
.typecho-page-main .tag-edit-link { visibility: hidden; }
.typecho-page-main li:hover .tag-edit-link { visibility: visible; }
.typecho-attachment-photo {
border: 1px solid #E6E6E3;
max-width: 100%;
@@ -873,39 +414,12 @@ background: #FFF1A8;
*/
.edit-media button { margin-right: 6px; }
/* 拖动调整 textarea 大小 */
.resize {
display: block;
margin: 2px auto 0;
padding: 2px 0;
border: 1px solid #D9D9D6;
border-width: 1px 0;
width: 60px;
cursor: row-resize;
i {
display: block;
height: 1px;
background-color: #D9D9D6;
}
}
/* 拖动排序 */
.tDnD_whileDrag {
background-color: #FFFBCC;
}
@media (max-width: $screen-phone - 1px) {
.typecho-list-operate {
.search {
margin-top: 10px;
}
}
.typecho-table-wrap {
padding: 10px;
margin: 0 -10px;
}
@include screen(phone, max) {
.typecho-option-submit {
button[type="submit"] {
width: 100%;

View File

@@ -6,56 +6,39 @@ include 'menu.php';
\Widget\Themes\Files::alloc()->to($files);
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12">
<ul class="typecho-option-tabs fix-tabs clearfix">
<li><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a></li>
<li class="current"><a href="<?php $options->adminUrl('theme-editor.php'); ?>">
<?php if ($options->theme == $files->theme): ?>
<?php _e('编辑当前外观'); ?>
<?php else: ?>
<?php _e('编辑%s外观', ' <cite>' . $files->theme . '</cite> '); ?>
<?php endif; ?>
</a></li>
<?php if (\Widget\Themes\Config::isExists()): ?>
<li><a href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
<?php endif; ?>
</ul>
</div>
<div class="typecho-edit-theme">
<div class="col-mb-12 col-tb-8 col-9 content">
<form method="post" name="theme" id="theme"
action="<?php $security->index('/action/themes-edit'); ?>">
<label for="content" class="sr-only"><?php _e('编辑源码'); ?></label>
<textarea name="content" id="content" class="w-100 mono"
<?php if (!$files->currentIsWriteable()): ?>readonly<?php endif; ?>><?php echo $files->currentContent(); ?></textarea>
<p class="typecho-option typecho-option-submit">
<?php if ($files->currentIsWriteable()): ?>
<input type="hidden" name="theme" value="<?php echo $files->currentTheme(); ?>"/>
<input type="hidden" name="edit" value="<?php echo $files->currentFile(); ?>"/>
<button type="submit" class="btn primary"><?php _e('保存文件'); ?></button>
<?php else: ?>
<em><?php _e('此文件无法写入'); ?></em>
<?php endif; ?>
</p>
</form>
</div>
<ul class="col-mb-12 col-tb-4 col-3">
<li><strong>模板文件</strong></li>
<?php while ($files->next()): ?>
<li<?php if ($files->current): ?> class="current"<?php endif; ?>>
<a href="<?php $options->adminUrl('theme-editor.php?theme=' . $files->currentTheme() . '&file=' . $files->file); ?>"><?php $files->file(); ?></a>
</li>
<?php endwhile; ?>
</ul>
<?php include 'theme-tabs.php'; ?>
<div class="row typecho-page-main typecho-edit-theme" role="main">
<div class="col-mb-12 col-tb-8 col-9 content">
<form method="post" name="theme" id="theme"
action="<?php $security->index('/action/themes-edit'); ?>">
<label for="content" class="sr-only"><?php _e('编辑源码'); ?></label>
<textarea name="content" id="content" class="w-100 mono"
<?php if (!$files->currentIsWriteable()): ?>readonly<?php endif; ?>><?php echo $files->currentContent(); ?></textarea>
<p class="typecho-option typecho-option-submit">
<?php if ($files->currentIsWriteable()): ?>
<input type="hidden" name="theme" value="<?php echo $files->currentTheme(); ?>"/>
<input type="hidden" name="edit" value="<?php echo $files->currentFile(); ?>"/>
<button type="submit" class="btn primary"><?php _e('保存文件'); ?></button>
<?php else: ?>
<em><?php _e('此文件无法写入'); ?></em>
<?php endif; ?>
</p>
</form>
</div>
<ul class="col-mb-12 col-tb-4 col-3">
<li><strong>模板文件</strong></li>
<?php while ($files->next()): ?>
<li<?php if ($files->current): ?> class="current"<?php endif; ?>>
<a href="<?php $options->adminUrl('theme-editor.php?theme=' . $files->currentTheme() . '&file=' . $files->file); ?>"><?php $files->file(); ?></a>
</li>
<?php endwhile; ?>
</ul>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

16
admin/theme-tabs.php Normal file
View File

@@ -0,0 +1,16 @@
<?php if (!defined('__TYPECHO_ADMIN__')) exit; ?>
<ul class="typecho-option-tabs fix-tabs">
<li<?php if ($menu->getCurrentMenuUrl() === 'themes.php'): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a></li>
<?php if (\Widget\Themes\Files::isWriteable()): ?>
<li<?php if ($menu->getCurrentMenuUrl() === 'theme-editor.php'): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('theme-editor.php'); ?>">
<?php if (!isset($files) || $options->theme == $files->theme): ?>
<?php _e('编辑当前外观'); ?>
<?php else: ?>
<?php _e('编辑%s外观', ' <cite>' . $files->theme . '</cite> '); ?>
<?php endif; ?>
</a></li>
<?php endif; ?>
<?php if (\Widget\Themes\Config::isExists()): ?>
<li<?php if ($menu->getCurrentMenuUrl() === 'options-theme.php'): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
<?php endif; ?>
</ul>

View File

@@ -4,79 +4,67 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<?php include 'theme-tabs.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12">
<ul class="typecho-option-tabs fix-tabs clearfix">
<li class="current"><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a>
</li>
<?php if (\Widget\Themes\Files::isWriteable()): ?>
<li><a href="<?php $options->adminUrl('theme-editor.php'); ?>"><?php _e('编辑当前外观'); ?></a></li>
<table class="typecho-list-table typecho-theme-list">
<colgroup>
<col width="35%"/>
<col/>
</colgroup>
<thead>
<th><?php _e('截图'); ?></th>
<th><?php _e('详情'); ?></th>
</thead>
<tbody>
<?php if ($options->missingTheme): ?>
<tr id="theme-<?php $options->missingTheme; ?>" class="current">
<td colspan="2" class="warning">
<p><strong><?php _e('检测到您之前使用的 "%s" 外观文件不存在,您可以重新上传此外观或者启用其他外观。', $options->missingTheme); ?></strong></p>
<ul>
<li><?php _e('重新上传此外观后刷新当前页面,此提示将会消失。'); ?></li>
<li><?php _e('启用新外观后,当前外观的设置数据将被删除。'); ?></li>
</ul>
</td>
</tr>
<?php endif; ?>
<?php if (\Widget\Themes\Config::isExists()): ?>
<li><a href="<?php $options->adminUrl('options-theme.php'); ?>"><?php _e('设置外观'); ?></a></li>
<?php endif; ?>
</ul>
<div class="typecho-table-wrap">
<table class="typecho-list-table typecho-theme-list">
<colgroup>
<col width="35%"/>
<col/>
</colgroup>
<thead>
<th><?php _e('截图'); ?></th>
<th><?php _e('详情'); ?></th>
</thead>
<tbody>
<?php if ($options->missingTheme): ?>
<tr id="theme-<?php $options->missingTheme; ?>" class="current">
<td colspan="2" class="warning">
<p><strong><?php _e('检测到您之前使用的 "%s" 外观文件不存在,您可以重新上传此外观或者启用其他外观。', $options->missingTheme); ?></strong></p>
<ul>
<li><?php _e('重新上传此外观后刷新当前页面,此提示将会消失。'); ?></li>
<li><?php _e('启用新外观后,当前外观的设置数据将被删除。'); ?></li>
</ul>
</td>
</tr>
<?php endif; ?>
<?php \Widget\Themes\Rows::alloc()->to($themes); ?>
<?php while ($themes->next()): ?>
<tr id="theme-<?php $themes->name(); ?>"
class="<?php if ($themes->activated && !$options->missingTheme): ?>current<?php endif; ?>">
<td valign="top"><img src="<?php $themes->screen(); ?>"
alt="<?php $themes->name(); ?>"/></td>
<td valign="top">
<h3><?php '' != $themes->title ? $themes->title() : $themes->name(); ?></h3>
<cite>
<?php if ($themes->author): ?><?php _e('作者'); ?>: <?php if ($themes->homepage): ?><a href="<?php $themes->homepage() ?>"><?php endif; ?><?php $themes->author(); ?><?php if ($themes->homepage): ?></a><?php endif; ?> &nbsp;&nbsp;<?php endif; ?>
<?php if ($themes->version): ?><?php _e('版本'); ?>: <?php $themes->version() ?><?php endif; ?>
</cite>
<p><?php echo nl2br($themes->description); ?></p>
<?php if ($options->theme != $themes->name || $options->missingTheme): ?>
<p>
<?php if (\Widget\Themes\Files::isWriteable()): ?>
<a class="edit"
href="<?php $options->adminUrl('theme-editor.php?theme=' . $themes->name); ?>"><?php _e('编辑'); ?></a> &nbsp;
<?php endif; ?>
<a class="activate"
href="<?php $security->index('/action/themes-edit?change=' . $themes->name); ?>"><?php _e('启用'); ?></a>
</p>
<?php endif; ?>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
<?php \Widget\Themes\Rows::alloc()->to($themes); ?>
<?php while ($themes->next()): ?>
<tr id="theme-<?php $themes->name(); ?>"
class="<?php if ($themes->activated && !$options->missingTheme): ?>current<?php endif; ?>">
<td valign="top"><img src="<?php $themes->screen(); ?>"
alt="<?php $themes->name(); ?>"/></td>
<td valign="top">
<h3><?php '' != $themes->title ? $themes->title() : $themes->name(); ?></h3>
<cite>
<?php if ($themes->author): ?><?php _e('作者'); ?>: <?php if ($themes->homepage): ?><a href="<?php $themes->homepage() ?>"><?php endif; ?><?php $themes->author(); ?><?php if ($themes->homepage): ?></a><?php endif; ?> &nbsp;&nbsp;<?php endif; ?>
<?php if ($themes->version): ?><?php _e('版本'); ?>: <?php $themes->version() ?><?php endif; ?>
</cite>
<p><?php echo nl2br($themes->description); ?></p>
<?php if ($options->theme != $themes->name || $options->missingTheme): ?>
<p>
<?php if (\Widget\Themes\Files::isWriteable()): ?>
<a class="edit"
href="<?php $options->adminUrl('theme-editor.php?theme=' . $themes->name); ?>"><?php _e('编辑'); ?></a> &nbsp;
<?php endif; ?>
<a class="activate"
href="<?php $security->index('/action/themes-edit?change=' . $themes->name); ?>"><?php _e('启用'); ?></a>
</p>
<?php endif; ?>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
@@ -29,7 +29,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="form">
@@ -13,7 +13,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
@@ -27,7 +27,7 @@ include 'menu.php';
</div>
</div>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -145,7 +145,7 @@ $(document).ready(function() {
idInput = $('input[name=cid]'),
draft = $('input[name=draft]'),
btnPreview = $('#btn-preview'),
autoSave = $('<span id="auto-save-message" class="left"></span>').prependTo('.submit');
autoSave = $('<span id="auto-save-message"></span>').prependTo('.left');
let cid = idInput.val(),
draftId = draft.length > 0 ? draft.val() : 0,
@@ -320,12 +320,6 @@ $(document).ready(function() {
return false;
});
// 高级选项控制
$('#advance-panel-btn').click(function() {
$('#advance-panel').toggle();
return false;
});
// 自动隐藏密码框
$('#visibility').change(function () {
const val = $(this).val(), password = $('#post-password');

View File

@@ -16,189 +16,187 @@ while ($parents->next()) {
$parentPages[$parents->cid] = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $parents->levels) . $parents->title;
}
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main typecho-post-area" role="form">
<form action="<?php $security->index('/action/contents-page-edit'); ?>" method="post" name="write_page">
<div class="col-mb-12 col-tb-9" role="main">
<?php if ($page->draft): ?>
<?php if ($page->draft['cid'] != $page->cid): ?>
<?php $pageModifyDate = new \Typecho\Date($page->draft['modified']); ?>
<cite
class="edit-draft-notice"><?php _e('你正在编辑的是保存于 %s 的修订版, 你也可以 <a href="%s">删除它</a>', $pageModifyDate->word(),
$security->getIndex('/action/contents-page-edit?do=deleteDraft&cid=' . $page->cid)); ?></cite>
<?php else: ?>
<cite class="edit-draft-notice"><?php _e('当前正在编辑的是未发布的草稿'); ?></cite>
<?php endif; ?>
<input name="draft" type="hidden" value="<?php echo $page->draft['cid'] ?>"/>
<form class="row typecho-page-main typecho-post-area" action="<?php $security->index('/action/contents-page-edit'); ?>" method="post" name="write_page">
<div class="col-mb-12 col-tb-9" role="main">
<?php if ($page->draft): ?>
<?php if ($page->draft['cid'] != $page->cid): ?>
<?php $pageModifyDate = new \Typecho\Date($page->draft['modified']); ?>
<cite
class="edit-draft-notice"><?php _e('你正在编辑的是保存于 %s 的修订版, 你也可以 <a href="%s">删除它</a>', $pageModifyDate->word(),
$security->getIndex('/action/contents-page-edit?do=deleteDraft&cid=' . $page->cid)); ?></cite>
<?php else: ?>
<cite class="edit-draft-notice"><?php _e('当前正在编辑的是未发布的草稿'); ?></cite>
<?php endif; ?>
<input name="draft" type="hidden" value="<?php echo $page->draft['cid'] ?>"/>
<?php endif; ?>
<p class="title">
<label for="title" class="sr-only"><?php _e('标题'); ?></label>
<input type="text" id="title" name="title" autocomplete="off" value="<?php $page->title(); ?>"
placeholder="<?php _e('标题'); ?>" class="w-100 text title"/>
</p>
<?php $permalink = \Typecho\Common::url($options->routingTable['page']['url'], $options->index);
[$scheme, $permalink] = explode(':', $permalink, 2);
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($page->have()) {
$permalink = preg_replace_callback(
"/\{(cid)\}/i",
function ($matches) use ($page) {
$key = $matches[1];
return $page->getRouterParam($key);
},
$permalink
);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($page->slug ?? '') . '" class="mono" />';
?>
<p class="mono url-slug">
<label for="slug" class="sr-only"><?php _e('网址缩略名'); ?></label>
<?php echo preg_replace_callback("/\{(slug|directory)\}/i", function ($matches) use ($input) {
if ($matches[1] == 'slug') {
return $input;
} else {
return '{directory/' . $input . '}';
}
}, $permalink); ?>
</p>
<p>
<label for="text" class="sr-only"><?php _e('页面内容'); ?></label>
<textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text"
name="text" class="w-100 mono"><?php echo htmlspecialchars($page->text); ?></textarea>
</p>
<p class="title">
<label for="title" class="sr-only"><?php _e('标题'); ?></label>
<input type="text" id="title" name="title" autocomplete="off" value="<?php $page->title(); ?>"
placeholder="<?php _e('标题'); ?>" class="w-100 text title"/>
</p>
<?php $permalink = \Typecho\Common::url($options->routingTable['page']['url'], $options->index);
[$scheme, $permalink] = explode(':', $permalink, 2);
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($page->have()) {
$permalink = preg_replace_callback(
"/\{(cid)\}/i",
function ($matches) use ($page) {
$key = $matches[1];
return $page->getRouterParam($key);
},
$permalink
);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($page->slug ?? '') . '" class="mono" />';
?>
<p class="mono url-slug">
<label for="slug" class="sr-only"><?php _e('网址缩略名'); ?></label>
<?php echo preg_replace_callback("/\{(slug|directory)\}/i", function ($matches) use ($input) {
if ($matches[1] == 'slug') {
return $input;
} else {
return '{directory/' . $input . '}';
}
}, $permalink); ?>
</p>
<p>
<label for="text" class="sr-only"><?php _e('页面内容'); ?></label>
<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 include 'custom-fields.php'; ?>
<p class="submit clearfix">
<span class="left">
<button type="button" id="btn-cancel-preview" class="btn"><i
class="i-caret-left"></i> <?php _e('取消预览'); ?></button>
</span>
<span class="right">
<input type="hidden" name="do" value="publish" />
<input type="hidden" name="cid" value="<?php $page->cid(); ?>"/>
<button type="button" id="btn-preview" class="btn"><i
class="i-exlink"></i> <?php _e('预览页面'); ?></button>
<button type="submit" name="do" value="save" id="btn-save"
class="btn"><?php _e('保存草稿'); ?></button>
<button type="submit" name="do" value="publish" class="btn primary"
id="btn-submit"><?php _e('发布页面'); ?></button>
<?php if ($options->markdown && (!$page->have() || $page->isMarkdown)): ?>
<input type="hidden" name="markdown" value="1"/>
<?php endif; ?>
</span>
</p>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('content', $page); ?>
</div>
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
<ul class="typecho-option-tabs clearfix">
<li class="active w-50"><a href="#tab-advance"><?php _e('选项'); ?></a></li>
<li class="w-50"><a href="#tab-files" id="tab-files-btn"><?php _e('附件'); ?></a></li>
</ul>
<div id="tab-advance" class="tab-content">
<section class="typecho-post-option" role="application">
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
<p><input class="typecho-date w-100" type="text" name="date" id="date" autocomplete="off"
value="<?php $page->have() && $page->created > 0 ? $page->date('Y-m-d H:i') : ''; ?>"/>
</p>
</section>
<section class="typecho-post-option">
<label for="order" class="typecho-label"><?php _e('页面顺序'); ?></label>
<p><input type="text" id="order" name="order" value="<?php $page->order(); ?>"
class="w-100"/></p>
<p class="description"><?php _e('为你的自定义页面设定一个序列值以后, 能够使得它们按此值从小到大排列'); ?></p>
</section>
<section class="typecho-post-option">
<label for="template" class="typecho-label"><?php _e('自定义模板'); ?></label>
<p>
<select name="template" id="template">
<option value=""><?php _e('不选择'); ?></option>
<?php $templates = $page->getTemplates();
foreach ($templates as $template => $name): ?>
<option
value="<?php echo $template; ?>"<?php if ($template == $page->template): ?> selected="true"<?php endif; ?>><?php echo $name; ?></option>
<?php endforeach; ?>
</select>
</p>
<p class="description"><?php _e('如果你为此页面选择了一个自定义模板, 系统将按照你选择的模板文件展现它'); ?></p>
</section>
<section class="typecho-post-option">
<label for="parent" class="typecho-label"><?php _e('父级页面'); ?></label>
<p>
<select name="parent" id="parent">
<?php foreach ($parentPages as $pageId => $pageTitle): ?>
<option
value="<?php echo $pageId; ?>"<?php if ($pageId == ($page->parent ?? $parentPageId)): ?> selected="true"<?php endif; ?>><?php echo $pageTitle; ?></option>
<?php endforeach; ?>
</select>
</p>
<p class="description"><?php _e('如果你设定了父级页面, 此页面将作为子页面呈现'); ?></p>
</section>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('option', $page); ?>
<button type="button" id="advance-panel-btn" class="btn btn-xs"><?php _e('高级选项'); ?> <i
class="i-caret-down"></i></button>
<div id="advance-panel">
<section class="typecho-post-option visibility-option">
<label for="visibility" class="typecho-label"><?php _e('公开度'); ?></label>
<p>
<select id="visibility" name="visibility">
<option
value="publish"<?php if ($page->status == 'publish' || !$page->status): ?> selected<?php endif; ?>><?php _e('公开'); ?></option>
<option
value="hidden"<?php if ($page->status == 'hidden'): ?> selected<?php endif; ?>><?php _e('隐藏'); ?></option>
</select>
</p>
</section>
<section class="typecho-post-option allow-option">
<label class="typecho-label"><?php _e('权限控制'); ?></label>
<ul>
<li><input id="allowComment" name="allowComment" type="checkbox" value="1"
<?php if ($page->allow('comment')): ?>checked="true"<?php endif; ?> />
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
<li><input id="allowPing" name="allowPing" type="checkbox" value="1"
<?php if ($page->allow('ping')): ?>checked="true"<?php endif; ?> />
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1"
<?php if ($page->allow('feed')): ?>checked="true"<?php endif; ?> />
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
</ul>
</section>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('advanceOption', $page); ?>
</div>
<?php if ($page->have()): ?>
<?php $modified = new \Typecho\Date($page->modified); ?>
<section class="typecho-post-option">
<p class="description">
<br>&mdash;<br>
<?php _e('本页面由 <a href="%s">%s</a> 创建',
\Typecho\Common::url('manage-pages.php?uid=' . $page->author->uid, $options->adminUrl), $page->author->screenName); ?>
<br>
<?php _e('最后更新于 %s', $modified->word()); ?>
</p>
</section>
<?php include 'custom-fields.php'; ?>
<p class="submit">
<span class="left">
<button type="button" id="btn-cancel-preview" class="btn"><i
class="i-caret-left"></i> <?php _e('取消预览'); ?></button>
</span>
<span class="right">
<input type="hidden" name="do" value="publish" />
<input type="hidden" name="cid" value="<?php $page->cid(); ?>"/>
<button type="button" id="btn-preview" class="btn"><i
class="i-exlink"></i> <?php _e('预览页面'); ?></button>
<button type="submit" name="do" value="save" id="btn-save"
class="btn"><?php _e('保存草稿'); ?></button>
<button type="submit" name="do" value="publish" class="btn primary"
id="btn-submit"><?php _e('发布页面'); ?></button>
<?php if ($options->markdown && (!$page->have() || $page->isMarkdown)): ?>
<input type="hidden" name="markdown" value="1"/>
<?php endif; ?>
</div><!-- end #tab-advance -->
</span>
</p>
<div id="tab-files" class="tab-content hidden">
<?php include 'file-upload.php'; ?>
</div><!-- end #tab-files -->
</div>
</form>
</div>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('content', $page); ?>
</div>
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
<ul class="typecho-option-tabs">
<li class="active w-50"><a href="#tab-advance"><?php _e('选项'); ?></a></li>
<li class="w-50"><a href="#tab-files" id="tab-files-btn"><?php _e('附件'); ?></a></li>
</ul>
<div id="tab-advance" class="tab-content">
<section class="typecho-post-option" role="application">
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
<p><input class="typecho-date w-100" type="text" name="date" id="date" autocomplete="off"
value="<?php $page->have() && $page->created > 0 ? $page->date('Y-m-d H:i') : ''; ?>"/>
</p>
</section>
<section class="typecho-post-option">
<label for="order" class="typecho-label"><?php _e('页面顺序'); ?></label>
<p><input type="number" id="order" name="order" value="<?php $page->order(); ?>"
class="w-100"/></p>
<p class="description"><?php _e('为你的自定义页面设定一个序列值以后, 能够使得它们按此值从小到大排列'); ?></p>
</section>
<section class="typecho-post-option">
<label for="template" class="typecho-label"><?php _e('自定义模板'); ?></label>
<p>
<select name="template" id="template">
<option value=""><?php _e('不选择'); ?></option>
<?php $templates = $page->getTemplates();
foreach ($templates as $template => $name): ?>
<option
value="<?php echo $template; ?>"<?php if ($template == $page->template): ?> selected="true"<?php endif; ?>><?php echo $name; ?></option>
<?php endforeach; ?>
</select>
</p>
<p class="description"><?php _e('如果你为此页面选择了一个自定义模板, 系统将按照你选择的模板文件展现它'); ?></p>
</section>
<section class="typecho-post-option">
<label for="parent" class="typecho-label"><?php _e('父级页面'); ?></label>
<p>
<select name="parent" id="parent">
<?php foreach ($parentPages as $pageId => $pageTitle): ?>
<option
value="<?php echo $pageId; ?>"<?php if ($pageId == ($page->parent ?? $parentPageId)): ?> selected="true"<?php endif; ?>><?php echo $pageTitle; ?></option>
<?php endforeach; ?>
</select>
</p>
<p class="description"><?php _e('如果你设定了父级页面, 此页面将作为子页面呈现'); ?></p>
</section>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('option', $page); ?>
<details id="advance-panel">
<summary class="btn btn-xs"><?php _e('高级选项'); ?> <i class="i-caret-down"></i></summary>
<section class="typecho-post-option visibility-option">
<label for="visibility" class="typecho-label"><?php _e('公开度'); ?></label>
<p>
<select id="visibility" name="visibility">
<option
value="publish"<?php if ($page->status == 'publish' || !$page->status): ?> selected<?php endif; ?>><?php _e('公开'); ?></option>
<option
value="hidden"<?php if ($page->status == 'hidden'): ?> selected<?php endif; ?>><?php _e('隐藏'); ?></option>
</select>
</p>
</section>
<section class="typecho-post-option allow-option">
<label class="typecho-label"><?php _e('权限控制'); ?></label>
<ul>
<li><input id="allowComment" name="allowComment" type="checkbox" value="1"
<?php if ($page->allow('comment')): ?>checked="true"<?php endif; ?> />
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
<li><input id="allowPing" name="allowPing" type="checkbox" value="1"
<?php if ($page->allow('ping')): ?>checked="true"<?php endif; ?> />
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1"
<?php if ($page->allow('feed')): ?>checked="true"<?php endif; ?> />
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
</ul>
</section>
<?php \Typecho\Plugin::factory('admin/write-page.php')->call('advanceOption', $page); ?>
</details>
<?php if ($page->have()): ?>
<?php $modified = new \Typecho\Date($page->modified); ?>
<section class="typecho-post-option">
<p class="description">
<br>&mdash;<br>
<?php _e('本页面由 <a href="%s">%s</a> 创建',
\Typecho\Common::url('manage-pages.php?uid=' . $page->author->uid, $options->adminUrl), $page->author->screenName); ?>
<br>
<?php _e('最后更新于 %s', $modified->word()); ?>
</p>
</section>
<?php endif; ?>
</div><!-- end #tab-advance -->
<div id="tab-files" class="tab-content hidden">
<?php include 'file-upload.php'; ?>
</div><!-- end #tab-files -->
</div>
</form>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -5,197 +5,195 @@ include 'menu.php';
$post = \Widget\Contents\Post\Edit::alloc()->prepare();
?>
<div class="main">
<main class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main typecho-post-area" role="form">
<form action="<?php $security->index('/action/contents-post-edit'); ?>" method="post" name="write_post">
<div class="col-mb-12 col-tb-9" role="main">
<?php if ($post->draft): ?>
<?php if ($post->draft['cid'] != $post->cid): ?>
<?php $postModifyDate = new \Typecho\Date($post->draft['modified']); ?>
<cite
class="edit-draft-notice"><?php _e('你正在编辑的是保存于 %s 的修订版, 你也可以 <a href="%s">删除它</a>', $postModifyDate->word(),
$security->getIndex('/action/contents-post-edit?do=deleteDraft&cid=' . $post->cid)); ?></cite>
<?php else: ?>
<cite class="edit-draft-notice"><?php _e('当前正在编辑的是未发布的草稿'); ?></cite>
<?php endif; ?>
<input name="draft" type="hidden" value="<?php echo $post->draft['cid'] ?>"/>
<form class="row typecho-page-main typecho-post-area" action="<?php $security->index('/action/contents-post-edit'); ?>" method="post" name="write_post">
<div class="col-mb-12 col-tb-9" role="main">
<?php if ($post->draft): ?>
<?php if ($post->draft['cid'] != $post->cid): ?>
<?php $postModifyDate = new \Typecho\Date($post->draft['modified']); ?>
<cite
class="edit-draft-notice"><?php _e('你正在编辑的是保存于 %s 的修订版, 你也可以 <a href="%s">删除它</a>', $postModifyDate->word(),
$security->getIndex('/action/contents-post-edit?do=deleteDraft&cid=' . $post->cid)); ?></cite>
<?php else: ?>
<cite class="edit-draft-notice"><?php _e('当前正在编辑的是未发布的草稿'); ?></cite>
<?php endif; ?>
<input name="draft" type="hidden" value="<?php echo $post->draft['cid'] ?>"/>
<?php endif; ?>
<p class="title">
<label for="title" class="sr-only"><?php _e('标题'); ?></label>
<input type="text" id="title" name="title" autocomplete="off" value="<?php $post->title(); ?>"
placeholder="<?php _e('标题'); ?>" class="w-100 text title"/>
</p>
<?php $permalink = \Typecho\Common::url($options->routingTable['post']['url'], $options->index);
[$scheme, $permalink] = explode(':', $permalink, 2);
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($post->have()) {
$permalink = preg_replace_callback(
"/\{(cid|category|year|month|day)\}/i",
function ($matches) use ($post) {
$key = $matches[1];
return $post->getRouterParam($key);
},
$permalink
);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($post->slug ?? '') . '" class="mono" />';
?>
<p class="mono url-slug">
<label for="slug" class="sr-only"><?php _e('网址缩略名'); ?></label>
<?php echo preg_replace("/\{slug\}/i", $input, $permalink); ?>
</p>
<p>
<label for="text" class="sr-only"><?php _e('文章内容'); ?></label>
<textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text"
name="text" class="w-100 mono"><?php echo htmlspecialchars($post->text); ?></textarea>
</p>
<p class="title">
<label for="title" class="sr-only"><?php _e('标题'); ?></label>
<input type="text" id="title" name="title" autocomplete="off" value="<?php $post->title(); ?>"
placeholder="<?php _e('标题'); ?>" class="w-100 text title"/>
</p>
<?php $permalink = \Typecho\Common::url($options->routingTable['post']['url'], $options->index);
[$scheme, $permalink] = explode(':', $permalink, 2);
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($post->have()) {
$permalink = preg_replace_callback(
"/\{(cid|category|year|month|day)\}/i",
function ($matches) use ($post) {
$key = $matches[1];
return $post->getRouterParam($key);
},
$permalink
);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($post->slug ?? '') . '" class="mono" />';
?>
<p class="mono url-slug">
<label for="slug" class="sr-only"><?php _e('网址缩略名'); ?></label>
<?php echo preg_replace("/\{slug\}/i", $input, $permalink); ?>
</p>
<p>
<label for="text" class="sr-only"><?php _e('文章内容'); ?></label>
<textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text"
name="text" class="w-100 mono"><?php echo htmlspecialchars($post->text); ?></textarea>
</p>
<?php include 'custom-fields.php'; ?>
<?php include 'custom-fields.php'; ?>
<p class="submit clearfix">
<span class="left">
<button type="button" id="btn-cancel-preview" class="btn"><i
class="i-caret-left"></i> <?php _e('取消预览'); ?></button>
</span>
<span class="right">
<input type="hidden" name="do" value="publish" />
<input type="hidden" name="cid" value="<?php $post->cid(); ?>"/>
<button type="button" id="btn-preview" class="btn"><i
class="i-exlink"></i> <?php _e('预览文章'); ?></button>
<button type="submit" name="do" value="save" id="btn-save"
class="btn"><?php _e('保存草稿'); ?></button>
<button type="submit" name="do" value="publish" class="btn primary"
id="btn-submit"><?php _e('发布文章'); ?></button>
<?php if ($options->markdown && (!$post->have() || $post->isMarkdown)): ?>
<input type="hidden" name="markdown" value="1"/>
<?php endif; ?>
</span>
</p>
<p class="submit">
<span class="left">
<button type="button" id="btn-cancel-preview" class="btn"><i
class="i-caret-left"></i> <?php _e('取消预览'); ?></button>
</span>
<span class="right">
<input type="hidden" name="do" value="publish" />
<input type="hidden" name="cid" value="<?php $post->cid(); ?>"/>
<button type="button" id="btn-preview" class="btn"><i
class="i-exlink"></i> <?php _e('预览文章'); ?></button>
<button type="submit" name="do" value="save" id="btn-save"
class="btn"><?php _e('保存草稿'); ?></button>
<button type="submit" name="do" value="publish" class="btn primary"
id="btn-submit"><?php _e('发布文章'); ?></button>
<?php if ($options->markdown && (!$post->have() || $post->isMarkdown)): ?>
<input type="hidden" name="markdown" value="1"/>
<?php endif; ?>
</span>
</p>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('content', $post); ?>
</div>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('content', $post); ?>
</div>
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
<ul class="typecho-option-tabs clearfix">
<li class="active w-50"><a href="#tab-advance"><?php _e('选项'); ?></a></li>
<li class="w-50"><a href="#tab-files" id="tab-files-btn"><?php _e('附件'); ?></a></li>
</ul>
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
<ul class="typecho-option-tabs">
<li class="active w-50"><a href="#tab-advance"><?php _e('选项'); ?></a></li>
<li class="w-50"><a href="#tab-files" id="tab-files-btn"><?php _e('附件'); ?></a></li>
</ul>
<div id="tab-advance" class="tab-content">
<section class="typecho-post-option" role="application">
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
<p><input class="typecho-date w-100" type="text" name="date" id="date" autocomplete="off"
value="<?php $post->have() && $post->created > 0 ? $post->date('Y-m-d H:i') : ''; ?>"/>
</p>
</section>
<div id="tab-advance" class="tab-content">
<section class="typecho-post-option" role="application">
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
<p><input class="typecho-date w-100" type="text" name="date" id="date" autocomplete="off"
value="<?php $post->have() && $post->created > 0 ? $post->date('Y-m-d H:i') : ''; ?>"/>
</p>
</section>
<section class="typecho-post-option category-option">
<label class="typecho-label"><?php _e('分类'); ?></label>
<?php \Widget\Metas\Category\Rows::alloc()->to($category); ?>
<section class="typecho-post-option category-option">
<label class="typecho-label"><?php _e('分类'); ?></label>
<?php \Widget\Metas\Category\Rows::alloc()->to($category); ?>
<ul>
<?php $categories = array_column($post->categories, 'mid'); ?>
<?php while ($category->next()): ?>
<li><?php echo str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $category->levels); ?><input
type="checkbox" id="category-<?php $category->mid(); ?>"
value="<?php $category->mid(); ?>" name="category[]"
<?php if (in_array($category->mid, $categories)): ?>checked="true"<?php endif; ?>/>
<label
for="category-<?php $category->mid(); ?>"><?php $category->name(); ?></label>
</li>
<?php endwhile; ?>
</ul>
</section>
<section class="typecho-post-option">
<label for="token-input-tags" class="typecho-label"><?php _e('标签'); ?></label>
<p><input id="tags" name="tags" type="text" value="<?php $post->have() ? $post->tags(',', false) : ''; ?>"
class="w-100 text"/></p>
</section>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('option', $post); ?>
<details id="advance-panel">
<summary class="btn btn-xs"><?php _e('高级选项'); ?> <i class="i-caret-down"></i></summary>
<?php if ($user->pass('editor', true)): ?>
<section class="typecho-post-option visibility-option">
<label for="visibility" class="typecho-label"><?php _e('公开度'); ?></label>
<p>
<select id="visibility" name="visibility">
<?php if ($user->pass('editor', true)): ?>
<option
value="publish"<?php if (($post->status == 'publish' && !$post->password) || !$post->status): ?> selected<?php endif; ?>><?php _e('公开'); ?></option>
<option
value="hidden"<?php if ($post->status == 'hidden'): ?> selected<?php endif; ?>><?php _e('隐藏'); ?></option>
<option
value="password"<?php if (strlen($post->password ?? '') > 0): ?> selected<?php endif; ?>><?php _e('密码保护'); ?></option>
<option
value="private"<?php if ($post->status == 'private'): ?> selected<?php endif; ?>><?php _e('私密'); ?></option>
<?php endif; ?>
<option
value="waiting"<?php if (!$user->pass('editor', true) || $post->status == 'waiting'): ?> selected<?php endif; ?>><?php _e('待审核'); ?></option>
</select>
</p>
<p id="post-password"<?php if (strlen($post->password ?? '') == 0): ?> class="hidden"<?php endif; ?>>
<label for="protect-pwd" class="sr-only">内容密码</label>
<input type="text" name="password" id="protect-pwd" class="text-s"
value="<?php $post->password(); ?>" size="16"
placeholder="<?php _e('内容密码'); ?>" autocomplete="off"/>
</p>
</section>
<?php endif; ?>
<section class="typecho-post-option allow-option">
<label class="typecho-label"><?php _e('权限控制'); ?></label>
<ul>
<?php $categories = array_column($post->categories, 'mid'); ?>
<?php while ($category->next()): ?>
<li><?php echo str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $category->levels); ?><input
type="checkbox" id="category-<?php $category->mid(); ?>"
value="<?php $category->mid(); ?>" name="category[]"
<?php if (in_array($category->mid, $categories)): ?>checked="true"<?php endif; ?>/>
<label
for="category-<?php $category->mid(); ?>"><?php $category->name(); ?></label>
</li>
<?php endwhile; ?>
<li><input id="allowComment" name="allowComment" type="checkbox" value="1"
<?php if ($post->allow('comment')): ?>checked="true"<?php endif; ?> />
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
<li><input id="allowPing" name="allowPing" type="checkbox" value="1"
<?php if ($post->allow('ping')): ?>checked="true"<?php endif; ?> />
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1"
<?php if ($post->allow('feed')): ?>checked="true"<?php endif; ?> />
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
</ul>
</section>
<section class="typecho-post-option">
<label for="token-input-tags" class="typecho-label"><?php _e('标签'); ?></label>
<p><input id="tags" name="tags" type="text" value="<?php $post->have() ? $post->tags(',', false) : ''; ?>"
class="w-100 text"/></p>
<label for="trackback" class="typecho-label"><?php _e('引用通告'); ?></label>
<p><textarea id="trackback" class="w-100 mono" name="trackback" rows="2"></textarea></p>
<p class="description"><?php _e('每一行一个引用地址, 用回车隔开'); ?></p>
</section>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('option', $post); ?>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('advanceOption', $post); ?>
</details><!-- end #advance-panel -->
<button type="button" id="advance-panel-btn" class="btn btn-xs"><?php _e('高级选项'); ?> <i
class="i-caret-down"></i></button>
<div id="advance-panel">
<?php if ($user->pass('editor', true)): ?>
<section class="typecho-post-option visibility-option">
<label for="visibility" class="typecho-label"><?php _e('公开度'); ?></label>
<p>
<select id="visibility" name="visibility">
<?php if ($user->pass('editor', true)): ?>
<option
value="publish"<?php if (($post->status == 'publish' && !$post->password) || !$post->status): ?> selected<?php endif; ?>><?php _e('公开'); ?></option>
<option
value="hidden"<?php if ($post->status == 'hidden'): ?> selected<?php endif; ?>><?php _e('隐藏'); ?></option>
<option
value="password"<?php if (strlen($post->password ?? '') > 0): ?> selected<?php endif; ?>><?php _e('密码保护'); ?></option>
<option
value="private"<?php if ($post->status == 'private'): ?> selected<?php endif; ?>><?php _e('私密'); ?></option>
<?php endif; ?>
<option
value="waiting"<?php if (!$user->pass('editor', true) || $post->status == 'waiting'): ?> selected<?php endif; ?>><?php _e('待审核'); ?></option>
</select>
</p>
<p id="post-password"<?php if (strlen($post->password ?? '') == 0): ?> class="hidden"<?php endif; ?>>
<label for="protect-pwd" class="sr-only">内容密码</label>
<input type="text" name="password" id="protect-pwd" class="text-s"
value="<?php $post->password(); ?>" size="16"
placeholder="<?php _e('内容密码'); ?>" autocomplete="off"/>
</p>
</section>
<?php endif; ?>
<?php if ($post->have()): ?>
<?php $modified = new \Typecho\Date($post->modified); ?>
<section class="typecho-post-option">
<p class="description">
<br>&mdash;<br>
<?php _e('本文由 <a href="%s">%s</a> 撰写',
\Typecho\Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?>
<br>
<?php _e('最后更新于 %s', $modified->word()); ?>
</p>
</section>
<?php endif; ?>
</div><!-- end #tab-advance -->
<section class="typecho-post-option allow-option">
<label class="typecho-label"><?php _e('权限控制'); ?></label>
<ul>
<li><input id="allowComment" name="allowComment" type="checkbox" value="1"
<?php if ($post->allow('comment')): ?>checked="true"<?php endif; ?> />
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
<li><input id="allowPing" name="allowPing" type="checkbox" value="1"
<?php if ($post->allow('ping')): ?>checked="true"<?php endif; ?> />
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1"
<?php if ($post->allow('feed')): ?>checked="true"<?php endif; ?> />
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
</ul>
</section>
<section class="typecho-post-option">
<label for="trackback" class="typecho-label"><?php _e('引用通告'); ?></label>
<p><textarea id="trackback" class="w-100 mono" name="trackback" rows="2"></textarea></p>
<p class="description"><?php _e('每一行一个引用地址, 用回车隔开'); ?></p>
</section>
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('advanceOption', $post); ?>
</div><!-- end #advance-panel -->
<?php if ($post->have()): ?>
<?php $modified = new \Typecho\Date($post->modified); ?>
<section class="typecho-post-option">
<p class="description">
<br>&mdash;<br>
<?php _e('本文由 <a href="%s">%s</a> 撰写',
\Typecho\Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?>
<br>
<?php _e('最后更新于 %s', $modified->word()); ?>
</p>
</section>
<?php endif; ?>
</div><!-- end #tab-advance -->
<div id="tab-files" class="tab-content hidden">
<?php include 'file-upload.php'; ?>
</div><!-- end #tab-files -->
</div>
</form>
</div>
<div id="tab-files" class="tab-content hidden">
<?php include 'file-upload.php'; ?>
</div><!-- end #tab-files -->
</div>
</form>
</div>
</div>
</main>
<?php
include 'copyright.php';

View File

@@ -1,52 +0,0 @@
Version 0.8.1/12.4.1
修复同级子目录下安装多个站点引起的登录失效
增加评论黑名单插件
修复评论接口重用导致启用评论验证插件后后台无法评论的bug
修正年份路由的bug
修正由于flash的cookie丢失bug导致的文件无法上传bug
增加对ini_get的判断
提交对Sina App Engine的兼容性判断
增加对Sina App Engine环境的支持
增加对ini_get的判断
修正新注册用户登录后跳转错误bug
修正对ssl的支持
fix issue 510
修复使用多层代理时, 获取ip地址错误
修正修改文章时上传控件无法载入的问题
修改后台错别字
修正错别字
兼容server不支持http 1.1的情况,典型问题如 sae环境404页面乱码
修正由于SAE更改常用导致的数据库信息无法自动读入的问题
增加上传插件接口
提交Sina App Engine专用的文件上传插件
使用SAE的Storage做持久化存储。
修正SaeUpload插件的说明地址
new version library
只是一些小修正
fix bug report on segmentfault
fix issue 536
fix Issue 541
fix Issue 544
fix Issue 544
fix Issue 540
fix Issue 537
fix Issue 529
fix Issue 532
fix issue 526
文章增加待审核功能下一步给文章增加private属性
更新后台表单样式, 新增文章预览功能
css细节微调
文章增加private属性显示
修正插件显示空白问题, 预览框box修正
修改预览内容样式,修改预览选项位置,高级选项->权限控制增加“允许游客访问”选项,用于私密浏览
fix Issue 545
实现文章公开度:公开、密码保护、私有、未审核
little change
实现功能1,当用户之前有审核通过的评论再次发评论会直接为通过审核可关闭2,未通过审核的评论评论作者可以在前台看到他人不可见3,隐藏功能;
修正后台修改或添加页面状态错误的问题;修正保存私密、审核日志时会新增一篇同样日志的问题
简单增强搜索功能 Issue 480
添加有密码和未发布图标
fix Issue 551
将文章管理页的公开度草稿等信息改为文字
接受插件返回的header

View File

@@ -17,10 +17,10 @@ if (!defined('__TYPECHO_ROOT_DIR__') && !@include_once 'config.inc.php') {
\Widget\Init::alloc();
/** 注册一个初始化插件 */
\Typecho\Plugin::factory('index.php')->begin();
\Typecho\Plugin::factory('index.php')->call('begin');
/** 开始路由分发 */
\Typecho\Router::dispatch();
/** 注册一个结束插件 */
\Typecho\Plugin::factory('index.php')->end();
\Typecho\Plugin::factory('index.php')->call('end');

View File

@@ -1064,7 +1064,11 @@ function install_step_2_perform()
// intval port number
if (isset($dbConfig['port'])) {
$dbConfig['port'] = intval($dbConfig['port']);
if (strpos($dbConfig['host'], '/') !== false && $type == 'Mysql') {
$dbConfig['port'] = null;
} else {
$dbConfig['port'] = intval($dbConfig['port']);
}
}
// bool ssl verify

View File

@@ -9,14 +9,14 @@
"version": "1.0.0",
"license": "GPL-2.0-only",
"dependencies": {
"@picocss/pico": "^1.5.0",
"@picocss/pico": "^2.0.6",
"chalk": "^4.0.0",
"node-sass": "^9.0.0",
"sprite-magic-importer": "^1.6.2",
"uglify-js": "^3.11.6"
},
"engines": {
"node": "16.x"
"node": "18.x"
}
},
"node_modules/@babel/code-frame": {
@@ -227,9 +227,12 @@
}
},
"node_modules/@picocss/pico": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/@picocss/pico/-/pico-1.5.10.tgz",
"integrity": "sha512-+LafMsrwPxXQMk6sI///TmSInCwwZmq+K7SikyL3N/4GhhwzyPC+TQLUEqmrLyjluR+uIpFFcqjty30Rtr6GxQ=="
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/@picocss/pico/-/pico-2.0.6.tgz",
"integrity": "sha512-/d8qsykowelD6g8k8JYgmCagOIulCPHMEc2NC4u7OjmpQLmtSetLhEbt0j1n3fPNJVcrT84dRp0RfJBn3wJROA==",
"engines": {
"node": ">=18.19.0"
}
},
"node_modules/@sindresorhus/is": {
"version": "0.7.0",

View File

@@ -4,7 +4,7 @@
"description": "Typecho build tools",
"main": "build.js",
"engines": {
"node": "16.x"
"node": "18.x"
},
"scripts": {
"build_js": "node build.js js",
@@ -17,7 +17,7 @@
"author": "joyqi",
"license": "GPL-2.0-only",
"dependencies": {
"@picocss/pico": "^1.5.0",
"@picocss/pico": "^2.0.6",
"chalk": "^4.0.0",
"node-sass": "^9.0.0",
"sprite-magic-importer": "^1.6.2",

View File

@@ -1,13 +1,13 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<footer class="site-footer container-fluid">
<div class="d-flex justify-content-between container-inner">
<div class="d-flex justify-content-between">
<ul class="list-inline text-muted">
<li>&copy; <?php echo date('Y'); ?> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a></li>
<li><a href="<?php $this->options->feedUrl(); ?>"><?php _e('RSS'); ?></a></li>
</ul>
<ul class="list-inline text-muted">
<li>
<?php _e(' <a href="https://typecho.org">Typecho</a> 强力驱动'); ?>
<?php _e('Powered by <a href="https://typecho.org">Typecho</a>'); ?>
</li>
</ul>
</div>

View File

@@ -15,48 +15,46 @@
<body>
<header class="site-navbar container-fluid">
<div class="container-inner">
<nav>
<ul class="site-name">
<?php if ($this->options->logoUrl): ?>
<li><a href="<?php $this->options->siteUrl(); ?>" class="brand"><img src="<?php $this->options->logoUrl() ?>" alt="<?php $this->options->title() ?>"></a></li>
<?php else: ?>
<li>
<a href="<?php $this->options->siteUrl(); ?>" class="brand"><?php $this->options->title() ?></a>
</li>
<li class="desc"><?php $this->options->description() ?></li>
<?php endif; ?>
</ul>
<nav>
<ul class="site-name">
<?php if ($this->options->logoUrl): ?>
<li><a href="<?php $this->options->siteUrl(); ?>" class="brand"><img src="<?php $this->options->logoUrl() ?>" alt="<?php $this->options->title() ?>"></a></li>
<?php else: ?>
<li>
<a href="<?php $this->options->siteUrl(); ?>" class="brand"><?php $this->options->title() ?></a>
</li>
<li class="desc"><?php $this->options->description() ?></li>
<?php endif; ?>
</ul>
<ul>
<li>
<label for="nav-toggler" class="nav-toggler-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="18" x2="21" y2="18" /></svg>
</label>
</li>
</ul>
</nav>
<ul>
<li>
<label for="nav-toggler" class="nav-toggler-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="18" x2="21" y2="18" /></svg>
</label>
</li>
</ul>
</nav>
<nav class="site-nav">
<input type="checkbox" id="nav-toggler">
<nav class="site-nav">
<input type="checkbox" id="nav-toggler">
<ul class="nav-menu">
<li>
<a href="<?php $this->options->siteUrl(); ?>"<?php if ($this->is('index')): ?> class="active"<?php endif; ?>><?php _e('首页'); ?></a>
</li>
<ul class="nav-menu">
<li>
<a href="<?php $this->options->siteUrl(); ?>"<?php if ($this->is('index')): ?> class="active"<?php endif; ?>><?php _e('首页'); ?></a>
</li>
<?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>
<?php while ($pages->next()): ?>
<li>
<a href="<?php $pages->permalink(); ?>"<?php if ($this->is('page', $pages->slug)): ?> class="active"<?php endif; ?>><?php $pages->title(); ?></a>
</li>
<?php endwhile; ?>
<li>
<form method="post" action="<?php $this->options->siteUrl(); ?>">
<input type="search" id="s" name="s">
</form>
</li>
</ul>
</nav>
</div>
<?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>
<?php while ($pages->next()): ?>
<li>
<a href="<?php $pages->permalink(); ?>"<?php if ($this->is('page', $pages->slug)): ?> class="active"<?php endif; ?>><?php $pages->title(); ?></a>
</li>
<?php endwhile; ?>
<li>
<form method="post" action="<?php $this->options->siteUrl(); ?>">
<input type="search" id="s" name="s">
</form>
</li>
</ul>
</nav>
</header>

View File

@@ -14,15 +14,15 @@ $this->need('header.php');
<main class="container">
<div class="container-thin">
<?php if (!($this->is('index')) and !($this->is('post'))): ?>
<h4 class="text-center text-muted">
<?php if (!($this->is('index')) && !($this->is('post'))): ?>
<h6 class="text-center text-muted">
<?php $this->archiveTitle([
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
], '', ''); ?>
</h4>
</h6>
<?php endif; ?>
<?php while ($this->next()): ?>

File diff suppressed because one or more lines are too long

View File

@@ -1,70 +0,0 @@
/*!
* Pico.css (https://picocss.com)
* Licensed under MIT
*/
// Customize
// $enable-responsive-typography: false;
// Grey
$grey-50: #f8fafc;
$grey-100: #f1f5f9;
$grey-200: #e2e8f0;
$grey-300: #cbd5e1;
$grey-400: #94a3b8;
$grey-500: #64748b;
$grey-600: #475569;
$grey-700: #334155;
$grey-800: #1e293b;
$grey-900: #0f172a;
// Blue
$primary-50: #d6f0ff;
$primary-100: #b5e7ff;
$primary-200: #83d9ff;
$primary-300: #48c3ff;
$primary-400: #1ea2ff;
$primary-500: #0683ff;
$primary-600: #0064e6;
$primary-700: #0855c5;
$primary-800: #0d4b9b;
$primary-900: #0e2e5d;
// Config
@import "../../../../../tools/node_modules/@picocss/pico/scss/variables";
// Theming
@import "../../../../../tools/node_modules/@picocss/pico/scss/themes/default";
// Layout
@import "../../../../../tools/node_modules/@picocss/pico/scss/layout/document"; // html
@import "../../../../../tools/node_modules/@picocss/pico/scss/layout/sectioning"; // body, header, main, footer
@import "../../../../../tools/node_modules/@picocss/pico/scss/layout/container"; // .container, .container-fluid
@import "../../../../../tools/node_modules/@picocss/pico/scss/layout/section"; // section
@import "../../../../../tools/node_modules/@picocss/pico/scss/layout/grid"; // .grid
// @import "../../../../../tools/node_modules/@picocss/pico/scss/layout/scroller"; // figure
// Content
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/typography"; // a, headings, p, ul, blockquote, ...
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/embedded"; // audio, canvas, iframe, img, svg, video
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/button"; // button, a[role=button], type=button, type=submit ...
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/form"; // input, select, textarea, label, fieldset, legend
// @import "../../../../../tools/node_modules/@picocss/pico/scss/content/form-checkbox-radio"; // type=checkbox, type=radio, role=switch
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/form-alt-input-types"; // type=color, type=date, type=file, type=search, ...
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/table"; // table, tr, td, ...
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/code"; // pre, code, ...
@import "../../../../../tools/node_modules/@picocss/pico/scss/content/miscs"; // hr, template, [hidden], dialog, canvas
// Components
// @import "../../../../../tools/node_modules/@picocss/pico/scss/components/accordion"; // details, summary
// @import "../../../../../tools/node_modules/@picocss/pico/scss/components/card"; // article
// @import "../../../../../tools/node_modules/@picocss/pico/scss/components/modal"; // dialog
@import "../../../../../tools/node_modules/@picocss/pico/scss/components/nav"; // nav
// @import "../../../../../tools/node_modules/@picocss/pico/scss/components/progress"; // progress
// @import "../../../../../tools/node_modules/@picocss/pico/scss/components/dropdown"; // dropdown
// Utilities
// @import "../../../../../tools/node_modules/@picocss/pico/scss/utilities/loading"; // aria-busy=true
// @import "../../../../../tools/node_modules/@picocss/pico/scss/utilities/tooltip"; // data-tooltip
@import "../../../../../tools/node_modules/@picocss/pico/scss/utilities/accessibility"; // -ms-touch-action, aria-*
@import "../../../../../tools/node_modules/@picocss/pico/scss/utilities/reduce-motion"; // prefers-reduced-motion

View File

@@ -1,38 +1,66 @@
@import "pico";
@use "../../../../../tools/node_modules/@picocss/pico/scss" with (
$modules: (
// Layout
"layout/landmarks": false,
"layout/section": false,
// Forms
"forms/checkbox-radio-switch": false,
"forms/input-color": false,
"forms/input-date": false,
"forms/input-file": false,
"forms/input-range": false,
// Components
"components/accordion": false,
"components/card": false,
"components/dropdown": false,
"components/group": false,
"components/loading": false,
"components/modal": false,
"components/progress": false,
"components/tooltip": false,
)
);
// Global Set
:root {
--border-radius: .5rem;
--pico-border-radius: .5rem;
}
body {
cursor: auto;
text-underline-offset: 0.2rem;
margin: 0;
}
:not(.fmt a) {
text-decoration: none;
}
// button[type=submit],
// input[type=submit] {
// display: inline-block;
// width: auto !important;
// }
// Theme
[data-theme="light"],
:root:not([data-theme="dark"]) {
--muted-border-color: #{$grey-200};
--level-odd-color: #{$grey-50};
--pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(50, 60, 68)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
}
@media only screen and (prefers-color-scheme: dark) {
:root:not([data-theme]) {
--background-color: #{$grey-900};
--muted-border-color: #{$grey-700};
--level-odd-color: #{$grey-800};
--pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(194, 199, 208)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
}
}
[data-theme="dark"] {
--background-color: #{$grey-900};
--muted-border-color: #{$grey-700};
--level-odd-color: #{$grey-800};
--pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(194, 199, 208)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
}
// Content
h1, h2, h3, h4, h5 { line-height: 1.25; }
h1, h2, h3, h4, h5 { line-height: 1.2; }
// Icon Size
.is-sm {
@@ -43,11 +71,11 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
// Utilities
.text-muted,
.text-muted a {
color: var(--muted-color);
color: var(--pico-secondary);
}
.text-muted a:hover {
color: var(--secondary-hover);
color: var(--pico-secondary-hover);
}
.text-center {
@@ -59,16 +87,16 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
}
.ms-2 {
margin-left: calc(var(--spacing) / 2);
margin-left: .5rem;
}
.me-2 {
margin-right: calc(var(--spacing) / 2);
margin-right: .5rem;
}
.mx-2 {
margin-left: calc(var(--spacing) / 2);
margin-right: calc(var(--spacing) / 2);
margin-left: .5rem;
margin-right: .5rem;
}
.list-inline {
@@ -80,20 +108,17 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
display: inline-block;
margin-bottom: 0;
&:not(:last-child) { margin-right: var(--spacing); }
&:not(:last-child) { margin-right: 1rem; }
}
svg { vertical-align: text-bottom; }
}
// Layout
.container-inner {
@if map-get($breakpoints, "lg") {
@media (min-width: map-get($breakpoints, "lg")) {
padding-left: calc(var(--spacing) / 2);
padding-right: calc(var(--spacing) / 2);
}
}
main.container {
padding-top: 4rem;
padding-bottom: 4rem;
}
.container-thin {
@@ -124,11 +149,12 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
// Header & Navbar
.site-navbar {
padding-top: .25rem;
padding-bottom: .25rem;
a {
color: inherit;
&:focus {
background-color: var(--pico-text-selection-color);
}
}
.site-name {
@@ -145,13 +171,11 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
}
.desc {
color: var(--muted-color);
color: var(--pico-secondary);
display: none;
@if map-get($breakpoints, "sm") {
@media (min-width: map-get($breakpoints, "sm")) {
@media (min-width: 576px) {
display: inline-block;
}
}
}
}
@@ -177,7 +201,7 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
li {
display: block;
padding: calc(var(--spacing) * .5);
padding: .5rem;
}
form {
@@ -201,32 +225,30 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
}
}
@if map-get($breakpoints, "lg") {
@media (min-width: map-get($breakpoints, "lg")) {
.site-navbar .container-inner,
.site-nav { display: flex; }
.site-navbar .container-inner nav:first-child { flex-grow: 1; }
.nav-toggler-btn { display: none; }
.nav-menu {
display: flex !important;
li:not(:last-child) { margin-right: calc(var(--spacing) / 2); }
}
@media (min-width: 1024px) {
.site-navbar,
.site-nav { display: flex; }
.site-navbar nav:first-child { flex-grow: 1; }
.nav-toggler-btn { display: none; }
.nav-menu {
display: flex !important;
li:not(:last-child) { margin-right: .5rem; }
}
}
// Posts
.post-separator {
margin: var(--block-spacing-vertical) 0;
margin: 4rem 0;
}
.entry-header {
margin-bottom: calc(var(--spacing) * 2);
margin-bottom: 2rem;
}
.entry-title {
margin-bottom: var(--spacing);
margin-bottom: 1rem;
a { color: var(--h1-color); }
a { color: var(--pico-h2-color); }
}
.entry-meta {
@@ -260,17 +282,20 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
display: inline-block;
font-size: .875rem;
padding: 6px 16px;
border: 1px solid var(--muted-border-color);
color: var(--muted-color);
border: 1px solid var(--pico-muted-border-color);
color: var(--pico-muted-color);
border-radius: 100px;
text-decoration: none;
&:focus {
background-color: var(--pico-text-selection-color);
}
}
}
.post-nav {
border-top: 1px solid var(--muted-border-color);
padding-top: var(--spacing);
margin: var(--block-spacing-vertical) 0;
border-top: 1px solid var(--pico-muted-border-color);
margin: 4rem 0;
a {
color: inherit;
@@ -280,15 +305,11 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
// Format
.fmt {
line-height: 1.6;
pre, hr {
margin-bottom: var(--typography-spacing-vertical);
}
}
// Footer
.site-footer {
padding-bottom: calc(var(--block-spacing-vertical) / 2);
padding-bottom: 1rem;
}
// Comments
@@ -297,28 +318,21 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
padding: 0;
}
.comment-level-odd {
background-color: var(--level-odd-color);
}
.comment-level-even {
background-color: var(--background-color);
}
.comment-body {
margin: calc(var(--spacing) * 1.5) 0;
padding: var(--spacing);
border: 1px solid var(--muted-border-color);
border-radius: var(--border-radius);
margin: 1rem 0;
padding: 1rem;
border: 1px solid var(--pico-muted-border-color);
border-radius: var(--pico-border-radius);
}
.comment-by-author > .comment-author::after {
content: "OP";
margin-left: .25rem;
color: var(--muted-color);
padding: 0 .375rem;
border: 1px solid var(--muted-color);
color: var(--pico-muted-color);
padding: 1px .375rem;
border: 1px solid var(--pico-muted-color);
font-size: .75rem;
border-radius: var(--border-radius);
border-radius: 2rem;
}
.comment-author {
@@ -326,36 +340,38 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
.avatar {
margin-right: .25rem;
width: calc(var(--spacing) * 2);
width: 2rem;
border-radius: 48px;
}
cite {
cite,
cite a {
font-style: normal;
font-weight: 700;
color: var(--pico-h2-color);
}
}
.comment-meta a,
.comment-reply a {
font-size: .875em;
color: var(--muted-color);
color: var(--pico-secondary);
&:hover { color: var(--secondary-hover); }
&:hover { color: var(--pico-secondary-hover); }
}
.comment-meta {
display: inline-block;
color: var(--muted-color);
margin-left: calc(var(--spacing) / 4);
color: var(--pico-muted-color);
margin-left: .25rem;
&::before {
content: "·";
margin-right: calc(var(--spacing) / 4);
margin-right: .25rem;
}
}
.comment-content {
margin-top: var(--spacing);
margin-top: 1rem;
}
.comment-reply:blank {
@@ -363,21 +379,17 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
}
.comment-awaiting-moderation {
margin-left: calc(var(--spacing) / 2);
margin-left: .5rem;
font-size: .875em;
color: var(--del-color);
color: var(--pico-del-color);
}
.comment-children {
margin-bottom: calc(var(--spacing) * -1);
margin-bottom: -1rem;
}
// .comment-by-author {
// background-color: var(--mark-background-color);
// }
#response {
margin-bottom: var(--spacing);
margin-bottom: 1rem;
}
#cancel-comment-reply-link {
@@ -385,10 +397,10 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
}
.respond {
margin-top: calc(var(--spacing) * 1.5);
margin-top: 1.5rem;
.comment-body & {
margin-top: var(--spacing);
margin-top: 1rem;
}
}
@@ -407,16 +419,21 @@ h1, h2, h3, h4, h5 { line-height: 1.25; }
pointer-events: none;
}
a:focus {
background-color: var(--pico-text-selection-color);
}
.prev {
margin-right: auto;
& a::before {
a::before {
content: "";
margin-right: .25rem;
}
}
.next {
margin-left: auto;
& a::after {
text-align: right;
a::after {
content: "";
margin-left: .25rem;
}

View File

@@ -4,30 +4,27 @@
*/
[data-theme="customize"] {
--primary: #017FC0 !important;
--primary-hover: #02659A !important;
--background-color: #fffbeb !important;
--muted-border-color: rgba(0, 0, 0, .1) !important;
--form-element-border-color: rgba(0, 0, 0, .2) !important;
--level-odd-color: rgba(0, 0, 0, .025) !important;
--code-background-color: rgba(0, 0, 0, .05) !important;
--pico-primary: #017FC0 !important;
--pico-primary-hover: #02659A !important;
--pico-background-color: #fffbeb !important;
--pico-muted-border-color: rgba(0, 0, 0, .1) !important;
--pico-form-element-border-color: rgba(0, 0, 0, .2) !important;
--pico-code-background-color: rgba(0, 0, 0, .05) !important;
}
.site-navbar {
background-color: var(--primary);
background-color: var(--pico-primary);
}
.site-navbar a,
.site-navbar .nav-toggler-btn,
.site-navbar input[type="search"] {
color: var(--primary-inverse);
.site-navbar .nav-toggler-btn {
color: var(--pico-primary-inverse);
}
.site-navbar .desc {
color: rgba(255, 255, 255, .5);
}
.site-navbar input[type="search"] {
border-color: rgba(255, 255, 255, .25);
--icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
.site-navbar input[type="search"]:not(:focus) {
--pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
}

View File

@@ -54,7 +54,7 @@ function postMeta(
<?php if ($metaType == 'archive'): ?>
<li itemprop="interactionCount">
<a itemprop="discussionUrl"
href="<?php $archive->permalink() ?>#comments"><?php $archive->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a>
href="<?php $archive->permalink() ?>#comments"><?php $archive->commentsNum(_t('暂无评论'), _t('1 条评论'), _t('%d 条评论')); ?></a>
</li>
<?php endif; ?>
</ul>

View File

@@ -13,7 +13,7 @@ $this->need('header.php');
?>
<div class="col-mb-12 col-8" id="main" role="main">
<?php if (!($this->is('index')) and !($this->is('post'))): ?>
<?php if (!($this->is('index')) && !($this->is('post'))): ?>
<h3 class="archive-title"><?php $this->archiveTitle([
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),

View File

@@ -9,17 +9,19 @@ namespace IXR;
*/
class Date
{
private int $year;
private string $year;
private int $month;
private string $month;
private int $day;
private string $day;
private int $hour;
private string $hour;
private int $minute;
private string $minute;
private int $second;
private string $second;
private string $timezone;
/**
* @param int|string $time
@@ -39,12 +41,13 @@ class Date
*/
private function parseTimestamp(int $timestamp)
{
$this->year = intval(date('Y', $timestamp));
$this->month = intval(date('m', $timestamp));
$this->day = intval(date('d', $timestamp));
$this->hour = intval(date('H', $timestamp));
$this->minute = intval(date('i', $timestamp));
$this->second = intval(date('s', $timestamp));
$this->year = gmdate('Y', $timestamp);
$this->month = gmdate('m', $timestamp);
$this->day = gmdate('d', $timestamp);
$this->hour = gmdate('H', $timestamp);
$this->minute = gmdate('i', $timestamp);
$this->second = gmdate('s', $timestamp);
$this->timezone = '';
}
/**
@@ -58,6 +61,7 @@ class Date
$this->hour = substr($iso, 9, 2);
$this->minute = substr($iso, 12, 2);
$this->second = substr($iso, 15, 2);
$this->timezone = substr($iso, 17);
}
/**
@@ -65,7 +69,7 @@ class Date
*/
public function getIso(): string
{
return $this->year . $this->month . $this->day . 'T' . $this->hour . ':' . $this->minute . ':' . $this->second;
return $this->year . $this->month . $this->day . 'T' . $this->hour . ':' . $this->minute . ':' . $this->second . $this->timezone;
}
/**

View File

@@ -236,6 +236,8 @@ namespace Typecho {
} elseif ($exception instanceof \Typecho\Db\Adapter\SQLException) {
$message = 'Database Query Error';
}
} elseif ($exception instanceof \Typecho\Widget\Exception) {
$message = $exception->getMessage();
} else {
$message = 'Server Error';
}

View File

@@ -5,6 +5,7 @@ namespace Typecho\Db\Adapter;
use Typecho\Config;
use Typecho\Db;
use Typecho\Db\Adapter;
use mysqli_sql_exception;
if (!defined('__TYPECHO_ROOT_DIR__')) {
exit;
@@ -49,26 +50,40 @@ class Mysqli implements Adapter
{
$mysqli = mysqli_init();
if ($mysqli) {
if (!empty($config->sslCa)) {
$mysqli->ssl_set(null, null, $config->sslCa, null, null);
try {
if (!empty($config->sslCa)) {
$mysqli->ssl_set(null, null, $config->sslCa, null, null);
if (isset($config->sslVerify)) {
$mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, $config->sslVerify);
if (isset($config->sslVerify)) {
$mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, $config->sslVerify);
}
}
}
$mysqli->real_connect(
$config->host,
$config->user,
$config->password,
$config->database,
(empty($config->port) ? null : $config->port)
);
$host = $config->host;
$port = empty($config->port) ? null : $config->port;
$socket = null;
if (strpos($host, '/') !== false) {
$socket = $host;
$host = 'localhost';
$port = null;
}
$this->dbLink = $mysqli;
$mysqli->real_connect(
$host,
$config->user,
$config->password,
$config->database,
$port,
$socket
);
if ($config->charset) {
$this->dbLink->query("SET NAMES '{$config->charset}'");
$this->dbLink = $mysqli;
if ($config->charset) {
$this->dbLink->query("SET NAMES '{$config->charset}'");
}
} catch (mysqli_sql_exception $e) {
throw new ConnectionException($e->getMessage(), $e->getCode());
}
return $this->dbLink;
@@ -106,8 +121,13 @@ class Mysqli implements Adapter
?string $action = null,
?string $table = null
) {
if ($resource = @$this->dbLink->query($query)) {
return $resource;
try {
if ($resource = $this->dbLink->query($query)) {
return $resource;
}
} catch (mysqli_sql_exception $e) {
/** 数据库异常 */
throw new SQLException($e->getMessage(), $e->getCode());
}
/** 数据库异常 */

View File

@@ -61,14 +61,26 @@ class Mysql extends Pdo
}
}
$dsn = !empty($config->dsn)
? $config->dsn
: (strpos($config->host, '/') !== false
? "mysql:dbname={$config->database};unix_socket={$config->host}"
: "mysql:dbname={$config->database};host={$config->host};port={$config->port}");
$pdo = new \PDO(
!empty($config->dsn)
? $config->dsn : "mysql:dbname={$config->database};host={$config->host};port={$config->port}",
$dsn,
$config->user,
$config->password,
$options
);
$pdo->setAttribute(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
if (class_exists('\Pdo\Mysql')) {
// 新版本写法
$pdo->setAttribute(\Pdo\Mysql::ATTR_USE_BUFFERED_QUERY, true);
} else {
// 兼容旧版本
$pdo->setAttribute(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
}
if ($config->charset) {
$pdo->exec("SET NAMES '{$config->charset}'");

View File

@@ -119,7 +119,7 @@ class Pgsql implements Adapter
/**
* @param resource $resource
* @return array|null
* @return array
*/
public function fetchAll($resource): array
{
@@ -146,6 +146,6 @@ class Pgsql implements Adapter
*/
public function quoteValue($string): string
{
return '\'' . pg_escape_string($string) . '\'';
return '\'' . str_replace('\'', '\'\'', $string) . '\'';
}
}

View File

@@ -21,7 +21,7 @@ use Typecho\Db;
class Query
{
/** 数据库关键字 */
private const KEYWORDS = '*PRIMARY|AND|OR|LIKE|ILIKE|BINARY|BY|DISTINCT|AS|IN|IS|NULL';
private const KEYWORDS = '*PRIMARY|AND|OR|LIKE|ILIKE|BINARY|BY|DISTINCT|AS|IN|NOT|IS|NULL';
/**
* 默认字段

View File

@@ -79,9 +79,9 @@ class Feed
* 聚合副标题
*
* @access private
* @var string
* @var string|null
*/
private string $subTitle;
private ?string $subTitle;
/**
* 版本信息

View File

@@ -337,13 +337,21 @@ class Client
$response = curl_exec($ch);
if (false === $response) {
$error = curl_error($ch);
curl_close($ch);
if (PHP_VERSION_ID >= 80000) {
unset($ch);
} else {
curl_close($ch);
}
throw new Exception($error, 500);
}
$this->responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$this->responseBody = $response;
curl_close($ch);
if (PHP_VERSION_ID >= 80000) {
unset($ch);
} else {
curl_close($ch);
}
}
/**

View File

@@ -394,7 +394,8 @@ class GetText
} else {
$header = $this->getTranslationString(0);
}
if (preg_match("/plural\-forms: ([^\n]*)\n/i", $header, $regs)) {
if (!is_null($header) && preg_match("/plural\-forms: ([^\n]*)\n/i", $header, $regs)) {
$expr = $regs[1];
} else {
$expr = "nplurals=2; plural=n == 1 ? 0 : 1;";

View File

@@ -435,19 +435,47 @@ class Plugin
*/
public function call(string $component, ...$args)
{
$component = $this->handle . ':' . $component;
$last = count($args);
$args[$last] = $last > 0 ? $args[0] : false;
$componentKey = $this->handle . ':' . $component;
if (isset(self::$plugin['handles'][$component])) {
$args[$last] = null;
$this->signal = true;
foreach (self::$plugin['handles'][$component] as $callback) {
$args[$last] = call_user_func_array($callback, $args);
}
if (!isset(self::$plugin['handles'][$componentKey])) {
return null;
}
return $args[$last];
$return = null;
$this->signal = true;
foreach (self::$plugin['handles'][$componentKey] as $callback) {
$return = call_user_func_array($callback, $args);
}
return $return;
}
/**
* 过滤处理函数
*
* @param string $component 当前组件
* @param mixed $value 值
* @param array $args 参数
* @return mixed
*/
public function filter(string $component, $value, ...$args)
{
$componentKey = $this->handle . ':' . $component;
if (!isset(self::$plugin['handles'][$componentKey])) {
return $value;
}
$result = $value;
$this->signal = true;
foreach (self::$plugin['handles'][$componentKey] as $callback) {
$currentArgs = array_merge([$result], $args, [$result]);
$result = call_user_func_array($callback, $currentArgs);
}
return $result;
}
/**

View File

@@ -377,7 +377,7 @@ class Request
* @param string|null $default
* @return string|null
*/
public function getServer(string $name, string $default = null): ?string
public function getServer(string $name, ?string $default = null): ?string
{
return $_SERVER[$name] ?? $default;
}

View File

@@ -214,6 +214,18 @@ class Validate
return filter_var($str, FILTER_VALIDATE_INT) !== false;
}
/**
* 正则表达式验证
*
* @param string $str
* @param string $pattern
* @return bool
*/
public static function regexp(string $str, string $pattern): bool
{
return preg_match($pattern, $str) === 1;
}
/**
* 增加验证规则
*
@@ -260,7 +272,7 @@ class Validate
*
* @return array
*/
public function run(array $data, array $rules = null): array
public function run(array $data, ?array $rules = null): array
{
$result = [];
$this->data = $data;
@@ -322,6 +334,8 @@ class Validate
*/
public function required(): bool
{
return !empty($this->data[$this->key]);
return array_key_exists($this->key, $this->data) &&
(is_array($this->data[$this->key]) ? 0 < count($this->data[$this->key])
: 0 < strlen($this->data[$this->key] ?? ''));
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace Typecho\Widget\Helper\Form\Element;
if (!defined('__TYPECHO_ROOT_DIR__')) {
exit;
}
class Number extends Text
{
/**
* @return string
*/
protected function getType(): string
{
return 'number';
}
}

View File

@@ -110,6 +110,6 @@ abstract class PageNavigator
*/
public function render()
{
throw new Exception(get_class($this) . ':' . __METHOD__, 500);
throw new Exception('Method Not Implemented', 500);
}
}

View File

@@ -245,7 +245,7 @@ class Request
* @param string|null $default
* @return string|null
*/
public function getServer(string $name, string $default = null): ?string
public function getServer(string $name, ?string $default = null): ?string
{
return $this->request->getServer($name, $default);
}

View File

@@ -184,7 +184,7 @@ class Response
* @param string|null $suffix 附加地址
* @param string|null $default 默认来路
*/
public function goBack(string $suffix = null, string $default = null)
public function goBack(?string $suffix = null, ?string $default = null)
{
//获取来源
$referer = $this->request->getReferer();

View File

@@ -143,7 +143,7 @@ class HyperDown
$this->_id = 0;
usort($this->blockParsers, function ($a, $b) {
return $a[1] < $b[1] ? - 1 : 1;
return $a[1] < $b[1] ? -1 : 1;
});
foreach ($this->blockParsers as $parser) {
@@ -197,7 +197,7 @@ class HyperDown
public function makeHolder(string $str): string
{
$key = "\r" . $this->_uniqid . $this->_id . "\r";
$this->_id ++;
$this->_id++;
$this->_holders[$key] = $str;
return $key;
@@ -234,7 +234,7 @@ class HyperDown
}
$html .= "<li id=\"fn-{$index}\">{$val}</li>";
$index ++;
$index++;
}
$html .= '</ol></div>';
@@ -288,7 +288,7 @@ class HyperDown
$deep = 0;
while (strpos($text, "\r") !== false && $deep < 10) {
$text = str_replace(array_keys($this->_holders), array_values($this->_holders), $text);
$deep ++;
$deep++;
}
if ($clearHolders) {
@@ -304,7 +304,7 @@ class HyperDown
*
* @return string
*/
private function markLine(int $start, int $end = - 1): string
private function markLine(int $start, int $end = -1): string
{
if ($this->_line) {
$end = $end < 0 ? $start : $end;
@@ -323,10 +323,10 @@ class HyperDown
*/
private function markLines(array $lines, int $start): array
{
$i = - 1;
$i = -1;
return $this->_line ? array_map(function ($line) use ($start, &$i) {
$i ++;
$i++;
return $this->markLine($start + $i) . $line;
}, $lines) : $lines;
}
@@ -389,9 +389,10 @@ class HyperDown
private function parseInline(
string $text,
string $whiteList = '',
bool $clearHolders = true,
bool $enableAutoLink = true
): string {
bool $clearHolders = true,
bool $enableAutoLink = true
): string
{
$text = $this->call('beforeParseInline', $text);
// code
@@ -515,7 +516,7 @@ class HyperDown
// link
$text = preg_replace_callback(
"/\[((?:[^\]]|\\\\\]|\\\\\[)+?)\]\(((?:[^\)]|\\\\\)|\\\\\()+?)\)/",
"/\[([^\]]*(?:\\\\.[^\]]*)*)\]\(([^)]*(?:\\\\.[^)]*)*)\)/",
function ($matches) {
$escaped = $this->parseInline(
$this->escapeBracket($matches[1]), '', false, false
@@ -666,7 +667,7 @@ class HyperDown
$lines = explode("\n", $text);
$this->_blocks = [];
$this->_current = 'normal';
$this->_pos = - 1;
$this->_pos = -1;
$state = [
'special' => implode("|", array_keys($this->_specialWhiteList)),
@@ -723,7 +724,7 @@ class HyperDown
$this->setBlock($key);
return false;
} elseif (preg_match("/^(\s*)$/", $line) && $state['empty'] == 0) {
$state['empty'] ++;
$state['empty']++;
$this->setBlock($key);
return false;
}
@@ -1036,53 +1037,54 @@ class HyperDown
*/
private function parseBlockTable(?array $block, int $key, string $line, ?array &$state, array $lines): bool
{
if (preg_match("/^((?:(?:(?:\||\+)(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:[ :]*\-+[ :]*)(?:\||\+)(?:[ :]*\-+[ :]*))|(?:(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:\||\+)(?:[ :]*\-+[ :]*)))+)$/", $line, $matches)) {
if ($this->isBlock('table')) {
$block[3][0][] = $block[3][2];
$block[3][2] ++;
$this->setBlock($key, $block[3]);
} else {
$head = 0;
if (empty($block) ||
$block[0] != 'normal' ||
preg_match("/^\s*$/", $lines[$block[2]])) {
$this->startBlock('table', $key);
if (preg_match("/^\s*(\|?[ :]*-{2,}[ :]*(?:[\|\+][ :]*-{2,}[ :]*)*\|?)\s*$/", $line, $matches)) {
if (strpos($matches[1], '|') !== false || strpos($matches[1], '+') !== false) {
if ($this->isBlock('table')) {
$block[3][0][] = $block[3][2];
$block[3][2]++;
$this->setBlock($key, $block[3]);
} else {
$head = 1;
$this->backBlock(1, 'table');
}
$head = 0;
if ($matches[1][0] == '|') {
$matches[1] = substr($matches[1], 1);
if ($matches[1][strlen($matches[1]) - 1] == '|') {
$matches[1] = substr($matches[1], 0, - 1);
if (empty($block) ||
$block[0] != 'normal' ||
preg_match("/^\s*$/", $lines[$block[2]])) {
$this->startBlock('table', $key);
} else {
$head = 1;
$this->backBlock(1, 'table');
}
}
$rows = preg_split("/(\+|\|)/", $matches[1]);
$aligns = [];
foreach ($rows as $row) {
$align = 'none';
if ($matches[1][0] == '|') {
$matches[1] = substr($matches[1], 1);
if (preg_match("/^\s*(:?)\-+(:?)\s*$/", $row, $matches)) {
if (!empty($matches[1]) && !empty($matches[2])) {
$align = 'center';
} elseif (!empty($matches[1])) {
$align = 'left';
} elseif (!empty($matches[2])) {
$align = 'right';
if ($matches[1][strlen($matches[1]) - 1] == '|') {
$matches[1] = substr($matches[1], 0, -1);
}
}
$aligns[] = $align;
$rows = preg_split("/(\+|\|)/", $matches[1]);
$aligns = [];
foreach ($rows as $row) {
$align = 'none';
if (preg_match("/^\s*(:?)\-+(:?)\s*$/", $row, $matches)) {
if (!empty($matches[1]) && !empty($matches[2])) {
$align = 'center';
} elseif (!empty($matches[1])) {
$align = 'left';
} elseif (!empty($matches[2])) {
$align = 'right';
}
}
$aligns[] = $align;
}
$this->setBlock($key, [[$head], $aligns, $head + 1]);
}
$this->setBlock($key, [[$head], $aligns, $head + 1]);
return false;
}
return false;
}
return true;
@@ -1144,7 +1146,7 @@ class HyperDown
*/
private function parseBlockShr(?array $block, int $key, string $line): bool
{
if (preg_match("/^(\* *){3,}\s*$/", $line)) {
if (preg_match("/^\*{3,}\s*$/", $line)) {
$this->startBlock('hr', $key)
->endBlock();
@@ -1163,7 +1165,7 @@ class HyperDown
*/
private function parseBlockDhr(?array $block, int $key, string $line): bool
{
if (preg_match("/^(- *){3,}\s*$/", $line)) {
if (preg_match("/^-{3,}\s*$/", $line)) {
$this->startBlock('hr', $key)
->endBlock();
@@ -1192,7 +1194,7 @@ class HyperDown
}
} elseif ($this->isBlock('table')) {
if (false !== strpos($line, '|')) {
$block[3][2] ++;
$block[3][2]++;
$this->setBlock($key, $block[3]);
} else {
$this->startBlock('normal', $key);
@@ -1270,7 +1272,7 @@ class HyperDown
}
if (!$moved) {
$key ++;
$key++;
}
}
@@ -1312,7 +1314,7 @@ class HyperDown
}
return htmlspecialchars($line);
}, array_slice($lines, 1, - 1));
}, array_slice($lines, 1, -1));
$str = implode("\n", $this->markLines($lines, $start + 1));
return $isEmpty ? '' :
@@ -1365,7 +1367,7 @@ class HyperDown
*/
private function parseShtml(array $lines, $value, int $start): string
{
return trim(implode("\n", $this->markLines(array_slice($lines, 1, - 1), $start + 1)));
return trim(implode("\n", $this->markLines(array_slice($lines, 1, -1), $start + 1)));
}
/**
@@ -1508,7 +1510,7 @@ class HyperDown
$line = substr($line, 1);
if ($line[strlen($line) - 1] == '|') {
$line = substr($line, 0, - 1);
$line = substr($line, 0, -1);
}
}
@@ -1521,16 +1523,16 @@ class HyperDown
}
}, explode('|', $line));
$columns = [];
$last = - 1;
$last = -1;
foreach ($rows as $row) {
if (strlen($row) > 0) {
$last ++;
$last++;
$columns[$last] = [
isset($columns[$last]) ? $columns[$last][0] + 1 : 1, $row
];
} elseif (isset($columns[$last])) {
$columns[$last][0] ++;
$columns[$last][0]++;
} else {
$columns[0] = [1, $row];
}
@@ -1730,7 +1732,7 @@ class HyperDown
*/
private function startBlock($type, $start, $value = null): HyperDown
{
$this->_pos ++;
$this->_pos++;
$this->_current = $type;
$this->_blocks[$this->_pos] = [$type, $start, $start, $value];
@@ -1813,7 +1815,7 @@ class HyperDown
$this->_blocks[$this->_pos][2] = $last - $step;
if ($this->_blocks[$this->_pos][1] <= $this->_blocks[$this->_pos][2]) {
$this->_pos ++;
$this->_pos++;
}
$this->_current = $type;
@@ -1840,7 +1842,7 @@ class HyperDown
$this->_blocks[$this->_pos - 1] = $prev;
$this->_current = $prev[0];
unset($this->_blocks[$this->_pos]);
$this->_pos --;
$this->_pos--;
return $this;
}

View File

@@ -114,14 +114,14 @@ class Archive extends Contents
/**
* 本页关键字
*
* @var string
* @var string|null
*/
private string $archiveKeywords;
private ?string $archiveKeywords = null;
/**
* 本页描述
*
* @var string
* @var string|null
*/
private ?string $archiveDescription = null;
@@ -288,6 +288,15 @@ class Archive extends Contents
return $this->archiveDescription;
}
/**
* @deprecated 1.3.0
* @return string|null
*/
public function getDescription(): ?string
{
return $this->getArchiveDescription();
}
/**
* @param string $archiveDescription the $description to set
*/
@@ -304,6 +313,15 @@ class Archive extends Contents
return $this->archiveKeywords;
}
/**
* @deprecated 1.3.0
* @return string|null
*/
public function getKeywords(): ?string
{
return $this->getArchiveKeywords();
}
/**
* @param string $archiveKeywords the $keywords to set
*/
@@ -320,6 +338,15 @@ class Archive extends Contents
return $this->archiveFeedAtomUrl;
}
/**
* @deprecated 1.3.0
* @return string
*/
public function getFeedAtomUrl(): string
{
return $this->getArchiveFeedAtomUrl();
}
/**
* @param string $archiveFeedAtomUrl the $feedAtomUrl to set
*/
@@ -336,6 +363,15 @@ class Archive extends Contents
return $this->archiveFeedRssUrl;
}
/**
* @deprecated 1.3.0
* @return string
*/
public function getFeedRssUrl(): string
{
return $this->getArchiveFeedRssUrl();
}
/**
* @param string $archiveFeedRssUrl the $feedRssUrl to set
*/
@@ -352,6 +388,15 @@ class Archive extends Contents
return $this->archiveFeedUrl;
}
/**
* @deprecated 1.3.0
* @return string
*/
public function getFeedUrl(): string
{
return $this->getArchiveFeedUrl();
}
/**
* @param string $archiveFeedUrl the $feedUrl to set
*/
@@ -967,10 +1012,10 @@ class Archive extends Contents
$allows = array_merge($allows, $rules);
}
$allows = self::pluginHandle()->call('headerOptions', $allows, $this);
$allows = self::pluginHandle()->filter('headerOptions', $allows, $this);
$title = (empty($this->archiveTitle) ? '' : $this->archiveTitle . ' &raquo; ') . $this->options->title;
$header = $this->is('single') ? '<link rel="canonical" href="' . $this->archiveUrl . '" />' . "\n" : '';
$header = ($this->is('single') && !$this->is('index')) ? '<link rel="canonical" href="' . $this->archiveUrl . '" />' . "\n" : '';
if (!empty($allows['pingback']) && 2 == $this->options->allowXmlRpc) {
$header .= '<link rel="pingback" href="' . $allows['pingback'] . '" />' . "\n";
@@ -1023,7 +1068,7 @@ class Archive extends Contents
$header .= '<meta name="twitter:title" property="og:title" itemprop="name" content="'
. htmlspecialchars($this->archiveTitle ?? $this->options->title) . '" />' . "\n";
$header .= '<meta name="twitter:description" property="og:description" itemprop="description" content="'
. htmlspecialchars($this->archiveDescription ?? $this->options->description) . '" />' . "\n";
. htmlspecialchars($this->archiveDescription ?? ($this->options->description ?? '')) . '" />' . "\n";
$header .= '<meta property="og:site_name" content="' . htmlspecialchars($this->options->title) . '" />' . "\n";
$header .= '<meta name="twitter:card" content="summary" />' . "\n";
$header .= '<meta name="twitter:domain" content="' . $this->options->siteDomain . '" />' . "\n";
@@ -1700,20 +1745,28 @@ EOF;
->where('type = ?', 'category')
->limit(1);
$alias = 'category';
if ($this->request->is('mid')) {
$categorySelect->where('mid = ?', $this->request->filter('int')->get('mid'));
$mid = $this->request->filter('int')->get('mid');
$categorySelect->where('mid = ?', $mid);
$alias .= ':' . $mid;
}
if ($this->request->is('slug')) {
$categorySelect->where('slug = ?', $this->request->get('slug'));
$slug = $this->request->get('slug');
$categorySelect->where('slug = ?', $slug);
$alias .= ':' . $slug;
}
if ($this->request->is('directory')) {
$directory = explode('/', $this->request->get('directory'));
$categorySelect->where('slug = ?', $directory[count($directory) - 1]);
$slug = $directory[count($directory) - 1];
$categorySelect->where('slug = ?', $slug);
$alias .= ':' . $slug;
}
$category = MetasFrom::allocWithAlias('category:' . $this->cid, [
$category = MetasFrom::allocWithAlias($alias, [
'query' => $categorySelect
]);
@@ -1780,16 +1833,22 @@ EOF;
$tagSelect = $this->db->select()->from('table.metas')
->where('type = ?', 'tag')->limit(1);
$alias = 'tag';
if ($this->request->is('mid')) {
$tagSelect->where('mid = ?', $this->request->filter('int')->get('mid'));
$mid = $this->request->filter('int')->get('mid');
$tagSelect->where('mid = ?', $mid);
$alias .= ':' . $mid;
}
if ($this->request->is('slug')) {
$tagSelect->where('slug = ?', $this->request->get('slug'));
$slug = $this->request->get('slug');
$tagSelect->where('slug = ?', $slug);
$alias .= ':' . $slug;
}
/** 如果是标签 */
$tag = MetasFrom::allocWithAlias('tag:' . $this->cid, [
$tag = MetasFrom::allocWithAlias($alias, [
'query' => $tagSelect
]);

View File

@@ -34,6 +34,7 @@ if (!defined('__TYPECHO_ROOT_DIR__')) {
* @property string $type
* @property string status
* @property int $parent
* @property int $commentPage
* @property Date $date
* @property string $dateWord
* @property string $theId
@@ -61,6 +62,8 @@ class Comments extends Base implements QueryInterface, RowFilterInterface, Prima
switch ($key) {
case 'permalink':
return $this->parentContent->path;
case 'commentPage':
return $this->commentPage;
default:
return '{' . $key . '}';
}
@@ -241,7 +244,7 @@ class Comments extends Base implements QueryInterface, RowFilterInterface, Prima
$row['text'] = $row['text'] ?? '';
$row['date'] = new Date($row['created']);
return Comments::pluginHandle()->call('filter', $row, $this);
return Comments::pluginHandle()->filter('filter', $row, $this);
}
/**
@@ -343,7 +346,7 @@ class Comments extends Base implements QueryInterface, RowFilterInterface, Prima
*/
public function markdown(?string $text): ?string
{
$html = Comments::pluginHandle()->trigger($parsed)->call('markdown', $text);
$html = Comments::pluginHandle()->trigger($parsed)->filter('markdown', $text);
if (!$parsed) {
$html = Markdown::convert($text);
@@ -360,7 +363,7 @@ class Comments extends Base implements QueryInterface, RowFilterInterface, Prima
*/
public function autoP(?string $text): ?string
{
$html = Comments::pluginHandle()->trigger($parsed)->call('autoP', $text);
$html = Comments::pluginHandle()->trigger($parsed)->filter('autoP', $text);
if (!$parsed) {
static $parser;
@@ -396,14 +399,13 @@ class Comments extends Base implements QueryInterface, RowFilterInterface, Prima
}
/**
* 获取当前评论链接
* 获取当前评论页码
*
* @return string
* @throws Exception
* @return int
*/
protected function ___permalink(): string
protected function ___commentPage(): int
{
if ($this->options->commentsPageBreak && 'approved' == $this->status) {
if ($this->options->commentsPageBreak) {
$coid = $this->coid;
$parent = $this->parent;
@@ -420,7 +422,13 @@ class Comments extends Base implements QueryInterface, RowFilterInterface, Prima
}
$select = $this->db->select('coid', 'parent')
->from('table.comments')->where('cid = ? AND status = ?', $this->cid, 'approved')
->from('table.comments')
->where(
'cid = ? AND (status = ? OR coid = ?)',
$this->cid,
'approved',
$this->status !== 'approved' ? $this->coid : 0
)
->where('coid ' . ('DESC' == $this->options->commentsOrder ? '>=' : '<=') . ' ?', $coid)
->order('coid');
@@ -441,12 +449,24 @@ class Comments extends Base implements QueryInterface, RowFilterInterface, Prima
}
}
$currentPage = ceil($total / $this->options->commentsPageSize);
return ceil($total / $this->options->commentsPageSize);
}
$pageRow = ['permalink' => $this->parentContent->path, 'commentPage' => $currentPage];
return 0;
}
/**
* 获取当前评论链接
*
* @return string
* @throws Exception
*/
protected function ___permalink(): string
{
if ($this->options->commentsPageBreak) {
return Router::url(
'comment_page',
$pageRow,
$this,
$this->options->index
) . '#' . $this->theId;
}
@@ -463,13 +483,13 @@ class Comments extends Base implements QueryInterface, RowFilterInterface, Prima
{
$text = $this->parentContent->hidden ? _t('内容被隐藏') : $this->text;
$text = Comments::pluginHandle()->trigger($plugged)->call('content', $text, $this);
$text = Comments::pluginHandle()->trigger($plugged)->filter('content', $text, $this);
if (!$plugged) {
$text = $this->options->commentsMarkdown ? $this->markdown($text)
: $this->autoP($text);
}
$text = Comments::pluginHandle()->call('contentEx', $text, $this);
$text = Comments::pluginHandle()->filter('contentEx', $text, $this);
return Common::stripTags($text, '<p><br>' . $this->options->commentsHTMLTagAllowed);
}

View File

@@ -70,6 +70,9 @@ if (!defined('__TYPECHO_ROOT_DIR__')) {
* @property-read string $commentUrl
* @property-read string $trackbackUrl
* @property-read string $responseUrl
* @property-read string $year
* @property-read string $month
* @property-read string $day
*/
class Contents extends Base implements QueryInterface, RowFilterInterface, PrimaryKeyInterface, ParamsDelegateInterface
{
@@ -190,7 +193,7 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
$draft = $this->db->fetchObject($this->db->select('type', 'parent')
->from('table.contents')->where('cid = ?', $cid));
if (preg_match("/_draft$/", $draft->type) && $draft->parent) {
if ('revision' === $draft->type && $draft->parent) {
$result = '@' . $result;
}
@@ -356,7 +359,7 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
$row['password'] = $row['password'] ?? '';
$row['date'] = new Date($row['created']);
return Contents::pluginHandle()->call('filter', $row, $this);
return Contents::pluginHandle()->filter('filter', $row, $this);
}
/**
@@ -401,7 +404,7 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
*/
public function title(int $length = 0, string $trim = '...')
{
$title = Contents::pluginHandle()->trigger($plugged)->call('title', $this->title, $this);
$title = Contents::pluginHandle()->trigger($plugged)->filter('title', $this->title, $this);
if (!$plugged) {
echo $length > 0 ? Common::subStr($this->title, 0, $length, $trim) : $this->title;
} else {
@@ -449,7 +452,7 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
}
}
$allow &= ($this->row['allow' . ucfirst($permission)] == 1) and !$this->hidden;
$allow &= ($this->row['allow' . ucfirst($permission)] == 1) && !$this->hidden;
}
}
@@ -666,6 +669,14 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
return $directory;
}
/**
* @return string
*/
protected function ___category(): string
{
return empty($this->categories) ? '' : $this->categories[0]['slug'];
}
/**
* @return array
*/
@@ -769,10 +780,10 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
return $this->text;
}
$content = Contents::pluginHandle()->call('excerpt', $this->content, $this);
$content = Contents::pluginHandle()->filter('excerpt', $this->content, $this);
[$excerpt] = explode('<!--more-->', $content);
return Common::fixHtml(Contents::pluginHandle()->call('excerptEx', $excerpt, $this));
return Common::fixHtml(Contents::pluginHandle()->filter('excerptEx', $excerpt, $this));
}
/**
@@ -795,7 +806,7 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
*/
protected function markdown(?string $text): ?string
{
$html = Contents::pluginHandle()->trigger($parsed)->call('markdown', $text);
$html = Contents::pluginHandle()->trigger($parsed)->filter('markdown', $text);
if (!$parsed) {
$html = Markdown::convert($text);
@@ -812,7 +823,7 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
*/
protected function autoP(?string $text): ?string
{
$html = Contents::pluginHandle()->trigger($parsed)->call('autoP', $text);
$html = Contents::pluginHandle()->trigger($parsed)->filter('autoP', $text);
if (!$parsed && $text) {
static $parser;
@@ -838,14 +849,14 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
return $this->text;
}
$content = Contents::pluginHandle()->trigger($plugged)->call('content', $this->text, $this);
$content = Contents::pluginHandle()->trigger($plugged)->filter('content', $this->text, $this);
if (!$plugged) {
$content = $this->isMarkdown ? $this->markdown($content)
: $this->autoP($content);
}
return Contents::pluginHandle()->call('contentEx', $content, $this);
return Contents::pluginHandle()->filter('contentEx', $content, $this);
}
/**
@@ -923,4 +934,28 @@ class Contents extends Base implements QueryInterface, RowFilterInterface, Prima
{
return $this->permalink . '#' . $this->respondId;
}
/**
* @return string
*/
protected function ___year(): string
{
return $this->date->year;
}
/**
* @return string
*/
protected function ___month(): string
{
return $this->date->month;
}
/**
* @return string
*/
protected function ___day(): string
{
return $this->date->day;
}
}

View File

@@ -93,7 +93,7 @@ class Metas extends Base implements QueryInterface, RowFilterInterface, PrimaryK
*/
public function filter(array $row): array
{
return Metas::pluginHandle()->call('filter', $row, $this);
return Metas::pluginHandle()->filter('filter', $row, $this);
}
/**

View File

@@ -64,7 +64,7 @@ class Users extends Base implements QueryInterface, RowFilterInterface, PrimaryK
*/
public function filter(array $row): array
{
return Users::pluginHandle()->call('filter', $row, $this);
return Users::pluginHandle()->filter('filter', $row, $this);
}
/**

View File

@@ -61,7 +61,7 @@ class Admin extends Comments
$content = $this->parentContent;
if ($content) {
return _t('%s的评论', $content['title']);
return _t('%s的评论', $content->title);
}
throw new Exception(_t('内容不存在'), 404);
@@ -151,4 +151,16 @@ class Admin extends Comments
$cid = $this->request->is('cid') ? $this->request->filter('int')->get('cid') : $this->cid;
return From::allocWithAlias($cid, ['cid' => $cid]);
}
/**
* @return string
*/
protected function ___permalink(): string
{
if ('approved' === $this->status) {
return parent::___permalink();
}
return '#' . $this->theId;
}
}

View File

@@ -99,16 +99,13 @@ class Archive extends Comments
return;
}
$commentsAuthor = Cookie::get('__typecho_remember_author');
$commentsMail = Cookie::get('__typecho_remember_mail');
$select = $this->select()->where('table.comments.cid = ?', $this->parameter->parentId)
$unapprovedCommentId = intval(Cookie::get('__typecho_unapproved_comment', 0));
$select = $this->select()->where('cid = ?', $this->parameter->parentId)
->where(
'table.comments.status = ? OR (table.comments.author = ?'
. ' AND table.comments.mail = ? AND table.comments.status = ?)',
'status = ? OR (coid = ? AND status <> ?)',
'approved',
$commentsAuthor,
$commentsMail,
'waiting'
$unapprovedCommentId,
'approved'
);
if ($this->options->commentsShowCommentOnly) {
@@ -176,12 +173,11 @@ class Archive extends Comments
($this->currentPage - 1) * $this->options->commentsPageSize,
$this->options->commentsPageSize
);
/** 评论置位 */
$this->length = count($this->stack);
$this->row = $this->length > 0 ? current($this->stack) : [];
}
/** 评论置位 */
$this->length = count($this->stack);
$this->row = $this->length > 0 ? current($this->stack) : [];
reset($this->stack);
}
@@ -241,7 +237,10 @@ class Archive extends Comments
}
$template = array_merge($default, $config);
$query = Router::url('comment_page', $this, $this->options->index);
$query = Router::url('comment_page', [
'permalink' => $this->parameter->parentContent->path,
'commentPage' => '{commentPage}'
], $this->options->index);
self::pluginHandle()->trigger($hasNav)->call(
'pageNav',
@@ -360,7 +359,7 @@ class Archive extends Comments
$singleCommentOptions->afterDate();
?></time>
</a>
<?php if ('waiting' == $this->status) { ?>
<?php if ('approved' !== $this->status) { ?>
<em class="comment-awaiting-moderation"><?php $singleCommentOptions->commentStatus(); ?></em>
<?php } ?>
</div>
@@ -465,21 +464,6 @@ class Archive extends Comments
}
}
/**
* 获取当前评论链接
*
* @return string
*/
protected function ___permalink(): string
{
if ($this->options->commentsPageBreak) {
$pageRow = ['permalink' => $this->parentContent->path, 'commentPage' => $this->currentPage];
return Router::url('comment_page', $pageRow, $this->options->index) . '#' . $this->theId;
}
return $this->parentContent->permalink . '#' . $this->theId;
}
/**
* 子评论
*
@@ -501,6 +485,16 @@ class Archive extends Comments
return $this->levels > $this->options->commentsMaxNestingLevels - 2;
}
/**
* 重载评论页码获取
*
* @return int
*/
protected function ___commentPage(): int
{
return $this->currentPage;
}
/**
* 重载内容获取
*

View File

@@ -300,7 +300,7 @@ class Edit extends Comments implements ActionInterface
}
/** 评论插件接口 */
$comment = self::pluginHandle()->call('edit', $comment, $this);
$comment = self::pluginHandle()->filter('edit', $comment, $this);
/** 更新评论 */
$this->update($comment, $this->db->sql()->where('coid = ?', $coid));

Some files were not shown because too many files have changed in this diff Show More