+25
-19
@@ -1,20 +1,32 @@
|
||||
/*
|
||||
* Bento Grid System
|
||||
* Source: https://github.com/fenbox/bento
|
||||
* Version: 1.2.7
|
||||
* Update: 2013.11.15
|
||||
* Version: 1.2.8
|
||||
* Update: 2013.11.25
|
||||
*/
|
||||
.colgroup [class*="col-"] {
|
||||
float: left;
|
||||
min-height: 1px;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
.container, .row [class*="col-"] {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box; }
|
||||
|
||||
.colgroup [class*="push-"],
|
||||
.colgroup [class*="pull-"] {
|
||||
.container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px; }
|
||||
|
||||
.row {
|
||||
margin-right: -10px;
|
||||
margin-left: -10px; }
|
||||
|
||||
.row [class*="col-"] {
|
||||
float: left;
|
||||
min-height: 1px;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px; }
|
||||
|
||||
.row [class*="-push-"],
|
||||
.row [class*="-pull-"] {
|
||||
position: relative; }
|
||||
|
||||
/*
|
||||
@@ -61,8 +73,6 @@
|
||||
*/
|
||||
@media (min-width: 768px) {
|
||||
.container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
max-width: 728px; }
|
||||
|
||||
.col-tb-1 {
|
||||
@@ -216,11 +226,7 @@
|
||||
left: 91.66667%; }
|
||||
|
||||
.col-tb-push-12 {
|
||||
left: 100%; }
|
||||
|
||||
.colgroup {
|
||||
margin-right: -10px;
|
||||
margin-left: -10px; } }
|
||||
left: 100%; } }
|
||||
/*
|
||||
* Desktop and up
|
||||
*/
|
||||
@@ -554,10 +560,10 @@
|
||||
/*
|
||||
* Clearfix
|
||||
*/
|
||||
.clearfix, .colgroup {
|
||||
.clearfix, .row {
|
||||
zoom: 1; }
|
||||
.clearfix:before, .colgroup:before, .clearfix:after, .colgroup:after {
|
||||
.clearfix:before, .row:before, .clearfix:after, .row:after {
|
||||
content: " ";
|
||||
display: table; }
|
||||
.clearfix:after, .colgroup:after {
|
||||
.clearfix:after, .row:after {
|
||||
clear: both; }
|
||||
|
||||
+12
-17
@@ -210,9 +210,7 @@ button {
|
||||
cursor: default; }
|
||||
|
||||
.btn-text {
|
||||
background: transparent; }
|
||||
.btn-text:hover, .btn-text:active, .btn-text.active {
|
||||
background: #F3F3F0; }
|
||||
background-color: transparent !important; }
|
||||
|
||||
/* 下拉菜单 */
|
||||
.btn-drop {
|
||||
@@ -974,8 +972,7 @@ a.operate-reply {
|
||||
color: #666; }
|
||||
|
||||
.typecho-post-area #text {
|
||||
resize: none;
|
||||
font-size: .92857em; }
|
||||
resize: none; }
|
||||
|
||||
#advance-panel-btn {
|
||||
font-size: .92857em; }
|
||||
@@ -1040,9 +1037,6 @@ a.operate-reply {
|
||||
list-style: none;
|
||||
padding: 0; }
|
||||
|
||||
#edit-secondary #tab-files {
|
||||
display: none; }
|
||||
|
||||
/**
|
||||
* 标签列表
|
||||
*/
|
||||
@@ -1112,17 +1106,19 @@ a.operate-reply {
|
||||
margin: 0 10px;
|
||||
padding: 0;
|
||||
word-break: break-all; }
|
||||
#file-list li {
|
||||
padding: 8px 0;
|
||||
border-top: 1px dashed #D9D9D6; }
|
||||
#file-list .file {
|
||||
margin-left: 5px; }
|
||||
#file-list li,
|
||||
#file-list .insert {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis; }
|
||||
#file-list li {
|
||||
padding: 8px 0;
|
||||
border-top: 1px dashed #D9D9D6; }
|
||||
#file-list .insert {
|
||||
display: block;
|
||||
max-width: 100%; }
|
||||
#file-list .file {
|
||||
margin-left: 5px; }
|
||||
#file-list .info {
|
||||
text-transform: uppercase; }
|
||||
|
||||
@@ -1642,8 +1638,7 @@ div.token-input-dropdown ul li.token-input-selected-dropdown-item {
|
||||
* Hide from both screenreaders and browsers: h5bp.com/u
|
||||
*/
|
||||
.hidden {
|
||||
display: none !important;
|
||||
visibility: hidden; }
|
||||
display: none; }
|
||||
|
||||
/*
|
||||
* Hide only visually, but have it available for screenreaders: h5bp.com/v
|
||||
|
||||
+4
-1
@@ -48,7 +48,7 @@ $(document).ready(function () {
|
||||
exitFullscreen: '<?php _e('退出全屏'); ?> - Ctrl+E',
|
||||
fullscreenUnsupport: '<?php _e('此浏览器不支持全屏操作'); ?>',
|
||||
|
||||
imagedialog: '<p><b><?php _e('插入图片'); ?></b></p><p><?php _e('请在下方的输入框内输入要插入的远程图片地址'); ?></p><p><?php _e('您也可以使用编辑器下方的文件上传功能插入本地图片'); ?></p>',
|
||||
imagedialog: '<p><b><?php _e('插入图片'); ?></b></p><p><?php _e('请在下方的输入框内输入要插入的远程图片地址'); ?></p><p><?php _e('您也可以使用附件功能插入上传的本地图片'); ?></p>',
|
||||
linkdialog: '<p><b><?php _e('插入链接'); ?></b></p><p><?php _e('请在下方的输入框内输入要插入的链接地址'); ?></p>',
|
||||
|
||||
ok: '<?php _e('确定'); ?>',
|
||||
@@ -215,6 +215,9 @@ $(document).ready(function () {
|
||||
}, 10);
|
||||
};
|
||||
|
||||
Typecho.uploadComplete = function (file) {
|
||||
Typecho.insertFileToEditor(file.title, file.url, file.isImage);
|
||||
};
|
||||
|
||||
// 编辑预览切换
|
||||
var edittab = $('.editor').prepend('<div class="wmd-edittab"><a href="#wmd-editarea" class="active"><?php _e('撰写'); ?></a><a href="#wmd-preview"><?php _e('预览'); ?></a></div>'),
|
||||
|
||||
@@ -52,6 +52,12 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
function fileUploadComplete (id, url, data) {
|
||||
// 拖拽上传的错误提示
|
||||
if (!data) {
|
||||
alert(errorWord);
|
||||
return;
|
||||
}
|
||||
|
||||
var li = $('#' + id).removeClass('loading').data('cid', data.cid)
|
||||
.data('url', data.url)
|
||||
.data('image', data.isImage)
|
||||
@@ -65,6 +71,7 @@ $(document).ready(function() {
|
||||
attachInsertEvent(li);
|
||||
attachDeleteEvent(li);
|
||||
updateAttacmentNumber();
|
||||
Typecho.uploadComplete(data);
|
||||
}
|
||||
|
||||
$('#tab-files').bind('init', function () {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ $stat = Typecho_Widget::widget('Widget_Stat');
|
||||
<div class="main">
|
||||
<div class="container typecho-dashboard">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main">
|
||||
<div class="row typecho-page-main">
|
||||
<div class="col-mb-12 welcome-board" role="main">
|
||||
<p><?php _e('目前有 <em>%s</em> 篇日志, 并有 <em>%s</em> 条关于你的评论在 <em>%s</em> 个分类中.',
|
||||
$stat->myPublishedPostsNum, $stat->myPublishedCommentsNum, $stat->categoriesNum); ?>
|
||||
|
||||
@@ -3217,6 +3217,7 @@ else
|
||||
|
||||
buttons.redo = makeButton("wmd-redo-button", redoTitle, "-220px", null);
|
||||
buttons.redo.execute = function (manager) { if (manager) manager.redo(); };
|
||||
makeSpacer(4);
|
||||
buttons.fullscreen = makeButton("wmd-fullscreen-button", getString("fullscreen"), "-240px", null);
|
||||
buttons.fullscreen.execute = function () { fullScreenManager.doFullScreen(buttons, true); };
|
||||
buttons.exitFullscreen = makeButton("wmd-exit-fullscreen-button", getString("exitFullscreen"), "-260px", null);
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@
|
||||
$.post(url, {size : h});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
uploadComplete : function (file) {}
|
||||
};
|
||||
})(window);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ $isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == Typ
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<div class="row typecho-page-main" role="main">
|
||||
<div class="col-mb-12 typecho-list">
|
||||
<div class="clearfix">
|
||||
<ul class="typecho-option-tabs right">
|
||||
|
||||
@@ -10,7 +10,7 @@ $stat = Typecho_Widget::widget('Widget_Stat');
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<div class="row typecho-page-main" role="main">
|
||||
<div class="col-mb-12">
|
||||
|
||||
<div class="typecho-list-operate clearfix">
|
||||
|
||||
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main manage-metas">
|
||||
<div class="row typecho-page-main manage-metas">
|
||||
<div class="col-mb-12">
|
||||
<ul class="typecho-option-tabs clearfix">
|
||||
<li<?php if(!isset($request->type) || 'category' == $request->get('type')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-metas.php'); ?>"><?php _e('分类'); ?></a></li>
|
||||
|
||||
@@ -8,7 +8,7 @@ $stat = Typecho_Widget::widget('Widget_Stat');
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<div class="row typecho-page-main" role="main">
|
||||
<div class="col-mb-12 typecho-list">
|
||||
<div class="typecho-list-operate clearfix">
|
||||
<form method="get">
|
||||
|
||||
@@ -8,7 +8,7 @@ $stat = Typecho_Widget::widget('Widget_Stat');
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<div class="row typecho-page-main" role="main">
|
||||
<div class="col-mb-12 typecho-list">
|
||||
<div class="typecho-list-operate clearfix">
|
||||
<form method="get">
|
||||
|
||||
@@ -6,7 +6,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<div class="row typecho-page-main" role="main">
|
||||
<div class="col-mb-12 typecho-list">
|
||||
<div class="typecho-list-operate clearfix">
|
||||
<form method="get">
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ Typecho_Widget::widget('Widget_Contents_Attachment_Edit')->to($attachment);
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main">
|
||||
<div class="row typecho-page-main">
|
||||
<div class="col-mb-12 col-tb-8" role="main">
|
||||
<?php if ($attachment->attachment->isImage): ?>
|
||||
<p><img src="<?php $attachment->attachment->url(); ?>" alt="<?php $attachment->attachment->name(); ?>" class="typecho-attachment-photo" /></p>
|
||||
|
||||
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="form">
|
||||
<div class="row typecho-page-main" role="form">
|
||||
<div class="col-mb-12 col-tb-8 col-tb-offset-2">
|
||||
<?php Typecho_Widget::widget('Widget_Options_Discussion')->form()->render(); ?>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="form">
|
||||
<div class="row typecho-page-main" role="form">
|
||||
<div class="col-mb-12 col-tb-8 col-tb-offset-2">
|
||||
<?php Typecho_Widget::widget('Widget_Options_General')->form()->render(); ?>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="form">
|
||||
<div class="row typecho-page-main" role="form">
|
||||
<div class="col-mb-12 col-tb-8 col-tb-offset-2">
|
||||
<?php Typecho_Widget::widget('Widget_Options_Permalink')->form()->render(); ?>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="form">
|
||||
<div class="row typecho-page-main" role="form">
|
||||
<div class="col-mb-12 col-tb-8 col-tb-offset-2">
|
||||
<?php Typecho_Widget::widget('Widget_Plugins_Config')->config()->render(); ?>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="form">
|
||||
<div class="row typecho-page-main" role="form">
|
||||
<div class="col-mb-12 col-tb-8 col-tb-offset-2">
|
||||
<?php Typecho_Widget::widget('Widget_Options_Reading')->form()->render(); ?>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<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>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
|
||||
<div class="colgroup">
|
||||
<div class="typecho-page-title col-mb-12">
|
||||
<h2><?php echo $menu->title; ?><?php
|
||||
if (!empty($menu->addLink)) {
|
||||
echo "<a href=\"{$menu->addLink}\">" . _t("新增") . "</a>";
|
||||
}
|
||||
?></h2>
|
||||
</div>
|
||||
<div class="typecho-page-title">
|
||||
<h2><?php echo $menu->title; ?><?php
|
||||
if (!empty($menu->addLink)) {
|
||||
echo "<a href=\"{$menu->addLink}\">" . _t("新增") . "</a>";
|
||||
}
|
||||
?></h2>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<div class="row typecho-page-main" role="main">
|
||||
<div class="col-mb-12 typecho-list">
|
||||
<?php Typecho_Widget::widget('Widget_Plugins_List_Activated')->to($activatedPlugins); ?>
|
||||
<?php if ($activatedPlugins->have() || !empty($activatedPlugins->activatedPlugins)): ?>
|
||||
|
||||
+5
-4
@@ -9,13 +9,14 @@ $stat = Typecho_Widget::widget('Widget_Stat');
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main">
|
||||
<div class="row typecho-page-main">
|
||||
<div class="col-mb-12 col-tb-3">
|
||||
<p><a href="http://gravatar.com/emails/" title="<?php _e('在 Gravatar 上修改头像'); ?>"><?php echo '<img class="profile-avatar" src="'
|
||||
. ($request->isSecure() ? 'https://secure' : 'http://www') . '.gravatar.com/avatar/' . md5($user->mail) . '?s=220&r=X' .
|
||||
'&d=" alt="' . $user->screenName . '" />'; ?></a></p>
|
||||
<h2><?php $user->screenName(); ?><br><small><?php $user->name(); ?></small></h2>
|
||||
<p><?php _e('目前有 <em>%s</em> 篇 Blog,并有 <em>%s</em> 条关于你的评论在已设定的 <em>%s</em> 个分类中.',
|
||||
'&d=mm" alt="' . $user->screenName . '" />'; ?></a></p>
|
||||
<h2><?php $user->screenName(); ?></h2>
|
||||
<p><?php $user->name(); ?></p>
|
||||
<p><?php _e('目前有 <em>%s</em> 篇日志, 并有 <em>%s</em> 条关于你的评论在 <em>%s</em> 个分类中.',
|
||||
$stat->myPublishedPostsNum, $stat->myPublishedCommentsNum, $stat->categoriesNum); ?></p>
|
||||
<p><?php
|
||||
if ($user->logged > 0) {
|
||||
|
||||
@@ -66,10 +66,7 @@ button {
|
||||
}
|
||||
|
||||
.btn-text {
|
||||
background: transparent;
|
||||
&:hover, &:active, &.active {
|
||||
background: #F3F3F0;
|
||||
}
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
/* 下拉菜单 */
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
*/
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
visibility: hidden;
|
||||
display: none;
|
||||
// display: none !important;
|
||||
// visibility: hidden;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+31
-22
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Bento Grid System
|
||||
* Source: https://github.com/fenbox/bento
|
||||
* Version: 1.2.7
|
||||
* Update: 2013.11.15
|
||||
* Version: 1.2.8
|
||||
* Update: 2013.11.25
|
||||
*/
|
||||
|
||||
//
|
||||
@@ -18,23 +18,41 @@ $screen-tablet: 768px;
|
||||
$screen-desktop: 992px;
|
||||
$screen-wide: 1200px;
|
||||
|
||||
// Column group
|
||||
.colgroup {
|
||||
@extend .clearfix;
|
||||
}
|
||||
|
||||
.colgroup [class*="col-"] {
|
||||
float: left;
|
||||
min-height: 1px;
|
||||
padding-right: $gutter-width / 2;
|
||||
padding-left: $gutter-width / 2;
|
||||
// Mixins
|
||||
%box-sizing {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.colgroup [class*="push-"],
|
||||
.colgroup [class*="pull-"] {
|
||||
|
||||
// Container
|
||||
.container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-left: $gutter-width / 2;
|
||||
padding-right: $gutter-width / 2;
|
||||
@extend %box-sizing;
|
||||
}
|
||||
|
||||
// Column group
|
||||
.row {
|
||||
margin-right: $gutter-width / -2;
|
||||
margin-left: $gutter-width / -2;
|
||||
@extend .clearfix;
|
||||
}
|
||||
|
||||
.row [class*="col-"] {
|
||||
float: left;
|
||||
min-height: 1px;
|
||||
padding-right: $gutter-width / 2;
|
||||
padding-left: $gutter-width / 2;
|
||||
@extend %box-sizing;
|
||||
}
|
||||
|
||||
.row [class*="-push-"],
|
||||
.row [class*="-pull-"] {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -56,10 +74,7 @@ $screen-wide: 1200px;
|
||||
|
||||
@media (min-width: $screen-tablet) {
|
||||
.container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
max-width: $screen-tablet - ($gutter-width * 2);
|
||||
@extend .center-block;
|
||||
}
|
||||
|
||||
// Colunms
|
||||
@@ -89,12 +104,6 @@ $screen-wide: 1200px;
|
||||
left: $column-width * $index;
|
||||
}
|
||||
}
|
||||
|
||||
// Groups
|
||||
.colgroup {
|
||||
margin-right: $gutter-width / -2;
|
||||
margin-left: $gutter-width / -2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+9
-10
@@ -725,7 +725,6 @@ a.operate-reply {
|
||||
|
||||
.typecho-post-area #text {
|
||||
resize: none;
|
||||
font-size: .92857em;
|
||||
}
|
||||
|
||||
#advance-panel-btn {
|
||||
@@ -808,9 +807,6 @@ background: #FFF1A8;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#edit-secondary {
|
||||
#tab-files { display: none; }
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签列表
|
||||
@@ -880,19 +876,22 @@ background: #FFF1A8;
|
||||
margin: 0 10px;
|
||||
padding: 0;
|
||||
word-break: break-all;
|
||||
li,
|
||||
.insert {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
li {
|
||||
padding: 8px 0;
|
||||
border-top: 1px dashed #D9D9D6;
|
||||
}
|
||||
.file {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.insert {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.file {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.info {
|
||||
text-transform: uppercase;
|
||||
|
||||
@@ -9,7 +9,7 @@ Typecho_Widget::widget('Widget_Themes_Files')->to($files);
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<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>
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<div class="row typecho-page-main" role="main">
|
||||
<div class="col-mb-12">
|
||||
<ul class="typecho-option-tabs fix-tabs clearfix">
|
||||
<li class="current"><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('可以使用的外观'); ?></a></li>
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<div class="row typecho-page-main" role="main">
|
||||
<div class="col-mb-12">
|
||||
<div id="typecho-welcome">
|
||||
<form action="<?php echo Typecho_Router::url('do', array('action' => 'upgrade', 'widget' => 'Upgrade'),
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="form">
|
||||
<div class="row typecho-page-main" role="form">
|
||||
<div class="col-mb-12 col-tb-6 col-tb-offset-3">
|
||||
<?php Typecho_Widget::widget('Widget_Users_Edit')->form()->render(); ?>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ include 'menu.php';
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main" role="main">
|
||||
<div class="row typecho-page-main" role="main">
|
||||
<div class="col-mb-12">
|
||||
<div id="typecho-welcome" class="message">
|
||||
<form action="<?php $options->adminUrl(); ?>" method="get">
|
||||
|
||||
+15
-13
@@ -175,7 +175,7 @@ $(document).ready(function() {
|
||||
savedData = data;
|
||||
lastSaveTime = o.time;
|
||||
cid = o.cid;
|
||||
autoSave.text('<?php _e('内容已经保存'); ?>' + ' (' + o.time + ')').effect('highlight', 1000);
|
||||
autoSave.text('<?php _e('已保存'); ?>' + ' (' + o.time + ')').effect('highlight', 1000);
|
||||
locked = false;
|
||||
}, 'json');
|
||||
}
|
||||
@@ -189,7 +189,7 @@ $(document).ready(function() {
|
||||
|
||||
$('#text').bind('input propertychange', function () {
|
||||
if (!locked) {
|
||||
autoSave.text('<?php _e('内容尚未保存'); ?>' + (lastSaveTime ? ' (<?php _e('上次保存时间'); ?>: ' + lastSaveTime + ')' : ''));
|
||||
autoSave.text('<?php _e('尚未保存'); ?>' + (lastSaveTime ? ' (<?php _e('上次保存时间'); ?>: ' + lastSaveTime + ')' : ''));
|
||||
}
|
||||
|
||||
if (!autoSaveOnce) {
|
||||
@@ -214,13 +214,13 @@ $(document).ready(function() {
|
||||
|
||||
// 控制选项和附件的切换
|
||||
var fileUploadInit = false;
|
||||
$("#edit-secondary .typecho-option-tabs li").click(function() {
|
||||
$("#edit-secondary .typecho-option-tabs li").removeClass('active');
|
||||
$(this).addClass("active");
|
||||
$(".tab-content").hide();
|
||||
$('#edit-secondary .typecho-option-tabs li').click(function() {
|
||||
$('#edit-secondary .typecho-option-tabs li').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$('.tab-content').addClass('hidden');
|
||||
|
||||
var selected_tab = $(this).find("a").attr("href"),
|
||||
selected_el = $(selected_tab).show();
|
||||
var selected_tab = $(this).find('a').attr('href'),
|
||||
selected_el = $(selected_tab).removeClass('hidden');
|
||||
|
||||
if (!fileUploadInit) {
|
||||
selected_el.trigger('init');
|
||||
@@ -258,11 +258,13 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
// 全屏上传按钮控制
|
||||
// $('#btn-fullscreen-upload').click(function() {
|
||||
// $(this).toggleClass('active');
|
||||
// $('#tab-files').toggle();
|
||||
// return false;
|
||||
// });
|
||||
$('#btn-fullscreen-upload').click(function() {
|
||||
$(this).toggleClass('active');
|
||||
$('.tab-content').toggleClass('hidden');
|
||||
$('.typecho-option-tabs li').toggleClass('active');
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main typecho-post-area" role="form">
|
||||
<div class="row typecho-page-main typecho-post-area" role="form">
|
||||
<form action="<?php $options->index('/action/contents-page-edit'); ?>" method="post" name="write_page">
|
||||
<div class="col-mb-12 col-tb-9" role="main">
|
||||
<?php if ($page->draft && $page->draft['cid'] != $page->cid): ?>
|
||||
@@ -41,6 +41,7 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
|
||||
<?php include 'custom-fields.php'; ?>
|
||||
<p class="submit clearfix">
|
||||
<span class="right">
|
||||
<button type="button" class="btn-text" id="btn-fullscreen-upload"><i class="i-upload"><?php _e('附件'); ?></i></button>
|
||||
<input type="hidden" name="cid" value="<?php $page->cid(); ?>" />
|
||||
<button type="submit" name="do" value="save" id="btn-save"><?php _e('保存草稿'); ?></button>
|
||||
<button type="submit" name="do" value="publish" class="primary" id="btn-submit"><?php _e('发布页面'); ?></button>
|
||||
@@ -124,7 +125,7 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
|
||||
<?php endif; ?>
|
||||
</div><!-- end #tab-advance -->
|
||||
|
||||
<div id="tab-files" class="tab-content">
|
||||
<div id="tab-files" class="tab-content hidden">
|
||||
<?php include 'file-upload.php'; ?>
|
||||
</div><!-- end #tab-files -->
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="colgroup typecho-page-main typecho-post-area" role="form">
|
||||
<div class="row typecho-page-main typecho-post-area" role="form">
|
||||
<form action="<?php $options->index('/action/contents-post-edit'); ?>" method="post" name="write_post">
|
||||
<div class="col-mb-12 col-tb-9" role="main">
|
||||
<?php if ($post->draft && $post->draft['cid'] != $post->cid): ?>
|
||||
@@ -46,7 +46,7 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
|
||||
|
||||
<p class="submit clearfix">
|
||||
<span class="right">
|
||||
<!-- <button type="button" class="btn-text" id="btn-fullscreen-upload"><i class="i-upload"><?php _e('附件'); ?></i></button> -->
|
||||
<button type="button" class="btn-text" id="btn-fullscreen-upload"><i class="i-upload"><?php _e('附件'); ?></i></button>
|
||||
<input type="hidden" name="cid" value="<?php $post->cid(); ?>" />
|
||||
<button type="submit" name="do" value="save" id="btn-save"><?php _e('保存草稿'); ?></button>
|
||||
<button type="submit" name="do" value="publish" class="primary" id="btn-submit"><?php _e('发布文章'); ?></button>
|
||||
@@ -154,7 +154,7 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
|
||||
<?php endif; ?>
|
||||
</div><!-- end #tab-advance -->
|
||||
|
||||
<div id="tab-files" class="tab-content">
|
||||
<div id="tab-files" class="tab-content hidden">
|
||||
<?php include 'file-upload.php'; ?>
|
||||
</div><!-- end #tab-files -->
|
||||
</div>
|
||||
|
||||
+2
-2
@@ -185,7 +185,7 @@ list($prefixVersion, $suffixVersion) = explode('/', $currentVersion);
|
||||
</ol>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="colgroup">
|
||||
<div class="row">
|
||||
<div class="col-mb-12 col-tb-8 col-tb-offset-2">
|
||||
<div class="column-14 start-06 typecho-install">
|
||||
<?php if (isset($_GET['finish'])) : ?>
|
||||
@@ -517,7 +517,7 @@ Typecho_Db::set(\$db);
|
||||
?>
|
||||
<div class="message notice"><p><?php _e('安装程序无法自动创建 <strong>config.inc.php</strong> 文件'); ?><br />
|
||||
<?php _e('您可以在网站根目录下手动创建 <strong>config.inc.php</strong> 文件, 并复制如下代码至其中'); ?></p>
|
||||
<p><textarea rows="5" onmouseover="this.select();" class="w-100" readonly><?php echo htmlspecialchars($contents); ?></textarea></p>
|
||||
<p><textarea rows="5" onmouseover="this.select();" class="w-100 mono" readonly><?php echo htmlspecialchars($contents); ?></textarea></p>
|
||||
<p><button name="created" value="1" type="submit" class="primary">创建完毕, 继续安装 »</button></p></div>
|
||||
<?php
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
</div><!-- end .colgroup -->
|
||||
</div><!-- end .row -->
|
||||
</div>
|
||||
</div><!-- end #body -->
|
||||
|
||||
|
||||
+25
-19
@@ -1,20 +1,32 @@
|
||||
/*
|
||||
* Bento Grid System
|
||||
* Source: https://github.com/fenbox/bento
|
||||
* Version: 1.2.7
|
||||
* Update: 2013.11.15
|
||||
* Version: 1.2.8
|
||||
* Update: 2013.11.25
|
||||
*/
|
||||
.colgroup [class*="col-"] {
|
||||
float: left;
|
||||
min-height: 1px;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
.container, .row [class*="col-"] {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box; }
|
||||
|
||||
.colgroup [class*="push-"],
|
||||
.colgroup [class*="pull-"] {
|
||||
.container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px; }
|
||||
|
||||
.row {
|
||||
margin-right: -10px;
|
||||
margin-left: -10px; }
|
||||
|
||||
.row [class*="col-"] {
|
||||
float: left;
|
||||
min-height: 1px;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px; }
|
||||
|
||||
.row [class*="-push-"],
|
||||
.row [class*="-pull-"] {
|
||||
position: relative; }
|
||||
|
||||
/*
|
||||
@@ -61,8 +73,6 @@
|
||||
*/
|
||||
@media (min-width: 768px) {
|
||||
.container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
max-width: 728px; }
|
||||
|
||||
.col-tb-1 {
|
||||
@@ -216,11 +226,7 @@
|
||||
left: 91.66667%; }
|
||||
|
||||
.col-tb-push-12 {
|
||||
left: 100%; }
|
||||
|
||||
.colgroup {
|
||||
margin-right: -10px;
|
||||
margin-left: -10px; } }
|
||||
left: 100%; } }
|
||||
/*
|
||||
* Desktop and up
|
||||
*/
|
||||
@@ -554,10 +560,10 @@
|
||||
/*
|
||||
* Clearfix
|
||||
*/
|
||||
.clearfix, .colgroup {
|
||||
.clearfix, .row {
|
||||
zoom: 1; }
|
||||
.clearfix:before, .colgroup:before, .clearfix:after, .colgroup:after {
|
||||
.clearfix:before, .row:before, .clearfix:after, .row:after {
|
||||
content: " ";
|
||||
display: table; }
|
||||
.clearfix:after, .colgroup:after {
|
||||
.clearfix:after, .row:after {
|
||||
clear: both; }
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
<header id="header" class="clearfix">
|
||||
<div class="container">
|
||||
<div class="colgroup">
|
||||
<div class="row">
|
||||
<div class="site-name col-mb-12 col-9">
|
||||
<a id="logo" href="<?php $this->options->siteUrl(); ?>">
|
||||
<?php if ($this->options->logoUrl): ?>
|
||||
@@ -58,12 +58,12 @@
|
||||
<?php endwhile; ?>
|
||||
</nav>
|
||||
</div>
|
||||
</div><!-- end .colgroup -->
|
||||
</div><!-- end .row -->
|
||||
</div>
|
||||
</header><!-- end #header -->
|
||||
<div id="body">
|
||||
<div class="container">
|
||||
<div class="colgroup">
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
|
||||
+10
-4
@@ -736,7 +736,10 @@ class Widget_Archive extends Widget_Abstract_Contents
|
||||
$this->_archiveType = 'single';
|
||||
|
||||
/** 匹配类型 */
|
||||
$select->where('table.contents.type = ?', $this->parameter->type);
|
||||
|
||||
if ('single'!=$this->parameter->type) {
|
||||
$select->where('table.contents.type = ?', $this->parameter->type);
|
||||
}
|
||||
|
||||
/** 如果是单篇文章或独立页面 */
|
||||
if (isset($this->request->cid)) {
|
||||
@@ -1215,6 +1218,7 @@ class Widget_Archive extends Widget_Abstract_Contents
|
||||
'archive' => 'error404Handle',
|
||||
'archive_page' => 'error404Handle',
|
||||
404 => 'error404Handle',
|
||||
'single' => 'singleHandle',
|
||||
'page' => 'singleHandle',
|
||||
'post' => 'singleHandle',
|
||||
'attachment' => 'singleHandle',
|
||||
@@ -1359,7 +1363,7 @@ class Widget_Archive extends Widget_Abstract_Contents
|
||||
* @return void
|
||||
*/
|
||||
public function pageNav($prev = '«', $next = '»', $splitPage = 3, $splitWord = '...',
|
||||
$class = 'page-navigator', $currentClass = 'current')
|
||||
$class = 'page-navigator', $currentClass = 'current', $label = 'ol')
|
||||
{
|
||||
if ($this->have()) {
|
||||
$hasNav = false;
|
||||
@@ -1376,9 +1380,11 @@ class Widget_Archive extends Widget_Abstract_Contents
|
||||
$nav = new Typecho_Widget_Helper_PageNavigator_Box($this->_total,
|
||||
$this->_currentPage, $this->parameter->pageSize, $query);
|
||||
|
||||
echo '<ol class="' . $class . '">';
|
||||
/** 添加判断防止输入错误的标签,判断逻辑:如果为 <ul>,使用 <ul>;否则,使用 <ol> */
|
||||
$label = ($label == 'ul') ? 'ul' : 'ol';
|
||||
echo '<' . $label . ' class="' . $class . '">';
|
||||
$nav->render($prev, $next, $splitPage, $splitWord, $currentClass);
|
||||
echo '</ol>';
|
||||
echo '</' . $label . '>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,9 +275,9 @@ class Widget_Feedback extends Widget_Abstract_Comments implements Widget_Interfa
|
||||
if (!$this->_content->allow('comment')) {
|
||||
throw new Typecho_Widget_Exception(_t('对不起,此内容的反馈被禁止.'), 403);
|
||||
}
|
||||
|
||||
|
||||
/** 检查来源 */
|
||||
if ($this->options->commentsCheckReferer) {
|
||||
if ($this->options->commentsCheckReferer&&'false'!=$this->parameter->checkReferer) {
|
||||
$referer = $this->request->getReferer();
|
||||
|
||||
if (empty($referer)) {
|
||||
|
||||
@@ -34,7 +34,7 @@ class Widget_Options_General extends Widget_Abstract_Options implements Widget_I
|
||||
|
||||
/** 站点名称 */
|
||||
$title = new Typecho_Widget_Helper_Form_Element_Text('title', NULL, $this->options->title, _t('站点名称'), _t('站点的名称将显示在网页的标题处.'));
|
||||
$title->input->setAttribute('class', 'w-40');
|
||||
$title->input->setAttribute('class', 'w-100');
|
||||
$form->addInput($title->addRule('required', _t('请填写站点名称')));
|
||||
|
||||
/** 站点地址 */
|
||||
@@ -42,7 +42,7 @@ class Widget_Options_General extends Widget_Abstract_Options implements Widget_I
|
||||
. ($this->options->originalSiteUrl == $this->options->rootUrl ?
|
||||
'' : '</p><p class="message notice mono">' . _t('当前地址 <strong>%s</strong> 与上述设定值不一致',
|
||||
$this->options->rootUrl)));
|
||||
$siteUrl->input->setAttribute('class', 'w-60 mono');
|
||||
$siteUrl->input->setAttribute('class', 'w-100 mono');
|
||||
$form->addInput($siteUrl->addRule('required', _t('请填写站点地址'))
|
||||
->addRule('url', _t('请填写一个合法的URL地址')));
|
||||
|
||||
|
||||
+17
-4
@@ -30,15 +30,28 @@ class Widget_Upload extends Widget_Abstract_Contents implements Widget_Interface
|
||||
*/
|
||||
private static function makeUploadDir($path)
|
||||
{
|
||||
if (!@mkdir($path, 0777, true)) {
|
||||
$path = preg_replace("/\\\+/", '/', $path);
|
||||
$current = rtrim($path, '/');
|
||||
$last = $current;
|
||||
|
||||
while (!is_dir($current) && false !== strpos($path, '/')) {
|
||||
$last = $current;
|
||||
$current = dirname($current);
|
||||
}
|
||||
|
||||
if ($last == $current) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!@mkdir($last)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$stat = @stat($path);
|
||||
$stat = @stat($last);
|
||||
$perms = $stat['mode'] & 0007777;
|
||||
@chmod($path, $perms);
|
||||
@chmod($last, $perms);
|
||||
|
||||
return true;
|
||||
return self::makeUploadDir($path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+263
-19
@@ -217,6 +217,27 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
'readonly' => true,
|
||||
'option' => 'siteUrl'
|
||||
),
|
||||
'home_url' => array(
|
||||
'desc' => _t( '博客首页地址' ),
|
||||
'readonly' => true,
|
||||
'option' => 'siteUrl'
|
||||
),
|
||||
'login_url' => array(
|
||||
'desc' => _t( '登录地址' ),
|
||||
'readonly' => true,
|
||||
'value' => $this->options->siteUrl.'admin/login.php'
|
||||
),
|
||||
'admin_url' => array(
|
||||
'desc' => _t( '管理区域的地址' ),
|
||||
'readonly' => true,
|
||||
'value' => $this->options->siteUrl.'admin/'
|
||||
),
|
||||
|
||||
'post_thumbnail' => array(
|
||||
'desc' => _t( '文章缩略图' ),
|
||||
'readonly' => true,
|
||||
'value' => false
|
||||
),
|
||||
|
||||
// Updatable options
|
||||
'time_zone' => array(
|
||||
@@ -315,7 +336,7 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
'description' => $excerpt,
|
||||
'title' => $page->title,
|
||||
'link' => $page->permalink,
|
||||
'permalink' => $page->permalink,
|
||||
'permaLink' => $page->permalink,
|
||||
'categories' => $page->categories,
|
||||
'excerpt' => $page->description,
|
||||
'text_more' => $more,
|
||||
@@ -365,13 +386,13 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
$pageStructs[] = array(
|
||||
'dateCreated' => new IXR_Date($this->options->timezone + $pages->created),
|
||||
'userid' => $pages->authorId,
|
||||
'page_id' => $pages->cid,
|
||||
'page_id' => intval($pages->cid),
|
||||
/** todo:此处有疑问 */
|
||||
'page_status' => $this->typechoToWordpressStatus($pages->status, 'page'),
|
||||
'description' => $excerpt,
|
||||
'title' => $pages->title,
|
||||
'link' => $pages->permalink,
|
||||
'permalink' => $pages->permalink,
|
||||
'permaLink' => $pages->permalink,
|
||||
'categories' => $pages->categories,
|
||||
'excerpt' => $pages->description,
|
||||
'text_more' => $more,
|
||||
@@ -380,9 +401,9 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
'wp_slug' => $pages->slug,
|
||||
'wp_password' => $pages->password,
|
||||
'wp_author' => $pages->author->name,
|
||||
'wp_page_parent_id' => '0',
|
||||
'wp_page_parent_id' => 0,
|
||||
'wp_page_parent_title' => '',
|
||||
'wp_page_order' => $pages->order, //meta是描述字段, 在page时表示顺序
|
||||
'wp_page_order' => intval($pages->order), //meta是描述字段, 在page时表示顺序
|
||||
'wp_author_id' => $pages->authorId,
|
||||
'wp_author_display_name' => $pages->author->screenName,
|
||||
'date_created_gmt' => new IXR_Date($pages->created),
|
||||
@@ -460,6 +481,38 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
$this->mwEditPost($blogId, $pageId, $userName, $password, $content, $publish);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑postId指定的post
|
||||
*
|
||||
* @param int $blogId
|
||||
* @param string $userName
|
||||
* @param string $password
|
||||
* @param int $postId
|
||||
* @param struct $content
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function wpEditPost($blogId, $userName, $password, $postId, $content)
|
||||
{
|
||||
|
||||
$post = $this->singletonWidget('Widget_Archive', 'type=single', 'cid=' . $postId, false);
|
||||
if ($post->type=='attachment') {
|
||||
$attachment['title'] = $content['post_title'];
|
||||
$attachment['slug'] = $content['post_excerpt'];
|
||||
|
||||
$text = unserialize($post->text);
|
||||
$text['description'] = $content['description'];
|
||||
|
||||
$attachment['text'] = serialize($text);
|
||||
|
||||
/** 更新数据 */
|
||||
$updateRows = $this->update($attachment, $this->db->sql()->where('cid = ?', $postId));
|
||||
return true;
|
||||
}
|
||||
return $this->mwEditPost($blogId, $postId, $userName, $password, $content, $publish);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取page列表,没有wpGetPages获得的详细
|
||||
*
|
||||
@@ -548,13 +601,14 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
/** 调用已有组件 */
|
||||
try {
|
||||
/** 插入 */
|
||||
$this->singletonWidget('Widget_Metas_Category_Edit', NULL, $input, false)->action();
|
||||
return $this->singletonWidget('Widget_Notice')->getHighlightId() ? true : false;
|
||||
$categoryWidget = $this->singletonWidget('Widget_Metas_Category_Edit', NULL, $input, false);
|
||||
$categoryWidget->action();
|
||||
return $categoryWidget->mid;
|
||||
} catch (Typecho_Widget_Exception $e) {
|
||||
return new IXR_Error($e->getCode(), $e->getMessage());
|
||||
}
|
||||
|
||||
return true;
|
||||
return new IXR_Error(403, _t('无法添加分类'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -606,6 +660,7 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
*/
|
||||
public function wpGetUsersBlogs($userName, $password)
|
||||
{
|
||||
|
||||
if (!$this->checkAccess($userName, $password)) {
|
||||
return $this->error;
|
||||
}
|
||||
@@ -613,12 +668,42 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
$struct = array();
|
||||
$struct[] = array(
|
||||
'isAdmin' => $this->user->pass('administrator', true),
|
||||
'url' => $this->options->siteUrl,
|
||||
'url' => $this->options->siteUrl,
|
||||
'blogid' => '1',
|
||||
'blogName' => $this->options->title,
|
||||
'xmlrpc' => $this->options->xmlRpcUrl
|
||||
);
|
||||
|
||||
return $struct;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户
|
||||
*
|
||||
* @access public
|
||||
* @param string $userName 用户名
|
||||
* @param string $password 密码
|
||||
* @return array
|
||||
*/
|
||||
public function wpGetProfile($blogId, $userName, $password)
|
||||
{
|
||||
|
||||
if (!$this->checkAccess($userName, $password)) {
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
$struct = array(
|
||||
'user_id' => $this->user->uid,
|
||||
'username' => $this->user->name,
|
||||
'first_name' => '',
|
||||
'last_name' => '',
|
||||
'registered' => new IXR_Date($this->options->timezone + $this->user->created),
|
||||
'bio' => '',
|
||||
'email' => $this->user->mail,
|
||||
'nickname' => $this->user->screenName,
|
||||
'url' => $this->user->url,
|
||||
'display_name' => $this->user->screenName,
|
||||
'roles' => $this->user->group
|
||||
);
|
||||
return $struct;
|
||||
}
|
||||
|
||||
@@ -706,6 +791,28 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
'total_comments' => $stat->currentCommentsNum
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取文章类型列表
|
||||
*
|
||||
* @access public
|
||||
* @param integer $blogId
|
||||
* @param string $userName
|
||||
* @param string $password
|
||||
* @return array
|
||||
*/
|
||||
public function wpGetPostFormats($blogId, $userName, $password)
|
||||
{
|
||||
/** 检查权限*/
|
||||
if (!$this->checkAccess($userName, $password)) {
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
return array(
|
||||
'standard' => _t('标准')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章状态列表
|
||||
@@ -751,6 +858,8 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
'publish' => _t('已发布')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取评论状态列表
|
||||
@@ -998,8 +1107,14 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
}
|
||||
|
||||
$commentId = abs(intval($commentId));
|
||||
return intval($this->singletonWidget('Widget_Abstract_Comments')->delete(
|
||||
$this->db->sql()->where('coid = ?', $commentId))) > 0;
|
||||
$commentWidget = $this->singletonWidget('Widget_Abstract_Comments');
|
||||
$where = $this->db->sql()->where('coid = ?', $commentId);
|
||||
|
||||
if (!$commentWidget->commentIsWriteable($where)) {
|
||||
return new IXR_Error(403, _t('无法编辑此评论'));
|
||||
}
|
||||
|
||||
return intval($this->singletonWidget('Widget_Abstract_Comments')->delete($where)) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1070,9 +1185,9 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
* @param integer $blogId
|
||||
* @param string $userName
|
||||
* @param string $password
|
||||
* @param mixed $post
|
||||
* @param mixed $path
|
||||
* @param array $struct
|
||||
* @return boolean
|
||||
* @return int
|
||||
*/
|
||||
public function wpNewComment($blogId, $userName, $password, $path, $struct)
|
||||
{
|
||||
@@ -1119,14 +1234,117 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
}
|
||||
|
||||
try {
|
||||
$this->singletonWidget('Widget_Feedback', NULL, $input, false);
|
||||
$commentWidget = $this->singletonWidget('Widget_Feedback', 'checkReferer=false', $input, false);
|
||||
$commentWidget->action();
|
||||
return intval($commentWidget->coid);
|
||||
} catch (Typecho_Exception $e) {
|
||||
return new IXR_Error(500, $e->getMessage());
|
||||
}
|
||||
|
||||
return true;
|
||||
return new IXR_Error(403, _t('无法添加评论'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取媒体文件
|
||||
*
|
||||
* @access public
|
||||
* @param integer $blogId
|
||||
* @param string $userName
|
||||
* @param string $password
|
||||
* @param struct $struct
|
||||
* @return boolean
|
||||
*/
|
||||
public function wpGetMediaLibrary($blogId, $userName, $password, $struct)
|
||||
{
|
||||
/** 检查权限*/
|
||||
if (!$this->checkAccess($userName, $password)) {
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
|
||||
$input = array();
|
||||
|
||||
if (!empty($struct['parent_id'])) {
|
||||
$input['parent'] = $struct['parent_id'];
|
||||
}
|
||||
|
||||
if (!empty($struct['mime_type'])) {
|
||||
$input['mime'] = $struct['mime_type'];
|
||||
}
|
||||
|
||||
$pageSize = 10;
|
||||
if (!empty($struct['number'])) {
|
||||
$pageSize = abs(intval($struct['number']));
|
||||
}
|
||||
|
||||
if (!empty($struct['offset'])) {
|
||||
$input['page'] = abs(intval($struct['offset']))+1;
|
||||
}
|
||||
|
||||
$attachments = $this->singletonWidget('Widget_Contents_Attachment_Admin', 'pageSize=' . $pageSize, $input, false);
|
||||
$attachmentsStruct = array();
|
||||
|
||||
while ($attachments->next()) {
|
||||
$attachmentsStruct[] = array(
|
||||
'attachment_id' => $attachments->cid,
|
||||
'date_created_gmt' => new IXR_Date($this->options->timezone + $attachments->created),
|
||||
'parent' => $attachments->parent,
|
||||
'link' => $attachments->attachment->url,
|
||||
'title' => $attachments->title,
|
||||
'caption' => $attachments->slug,
|
||||
'description' => $attachments->attachment->description,
|
||||
'metadata' => array(
|
||||
'file' => $attachments->attachment->path,
|
||||
'size' => $attachments->attachment->size,
|
||||
),
|
||||
'thumbnail' => $attachments->attachment->url,
|
||||
|
||||
);
|
||||
}
|
||||
return $attachmentsStruct;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取媒体文件
|
||||
*
|
||||
* @access public
|
||||
* @param integer $blogId
|
||||
* @param string $userName
|
||||
* @param string $password
|
||||
* @param int $attachmentId
|
||||
* @return boolean
|
||||
*/
|
||||
public function wpGetMediaItem($blogId, $userName, $password, $attachmentId)
|
||||
{
|
||||
/** 检查权限*/
|
||||
if (!$this->checkAccess($userName, $password)) {
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
|
||||
$attachment = $this->singletonWidget('Widget_Contents_Attachment_Edit', NULL, "cid={$attachmentId}");
|
||||
$struct = array(
|
||||
'attachment_id' => $attachment->cid,
|
||||
'date_created_gmt' => new IXR_Date($this->options->timezone + $attachment->created),
|
||||
'parent' => $attachment->parent,
|
||||
'link' => $attachment->attachment->url,
|
||||
'title' => $attachment->title,
|
||||
'caption' => $attachment->slug,
|
||||
'description' => $attachment->attachment->description,
|
||||
'metadata' => array(
|
||||
'file' => $attachment->attachment->path,
|
||||
'size' => $attachment->attachment->size,
|
||||
),
|
||||
'thumbnail' => $attachment->attachment->url,
|
||||
|
||||
);
|
||||
return $struct;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**about MetaWeblog API, you can see http://www.xmlrpc.com/metaWeblogApi*/
|
||||
/**
|
||||
* MetaWeblog API
|
||||
@@ -1306,7 +1524,7 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
'description' => $excerpt,
|
||||
'title' => $post->title,
|
||||
'link' => $post->permalink,
|
||||
'permalink' => $post->permalink,
|
||||
'permaLink' => $post->permalink,
|
||||
'categories' => $categories,
|
||||
'mt_excerpt' => $post->description,
|
||||
'mt_text_more' => $more,
|
||||
@@ -1363,10 +1581,11 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
'description' => $excerpt,
|
||||
'title' => $posts->title,
|
||||
'link' => $posts->permalink,
|
||||
'permalink' => $posts->permalink,
|
||||
'permaLink' => $posts->permalink,
|
||||
'categories' => $categories,
|
||||
'mt_excerpt' => $posts->description,
|
||||
'mt_text_more' => $more,
|
||||
'wp_more_text' => $more,
|
||||
'mt_allow_comments' => intval($posts->allowComment),
|
||||
'mt_allow_pings' => intval($posts->allowPing),
|
||||
'mt_keywords' => implode(', ', $tags),
|
||||
@@ -1378,6 +1597,10 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
'date_created_gmt' => new IXR_Date($posts->created),
|
||||
'post_status' => $this->typechoToWordpressStatus($posts->status, 'post'),
|
||||
'custom_fields' => array(),
|
||||
'wp_post_format'=>'standard',
|
||||
'date_modified'=>new IXR_Date($this->options->timezone + $posts->modified),
|
||||
'date_modified_gmt' => new IXR_Date($posts->modified),
|
||||
'wp_post_thumbnail' => '',
|
||||
'sticky' => 0
|
||||
);
|
||||
}
|
||||
@@ -1953,6 +2176,13 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
}
|
||||
}
|
||||
|
||||
public function log($value='')
|
||||
{
|
||||
$fp = fopen("log.txt", "a+");
|
||||
fwrite($fp,"[".date('Y-m-d H:i:s')."]\t".$value."\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 入口执行方法
|
||||
@@ -1962,6 +2192,9 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
|
||||
//$this->log($GLOBALS['HTTP_RAW_POST_DATA']);
|
||||
|
||||
if (isset($this->request->rsd)) {
|
||||
echo
|
||||
<<<EOF
|
||||
@@ -2018,6 +2251,9 @@ EOF;
|
||||
</manifest>
|
||||
EOF;
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
/** 直接把初始化放到这里 */
|
||||
new IXR_Server(array(
|
||||
/** WordPress API */
|
||||
@@ -2049,6 +2285,14 @@ EOF;
|
||||
'wp.editComment' => array($this, 'wpEditComment'),
|
||||
'wp.newComment' => array($this, 'wpNewComment'),
|
||||
'wp.getCommentStatusList' => array($this, 'wpGetCommentStatusList'),
|
||||
|
||||
/** New Wordpress API after 2.9.2 */
|
||||
'wp.getProfile' => array($this, 'wpGetProfile'),
|
||||
'wp.getPostFormats' => array($this, 'wpGetPostFormats'),
|
||||
'wp.getMediaLibrary' => array($this, 'wpGetMediaLibrary'),
|
||||
'wp.getMediaItem' => array($this, 'wpGetMediaItem'),
|
||||
'wp.editPost' => array($this, 'wpEditPost'),
|
||||
|
||||
|
||||
|
||||
/** Blogger API */
|
||||
@@ -2086,7 +2330,7 @@ EOF;
|
||||
'pingback.extensions.getPingbacks' => array($this,'pingbackExtensionsGetPingbacks'),
|
||||
|
||||
/** hook after */
|
||||
'hook.afterCall' => array($this, 'hookAfterCall'),
|
||||
'hook.afterCall' => array($this, 'hookAfterCall'),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user