56 Commits
master ... dev

Author SHA1 Message Date
fen
6df1b433ee improve: show site description in homepage title 2024-01-04 22:13:41 +08:00
fen
2650bb6654 fix: search result 2024-01-04 16:58:44 +08:00
fen
316cf1da39 improve: comment style 2024-01-04 16:58:44 +08:00
joyqi
be12409358 Merge commit 'f3299ecb8a6d7a4283f81905c4c8b079e85339ee' into dev 2024-01-01 23:47:24 +08:00
joyqi
2a1a692195 fix permission 2023-12-31 17:13:07 +08:00
joyqi
8b4118a2ce Merge commit '746667a8e602aece11bc8e6ec8d0daf20999aff5' into dev 2023-12-31 17:12:55 +08:00
joyqi
f209fd78fe Merge branch 'master' into dev
# Conflicts:
#	var/Widget/Options.php
2023-12-31 17:02:20 +08:00
joyqi
0265a50100 feat: pull request auto merge 2023-12-31 16:57:59 +08:00
joyqi
6e0bbe885d remove php 7.2/7.3 env 2023-12-30 23:01:18 +08:00
fen
fc5ac7969c fix: theme page layout 2023-12-30 22:52:11 +08:00
fen
edc73ccbc8 fix: theme screenshot 2023-12-30 22:50:04 +08:00
fen
752eed6890 improve: nav search 2023-12-30 22:29:12 +08:00
joyqi
90c0a70252 fix tags saving 2023-12-30 21:21:43 +08:00
fen
d7465f1cff improve: post detail layout 2023-12-30 20:34:04 +08:00
fen
fef2ec2377 fix: typo 2023-12-30 00:13:02 +08:00
fen
dde84fe0aa improve: remove feather-icon js file 2023-12-30 00:11:59 +08:00
joyqi
878b2b3d11 init plugin signal 2023-12-29 18:03:45 +08:00
joyqi
dd88938aa1 remove unnecessary scss file when packaging 2023-12-29 16:56:14 +08:00
joyqi
7415b5ba76 fix theme classic-22 2023-12-29 16:49:42 +08:00
joyqi
fd013a7508 fix canonical link meta 2023-12-29 14:34:24 +08:00
joyqi
005951ee4d add open graph and twitter card support
add canonical link
2023-12-29 14:31:39 +08:00
joyqi
7edd3f9659 fix query 2023-12-29 12:59:33 +08:00
joyqi
6b2c5b19e1 fix default theme 2023-12-29 11:50:38 +08:00
joyqi
f1937a3a7c fix theme lang 2023-12-28 18:26:14 +08:00
joyqi
0595d1126e add throw finish 2023-12-27 18:45:42 +08:00
joyqi
4c4b14020d fix http client cookie 2023-12-27 18:10:17 +08:00
joyqi
56d7e7eec8 fix typo errors 2023-12-26 23:33:01 +08:00
joyqi
144bbee912 fix typo errors 2023-12-18 15:50:53 +08:00
joyqi
a41fd2dc7c fix: cut down fields when selecting recent posts 2023-12-18 15:48:00 +08:00
joyqi
06fda5b1a6 add throwCallback to widget response 2023-12-18 15:44:41 +08:00
Lu Fei
9df0256e8c Fix Prevent XSS vulnerability in default theme (#1654)
* Fix Prevent XSS vulnerability in default theme

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

* fix the getter

---------

Co-authored-by: joyqi <joyqi@segmentfault.com>
2023-12-06 18:03:23 +08:00
Lu Fei
fbc7696ae8 Use json instead of serialize (#1624)
* Use json instead of serialize

* Fix Upgrade code

* add tree trait

* finish category tree trait

* support select fields

* fix select fields

* refactor admin trait

* fix draft status

* Add new contents type "revision"

* minor refactor

* add more tree view abstracts

* add tree trait to pages

* get ready for tree view pages

* improve page edit

* fix revision

* fix slug

* add router params delegate

* fix params delegate

* fix

* fix

* fix all

* fix all

* fix tree

* fix page link

* fix feed

* fix page

* fix permalink

* fix permalink input

* fix offset query

* Fix typo

* remove proxy methods

* remove unnecessary useage

---------

Co-authored-by: joyqi <joyqi@segmentfault.com>
Co-authored-by: joyqi <magike.net@gmail.com>
2023-12-06 15:52:19 +08:00
joyqi
c9aba55949 fix #1651, close #1653 2023-12-04 17:56:17 +08:00
joyqi
a2c1fbf4a8 fix input element 2023-12-04 17:23:06 +08:00
Lu Fei
a1f62e1bcc Support IDN (#1629)
* Support IDN

* use js

* Optimize code

* Optimize code

* fix URL script

* remove unnecessary use

---------

Co-authored-by: joyqi <joyqi@segmentfault.com>
2023-12-04 14:07:20 +08:00
joyqi
e89b1bbcf6 Feat/tree pages (#1646)
* add tree trait

* finish category tree trait

* support select fields

* fix select fields

* refactor admin trait

* fix draft status

* Add new contents type "revision"

* minor refactor

* add more tree view abstracts

* add tree trait to pages

* get ready for tree view pages

* improve page edit

* fix revision

* fix slug

* add router params delegate

* fix params delegate

* fix

* fix

* fix all

* fix all

* fix tree

* fix page link

* fix feed

* fix page

* fix permalink

* fix permalink input

* fix offset query
2023-11-27 21:57:18 -08:00
joyqi
4c1c42ad40 Add svg to image types 2023-10-23 18:38:40 +08:00
joyqi
b28d5b7bab fix #1632 2023-10-04 15:58:30 +08:00
joyqi
b00a0ae06f Merge commit '99212ec78743317bf52063fb165b90fceb70de5e' into dev
# Conflicts:
#	admin/login.php
2023-10-03 11:16:04 +08:00
Lu Fei
438ac35487 Implement Ctrl+S or Command+S for save draft (#1628)
* Implement Ctrl+S or Command+S for save draft

* rename

* add Typecho.savePost

* fix upload file size

* add new uploader

* replace new uploader

* fix textarea change

* fix preview

* refactor post edit

* fix issue

* fix page edit

---------

Co-authored-by: joyqi <joyqi@segmentfault.com>
Co-authored-by: joyqi <magike.net@gmail.com>
2023-10-01 16:51:09 +08:00
joyqi
ff1fde5c4b fix types in i18n component 2023-09-24 23:15:55 +08:00
joyqi
3296151409 [feat] support high resolution avatar 2023-09-24 17:31:35 +08:00
joyqi
157de39b54 fix 1.3.0 upgrade 2023-09-24 16:25:01 +08:00
joyqi
4c8c64c79e Feat/code refactor (#1626)
* remove all magic methods, add type for class properties

* refactor codes

* fix all

* refactor code

* fix type

* fix all

* fix request is method

* fix all

* fix router

* fix get page
2023-09-24 16:21:32 +08:00
joyqi
9b107027ed add pgsql ssl mode support (ref #1600) (#1623) 2023-09-22 13:51:35 +08:00
joyqi
b73187f12c merge new fixes from master 2023-09-22 11:09:34 +08:00
joyqi
f206d852bd Merge commit 'e143be0036b91a6ec4bfc5e8d3ad7c19edbfa6e8' into dev 2023-09-22 11:08:55 +08:00
joyqi
38562bab48 Merge commit '9d1b01a8736ab1ce39e9e2e666a2f992eba28b0f' into dev 2023-07-07 16:56:26 +08:00
joyqi
6de71129a4 Merge commit 'daef17d7eb250419ff84f499e87d25ee71daac87' into dev
# Conflicts:
#	var/Utils/Upgrade.php
2023-03-29 16:20:01 +08:00
joyqi
d4a5f765a3 Merge branch 'master' into dev
# Conflicts:
#	admin/css/style.css
#	var/Widget/Archive.php
2023-01-29 14:28:43 +08:00
joyqi
bec905274a New upgrade method 2022-04-08 15:11:09 +08:00
joyqi
53eda2cf75 s/is_writeable/is_writable/g 2022-04-07 17:31:32 +08:00
joyqi
bad3ef651d New theme (#1390)
* 调整忽略目录

* add theme

* fix theme scss build

Co-authored-by: fen <f3nb0x@gmail.com>
2022-04-07 14:20:59 +08:00
joyqi
a74206a89e Add CommentPage widget 2022-04-07 12:55:19 +08:00
joyqi
22a8ad362e add feed render 2022-04-07 01:53:33 +08:00
joyqi
f49564db23 Add feed widget 2022-04-06 18:26:15 +08:00
144 changed files with 3255 additions and 3573 deletions

14
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,14 @@
### 1. 该问题的重现步骤是什么?
### 2. 你期待的结果是什么?实际看到的又是什么?
### 3. 问题出现的环境
- 操作系统版本:
- Apache/NGINX 版本:
- 数据库版本:
- PHP 版本:
- Typecho 版本:
- 浏览器版本:
[//]: # (如有图片请附上截图)

View File

@@ -1,42 +0,0 @@
---
name: 上报 BUG
about: 报告问题,帮助改进项目
title: ''
labels: bug
assignees: ''
---
## 描述这个 Bug
简明扼要地描述错误是什么。
### 复现方式
复现的步骤:
1. 前往 '...'
2. 点击 '....'
3. 滚动到 '....'
4. 看到错误
### 期望的结果
简明扼要地描述你期望看到的结果。
### 截图
如果可以的话,请添加截图或视频以帮助解释你的问题。
### 平台
- 操作系统版本:
- Apache/Nginx 版本:
- 数据库版本:
- PHP 版本:
- Typecho 版本:
- 浏览器版本:

View File

@@ -1,5 +0,0 @@
blank_issues_enabled: true
contact_links:
- name: 论坛支持
url: https://forum.typecho.org/
about: 交流使用心得,使用模板插件,寻求帮助等等

View File

@@ -1,23 +0,0 @@
---
name: 提改进建议
about: 提出改进建议,改进项目现有功能
title: ''
labels: enhancement
assignees: ''
---
## 你的改进是否与某个问题有关?请描述
简明扼要地描述问题产生的原因。例如:当 [...] 时,我总是很困惑。
## 描述你想要的解决方案
简明扼要地描述你希望的解决方案。
## 描述你考虑过的替代方案
简明扼要地描述你考虑过的任何替代解决方案或功能。

View File

@@ -1,23 +0,0 @@
---
name: 新功能提议
about: 为项目提出一个想法或可能的新功能
title: ''
labels: feature
assignees: ''
---
## 你的想法是否与某个问题有关?请描述
简明扼要地描述问题产生的原因。例如:当 [...] 时,我总是很困惑。
## 描述你想要的解决方案
简明扼要地描述你希望的解决方案。
## 描述你考虑过的替代方案
简明扼要地描述你考虑过的任何替代解决方案或功能。

View File

@@ -1,7 +0,0 @@
Fixes #
## Proposed Changes
-
-
-

View File

@@ -19,7 +19,7 @@ jobs:
php: ['7.4', '8.0', '8.1', '8.2']
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: Setup PHP only
uses: shivammathur/setup-php@v2
with:
@@ -30,12 +30,12 @@ jobs:
build:
name: Typecho Build
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'skip ci') && github.event_name != 'pull_request' && github.repository == 'typecho/typecho' }}
if: ${{ !contains(github.event.head_commit.message, 'skip ci') && github.event_name != 'pull_request' }}
needs:
- php
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: Build
run: |
mkdir build

View File

@@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Build
run: |
mkdir build

0
.gitmodules vendored Normal file
View File

View File

@@ -6,7 +6,7 @@ Typecho is released under the GNU General Public License 2.0.
## Main Features
* Multiple databases support (MariaDB, MySQL, SQLite, PostgreSQL)
* Multiple databases support (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.4.0 or higher
* Database (MariaDB, MySQL, SQLite, PostgreSQL)
* MariaDB or MySQL 5.5.3 or higher
* PHP 7.2.0 or higher
* Database (MySQL, SQLite, PostgreSQL)
* MySQL 5.5.3 or higher
* SQLite 3.7.11 or higher
* PostgreSQL 9.1 or higher

View File

@@ -1,3 +0,0 @@
# Security Policy
Vulnerabilities can be reported by emailing security@typecho.org

View File

@@ -10,7 +10,7 @@ $actionUrl = $security->getTokenUrl(
$backupFiles = \Widget\Backup::alloc()->listFiles();
?>
<main class="main">
<div 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">
<ul class="typecho-option-tabs clearfix">
<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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -25,10 +25,31 @@
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';
@@ -54,6 +75,50 @@
}
})();
// 导航菜单 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; ?>
<footer class="typecho-foot" role="contentinfo">
<div 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>
</footer>
</div>

File diff suppressed because one or more lines are too long

View File

@@ -11,7 +11,6 @@
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,10 +2,21 @@
<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('li').fadeOut(function () {
$(this).parents('tr').fadeOut(function () {
$(this).remove();
});
@@ -14,21 +25,20 @@ $(document).ready(function () {
});
}
$('#custom-field .fields .field').each(function () {
$('#custom-field table tbody tr').each(function () {
attachDeleteEvent(this);
});
$('#custom-field button.operate-add').click(function () {
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="">'
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="">'
+ '<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></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();
+ '</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();
attachDeleteEvent(el);
});

View File

@@ -3,23 +3,32 @@
$fields = isset($post) ? $post->getFieldItems() : $page->getFieldItems();
$defaultFields = isset($post) ? $post->getDefaultFieldItems() : $page->getDefaultFieldItems();
?>
<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">
<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>
<?php foreach ($defaultFields as $field): ?>
<?php [$label, $input] = $field; ?>
<li class="field">
<div class="field-name"><?php $label->render(); ?></div>
<div class="field-value"><?php $input->render(); ?></div>
</li>
<tr>
<td><?php $label->render(); ?></td>
<td colspan="3"><?php $input->render(); ?></td>
</tr>
<?php endforeach; ?>
<?php foreach ($fields as $field): ?>
<li class="field">
<div class="field-name">
<tr>
<td>
<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
@@ -31,42 +40,45 @@ $defaultFields = isset($post) ? $post->getDefaultFieldItems() : $page->getDefaul
<option
value="json"<?php if ('json' == $field['type']): ?> selected<?php endif; ?>><?php _e('JSON 结构'); ?></option>
</select>
</div>
<div class="field-value">
</td>
<td>
<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>
</div>
</li>
</td>
</tr>
<?php endforeach; ?>
<?php if (empty($defaultFields) && empty($fields)): ?>
<li class="field">
<div class="field-name">
<tr>
<td>
<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>
</div>
<div class="field-value">
</td>
<td>
<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>
</div>
</li>
</td>
</tr>
<?php endif; ?>
</ul>
<div class="add">
</table>
<div class="description clearfix">
<button type="button" class="btn btn-xs operate-add"><?php _e('+添加字段'); ?></button>
<div class="description kit-hidden-mb">
<?php _e('自定义字段可以扩展你的模板功能, 使用方法参见 <a href="https://docs.typecho.org/help/custom-fields">帮助文档</a>'); ?>
</div>
<?php _e('自定义字段可以扩展你的模板功能, 使用方法参见 <a href="https://docs.typecho.org/help/custom-fields">帮助文档</a>'); ?>
</div>
</details>
</section>

View File

@@ -38,7 +38,7 @@ $(document).ready(function () {
preview = $('<div id="wmd-preview" class="wmd-hidetab" />').insertAfter('.editor');
let isFullScreen = false;
const options = {}, isMarkdown = <?php echo json_encode(!$content->have() || $content->isMarkdown); ?>;
const options = {}, isMarkdown = <?php echo intval($content->isMarkdown || !$content->have()); ?>;
options.strings = {
bold: '<?php _e('加粗'); ?> <strong> Ctrl+B',
@@ -214,7 +214,7 @@ $(document).ready(function () {
};
// 编辑预览切换
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>'),
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>'),
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')->filter('header', $header);
$header = \Typecho\Plugin::factory('admin/header.php')->call('header', $header);
?><!DOCTYPE HTML>
<html>

View File

@@ -5,7 +5,7 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
?>
<main class="main">
<div 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">
<ul id="start-link" class="clearfix">
<?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>
</main>
</div>
<?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);
?>
<main class="main">
<div 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">
<div class="typecho-list-operate clearfix">
<div class="operate">
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
class="typecho-table-select-all"/></label>
@@ -44,74 +44,77 @@ include 'menu.php';
</div>
</div>
<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>
<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>
<?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>
<?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>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何分类'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php endif; ?>
</tbody>
</table>
</div>
</form>
</div>
</div>
</div>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -7,12 +7,18 @@ $stat = \Widget\Stat::alloc();
$comments = \Widget\Comments\Admin::alloc();
$isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Typecho\Cookie::get('__typecho_all_comments'));
?>
<main class="main">
<div 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">
<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>
<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>
@@ -37,54 +43,50 @@ $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>
<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 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>
</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 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 -->
<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" />
<col width="6%" class="kit-hidden-mb" />
<col width="20%"/>
<col width="71%"/>
</colgroup>
@@ -115,7 +117,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">
<td valign="top" class="kit-hidden-mb">
<div class="comment-avatar">
<?php if ('comment' == $comments->type): ?>
<?php $comments->gravatar(40, null, true); ?>
@@ -173,43 +175,46 @@ $isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == \Ty
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="4" class="none"><?php _e('没有评论') ?></td>
<td colspan="4"><h6 class="typecho-list-table-title"><?php _e('没有评论') ?></h6></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 -->
<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 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>
</div>
<?php if($comments->have()): ?>
<ul class="typecho-pager">
<?php $comments->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
<?php if($comments->have()): ?>
<ul class="typecho-pager">
<?php $comments->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</main>
</div>
<?php
include 'copyright.php';
include 'common-js.php';

View File

@@ -6,128 +6,135 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
$attachments = \Widget\Contents\Attachment\Admin::alloc();
?>
<main class="main">
<div class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
<div class="col-mb-12">
<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 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>
<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>
<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 class="typecho-pager">
<?php $attachments->pageNav(); ?>
</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>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
</div>
</div><!-- end .typecho-page-main -->
</div>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -6,129 +6,134 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
$pages = \Widget\Contents\Page\Admin::alloc();
?>
<main class="main">
<div 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">
<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 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>
</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 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 -->
<form method="post" name="manage_pages" class="operate-form">
<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>';
}
<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>';
}
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; ?>
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>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何页面'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php endif; ?>
</tbody>
</table>
</div><!-- end .typecho-table-wrap -->
</form><!-- end .operate-form -->
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -7,12 +7,22 @@ $stat = \Widget\Stat::alloc();
$posts = \Widget\Contents\Post\Admin::alloc();
$isAllPosts = ('on' == $request->get('__typecho_all_posts') || 'on' == \Typecho\Cookie::get('__typecho_all_posts'));
?>
<main class="main">
<div 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">
<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>
<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'
@@ -41,208 +51,205 @@ $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>
<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>
<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>
</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>
<?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>
</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 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 -->
<form method="post" name="manage_posts" class="operate-form">
<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>';
}
<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>';
}
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; ?>
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 $categories = $posts->categories;
while ($categories->next()): ?>
<?php echo '<a href="';
$options->adminUrl('manage-posts.php?category=' . $categories->mid
. (isset($request->uid) ? '&uid=' . $request->filter('encode')->uid : '')
. (isset($request->status) ? '&status=' . $request->filter('encode')->status : ''));
echo '">' . $categories->name . '</a>' . ($categories->sequence < $categories->length - 1 ? ', ' : ''); ?>
<?php endwhile; ?>
</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>
</td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="6" class="none"><?php _e('没有任何文章'); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php endif; ?>
</tbody>
</table>
</div>
</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-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>
<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>
</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>
<?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>
</div>
<?php if ($posts->have()): ?>
<ul class="typecho-pager">
<?php $posts->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
<?php if ($posts->have()): ?>
<ul class="typecho-pager">
<?php $posts->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -6,7 +6,7 @@ include 'menu.php';
\Widget\Metas\Tag\Admin::alloc()->to($tags);
?>
<main class="main">
<div 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">
<div class="typecho-list-operate clearfix">
<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>
<?php if ($tags->have()): ?>
<ul class="typecho-list-notable tag-list">
<ul class="typecho-list-notable tag-list clearfix">
<?php if ($tags->have()): ?>
<?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,12 +51,10 @@ include 'menu.php';
class="i-edit"></i></a>
</li>
<?php endwhile; ?>
</ul>
<?php else: ?>
<ul class="tag-list">
<li class="none"><?php _e('没有任何标签'); ?></li>
</ul>
<?php endif; ?>
<?php else: ?>
<h6 class="typecho-list-table-title"><?php _e('没有任何标签'); ?></h6>
<?php endif; ?>
</ul>
<input type="hidden" name="do" value="delete"/>
</form>
@@ -66,7 +64,7 @@ include 'menu.php';
</div>
</div>
</div>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -5,125 +5,131 @@ include 'menu.php';
$users = \Widget\Users\Admin::alloc();
?>
<main class="main">
<div 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">
<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 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>
</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 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 -->
<form method="post" name="manage_users" class="operate-form">
<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>
<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>
</tr>
<?php endwhile; ?>
</tbody>
</table><!-- end .typecho-list-table -->
</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 -->
</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/users-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
</li>
</ul>
<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>
</div>
<?php if ($users->have()): ?>
<ul class="typecho-pager">
<?php $users->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
<?php if ($users->have()): ?>
<ul class="typecho-pager">
<?php $users->pageNav(); ?>
</ul>
<?php endif; ?>
</form>
</div><!-- end .typecho-list-operate -->
</div><!-- end .typecho-list -->
</div><!-- end .typecho-page-main -->
</div>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -6,7 +6,7 @@ include 'menu.php';
\Widget\Contents\Attachment\Edit::alloc()->prepare()->to($attachment);
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -1,22 +1,18 @@
<?php if (!defined('__TYPECHO_ADMIN__')) exit; ?>
<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>
<div class="typecho-head-nav clearfix" role="navigation">
<button class="menu-bar"><?php _e('菜单'); ?></button>
<nav id="typecho-nav-list">
<?php $menu->output(); ?>
</nav>
</header>
<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>

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -4,17 +4,26 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -1,9 +1,8 @@
<?php if (!defined('__TYPECHO_ADMIN__')) exit; ?>
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
<div class="typecho-page-title">
<h2><?php echo $menu->title; ?></h2>
<?php
<h2><?php echo $menu->title; ?><?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';
?>
<main class="main">
<div class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main" role="main">
@@ -11,116 +11,120 @@ 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>
<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>
<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>
</tr>
<?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>
</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>
<?php endforeach; ?>
<?php endif; ?>
<?php endwhile; ?>
</tbody>
</table>
<?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>
<?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>
<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>
<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>
</td>
</tr>
<?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; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
</div>
</div>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -6,7 +6,7 @@ include 'menu.php';
$stat = \Widget\Stat::alloc();
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -583,46 +583,44 @@
parseBlockTable(block, key, line, state, lines) {
var align, aligns, head, j, len, matches, row, rows;
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]);
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);
} else {
head = 0;
if ((block == null) || block[0] !== 'normal' || lines[block[2]].match(/^\s*$/)) {
this.startBlock('table', key);
} 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);
}
}
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]);
head = 1;
this.backBlock(1, 'table');
}
return false;
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);
}
}
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]);
}
return false;
}
return true;
}
@@ -651,7 +649,7 @@
}
parseBlockShr(block, key, line) {
if (!!(line.match(/^\*{3,}\s*$/))) {
if (!!(line.match(/^(\* *){3,}\s*$/))) {
this.startBlock('hr', key).endBlock();
return false;
}
@@ -659,7 +657,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) {
const table = this, s = $.extend({
var table = this, s = $.extend({
checkEl : null,
rowEl : null,
selectAllEl : null,
@@ -386,13 +386,19 @@ function scrollableEditor(el, preview) {
}, options);
function clickRow (t) {
const check = $(s.checkEl, t), checked = check.prop('checked');
var t = $(t), 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 () {
@@ -400,9 +406,9 @@ function scrollableEditor(el, preview) {
clickRow($(this).parents(s.rowEl));
});
}).click(function (e) {
const target = $(e.toElement ? e.toElement : e.target),
var 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();
@@ -412,15 +418,27 @@ function scrollableEditor(el, preview) {
});
$(s.selectAllEl).click(function () {
const t = $(this), checked = t.prop('checked');
$(s.rowEl, table).each(function () {
$(s.checkEl, this).prop('checked', !!checked);
});
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');
}
});
}
});
$(s.actionEl).click(function () {
const t = $(this), lang = t.attr('lang');
var 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=number],
input[type=text], input[type=url], input[type=password], input[type=email],
textarea {
background: #FFF;
border: 1px solid #D9D9D6;

View File

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

View File

@@ -30,10 +30,6 @@
}
.success a { color: #264409; }
.warning {
color: #B94A48;
}
// 气泡
.balloon {
@@ -51,28 +47,3 @@
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

@@ -1,61 +0,0 @@
/**
* 典型配置选项
*/
.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,35 +3,34 @@
*/
.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;
li {
margin: 0 3px;
height: 28px;
line-height: 28px;
a {
display: block;
padding: 0 10px;
border-radius: 2px;
&:hover {
text-decoration: none;
background: #E9E9E6;
}
}
&.current a {
background: #E9E9E6;
color: #444;
}
}
}
.typecho-pager li {
display: inline-block;
margin: 0 3px;
height: 28px;
line-height: 28px;
}
.typecho-pager a {
display: block;
padding: 0 10px;
border-radius: 2px;
}
.typecho-pager a:hover {
text-decoration: none;
background: #E9E9E6;
}
.typecho-pager li.current a {
background: #E9E9E6;
color: #444;
}

View File

@@ -1,175 +0,0 @@
/**
* 表格列表页
*/
/**
* 列表页选项
*/
.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;
}
}
}
}

View File

@@ -1,50 +0,0 @@
/**
* 标签页
*/
.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;
}
}
}
}

View File

@@ -1,70 +0,0 @@
/**
* 标签列表
*/
.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,29 +11,3 @@ $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;
}
}
}

View File

@@ -1,212 +0,0 @@
/**
* 编写页面
*/
.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,121 +14,111 @@
}
}
#wmd-button-bar {
display: flex;
align-items: center;
@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
@import "editor/*@2x.png";
@include all-editor-sprites();
@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);
}
@mixin editor-button-2x($name) {
&#wmd-#{$name}-button span {
@include editor-sprite(editor-#{$name})
}
}
.wmd-button-row {
flex: 1;
list-style: none;
margin: 0;
padding: 0;
height: 26px;
line-height: 1;
li {
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);
}
}
// 撰写预览切换 tab
.wmd-edittab {
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;
}
@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 {
list-style: none;
margin: 0;
padding: 0;
height: 26px;
line-height: 1;
li {
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);
}
}
#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;
@@ -162,24 +152,6 @@
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;
@@ -346,7 +318,7 @@
#btn-cancel-preview { display: inline-block }
}
@include screen(phone, max) {
@media (max-width: $screen-phone - 1px) {
#wmd-spacer2,
#wmd-olist-button,
#wmd-ulist-button,

View File

@@ -1,17 +1,20 @@
/*
* Bento Grid System (Flexbox Version)
* Bento Grid System
* Source: https://github.com/fenbox/bento
* Version: 2.0.0
* Update: 2024.10.23
* Version: 1.2.8
* Update: 2013.11.25
*/
@import "vars";
// Mixins
%box-sizing {
box-sizing: border-box;
}
// Container
.container {
margin-left: auto;
@@ -19,161 +22,189 @@
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;
display: flex;
flex-wrap: wrap;
width: 100vw;
@extend .clearfix;
}
.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;
}
// Use flex-grow to simulate columns in mobile
/*
* Mobile and up
*/
@for $index from 1 through $columns {
.col-mb-#{$index} {
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
width: $column-width * $index;
}
}
// Tablet and up
@include screen(tablet) {
/*
* Tablet and up
*/
@media (min-width: $screen-tablet) {
.container {
max-width: $screen-tablet - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-tb-#{$index} {
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
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} {
order: -$index;
right: $column-width * $index;
}
}
// Push
@for $index from 0 through $columns {
.col-tb-push-#{$index} {
order: $index;
left: $column-width * $index;
}
}
}
// Desktop and up
@include screen(desktop) {
/*
* Desktop and up
*/
@media (min-width: $screen-desktop) {
.container {
max-width: $screen-desktop - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-#{$index} {
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
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} {
order: -$index;
right: $column-width * $index;
}
}
// Push
@for $index from 0 through $columns {
.col-push-#{$index} {
order: $index;
left: $column-width * $index;
}
}
}
// Widescreen and up
@include screen(wide) {
/*
* Widescreen and up
*/
@media (min-width: $screen-wide) {
.container {
max-width: $screen-wide - ($gutter-width * 2);
}
// Colunms
@for $index from 1 through $columns {
.col-wd-#{$index} {
flex: 0 0 $column-width * $index;
max-width: $column-width * $index;
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} {
order: -$index;
right: $column-width * $index;
}
}
// Push
@for $index from 0 through $columns {
.col-wd-push-#{$index} {
order: $index;
left: $column-width * $index;
}
}
}
// Responsive kit
@include screen(phone, max) {
/*
* Responsive kit
*/
// Hidden in mobile and down
@media (max-width: $screen-phone - 1px) {
.kit-hidden-mb {
display: none;
}
}
@include screen(tablet, max) {
// Hidden in tablet and down
@media (max-width: $screen-tablet - 1px) {
.kit-hidden-tb {
display: none;
}
}
@include screen(desktop, max) {
// Hidden in descktop and down
@media (max-width: $screen-desktop - 1px) {
.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: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background: #F6F6F3;
color: #444;
font-size: 87.5%;
@@ -74,15 +74,38 @@ 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 的样式
*/
@@ -97,6 +120,48 @@ 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;
}
@@ -135,17 +200,12 @@ 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;
display: flex;
align-items: center;
.balloon {
margin-left: 5px;
}
}
.balloon {
margin-top: 2px;
}
}
@@ -177,55 +237,43 @@ 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;
}
.more-link {
margin-top: 2em;
color: #CCC;
a {
margin: 0 3px;
}
}
}
.typecho-login {
display: table-cell;
padding: 30px 0 100px;
width: 280px;
text-align: center;
vertical-align: middle;
h1 {
margin: 0 0 1em;
}
}
.typecho-login .more-link {
margin-top: 2em;
color: #CCC;
}
.typecho-login .more-link a { margin: 0 3px; }
/**
* 标题
*/
.typecho-page-title {
width: 100%;
display: flex;
align-items: center;
}
.typecho-page-title h2 {
margin: 25px 0 10px;
font-size: 1.28571em;
}
.typecho-page-title h2 a {
margin-left: 10px;
padding: 3px 8px;
background: #E9E9E6;
font-size: .8em;
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;
}
}
border-radius: 2px;
}
.typecho-page-title h2 a:hover {
text-decoration: none;
}
/**
@@ -237,16 +285,190 @@ a.button:hover, a.balloon-button:hover {
* 主页主体
*/
.typecho-dashboard {
ul {
list-style: none;
padding: 0;
}
.typecho-dashboard ul {
list-style: none;
padding: 0;
}
.typecho-dashboard li {
margin-bottom: 5px;
}
li {
margin-bottom: 5px;
/**
* 标签页
*/
.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;
}
}
}
.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;
}
/**
* 评论管理
*/
@@ -282,13 +504,12 @@ a.button:hover, a.balloon-button:hover {
max-width: 100%;
}
@include screen(phone, max) {
@media (max-width: $screen-phone - 1px) {
.comment-edit {
display: flex;
flex-direction: column;
width: 90vw;
}
.comment-edit td:first-child { display: none; }
}
@@ -300,57 +521,295 @@ a.button:hover, a.balloon-button:hover {
display: none;
}
/**
* 模板列表
*/
.typecho-theme-list {
img {
margin: 1em 0;
max-width: 100%;
max-height: 240px;
}
}
cite {
font-style: normal;
color: #999;
}
.typecho-theme-list .theme-item {
}
tbody tr.current td {
background-color: #FFF9E8;
.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;
}
}
/**
* 编辑模板
*/
.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;
li {
padding: 3px 10px;
}
}
.current {
background-color: #E6E6E3;
a {
color: #444;
}
}
textarea {
font-size: .92857em;
line-height: 1.2;
height: 500px;
}
.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 {
margin: 0;
a {
display: block;
color: #444;
&:hover {
color: #467B96;
text-decoration: none;
}
}
}
table {
margin-top: 10px;
}
td {
padding: 10px 5px;
font-size: .92857em;
border-bottom: 1px solid #F0F0EC;
vertical-align: top;
label {
font-size: 1em;
font-weight: normal;
}
}
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%;
@@ -414,12 +873,39 @@ a.button:hover, a.balloon-button:hover {
*/
.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;
}
@include screen(phone, max) {
@media (max-width: $screen-phone - 1px) {
.typecho-list-operate {
.search {
margin-top: 10px;
}
}
.typecho-table-wrap {
padding: 10px;
margin: 0 -10px;
}
.typecho-option-submit {
button[type="submit"] {
width: 100%;

View File

@@ -6,39 +6,56 @@ include 'menu.php';
\Widget\Themes\Files::alloc()->to($files);
?>
<main class="main">
<div class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<?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 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>
</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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -1,16 +0,0 @@
<?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,67 +4,79 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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">
<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>
<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>
<?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>
<?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>
</div>
</div>
</div>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -4,7 +4,7 @@ include 'header.php';
include 'menu.php';
?>
<main class="main">
<div 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>
</main>
</div>
<?php
include 'copyright.php';

View File

@@ -79,9 +79,6 @@ $(document).ready(function() {
prePopulate : tagsPre,
onResult : function (result, query, val) {
// remove special chars
val = val.replace(/<|>|&|"|'/g, '');
if (!query) {
return result;
}
@@ -145,7 +142,7 @@ $(document).ready(function() {
idInput = $('input[name=cid]'),
draft = $('input[name=draft]'),
btnPreview = $('#btn-preview'),
autoSave = $('<span id="auto-save-message"></span>').prependTo('.left');
autoSave = $('<span id="auto-save-message" class="left"></span>').prependTo('.submit');
let cid = idInput.val(),
draftId = draft.length > 0 ? draft.val() : 0,
@@ -320,6 +317,12 @@ $(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,187 +16,182 @@ while ($parents->next()) {
$parentPages[$parents->cid] = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $parents->levels) . $parents->title;
}
?>
<main class="main">
<div class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<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>
<?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"/>
<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; ?>
</span>
</p>
<input name="draft" type="hidden" value="<?php echo $page->draft['cid'] ?>"/>
<?php endif; ?>
<?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>
<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 = str_replace('{cid}', $page->cid, $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>
<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>
<?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>
<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>
<?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>
<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>
<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="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>
<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>
<?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>
<section class="typecho-post-option">
<label for="template" 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 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 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()); ?>
<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 endif; ?>
</div><!-- end #tab-advance -->
<div id="tab-files" class="tab-content hidden">
<?php include 'file-upload.php'; ?>
</div><!-- end #tab-files -->
</div>
</form>
<?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 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>
</div>
<?php
include 'copyright.php';

View File

@@ -5,195 +5,194 @@ include 'menu.php';
$post = \Widget\Contents\Post\Edit::alloc()->prepare();
?>
<main class="main">
<div class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
<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>
<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'] ?>"/>
<?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 = str_replace([
'{cid}', '{category}', '{year}', '{month}', '{day}'
], [
$post->cid, $post->category, $post->year, $post->month, $post->day
], $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">
<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 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>
<?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">
<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 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 $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); ?>
<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>
<section class="typecho-post-option category-option">
<label class="typecho-label"><?php _e('分类'); ?></label>
<?php \Widget\Metas\Category\Rows::alloc()->to($category); ?>
<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>
<?php $categories = $post->categories->toArray('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="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>
<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('advanceOption', $post); ?>
</details><!-- end #advance-panel -->
<?php \Typecho\Plugin::factory('admin/write-post.php')->call('option', $post); ?>
<?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 -->
<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; ?>
<div id="tab-files" class="tab-content hidden">
<?php include 'file-upload.php'; ?>
</div><!-- end #tab-files -->
</div>
</form>
<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>
</main>
</div>
<?php
include 'copyright.php';

52
changelog.txt Normal file
View File

@@ -0,0 +1,52 @@
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')->call('begin');
\Typecho\Plugin::factory('index.php')->begin();
/** 开始路由分发 */
\Typecho\Router::dispatch();
/** 注册一个结束插件 */
\Typecho\Plugin::factory('index.php')->call('end');
\Typecho\Plugin::factory('index.php')->end();

View File

@@ -1064,11 +1064,7 @@ function install_step_2_perform()
// intval port number
if (isset($dbConfig['port'])) {
if (strpos($dbConfig['host'], '/') !== false && $type == 'Mysql') {
$dbConfig['port'] = null;
} else {
$dbConfig['port'] = intval($dbConfig['port']);
}
$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": "^2.0.6",
"@picocss/pico": "^1.5.0",
"chalk": "^4.0.0",
"node-sass": "^9.0.0",
"sprite-magic-importer": "^1.6.2",
"uglify-js": "^3.11.6"
},
"engines": {
"node": "18.x"
"node": "16.x"
}
},
"node_modules/@babel/code-frame": {
@@ -227,12 +227,9 @@
}
},
"node_modules/@picocss/pico": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/@picocss/pico/-/pico-2.0.6.tgz",
"integrity": "sha512-/d8qsykowelD6g8k8JYgmCagOIulCPHMEc2NC4u7OjmpQLmtSetLhEbt0j1n3fPNJVcrT84dRp0RfJBn3wJROA==",
"engines": {
"node": ">=18.19.0"
}
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/@picocss/pico/-/pico-1.5.10.tgz",
"integrity": "sha512-+LafMsrwPxXQMk6sI///TmSInCwwZmq+K7SikyL3N/4GhhwzyPC+TQLUEqmrLyjluR+uIpFFcqjty30Rtr6GxQ=="
},
"node_modules/@sindresorhus/is": {
"version": "0.7.0",

View File

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

View File

@@ -10,7 +10,7 @@
'defaultAvatar' => 'identicon'
)); ?>
<nav><?php $comments->pageNav(_t('前一页'), _t('后一页'), 3, '...', array('wrapTag' => 'ul', 'itemTag' => 'li')); ?></nav>
<?php $comments->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
<?php endif; ?>
@@ -23,9 +23,7 @@
<h5 id="response"><?php _e('你的评论'); ?></h5>
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
<div class="grid">
<textarea placeholder="<?php _e('评论内容...'); ?>" rows="4" cols="300" name="text" id="textarea" required><?php $this->remember('text'); ?></textarea>
</div>
<textarea placeholder="<?php _e('评论内容...'); ?>" rows="4" cols="50" name="text" id="textarea" required><?php $this->remember('text'); ?></textarea>
<?php if ($this->user->hasLogin()): ?>
<p>
<?php _e('登录身份:'); ?><a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a><span class="mx-2 text-muted">&middot;</span><a href="<?php $this->options->logoutUrl(); ?>"><?php _e('退出'); ?></a>
@@ -34,7 +32,7 @@
<div class="grid">
<input type="text" placeholder="<?php _e('名字'); ?>" name="author" id="author" value="<?php $this->remember('author'); ?>" required/>
<input type="email" placeholder="<?php _e('Email'); ?>" name="mail" id="mail" value="<?php $this->remember('mail'); ?>"<?php if ($this->options->commentsRequireMail): ?> required<?php endif; ?> />
<input type="url" placeholder="<?php _e('http://网站'); ?><?php if (!$this->options->commentsRequireUrl): ?><?php _e('(选填)'); ?><?php endif; ?>" name="url" id="url" value="<?php $this->remember('url'); ?>"<?php if ($this->options->commentsRequireUrl): ?> required<?php endif; ?> />
<input type="url" placeholder="<?php _e('网站 http://'); ?><?php if (!($this->options->commentsRequireUrl)): ?><?php _e('(选填)'); ?><?php endif; ?>" name="url" id="url" placeholder="<?php _e('https://'); ?>" value="<?php $this->remember('url'); ?>"<?php if ($this->options->commentsRequireUrl): ?> required<?php endif; ?> />
</div>
<?php endif; ?>
<button type="submit"><?php _e('提交评论'); ?></button>

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">
<div class="d-flex justify-content-between container-inner">
<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('Powered by <a href="https://typecho.org">Typecho</a>'); ?>
<?php _e(' <a href="https://typecho.org">Typecho</a> 强力驱动'); ?>
</li>
</ul>
</div>

View File

@@ -13,20 +13,18 @@ function themeConfig($form)
$form->addInput($logoUrl->addRule('url', _t('请填写正确的 URL 地址')));
$colorSchema = new \Typecho\Widget\Helper\Form\Element\Select(
'colorSchema',
$themeStyle = new \Typecho\Widget\Helper\Form\Element\Radio(
'themeStyle',
array(
null => _t('自动'),
'auto' => _t('自动'),
'light' => _t('浅色'),
'dark' => _t('深色'),
'customize' => _t('自定义'),
'dark' => _t('深色')
),
null,
_t('外观风格'),
_t('如果选择了自定义,主题将使用 theme.css 的样式')
'auto',
_t('外观风格')
);
$form->addInput($colorSchema);
$form->addInput($themeStyle);
}
function postMeta(

View File

@@ -1,60 +1,60 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<!DOCTYPE html>
<html lang="zh-Hans"<?php if ($this->options->colorSchema): ?> data-theme="<?php $this->options->colorSchema(); ?>"<?php endif; ?>>
<html lang="zh-Hans" data-theme="<?php $this->options->themeStyle(); ?>">
<head>
<meta charset="<?php $this->options->charset(); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php $this->archiveTitle('', '', ' | '); ?><?php $this->options->title(); ?><?php if ($this->is('index')): ?> | <?php $this->options->description() ?><?php endif; ?></title>
<link rel="stylesheet" href="<?php $this->options->themeUrl('static/css/style.css'); ?>">
<?php if ($this->options->colorSchema == 'customize'): ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('theme.css'); ?>">
<?php endif; ?>
<?php $this->header(); ?>
</head>
<body>
<header class="site-navbar container-fluid">
<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>
<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>
<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"><img src="<?php $this->options->themeUrl('static/img/menu.svg'); ?>" alt="Menu"></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>
<?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>
</header>

View File

@@ -14,31 +14,35 @@ $this->need('header.php');
<main class="container">
<div class="container-thin">
<?php if (!($this->is('index')) && !($this->is('post'))): ?>
<h6 class="text-center text-muted">
<?php if (!($this->is('index')) and !($this->is('post'))): ?>
<h4 class="text-center text-muted">
<?php $this->archiveTitle([
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
], '', ''); ?>
</h6>
</h4>
<?php endif; ?>
<?php while ($this->next()): ?>
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<?php postMeta($this); ?>
<div class="entry-content fmt" itemprop="articleBody">
<?php $this->content(_t('阅读全文')); ?>
</div>
</article>
<hr class="post-separator">
<?php endwhile; ?>
<nav><?php $this->pageNav(_t('前一页'), _t('后一页'), 2, '...', array('wrapTag' => 'ul', 'itemTag' => 'li')); ?></nav>
<?php while ($this->next()): ?>
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<?php postMeta($this); ?>
<div class="entry-content fmt" itemprop="articleBody">
<?php $this->content(_t('阅读全文')); ?>
</div>
</article>
<hr class="post-separator">
<?php endwhile; ?>
</div>
<!-- <div class="text-center">
<a href="#">&laquo; Older Posts</a>
<span class="mx-2 text-muted">&middot;</span>
<a href="#">Newer Posts &raquo;</a>
</div> -->
<?php $this->pageNav('← ' . _t('前一页'), _t('后一页') . ' →'); ?>
</main>
<?php $this->need('footer.php'); ?>

View File

@@ -12,12 +12,14 @@
</div>
</article>
<nav class="post-nav">
<ul class="page-navigator">
<li class="prev"><?php $this->thePrev('%s', _t('没有了')); ?></li>
<li class="next"><?php $this->theNext('%s', _t('没有了')); ?></li>
</ul>
</nav>
<div class="grid post-next">
<div>
<?php $this->thePrev('%s', _t('没有了')); ?>
</div>
<div class="text-end">
<?php $this->theNext('%s', _t('没有了')); ?> →
</div>
</div>
<?php $this->need('comments.php'); ?>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="#fff"
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>

After

Width:  |  Height:  |  Size: 324 B

View File

@@ -0,0 +1,14 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="#fff"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="11" cy="11" r="8" />
<line x1="21" y1="21" x2="16.65" y2="16.65" />
</svg>

After

Width:  |  Height:  |  Size: 284 B

View File

@@ -0,0 +1,105 @@
/*!
* Pico.css (https://picocss.com)
* Licensed under MIT
*/
// Config
// $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: #E9F2FC;
$primary-100: #D1E5FB;
$primary-200: #9BCCFD;
$primary-300: #51B4FF;
$primary-400: #029AE8;
$primary-500: #017FC0;
$primary-600: #02659A;
$primary-700: #014C75;
$primary-800: #033452;
$primary-900: #061E2F;
// Amber
$amber-50: #fffbeb;
$amber-100: #fef3c7;
$amber-200: #fde68a;
$amber-300: #fcd34d;
$amber-400: #fbbf24;
$amber-500: #f59e0b;
$amber-600: #d97706;
$amber-700: #b45309;
$amber-800: #92400e;
$amber-900: #78350f;
// Green
$green-50: #f0fdf4;
$green-100: #dcfce7;
$green-200: #bbf7d0;
$green-300: #86efac;
$green-400: #4ade80;
$green-500: #22c55e;
$green-600: #16a34a;
$green-700: #15803d;
$green-800: #166534;
$green-900: #14532d;
// Red
$red-50: #fef2f2;
$red-100: #fee2e2;
$red-200: #fecaca;
$red-300: #fca5a5;
$red-400: #f87171;
$red-500: #ef4444;
$red-600: #dc2626;
$red-700: #b91c1c;
$red-800: #991b1b;
$red-900: #7f1d1d;
@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,66 +1,43 @@
@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,
)
);
@import "pico";
// Global Set
:root {
--pico-border-radius: .5rem;
--border-radius: .5rem;
}
body {
cursor: auto;
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"]) {
--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]) {
--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")
}
--primary: #{$primary-500};
--primary-hover: #{$primary-600};
--muted-border-color: #{$grey-200};
}
[data-theme="dark"] {
--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")
--primary: #{$primary-500};
--primary-hover: #{$primary-400};
--muted-border-color: #{$grey-800};
.site-navbar {
background-color: #{$primary-600};
}
.comment-level-odd {
background-color: #{$grey-900};
}
}
// Content
h1, h2, h3, h4, h5 { line-height: 1.2; }
h1, h2, h3, h4, h5 { line-height: 1.25; }
// h1 { --font-size: 2.5rem; }
// h2 { --font-size: 2rem; }
// h3 { --font-size: 1.75rem; }
// h4 { --font-size: 1.5rem; }
// h5 { --font-size: 1.25rem; }
// Icon Size
.is-sm {
@@ -71,11 +48,11 @@ h1, h2, h3, h4, h5 { line-height: 1.2; }
// Utilities
.text-muted,
.text-muted a {
color: var(--pico-secondary);
color: var(--muted-color);
}
.text-muted a:hover {
color: var(--pico-secondary-hover);
color: var(--secondary-hover);
}
.text-center {
@@ -87,16 +64,16 @@ h1, h2, h3, h4, h5 { line-height: 1.2; }
}
.ms-2 {
margin-left: .5rem;
margin-left: calc(var(--spacing) / 2);
}
.me-2 {
margin-right: .5rem;
margin-right: calc(var(--spacing) / 2);
}
.mx-2 {
margin-left: .5rem;
margin-right: .5rem;
margin-left: calc(var(--spacing) / 2);
margin-right: calc(var(--spacing) / 2);
}
.list-inline {
@@ -108,17 +85,20 @@ h1, h2, h3, h4, h5 { line-height: 1.2; }
display: inline-block;
margin-bottom: 0;
&:not(:last-child) { margin-right: 1rem; }
&:not(:last-child) { margin-right: var(--spacing); }
}
svg { vertical-align: text-bottom; }
}
// Layout
main.container {
padding-top: 4rem;
padding-bottom: 4rem;
.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);
}
}
}
.container-thin {
@@ -149,12 +129,14 @@ main.container {
// Header & Navbar
.site-navbar {
a {
color: inherit;
padding-top: .25rem;
padding-bottom: .25rem;
background-color: var(--primary);
&:focus {
background-color: var(--pico-text-selection-color);
}
a {
color: var(--primary-inverse);
// color: rgba(255, 255, 255);
// &:hover { text-decoration: underline; }
}
.site-name {
@@ -164,18 +146,16 @@ main.container {
.brand {
font-size: 1.25rem;
font-weight: 700;
img {
max-height: 2rem;
}
}
.desc {
color: var(--pico-secondary);
color: rgba(255, 255, 255, .5);
display: none;
@media (min-width: 576px) {
@if map-get($breakpoints, "sm") {
@media (min-width: map-get($breakpoints, "sm")) {
display: inline-block;
}
}
}
}
@@ -191,17 +171,13 @@ main.container {
}
}
.nav-toggler-btn {
cursor: pointer;
}
// Dropdown Menu
.nav-menu {
display: none;
li {
display: block;
padding: .5rem;
padding: calc(var(--spacing) * .5);
}
form {
@@ -209,7 +185,14 @@ main.container {
input[type=search] {
height: 50px;
background-image: url("../img/search.svg");
background-size: auto;
background-color: inherit;
color: var(--primary-inverse);
&:focus {
--form-element-focus-color: rgba(255, 255, 255, .5);
}
&:not(:focus) {
padding: 0;
@@ -217,38 +200,45 @@ main.container {
width: 30px;
padding-inline-start: 0;
background-position: center center;
background-color: inherit;
color: transparent;
cursor: pointer;
}
}
}
}
@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; }
.nav-toggler-btn {
margin: calc(var(--spacing) * -1) calc(var(--spacing) * -0.5);
padding: var(--spacing) calc(var(--spacing) * 0.5);
color: rgba(255, 255, 255, 1.0);
cursor: pointer;
}
@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); }
}
}
}
// Posts
.post-separator {
margin: 4rem 0;
margin: var(--block-spacing-vertical) 0;
}
.entry-header {
margin-bottom: 2rem;
margin-bottom: calc(var(--spacing) * 2);
}
.entry-title {
margin-bottom: 1rem;
margin-bottom: var(--spacing);
a { color: var(--pico-h2-color); }
a { color: var(--h1-color); }
}
.entry-meta {
@@ -282,57 +272,66 @@ main.container {
display: inline-block;
font-size: .875rem;
padding: 6px 16px;
border: 1px solid var(--pico-muted-border-color);
color: var(--pico-muted-color);
border: 1px solid var(--muted-border-color);
color: var(--muted-color);
border-radius: 100px;
text-decoration: none;
&:focus {
background-color: var(--pico-text-selection-color);
}
}
}
.post-nav {
border-top: 1px solid var(--pico-muted-border-color);
margin: 4rem 0;
.post-next {
border-top: 1px solid var(--muted-border-color);
padding-top: calc(var(--spacing) * 1.5);
margin: var(--block-spacing-vertical) 0;
a {
color: inherit;
color: var(--h5-color);
}
}
// Format
.fmt {
line-height: 1.6;
pre, hr {
margin-bottom: var(--typography-spacing-vertical);
}
}
// Footer
.site-footer {
padding-bottom: 1rem;
padding-bottom: calc(var(--block-spacing-vertical) / 2);
}
// Comments
.comment-list {
list-style: none;
padding: 0;
// padding-left: calc(var(--spacing) * 4);
}
.comment-level-odd {
background-color: #{$grey-50};
}
.comment-level-even {
background-color: var(--background-color);
}
.comment-body {
margin: 1rem 0;
padding: 1rem;
border: 1px solid var(--pico-muted-border-color);
border-radius: var(--pico-border-radius);
margin: calc(var(--spacing) * 1.5) 0;
padding: var(--spacing);
border: 1px solid var(--muted-border-color);
border-radius: var(--border-radius);
}
.comment-by-author > .comment-author::after {
content: "OP";
margin-left: .25rem;
color: var(--pico-muted-color);
padding: 1px .375rem;
border: 1px solid var(--pico-muted-color);
color: var(--muted-color);
padding: 0 .375rem;
border: 1px solid var(--muted-color);
font-size: .75rem;
border-radius: 2rem;
border-radius: var(--border-radius);
}
.comment-author {
@@ -340,38 +339,36 @@ main.container {
.avatar {
margin-right: .25rem;
width: 2rem;
width: calc(var(--spacing) * 2);
border-radius: 48px;
}
cite,
cite a {
cite {
font-style: normal;
font-weight: 700;
color: var(--pico-h2-color);
}
}
.comment-meta a,
.comment-reply a {
font-size: .875em;
color: var(--pico-secondary);
color: var(--muted-color);
&:hover { color: var(--pico-secondary-hover); }
&:hover { color: var(--secondary-hover); }
}
.comment-meta {
display: inline-block;
color: var(--pico-muted-color);
margin-left: .25rem;
color: var(--muted-color);
margin-left: calc(var(--spacing) / 4);
&::before {
content: "·";
margin-right: .25rem;
margin-right: calc(var(--spacing) / 4);
}
}
.comment-content {
margin-top: 1rem;
margin-top: var(--spacing);
}
.comment-reply:blank {
@@ -379,29 +376,30 @@ main.container {
}
.comment-awaiting-moderation {
margin-left: .5rem;
margin-left: calc(var(--spacing) / 2);
font-size: .875em;
color: var(--pico-del-color);
color: var(--del-color);
}
.comment-children {
margin-bottom: -1rem;
margin-bottom: calc(var(--spacing) * -1);
}
.comment-by-author {
// background-color: var(--mark-background-color);
}
#response {
margin-bottom: 1rem;
margin-bottom: var(--spacing);
}
#cancel-comment-reply-link {
font-size: .875em;
color: var(--del-color);
}
.respond {
margin-top: 1.5rem;
.comment-body & {
margin-top: 1rem;
}
.comment-body .respond {
margin-top: var(--spacing);
}
#comment-form textarea {
@@ -410,32 +408,18 @@ main.container {
// page nav
.page-navigator {
margin: 0;
flex: 1;
list-style: none;
padding: 0;
text-align: center;
.current a {
text-decoration: underline;
color: inherit;
pointer-events: none;
}
a:focus {
background-color: var(--pico-text-selection-color);
}
.prev {
margin-right: auto;
a::before {
content: "";
margin-right: .25rem;
li {
display: inline;
margin-left: calc(var(--spacing) / 2);
margin-right: calc(var(--spacing) / 2);
&.current a {
font-weight: 700;
color: var(--h5-color);
}
}
.next {
margin-left: auto;
text-align: right;
a::after {
content: "";
margin-left: .25rem;
}
}
}
}

View File

@@ -1,30 +0,0 @@
/*!
* This is an example of a color scheme
* You can define your color scheme below
*/
[data-theme="customize"] {
--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(--pico-primary);
}
.site-navbar a,
.site-navbar .nav-toggler-btn {
color: var(--pico-primary-inverse);
}
.site-navbar .desc {
color: rgba(255, 255, 255, .5);
}
.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(_t('暂无评论'), _t('1 条评论'), _t('%d 条评论')); ?></a>
href="<?php $archive->permalink() ?>#comments"><?php $archive->commentsNum('评论', '1 条评论', '%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')) && !($this->is('post'))): ?>
<?php if (!($this->is('index')) and !($this->is('post'))): ?>
<h3 class="archive-title"><?php $this->archiveTitle([
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),

View File

@@ -36,7 +36,6 @@ pre {
max-height: 400px;
}
pre code {
display: block;
padding: 3px;
color: #444;
}

View File

@@ -9,19 +9,17 @@ namespace IXR;
*/
class Date
{
private string $year;
private int $year;
private string $month;
private int $month;
private string $day;
private int $day;
private string $hour;
private int $hour;
private string $minute;
private int $minute;
private string $second;
private string $timezone;
private int $second;
/**
* @param int|string $time
@@ -41,13 +39,12 @@ class Date
*/
private function parseTimestamp(int $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 = '';
$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));
}
/**
@@ -61,7 +58,6 @@ 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);
}
/**
@@ -69,7 +65,7 @@ class Date
*/
public function getIso(): string
{
return $this->year . $this->month . $this->day . 'T' . $this->hour . ':' . $this->minute . ':' . $this->second . $this->timezone;
return $this->year . $this->month . $this->day . 'T' . $this->hour . ':' . $this->minute . ':' . $this->second;
}
/**

View File

@@ -29,9 +29,9 @@ class Error
* 构造函数
*
* @param integer $code 错误代码
* @param string $message 错误消息
* @param string|null $message 错误消息
*/
public function __construct(int $code, string $message)
public function __construct(int $code, ?string $message)
{
$this->code = $code;
$this->message = $message;

View File

@@ -40,7 +40,7 @@ class Message
private array $currentStructName = []; // A stack as well
private string $currentTagContents = '';
private string $currentTagContents;
/**
* @param string $message
@@ -60,25 +60,6 @@ class Message
if (trim($this->message) == '') {
return false;
}
// remove the DOCTYPE, avoid using a regexp, so we can save memory
$count = 0;
while (true) {
// Fail if there is an endless loop
if ($count >= 10) {
return false;
}
$pos = strpos($this->message, '<!DOCTYPE');
if ($pos !== false) {
$this->message = substr($this->message, 0, $pos)
. substr($this->message, strpos($this->message, '>', $pos) + 1);
$count ++;
} else {
break;
}
}
$parser = xml_parser_create();
// Set XML parser to take the case of tags in to account
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);

View File

@@ -17,7 +17,7 @@ class Value
* @param mixed $data
* @param string|null $type
*/
public function __construct($data, ?string $type = null)
public function __construct($data, ?string $type)
{
$this->data = $data;
if (!$type) {

View File

@@ -236,8 +236,6 @@ 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';
}
@@ -495,12 +493,12 @@ EOF;
* @access public
*
* @param string|null $str 需要生成缩略名的字符串
* @param string $default 默认的缩略名
* @param string|null $default 默认的缩略名
* @param integer $maxLength 缩略名最大长度
*
* @return string
*/
public static function slugName(?string $str, string $default = '', int $maxLength = 128): string
public static function slugName(?string $str, ?string $default = null, int $maxLength = 128): ?string
{
$str = trim($str ?? '');
@@ -679,18 +677,6 @@ EOF;
return $length < $iLength ? ($str . $trim) : $str;
}
/**
* 判断两个字符串是否为空并依次返回
*
* @param string|null $a
* @param string|null $b
* @return string|null
*/
public static function strBy(?string $a, ?string $b = null): ?string
{
return isset($a) && $a !== '' ? $a : $b;
}
/**
* 获取宽字符串长度函数
*

View File

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

View File

@@ -61,26 +61,14 @@ 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(
$dsn,
!empty($config->dsn)
? $config->dsn : "mysql:dbname={$config->database};host={$config->host};port={$config->port}",
$config->user,
$config->password,
$options
);
if (class_exists('\Pdo\Mysql')) {
// 新版本写法
$pdo->setAttribute(\Pdo\Mysql::ATTR_USE_BUFFERED_QUERY, true);
} else {
// 兼容旧版本
$pdo->setAttribute(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
}
$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
* @return array|null
*/
public function fetchAll($resource): array
{
@@ -146,6 +146,6 @@ class Pgsql implements Adapter
*/
public function quoteValue($string): string
{
return '\'' . str_replace('\'', '\'\'', $string) . '\'';
return '\'' . pg_escape_string($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|NOT|IS|NULL';
private const KEYWORDS = '*PRIMARY|AND|OR|LIKE|ILIKE|BINARY|BY|DISTINCT|AS|IN|IS|NULL';
/**
* 默认字段

View File

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

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