@ -0,0 +1 @@ |
||||
config.inc.php |
@ -0,0 +1,102 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
$actionUrl = $security->getTokenUrl( |
||||
Typecho_Router::url('do', array('action' => 'backup', 'widget' => 'Backup'), |
||||
Typecho_Common::url('index.php', $options->rootUrl))); |
||||
|
||||
$backupFiles = Typecho_Widget::widget('Widget_Backup')->listFiles(); |
||||
?> |
||||
|
||||
<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 col-tb-8"> |
||||
<div id="typecho-welcome"> |
||||
<form action="<?php echo $actionUrl; ?>" method="post">
|
||||
<h3><?php _e('备份您的数据'); ?></h3>
|
||||
<ul> |
||||
<li><?php _e('此备份操作仅包含<strong>内容数据</strong>, 并不会涉及任何<strong>设置信息</strong>'); ?></li>
|
||||
<li><?php _e('如果您的数据量过大, 为了避免操作超时, 建议您直接使用数据库提供的备份工具备份数据'); ?></li>
|
||||
<li><strong class="warning"><?php _e('为了缩小备份文件体积, 建议您在备份前删除不必要的数据'); ?></strong></li>
|
||||
</ul> |
||||
<p><button class="btn primary" type="submit"><?php _e('开始备份 »'); ?></button></p>
|
||||
<input tabindex="1" type="hidden" name="do" value="export"> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
|
||||
<div id="backup-secondary" class="col-mb-12 col-tb-4" role="form"> |
||||
<h3><?php _e('恢复数据'); ?></h3>
|
||||
<ul class="typecho-option-tabs clearfix"> |
||||
<li class="active w-50"><a href="#from-upload">上传</a></li> |
||||
<li class="w-50"><a href="#from-server">从服务器</a></li> |
||||
</ul> |
||||
|
||||
<form action="<?php echo $actionUrl; ?>" id="from-upload" class="tab-content" method="post" enctype="multipart/form-data">
|
||||
<ul class="typecho-option"> |
||||
<li> |
||||
<input tabindex="2" id="backup-upload-file" name="file" type="file" class="file"> |
||||
</li> |
||||
</ul> |
||||
<ul class="typecho-option typecho-option-submit"> |
||||
<li> |
||||
<button tabindex="3" type="submit" class="btn primary"><?php _e('上传并恢复 »'); ?></button>
|
||||
<input type="hidden" name="do" value="import"> |
||||
</li> |
||||
</ul> |
||||
</form> |
||||
|
||||
<form action="<?php echo $actionUrl; ?>" id="from-server" class="tab-content hidden" method="post">
|
||||
<ul class="typecho-option"> |
||||
<li> |
||||
<?php if (empty($backupFiles)): ?> |
||||
<p class="description"><?php _e('将备份文件手动上传至服务器的 %s 目录下后, 这里会出现文件选项', __TYPECHO_BACKUP_DIR__); ?></p>
|
||||
<?php else: ?> |
||||
<label class="typecho-label" for="backup-select-file"><?php _e('选择一个备份文件恢复数据'); ?></label>
|
||||
<select name="file" id="backup-select-file"> |
||||
<?php foreach ($backupFiles as $file): ?> |
||||
<option value="<?php echo $file; ?>"><?php echo $file; ?></option>
|
||||
<?php endforeach; ?> |
||||
</select> |
||||
<?php endif; ?> |
||||
</li> |
||||
</ul> |
||||
<ul class="typecho-option typecho-option-submit"> |
||||
<li> |
||||
<button tabindex="5" type="submit" class="btn primary"><?php _e('选择并恢复 »'); ?></button>
|
||||
<input type="hidden" name="do" value="import"> |
||||
</li> |
||||
</ul> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
?> |
||||
<script> |
||||
$('#backup-secondary .typecho-option-tabs li').click(function() { |
||||
$('#backup-secondary .typecho-option-tabs li').removeClass('active'); |
||||
$(this).addClass('active'); |
||||
$(this).parents('#backup-secondary').find('.tab-content').addClass('hidden'); |
||||
|
||||
var selected_tab = $(this).find('a').attr('href'); |
||||
$(selected_tab).removeClass('hidden'); |
||||
|
||||
return false; |
||||
}); |
||||
|
||||
$('#backup-secondary form').submit(function (e) { |
||||
if (!confirm('<?php _e('恢复操作将清除所有现有数据, 是否继续?'); ?>')) {
|
||||
return false; |
||||
} |
||||
}); |
||||
</script> |
||||
<?php include 'footer.php'; ?> |
@ -0,0 +1,23 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<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_Metas_Category_Edit')->form()->render(); ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,105 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<script src="<?php $options->adminStaticUrl('js', 'jquery.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminStaticUrl('js', 'jquery-ui.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminStaticUrl('js', 'typecho.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script> |
||||
(function () { |
||||
$(document).ready(function() { |
||||
// 处理消息机制 |
||||
(function () { |
||||
var prefix = '<?php echo Typecho_Cookie::getPrefix(); ?>',
|
||||
cookies = { |
||||
notice : $.cookie(prefix + '__typecho_notice'), |
||||
noticeType : $.cookie(prefix + '__typecho_notice_type'), |
||||
highlight : $.cookie(prefix + '__typecho_notice_highlight') |
||||
}, |
||||
path = '<?php echo Typecho_Cookie::getPath(); ?>';
|
||||
|
||||
if (!!cookies.notice && 'success|notice|error'.indexOf(cookies.noticeType) >= 0) { |
||||
var head = $('.typecho-head-nav'), |
||||
p = $('<div class="message popup ' + cookies.noticeType + '">' |
||||
+ '<ul><li>' + $.parseJSON(cookies.notice).join('</li><li>') |
||||
+ '</li></ul></div>'), offset = 0; |
||||
|
||||
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'; |
||||
|
||||
if (t.hasClass('error')) { |
||||
color = '#FBC2C4'; |
||||
} else if (t.hasClass('notice')) { |
||||
color = '#FFD324'; |
||||
} |
||||
|
||||
t.effect('highlight', {color : color}) |
||||
.delay(5000).fadeOut(function () { |
||||
$(this).remove(); |
||||
}); |
||||
}); |
||||
|
||||
|
||||
$.cookie(prefix + '__typecho_notice', null, {path : path}); |
||||
$.cookie(prefix + '__typecho_notice_type', null, {path : path}); |
||||
} |
||||
|
||||
if (cookies.highlight) { |
||||
$('#' + cookies.highlight).effect('highlight', 1000); |
||||
$.cookie(prefix + '__typecho_notice_highlight', null, {path : path}); |
||||
} |
||||
})(); |
||||
|
||||
|
||||
// 导航菜单 tab 聚焦时展开下拉菜单 |
||||
(function () { |
||||
$('#typecho-nav-list').find('.parent a').focus(function() { |
||||
$('#typecho-nav-list').find('.child').hide(); |
||||
$(this).parents('.root').find('.child').show(); |
||||
}); |
||||
$('.operate').find('a').focus(function() { |
||||
$('#typecho-nav-list').find('.child').hide(); |
||||
}); |
||||
})(); |
||||
|
||||
|
||||
if ($('.typecho-login').length == 0) { |
||||
$('a').each(function () { |
||||
var t = $(this), href = t.attr('href'); |
||||
|
||||
if ((href && href[0] == '#') |
||||
|| /^<?php echo preg_quote($options->adminUrl, '/'); ?>.*$/.exec(href)
|
||||
|| /^<?php echo substr(preg_quote(Typecho_Common::url('s', $options->index), '/'), 0, -1); ?>action\/[_a-zA-Z0-9\/]+.*$/.exec(href)) {
|
||||
return; |
||||
} |
||||
|
||||
t.attr('target', '_blank'); |
||||
}); |
||||
} |
||||
}); |
||||
})(); |
||||
</script> |
@ -0,0 +1,59 @@ |
||||
<?php |
||||
if (!defined('__DIR__')) { |
||||
define('__DIR__', dirname(__FILE__)); |
||||
} |
||||
|
||||
define('__TYPECHO_ADMIN__', true); |
||||
|
||||
/** 载入配置文件 */ |
||||
if (!defined('__TYPECHO_ROOT_DIR__') && !@include_once __DIR__ . '/../config.inc.php') { |
||||
file_exists(__DIR__ . '/../install.php') ? header('Location: ../install.php') : print('Missing Config File'); |
||||
exit; |
||||
} |
||||
|
||||
/** 初始化组件 */ |
||||
Typecho_Widget::widget('Widget_Init'); |
||||
|
||||
/** 注册一个初始化插件 */ |
||||
Typecho_Plugin::factory('admin/common.php')->begin(); |
||||
|
||||
Typecho_Widget::widget('Widget_Options')->to($options); |
||||
Typecho_Widget::widget('Widget_User')->to($user); |
||||
Typecho_Widget::widget('Widget_Security')->to($security); |
||||
Typecho_Widget::widget('Widget_Menu')->to($menu); |
||||
|
||||
/** 初始化上下文 */ |
||||
$request = $options->request; |
||||
$response = $options->response; |
||||
|
||||
/** 检测是否是第一次登录 */ |
||||
$currentMenu = $menu->getCurrentMenu(); |
||||
list($prefixVersion, $suffixVersion) = explode('/', $options->version); |
||||
$params = parse_url($currentMenu[2]); |
||||
$adminFile = basename($params['path']); |
||||
|
||||
if (!$user->logged && !Typecho_Cookie::get('__typecho_first_run') && !empty($currentMenu)) { |
||||
|
||||
if ('welcome.php' != $adminFile) { |
||||
$response->redirect(Typecho_Common::url('welcome.php', $options->adminUrl)); |
||||
} else { |
||||
Typecho_Cookie::set('__typecho_first_run', 1); |
||||
} |
||||
|
||||
} else { |
||||
|
||||
/** 检测版本是否升级 */ |
||||
if ($user->pass('administrator', true) && !empty($currentMenu)) { |
||||
$mustUpgrade = (!defined('Typecho_Common::VERSION') || version_compare(str_replace('/', '.', Typecho_Common::VERSION), |
||||
str_replace('/', '.', $options->version), '>')); |
||||
|
||||
if ($mustUpgrade && 'upgrade.php' != $adminFile && 'backup.php' != $adminFile) { |
||||
$response->redirect(Typecho_Common::url('upgrade.php', $options->adminUrl)); |
||||
} else if (!$mustUpgrade && 'upgrade.php' == $adminFile) { |
||||
$response->redirect($options->adminUrl); |
||||
} else if (!$mustUpgrade && 'welcome.php' == $adminFile && $user->logged) { |
||||
$response->redirect($options->adminUrl); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,13 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<div class="typecho-foot" role="contentinfo"> |
||||
<div class="copyright"> |
||||
<a href="http://typecho.org" class="i-logo-s">Typecho</a> |
||||
<p><?php _e('由 <a href="http://typecho.org">%s</a> 强力驱动, 版本 %s (%s)', $options->software, $prefixVersion, $suffixVersion); ?></p>
|
||||
</div> |
||||
<nav class="resource"> |
||||
<a href="http://docs.typecho.org"><?php _e('帮助文档'); ?></a> •
|
||||
<a href="http://forum.typecho.org"><?php _e('支持论坛'); ?></a> •
|
||||
<a href="https://github.com/typecho/typecho/issues"><?php _e('报告错误'); ?></a> •
|
||||
<a href="http://extends.typecho.org"><?php _e('资源下载'); ?></a>
|
||||
</nav> |
||||
</div> |
@ -0,0 +1 @@ |
||||
/*!normalize.css v2.1.3 | MIT License | git.io/normalize */ article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden],template{display:none;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}a{background:transparent;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:.67em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C" "\201D" "\2018" "\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:0;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em;}legend{border:0;padding:0;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;} |
@ -0,0 +1,44 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<script> |
||||
$(document).ready(function () { |
||||
// 自定义字段 |
||||
$('#custom-field-expand').click(function() { |
||||
var btn = $('i', this); |
||||
if (btn.hasClass('i-caret-right')) { |
||||
btn.removeClass('i-caret-right').addClass('i-caret-down'); |
||||
} else { |
||||
btn.removeClass('i-caret-down').addClass('i-caret-right'); |
||||
} |
||||
$(this).parent().toggleClass('fold'); |
||||
return false; |
||||
}); |
||||
|
||||
function attachDeleteEvent (el) { |
||||
$('button.btn-xs', el).click(function () { |
||||
if (confirm('<?php _e('确认要删除此字段吗?'); ?>')) {
|
||||
$(this).parents('tr').fadeOut(function () { |
||||
$(this).remove(); |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
$('#custom-field table tbody tr').each(function () { |
||||
attachDeleteEvent(this); |
||||
}); |
||||
|
||||
$('#custom-field button.operate-add').click(function () { |
||||
var html = '<tr><td><input type="text" name="fieldNames[]" placeholder="<?php _e('字段名称'); ?>" class="text-s w-100"></td>'
|
||||
+ '<td><select name="fieldTypes[]" id="">' |
||||
+ '<option value="str"><?php _e('字符'); ?></option>'
|
||||
+ '<option value="int"><?php _e('整数'); ?></option>'
|
||||
+ '<option value="float"><?php _e('小数'); ?></option>'
|
||||
+ '</select></td>' |
||||
+ '<td><textarea name="fieldValues[]" placeholder="<?php _e('字段值'); ?>" class="text-s w-100" rows="2"></textarea></td>'
|
||||
+ '<td><button type="button" class="btn btn-xs"><?php _e('删除'); ?></button></td></tr>',
|
||||
el = $(html).hide().appendTo('#custom-field table tbody').fadeIn(); |
||||
|
||||
attachDeleteEvent(el); |
||||
}); |
||||
}); |
||||
</script> |
@ -0,0 +1,73 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<?php |
||||
$fields = isset($post) ? $post->getFieldItems() : $page->getFieldItems(); |
||||
$defaultFields = isset($post) ? $post->getDefaultFieldItems() : $page->getDefaultFieldItems(); |
||||
?> |
||||
<section id="custom-field" class="typecho-post-option<?php if (empty($defaultFields) && empty($fields)): ?> fold<?php endif; ?>">
|
||||
<label id="custom-field-expand" class="typecho-label"><a href="##"><i class="i-caret-right"></i> <?php _e('自定义字段'); ?></a></label>
|
||||
<table class="typecho-list-table mono"> |
||||
<colgroup> |
||||
<col width="25%"/> |
||||
<col width="10%"/> |
||||
<col width="55%"/> |
||||
<col width="10%"/> |
||||
</colgroup> |
||||
<?php foreach ($defaultFields as $field): ?> |
||||
<?php list ($label, $input) = $field; ?> |
||||
<tr> |
||||
<td><?php $label->render(); ?></td>
|
||||
<td colspan="3"><?php $input->render(); ?></td>
|
||||
</tr> |
||||
<?php endforeach; ?> |
||||
<?php foreach ($fields as $field): ?> |
||||
<tr> |
||||
<td> |
||||
<label for="fieldname" class="sr-only"><?php _e('字段名称'); ?></label>
|
||||
<input type="text" name="fieldNames[]" value="<?php echo htmlspecialchars($field['name']); ?>" id="fieldname" class="text-s w-100">
|
||||
</td> |
||||
<td> |
||||
<label for="fieldtype" class="sr-only"><?php _e('字段类型'); ?></label>
|
||||
<select name="fieldTypes[]" id="fieldtype"> |
||||
<option value="str"<?php if ('str' == $field['type']): ?> selected<?php endif; ?>><?php _e('字符'); ?></option>
|
||||
<option value="int"<?php if ('int' == $field['type']): ?> selected<?php endif; ?>><?php _e('整数'); ?></option>
|
||||
<option value="float"<?php if ('float' == $field['type']): ?> selected<?php endif; ?>><?php _e('小数'); ?></option>
|
||||
</select> |
||||
</td> |
||||
<td> |
||||
<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'] . '_value']); ?></textarea>
|
||||
</td> |
||||
<td> |
||||
<button type="button" class="btn btn-xs"><?php _e('删除'); ?></button>
|
||||
</td> |
||||
</tr> |
||||
<?php endforeach; ?> |
||||
<?php if (empty($defaultFields) && empty($fields)): ?> |
||||
<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">
|
||||
</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>
|
||||
</select> |
||||
</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>
|
||||
</td> |
||||
</tr> |
||||
<?php endif; ?> |
||||
</table> |
||||
<div class="description clearfix"> |
||||
<button type="button" class="btn btn-xs operate-add"><?php _e('+添加字段'); ?></button>
|
||||
<?php _e('自定义字段可以扩展你的模板功能, 使用方法参见 <a href="http://docs.typecho.org/help/custom-fields">帮助文档</a>'); ?> |
||||
</div> |
||||
</section> |
@ -0,0 +1,336 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<?php $content = !empty($post) ? $post : $page; if ($options->markdown): ?> |
||||
<script src="<?php $options->adminStaticUrl('js', 'hyperdown.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminStaticUrl('js', 'pagedown.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminStaticUrl('js', 'pagedown-extra.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminStaticUrl('js', 'diff.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script> |
||||
$(document).ready(function () { |
||||
var textarea = $('#text'), |
||||
toolbar = $('<div class="editor" id="wmd-button-bar" />').insertBefore(textarea.parent()), |
||||
preview = $('<div id="wmd-preview" class="wmd-hidetab" />').insertAfter('.editor'); |
||||
|
||||
var options = {}, isMarkdown = <?php echo intval($content->isMarkdown || !$content->have()); ?>;
|
||||
|
||||
options.strings = { |
||||
bold: '<?php _e('加粗'); ?> <strong> Ctrl+B',
|
||||
boldexample: '<?php _e('加粗文字'); ?>',
|
||||
|
||||
italic: '<?php _e('斜体'); ?> <em> Ctrl+I',
|
||||
italicexample: '<?php _e('斜体文字'); ?>',
|
||||
|
||||
link: '<?php _e('链接'); ?> <a> Ctrl+L',
|
||||
linkdescription: '<?php _e('请输入链接描述'); ?>',
|
||||
|
||||
quote: '<?php _e('引用'); ?> <blockquote> Ctrl+Q',
|
||||
quoteexample: '<?php _e('引用文字'); ?>',
|
||||
|
||||
code: '<?php _e('代码'); ?> <pre><code> Ctrl+K',
|
||||
codeexample: '<?php _e('请输入代码'); ?>',
|
||||
|
||||
image: '<?php _e('图片'); ?> <img> Ctrl+G',
|
||||
imagedescription: '<?php _e('请输入图片描述'); ?>',
|
||||
|
||||
olist: '<?php _e('数字列表'); ?> <ol> Ctrl+O',
|
||||
ulist: '<?php _e('普通列表'); ?> <ul> Ctrl+U',
|
||||
litem: '<?php _e('列表项目'); ?>',
|
||||
|
||||
heading: '<?php _e('标题'); ?> <h1>/<h2> Ctrl+H',
|
||||
headingexample: '<?php _e('标题文字'); ?>',
|
||||
|
||||
hr: '<?php _e('分割线'); ?> <hr> Ctrl+R',
|
||||
more: '<?php _e('摘要分割线'); ?> <!--more--> Ctrl+M',
|
||||
|
||||
undo: '<?php _e('撤销'); ?> - Ctrl+Z',
|
||||
redo: '<?php _e('重做'); ?> - Ctrl+Y',
|
||||
redomac: '<?php _e('重做'); ?> - Ctrl+Shift+Z',
|
||||
|
||||
fullscreen: '<?php _e('全屏'); ?> - Ctrl+J',
|
||||
exitFullscreen: '<?php _e('退出全屏'); ?> - Ctrl+E',
|
||||
fullscreenUnsupport: '<?php _e('此浏览器不支持全屏操作'); ?>',
|
||||
|
||||
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('确定'); ?>',
|
||||
cancel: '<?php _e('取消'); ?>',
|
||||
|
||||
help: '<?php _e('Markdown语法帮助'); ?>'
|
||||
}; |
||||
|
||||
var converter = new HyperDown(), |
||||
editor = new Markdown.Editor(converter, '', options), |
||||
diffMatch = new diff_match_patch(), last = '', preview = $('#wmd-preview'), |
||||
mark = '@mark' + Math.ceil(Math.random() * 100000000) + '@', |
||||
span = '<span class="diff" />', |
||||
cache = {}; |
||||
|
||||
// 修正白名单 |
||||
converter.enableHtml(true); |
||||
converter.commonWhiteList += '|img|cite|embed|iframe'; |
||||
converter.specialWhiteList = $.extend(converter.specialWhiteList, { |
||||
'ol' : 'ol|li', |
||||
'ul' : 'ul|li', |
||||
'blockquote' : 'blockquote', |
||||
'pre' : 'pre|code' |
||||
}); |
||||
|
||||
converter.hook('beforeParseInline', function (html) { |
||||
return html.replace(/^\s*<!\-\-\s*more\s*\-\->\s*$/, function () { |
||||
return converter.makeHolder('<!--more-->'); |
||||
}); |
||||
}); |
||||
|
||||
// 自动跟随 |
||||
converter.hook('makeHtml', function (html) { |
||||
html = html.replace('<p><!--more--></p>', '<!--more-->'); |
||||
|
||||
if (html.indexOf('<!--more-->') > 0) { |
||||
var parts = html.split(/\s*<\!\-\-more\-\->\s*/), |
||||
summary = parts.shift(), |
||||
details = parts.join(''); |
||||
|
||||
html = '<div class="summary">' + summary + '</div>' |
||||
+ '<div class="details">' + details + '</div>'; |
||||
} |
||||
|
||||
|
||||
var diffs = diffMatch.diff_main(last, html); |
||||
last = html; |
||||
|
||||
if (diffs.length > 0) { |
||||
var stack = [], markStr = mark; |
||||
|
||||
for (var i = 0; i < diffs.length; i ++) { |
||||
var diff = diffs[i], op = diff[0], str = diff[1] |
||||
sp = str.lastIndexOf('<'), ep = str.lastIndexOf('>'); |
||||
|
||||
if (op != 0) { |
||||
if (sp >=0 && sp > ep) { |
||||
if (op > 0) { |
||||
stack.push(str.substring(0, sp) + markStr + str.substring(sp)); |
||||
} else { |
||||
var lastStr = stack[stack.length - 1], lastSp = lastStr.lastIndexOf('<'); |
||||
stack[stack.length - 1] = lastStr.substring(0, lastSp) + markStr + lastStr.substring(lastSp); |
||||
} |
||||
} else { |
||||
if (op > 0) { |
||||
stack.push(str + markStr); |
||||
} else { |
||||
stack.push(markStr); |
||||
} |
||||
} |
||||
|
||||
markStr = ''; |
||||
} else { |
||||
stack.push(str); |
||||
} |
||||
} |
||||
|
||||
html = stack.join(''); |
||||
|
||||
if (!markStr) { |
||||
var pos = html.indexOf(mark), prev = html.substring(0, pos), |
||||
next = html.substr(pos + mark.length), |
||||
sp = prev.lastIndexOf('<'), ep = prev.lastIndexOf('>'); |
||||
|
||||
if (sp >= 0 && sp > ep) { |
||||
html = prev.substring(0, sp) + span + prev.substring(sp) + next; |
||||
} else { |
||||
html = prev + span + next; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// 替换img |
||||
html = html.replace(/<(img)\s+([^>]*)\s*src="([^"]+)"([^>]*)>/ig, function (all, tag, prefix, src, suffix) { |
||||
if (!cache[src]) { |
||||
cache[src] = false; |
||||
} else { |
||||
return '<span class="cache" data-width="' + cache[src][0] + '" data-height="' + cache[src][1] + '" ' |
||||
+ 'style="background:url(' + src + ') no-repeat left top; width:' |
||||
+ cache[src][0] + 'px; height:' + cache[src][1] + 'px; display: inline-block; max-width: 100%;' |
||||
+ '-webkit-background-size: contain;-moz-background-size: contain;-o-background-size: contain;background-size: contain;" />'; |
||||
} |
||||
|
||||
return all; |
||||
}); |
||||
|
||||
// 替换block |
||||
html = html.replace(/<(iframe|embed)\s+([^>]*)>/ig, function (all, tag, src) { |
||||
if (src[src.length - 1] == '/') { |
||||
src = src.substring(0, src.length - 1); |
||||
} |
||||
|
||||
return '<div style="background: #ddd; height: 40px; overflow: hidden; line-height: 40px; text-align: center; font-size: 12px; color: #777">' |
||||
+ tag + ' : ' + $.trim(src) + '</div>'; |
||||
}); |
||||
|
||||
return html; |
||||
}); |
||||
|
||||
function cacheResize() { |
||||
var t = $(this), w = parseInt(t.data('width')), h = parseInt(t.data('height')), |
||||
ow = t.width(); |
||||
|
||||
t.height(h * ow / w); |
||||
} |
||||
|
||||
var to; |
||||
editor.hooks.chain('onPreviewRefresh', function () { |
||||
var diff = $('.diff', preview), scrolled = false; |
||||
|
||||
if (to) { |
||||
clearTimeout(to); |
||||
} |
||||
|
||||
$('img', preview).load(function () { |
||||
var t = $(this), src = t.attr('src'); |
||||
|
||||
if (scrolled) { |
||||
preview.scrollTo(diff, { |
||||
offset : - 50 |
||||
}); |
||||
} |
||||
|
||||
if (!!src && !cache[src]) { |
||||
cache[src] = [this.width, this.height]; |
||||
} |
||||
}); |
||||
|
||||
$('.cache', preview).resize(cacheResize).each(cacheResize); |
||||
|
||||
var changed = $('.diff', preview).parent(); |
||||
if (!changed.is(preview)) { |
||||
changed.css('background-color', 'rgba(255,230,0,0.5)'); |
||||
to = setTimeout(function () { |
||||
changed.css('background-color', 'transparent'); |
||||
}, 4500); |
||||
} |
||||
|
||||
if (diff.length > 0) { |
||||
var p = diff.position(), lh = diff.parent().css('line-height'); |
||||
lh = !!lh ? parseInt(lh) : 0; |
||||
|
||||
if (p.top < 0 || p.top > preview.height() - lh) { |
||||
preview.scrollTo(diff, { |
||||
offset : - 50 |
||||
}); |
||||
scrolled = true; |
||||
} |
||||
} |
||||
}); |
||||
|
||||
<?php Typecho_Plugin::factory('admin/editor-js.php')->markdownEditor($content); ?> |
||||
|
||||
var input = $('#text'), th = textarea.height(), ph = preview.height(), |
||||
uploadBtn = $('<button type="button" id="btn-fullscreen-upload" class="btn btn-link">' |
||||
+ '<i class="i-upload"><?php _e('附件'); ?></i></button>')
|
||||
.prependTo('.submit .right') |
||||
.click(function() { |
||||
$('a', $('.typecho-option-tabs li').not('.active')).trigger('click'); |
||||
return false; |
||||
}); |
||||
|
||||
$('.typecho-option-tabs li').click(function () { |
||||
uploadBtn.find('i').toggleClass('i-upload-active', |
||||
$('#tab-files-btn', this).length > 0); |
||||
}); |
||||
|
||||
editor.hooks.chain('enterFakeFullScreen', function () { |
||||
th = textarea.height(); |
||||
ph = preview.height(); |
||||
$(document.body).addClass('fullscreen'); |
||||
var h = $(window).height() - toolbar.outerHeight(); |
||||
|
||||
textarea.css('height', h); |
||||
preview.css('height', h); |
||||
}); |
||||
|
||||
editor.hooks.chain('enterFullScreen', function () { |
||||
$(document.body).addClass('fullscreen'); |
||||
|
||||
var h = window.screen.height - toolbar.outerHeight(); |
||||
textarea.css('height', h); |
||||
preview.css('height', h); |
||||
}); |
||||
|
||||
editor.hooks.chain('exitFullScreen', function () { |
||||
$(document.body).removeClass('fullscreen'); |
||||
textarea.height(th); |
||||
preview.height(ph); |
||||
}); |
||||
|
||||
function initMarkdown() { |
||||
editor.run(); |
||||
|
||||
var imageButton = $('#wmd-image-button'), |
||||
linkButton = $('#wmd-link-button'); |
||||
|
||||
Typecho.insertFileToEditor = function (file, url, isImage) { |
||||
var button = isImage ? imageButton : linkButton; |
||||
|
||||
options.strings[isImage ? 'imagename' : 'linkname'] = file; |
||||
button.trigger('click'); |
||||
|
||||
var checkDialog = setInterval(function () { |
||||
if ($('.wmd-prompt-dialog').length > 0) { |
||||
$('.wmd-prompt-dialog input').val(url).select(); |
||||
clearInterval(checkDialog); |
||||
checkDialog = null; |
||||
} |
||||
}, 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>'),
|
||||
editarea = $(textarea.parent()).attr("id", "wmd-editarea"); |
||||
|
||||
$(".wmd-edittab a").click(function() { |
||||
$(".wmd-edittab a").removeClass('active'); |
||||
$(this).addClass("active"); |
||||
$("#wmd-editarea, #wmd-preview").addClass("wmd-hidetab"); |
||||
|
||||
var selected_tab = $(this).attr("href"), |
||||
selected_el = $(selected_tab).removeClass("wmd-hidetab"); |
||||
|
||||
// 预览时隐藏编辑器按钮 |
||||
if (selected_tab == "#wmd-preview") { |
||||
$("#wmd-button-row").addClass("wmd-visualhide"); |
||||
} else { |
||||
$("#wmd-button-row").removeClass("wmd-visualhide"); |
||||
} |
||||
|
||||
// 预览和编辑窗口高度一致 |
||||
$("#wmd-preview").outerHeight($("#wmd-editarea").innerHeight()); |
||||
|
||||
return false; |
||||
}); |
||||
} |
||||
|
||||
if (isMarkdown) { |
||||
initMarkdown(); |
||||
} else { |
||||
var notice = $('<div class="message notice"><?php _e('这篇文章不是由Markdown语法创建的, 继续使用Markdown编辑它吗?'); ?> '
|
||||
+ '<button class="btn btn-xs primary yes"><?php _e('是'); ?></button> '
|
||||
+ '<button class="btn btn-xs no"><?php _e('否'); ?></button></div>')
|
||||
.hide().insertBefore(textarea).slideDown(); |
||||
|
||||
$('.yes', notice).click(function () { |
||||
notice.remove(); |
||||
$('<input type="hidden" name="markdown" value="1" />').appendTo('.submit'); |
||||
initMarkdown(); |
||||
}); |
||||
|
||||
$('.no', notice).click(function () { |
||||
notice.remove(); |
||||
}); |
||||
} |
||||
}); |
||||
</script> |
||||
<?php endif; ?> |
||||
|
@ -0,0 +1,13 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
|
||||
$panel = $request->get('panel'); |
||||
$panelTable = unserialize($options->panelTable); |
||||
|
||||
if (!isset($panelTable['file']) || !in_array(urlencode($panel), $panelTable['file'])) { |
||||
throw new Typecho_Plugin_Exception(_t('页面不存在'), 404); |
||||
} |
||||
|
||||
list ($pluginName, $file) = explode('/', trim($panel, '/'), 2); |
||||
|
||||
require_once $options->pluginDir($pluginName) . '/' . $panel; |
@ -0,0 +1,212 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<?php |
||||
if (isset($post) && $post instanceof Typecho_Widget && $post->have()) { |
||||
$fileParentContent = $post; |
||||
} else if (isset($page) && $page instanceof Typecho_Widget && $page->have()) { |
||||
$fileParentContent = $page; |
||||
} |
||||
|
||||
$phpMaxFilesize = function_exists('ini_get') ? trim(ini_get('upload_max_filesize')) : 0; |
||||
|
||||
if (preg_match("/^([0-9]+)([a-z]{1,2})$/i", $phpMaxFilesize, $matches)) { |
||||
$phpMaxFilesize = strtolower($matches[1] . $matches[2] . (1 == strlen($matches[2]) ? 'b' : '')); |
||||
} |
||||
?> |
||||
|
||||
<script src="<?php $options->adminStaticUrl('js', 'moxie.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminStaticUrl('js', 'plupload.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script> |
||||
$(document).ready(function() { |
||||
function updateAttacmentNumber () { |
||||
var btn = $('#tab-files-btn'), |
||||
balloon = $('.balloon', btn), |
||||
count = $('#file-list li .insert').length; |
||||
|
||||
if (count > 0) { |
||||
if (!balloon.length) { |
||||
btn.html($.trim(btn.html()) + ' '); |
||||
balloon = $('<span class="balloon"></span>').appendTo(btn); |
||||
} |
||||
|
||||
balloon.html(count); |
||||
} else if (0 == count && balloon.length > 0) { |
||||
balloon.remove(); |
||||
} |
||||
} |
||||
|
||||
$('.upload-area').bind({ |
||||
dragenter : function () { |
||||
$(this).parent().addClass('drag'); |
||||
}, |
||||
|
||||
dragover : function (e) { |
||||
$(this).parent().addClass('drag'); |
||||
}, |
||||
|
||||
drop : function () { |
||||
$(this).parent().removeClass('drag'); |
||||
}, |
||||
|
||||
dragend : function () { |
||||
$(this).parent().removeClass('drag'); |
||||
}, |
||||
|
||||
dragleave : function () { |
||||
$(this).parent().removeClass('drag'); |
||||
} |
||||
}); |
||||
|
||||
updateAttacmentNumber(); |
||||
|
||||
function fileUploadStart (file) { |
||||
$('<li id="' + file.id + '" class="loading">' |
||||
+ file.name + '</li>').appendTo('#file-list'); |
||||
} |
||||
|
||||
function fileUploadError (error) { |
||||
var file = error.file, code = error.code, word; |
||||
|
||||
switch (code) { |
||||
case plupload.FILE_SIZE_ERROR: |
||||
word = '<?php _e('文件大小超过限制'); ?>';
|
||||
break; |
||||
case plupload.FILE_EXTENSION_ERROR: |
||||
word = '<?php _e('文件扩展名不被支持'); ?>';
|
||||
break; |
||||
case plupload.FILE_DUPLICATE_ERROR: |
||||
word = '<?php _e('文件已经上传过'); ?>';
|
||||
break; |
||||
case plupload.HTTP_ERROR: |
||||
default: |
||||
word = '<?php _e('上传出现错误'); ?>';
|
||||
break; |
||||
} |
||||
|
||||
var fileError = '<?php _e('%s 上传失败'); ?>'.replace('%s', file.name),
|
||||
li, exist = $('#' + file.id); |
||||
|
||||
if (exist.length > 0) { |
||||
li = exist.removeClass('loading').html(fileError); |
||||
} else { |
||||
li = $('<li>' + fileError + '<br />' + word + '</li>').appendTo('#file-list'); |
||||
} |
||||
|
||||
li.effect('highlight', {color : '#FBC2C4'}, 2000, function () { |
||||
$(this).remove(); |
||||
}); |
||||
|
||||
// fix issue #341 |
||||
this.removeFile(file); |
||||
} |
||||
|
||||
var completeFile = null; |
||||
function fileUploadComplete (id, url, data) { |
||||
var li = $('#' + id).removeClass('loading').data('cid', data.cid) |
||||
.data('url', data.url) |
||||
.data('image', data.isImage) |
||||
.html('<input type="hidden" name="attachment[]" value="' + data.cid + '" />' |
||||
+ '<a class="insert" target="_blank" href="###" title="<?php _e('点击插入文件'); ?>">' + data.title + '</a><div class="info">' + data.bytes
|
||||
+ ' <a class="file" target="_blank" href="<?php $options->adminUrl('media.php'); ?>?cid='
|
||||
+ data.cid + '" title="<?php _e('编辑'); ?>"><i class="i-edit"></i></a>'
|
||||
+ ' <a class="delete" href="###" title="<?php _e('删除'); ?>"><i class="i-delete"></i></a></div>')
|
||||
.effect('highlight', 1000); |
||||
|
||||
attachInsertEvent(li); |
||||
attachDeleteEvent(li); |
||||
updateAttacmentNumber(); |
||||
|
||||
if (!completeFile) { |
||||
completeFile = data; |
||||
} |
||||
} |
||||
|
||||
$('#tab-files').bind('init', function () { |
||||
var uploader = new plupload.Uploader({ |
||||
browse_button : $('.upload-file').get(0), |
||||
url : '<?php $security->index('/action/upload' |
||||
. (isset($fileParentContent) ? '?cid=' . $fileParentContent->cid : '')); ?>', |
||||
runtimes : 'html5,flash,html4', |
||||
flash_swf_url : '<?php $options->adminStaticUrl('js', 'Moxie.swf'); ?>',
|
||||
drop_element : $('.upload-area').get(0), |
||||
filters : { |
||||
max_file_size : '<?php echo $phpMaxFilesize ?>',
|
||||
mime_types : [{'title' : '<?php _e('允许上传的文件'); ?>', 'extensions' : '<?php echo implode(',', $options->allowedAttachmentTypes); ?>'}],
|
||||
prevent_duplicates : true |
||||
}, |
||||
|
||||
init : { |
||||
FilesAdded : function (up, files) { |
||||
for (var i = 0; i < files.length; i ++) { |
||||
fileUploadStart(files[i]); |
||||
} |
||||
|
||||
completeFile = null; |
||||
uploader.start(); |
||||
}, |
||||
|
||||
UploadComplete : function () { |
||||
if (completeFile) { |
||||
Typecho.uploadComplete(completeFile); |
||||
} |
||||
}, |
||||
|
||||
FileUploaded : function (up, file, result) { |
||||
if (200 == result.status) { |
||||
var data = $.parseJSON(result.response); |
||||
|
||||
if (data) { |
||||
fileUploadComplete(file.id, data[0], data[1]); |
||||
uploader.removeFile(file); |
||||
return; |
||||
} |
||||
} |
||||
|
||||
fileUploadError.call(uploader, { |
||||
code : plupload.HTTP_ERROR, |
||||
file : file |
||||
}); |
||||
}, |
||||
|
||||
Error : function (up, error) { |
||||
fileUploadError.call(uploader, error); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
uploader.init(); |
||||
}); |
||||
|
||||
function attachInsertEvent (el) { |
||||
$('.insert', el).click(function () { |
||||
var t = $(this), p = t.parents('li'); |
||||
Typecho.insertFileToEditor(t.text(), p.data('url'), p.data('image')); |
||||
return false; |
||||
}); |
||||
} |
||||
|
||||
function attachDeleteEvent (el) { |
||||
var file = $('a.insert', el).text(); |
||||
$('.delete', el).click(function () { |
||||
if (confirm('<?php _e('确认要删除文件 %s 吗?'); ?>'.replace('%s', file))) {
|
||||
var cid = $(this).parents('li').data('cid'); |
||||
$.post('<?php $security->index('/action/contents-attachment-edit'); ?>',
|
||||
{'do' : 'delete', 'cid' : cid}, |
||||
function () { |
||||
$(el).fadeOut(function () { |
||||
$(this).remove(); |
||||
updateAttacmentNumber(); |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
return false; |
||||
}); |
||||
} |
||||
|
||||
$('#file-list li').each(function () { |
||||
attachInsertEvent(this); |
||||
attachDeleteEvent(this); |
||||
}); |
||||
}); |
||||
</script> |
||||
|
@ -0,0 +1,30 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
|
||||
<?php |
||||
if (isset($post) || isset($page)) { |
||||
$cid = isset($post) ? $post->cid : $page->cid; |
||||
|
||||
if ($cid) { |
||||
Typecho_Widget::widget('Widget_Contents_Attachment_Related', 'parentId=' . $cid)->to($attachment); |
||||
} else { |
||||
Typecho_Widget::widget('Widget_Contents_Attachment_Unattached')->to($attachment); |
||||
} |
||||
} |
||||
?> |
||||
|
||||
<div id="upload-panel" class="p"> |
||||
<div class="upload-area" draggable="true"><?php _e('拖放文件到这里<br>或者 %s选择文件上传%s', '<a href="###" class="upload-file">', '</a>'); ?></div>
|
||||
<ul id="file-list"> |
||||
<?php while ($attachment->next()): ?> |
||||
<li data-cid="<?php $attachment->cid(); ?>" data-url="<?php echo $attachment->attachment->url; ?>" data-image="<?php echo $attachment->attachment->isImage ? 1 : 0; ?>"><input type="hidden" name="attachment[]" value="<?php $attachment->cid(); ?>" />
|
||||
<a class="insert" title="<?php _e('点击插入文件'); ?>" href="###"><?php $attachment->title(); ?></a>
|
||||
<div class="info"> |
||||
<?php echo number_format(ceil($attachment->attachment->size / 1024)); ?> Kb
|
||||
<a class="file" target="_blank" href="<?php $options->adminUrl('media.php?cid=' . $attachment->cid); ?>" title="<?php _e('编辑'); ?>"><i class="i-edit"></i></a>
|
||||
<a href="###" class="delete" title="<?php _e('删除'); ?>"><i class="i-delete"></i></a>
|
||||
</div> |
||||
</li> |
||||
<?php endwhile; ?> |
||||
</ul> |
||||
</div> |
||||
|
@ -0,0 +1,6 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
</body> |
||||
</html> |
||||
<?php |
||||
/** 注册一个结束插件 */ |
||||
Typecho_Plugin::factory('admin/footer.php')->end(); |
@ -0,0 +1,26 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<script> |
||||
(function () { |
||||
$(document).ready(function () { |
||||
var error = $('.typecho-option .error:first'); |
||||
|
||||
if (error.length > 0) { |
||||
$('html,body').scrollTop(error.parents('.typecho-option').offset().top); |
||||
} |
||||
|
||||
$('form').submit(function () { |
||||
if (this.submitted) { |
||||
return false; |
||||
} else { |
||||
this.submitted = true; |
||||
} |
||||
}); |
||||
|
||||
$('label input[type=text]').click(function (e) { |
||||
var check = $('#' + $(this).parents('label').attr('for')); |
||||
check.prop('checked', true); |
||||
return false; |
||||
}); |
||||
}); |
||||
})(); |
||||
</script> |
@ -0,0 +1,31 @@ |
||||
<?php |
||||
if (!defined('__TYPECHO_ADMIN__')) { |
||||
exit; |
||||
} |
||||
|
||||
$header = '<link rel="stylesheet" href="' . Typecho_Common::url('normalize.css?v=' . $suffixVersion, $options->adminStaticUrl('css')) . '"> |
||||
<link rel="stylesheet" href="' . Typecho_Common::url('grid.css?v=' . $suffixVersion, $options->adminStaticUrl('css')) . '"> |
||||
<link rel="stylesheet" href="' . Typecho_Common::url('style.css?v=' . $suffixVersion, $options->adminStaticUrl('css')) . '"> |
||||
<!--[if lt IE 9]> |
||||
<script src="' . Typecho_Common::url('html5shiv.js?v=' . $suffixVersion, $options->adminStaticUrl('js')) . '"></script> |
||||
<script src="' . Typecho_Common::url('respond.js?v=' . $suffixVersion, $options->adminStaticUrl('js')) . '"></script> |
||||
<![endif]-->'; |
||||
|
||||
/** 注册一个初始化插件 */ |
||||
$header = Typecho_Plugin::factory('admin/header.php')->header($header); |
||||
|
||||
?><!DOCTYPE HTML> |
||||
<html class="no-js"> |
||||
<head> |
||||
<meta charset="<?php $options->charset(); ?>">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<meta name="renderer" content="webkit"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||
<title><?php _e('%s - %s - Powered by Typecho', $menu->title, $options->title); ?></title>
|
||||
<meta name="robots" content="noindex, nofollow"> |
||||
<?php echo $header; ?> |
||||
</head> |
||||
<body<?php if (isset($bodyClass)) {echo ' class="' . $bodyClass . '"';} ?>>
|
||||
<!--[if lt IE 9]> |
||||
<div class="message error browsehappy" role="dialog"><?php _e('当前网页 <strong>不支持</strong> 你正在使用的浏览器. 为了正常的访问, 请 <a href="http://browsehappy.com/">升级你的浏览器</a>'); ?>.</div>
|
||||
<![endif]--> |
After Width: | Height: | Size: 847 B |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,158 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat'); |
||||
?> |
||||
<div class="main"> |
||||
<div class="container typecho-dashboard"> |
||||
<?php include 'page-title.php'; ?> |
||||
<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); ?> |
||||
<br><?php _e('点击下面的链接快速开始:'); ?></p>
|
||||
|
||||
<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): ?> |
||||
<li><a href="<?php $options->adminUrl('manage-comments.php?status=waiting'); ?>"><?php _e('待审核的评论'); ?></a>
|
||||
<span class="balloon"><?php $stat->waitingCommentsNum(); ?></span>
|
||||
</li> |
||||
<?php elseif($stat->myWaitingCommentsNum > 0): ?> |
||||
<li><a href="<?php $options->adminUrl('manage-comments.php?status=waiting'); ?>"><?php _e('待审核评论'); ?></a>
|
||||
<span class="balloon"><?php $stat->myWaitingCommentsNum(); ?></span>
|
||||
</li> |
||||
<?php endif; ?> |
||||
<?php if($user->pass('editor', true) && 'on' == $request->get('__typecho_all_comments') && $stat->spamCommentsNum > 0): ?> |
||||
<li><a href="<?php $options->adminUrl('manage-comments.php?status=spam'); ?>"><?php _e('垃圾评论'); ?></a>
|
||||
<span class="balloon"><?php $stat->spamCommentsNum(); ?></span>
|
||||
</li> |
||||
<?php elseif($stat->mySpamCommentsNum > 0): ?> |
||||
<li><a href="<?php $options->adminUrl('manage-comments.php?status=spam'); ?>"><?php _e('垃圾评论'); ?></a>
|
||||
<span class="balloon"><?php $stat->mySpamCommentsNum(); ?></span>
|
||||
</li> |
||||
<?php endif; ?> |
||||
<?php if($user->pass('administrator', true)): ?> |
||||
<li><a href="<?php $options->adminUrl('themes.php'); ?>"><?php _e('更换外观'); ?></a></li>
|
||||
<li><a href="<?php $options->adminUrl('plugins.php'); ?>"><?php _e('插件管理'); ?></a></li>
|
||||
<li><a href="<?php $options->adminUrl('options-general.php'); ?>"><?php _e('系统设置'); ?></a></li>
|
||||
<?php endif; ?> |
||||
<?php endif; ?> |
||||
<!--<li><a href="<?php $options->adminUrl('profile.php'); ?>"><?php _e('更新我的资料'); ?></a></li>-->
|
||||
</ul> |
||||
<?php $version = Typecho_Cookie::get('__typecho_check_version'); ?> |
||||
<?php if ($version && $version['available']): ?> |
||||
<div class="update-check"> |
||||
<p class="message notice"> |
||||
<?php _e('您当前使用的版本是'); ?> <?php echo $version['current']; ?> →
|
||||
<strong><a href="<?php echo $version['link']; ?>"><?php _e('官方最新版本是'); ?> <?php echo $version['latest']; ?></a></strong>
|
||||
</p> |
||||
</div> |
||||
<?php endif; ?> |
||||
</div> |
||||
|
||||
<div class="col-mb-12 col-tb-4" role="complementary"> |
||||
<section class="latest-link"> |
||||
<h3><?php _e('最近发布的文章'); ?></h3>
|
||||
<?php Typecho_Widget::widget('Widget_Contents_Post_Recent', 'pageSize=10')->to($posts); ?> |
||||
<ul> |
||||
<?php if($posts->have()): ?> |
||||
<?php while($posts->next()): ?> |
||||
<li> |
||||
<span><?php $posts->date('n.j'); ?></span>
|
||||
<a href="<?php $posts->permalink(); ?>" class="title"><?php $posts->title(); ?></a>
|
||||
</li> |
||||
<?php endwhile; ?> |
||||
<?php else: ?> |
||||
<li><em><?php _e('暂时没有文章'); ?></em></li>
|
||||
<?php endif; ?> |
||||
</ul> |
||||
</section> |
||||
</div> |
||||
|
||||
<div class="col-mb-12 col-tb-4" role="complementary"> |
||||
<section class="latest-link"> |
||||
<h3><?php _e('最近得到的回复'); ?></h3>
|
||||
<ul> |
||||
<?php Typecho_Widget::widget('Widget_Comments_Recent', 'pageSize=10')->to($comments); ?> |
||||
<?php if($comments->have()): ?> |
||||
<?php while($comments->next()): ?> |
||||
<li> |
||||
<span><?php $comments->date('n.j'); ?></span>
|
||||
<a href="<?php $comments->permalink(); ?>" class="title"><?php $comments->author(true); ?></a>:
|
||||
<?php $comments->excerpt(35, '...'); ?> |
||||
</li> |
||||
<?php endwhile; ?> |
||||
<?php else: ?> |
||||
<li><?php _e('暂时没有回复'); ?></li>
|
||||
<?php endif; ?> |
||||
</ul> |
||||
</section> |
||||
</div> |
||||
|
||||
<div class="col-mb-12 col-tb-4" role="complementary"> |
||||
<section class="latest-link"> |
||||
<h3><?php _e('官方最新日志'); ?></h3>
|
||||
<div id="typecho-message"> |
||||
<ul> |
||||
<li><?php _e('读取中...'); ?></li>
|
||||
</ul> |
||||
</div> |
||||
</section> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
?> |
||||
|
||||
<script> |
||||
$(document).ready(function () { |
||||
var ul = $('#typecho-message ul'), cache = window.sessionStorage, |
||||
html = cache ? cache.getItem('feed') : '', |
||||
update = cache ? cache.getItem('update') : ''; |
||||
|
||||
if (!!html) { |
||||
ul.html(html); |
||||
} else { |
||||
html = ''; |
||||
$.get('<?php $options->index('/action/ajax?do=feed'); ?>', function (o) {
|
||||
for (var i = 0; i < o.length; i ++) { |
||||
var item = o[i]; |
||||
html += '<li><span>' + item.date + '</span> <a href="' + item.link + '" target="_blank">' + item.title |
||||
+ '</a></li>'; |
||||
} |
||||
|
||||
ul.html(html); |
||||
cache.setItem('feed', html); |
||||
}, 'json'); |
||||
} |
||||
|
||||
function applyUpdate(update) { |
||||
if (update.available) { |
||||
$('<div class="update-check message error"><p>' |
||||
+ '<?php _e('您当前使用的版本是 %s'); ?>'.replace('%s', update.current) + '<br />'
|
||||
+ '<strong><a href="' + update.link + '" target="_blank">' |
||||
+ '<?php _e('官方最新版本是 %s'); ?>'.replace('%s', update.latest) + '</a></strong></p></div>')
|
||||
.insertAfter('.typecho-page-title').effect('highlight'); |
||||
} |
||||
} |
||||
|
||||
if (!!update) { |
||||
applyUpdate($.parseJSON(update)); |
||||
} else { |
||||
$.get('<?php $options->index('/action/ajax?do=checkVersion'); ?>', function (o, status, resp) {
|
||||
applyUpdate(o); |
||||
cache.setItem('update', resp.responseText); |
||||
}, 'json'); |
||||
} |
||||
}); |
||||
|
||||
</script> |
||||
<?php include 'footer.php'; ?> |
@ -0,0 +1 @@ |
||||
(function(k,m){var g="3.7.0";var d=k.html5||{};var h=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;var c=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;var q;var i="_html5shiv";var a=0;var o={};var e;(function(){try{var t=m.createElement("a");t.innerHTML="<xyz></xyz>";q=("hidden" in t);e=t.childNodes.length==1||(function(){(m.createElement)("a");var v=m.createDocumentFragment();return(typeof v.cloneNode=="undefined"||typeof v.createDocumentFragment=="undefined"||typeof v.createElement=="undefined")}())}catch(u){q=true;e=true}}());function f(t,v){var w=t.createElement("p"),u=t.getElementsByTagName("head")[0]||t.documentElement;w.innerHTML="x<style>"+v+"</style>";return u.insertBefore(w.lastChild,u.firstChild)}function l(){var t=j.elements;return typeof t=="string"?t.split(" "):t}function p(t){var u=o[t[i]];if(!u){u={};a++;t[i]=a;o[a]=u}return u}function n(w,t,v){if(!t){t=m}if(e){return t.createElement(w)}if(!v){v=p(t)}var u;if(v.cache[w]){u=v.cache[w].cloneNode()}else{if(c.test(w)){u=(v.cache[w]=v.createElem(w)).cloneNode()}else{u=v.createElem(w)}}return u.canHaveChildren&&!h.test(w)?v.frag.appendChild(u):u}function r(v,x){if(!v){v=m}if(e){return v.createDocumentFragment()}x=x||p(v);var y=x.frag.cloneNode(),w=0,u=l(),t=u.length;for(;w<t;w++){y.createElement(u[w])}return y}function s(t,u){if(!u.cache){u.cache={};u.createElem=t.createElement;u.createFrag=t.createDocumentFragment;u.frag=u.createFrag()}t.createElement=function(v){if(!j.shivMethods){return u.createElem(v)}return n(v,t,u)};t.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/[\w\-]+/g,function(v){u.createElem(v);u.frag.createElement(v);return'c("'+v+'")'})+");return n}")(j,u.frag)}function b(t){if(!t){t=m}var u=p(t);if(j.shivCSS&&!q&&!u.hasCSS){u.hasCSS=!!f(t,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")}if(!e){s(t,u)}return t}var j={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:g,shivCSS:(d.shivCSS!==false),supportsUnknownElements:e,shivMethods:(d.shivMethods!==false),type:"default",shivDocument:b,createElement:n,createDocumentFragment:r};k.html5=j;b(m)}(this,document)); |
@ -0,0 +1,7 @@ |
||||
/* Respond.js v1.4.2: min/max-width media query polyfill |
||||
* Copyright 2013 Scott Jehl |
||||
* Licensed under MIT |
||||
* http://j.mp/respondjs */
|
||||
/* matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ |
||||
/* NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ |
||||
(function(a){a.matchMedia=a.matchMedia||function(f,g){var d,b=f.documentElement,c=b.firstElementChild||b.firstChild,e=f.createElement("body"),h=f.createElement("div");h.id="mq-test-1";h.style.cssText="position:absolute;top:-100em";e.style.background="none";e.appendChild(h);return function(i){h.innerHTML='­<style media="'+i+'"> #mq-test-1 { width: 42px; }</style>';b.insertBefore(e,c);d=h.offsetWidth===42;b.removeChild(e);return{matches:d,media:i}}}(a.document)})(this);(function(k){var u={};k.respond=u;u.update=function(){};var c=[],d=function(){var w=false;try{w=new k.XMLHttpRequest()}catch(A){w=new k.ActiveXObject("Microsoft.XMLHTTP")}return function(){return w}}(),n=function(w,B){var A=d();if(!A){return}A.open("GET",w,true);A.onreadystatechange=function(){if(A.readyState!==4||A.status!==200&&A.status!==304){return}B(A.responseText)};if(A.readyState===4){return}A.send(null)},r=function(w){return w.replace(u.regex.minmaxwh,"").match(u.regex.other)};u.ajax=n;u.queue=c;u.unsupportedmq=r;u.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g};u.mediaQueriesSupported=k.matchMedia&&k.matchMedia("only all")!==null&&k.matchMedia("only all").matches;if(u.mediaQueriesSupported){return}var z=k.document,t=z.documentElement,h=[],j=[],q=[],o={},g=30,e=z.getElementsByTagName("head")[0]||t,f=z.getElementsByTagName("base")[0],b=e.getElementsByTagName("link"),l,s,p,y=function(){var B,E=z.createElement("div"),w=z.body,D=t.style.fontSize,C=w&&w.style.fontSize,A=false;E.style.cssText="position:absolute;font-size:1em;width:1em";if(!w){w=A=z.createElement("body");w.style.background="none"}t.style.fontSize="100%";w.style.fontSize="100%";w.appendChild(E);if(A){t.insertBefore(w,t.firstChild)}B=E.offsetWidth;if(A){t.removeChild(w)}else{w.removeChild(E)}t.style.fontSize=D;if(C){w.style.fontSize=C}B=p=parseFloat(B);return B},i=function(L){var Q="clientWidth",C=t[Q],A=z.compatMode==="CSS1Compat"&&C||z.body[Q]||C,O={},P=b[b.length-1],B=new Date().getTime();if(L&&l&&B-l<g){k.clearTimeout(s);s=k.setTimeout(i,g);return}else{l=B}for(var J in h){if(h.hasOwnProperty(J)){var M=h[J],F=M.minw,I=M.maxw,K=F===null,N=I===null,w="em";if(!!F){F=parseFloat(F)*(F.indexOf(w)>-1?p||y():1)}if(!!I){I=parseFloat(I)*(I.indexOf(w)>-1?p||y():1)}if(!M.hasquery||(!K||!N)&&(K||A>=F)&&(N||A<=I)){if(!O[M.media]){O[M.media]=[]}O[M.media].push(j[M.rules])}}}for(var H in q){if(q.hasOwnProperty(H)){if(q[H]&&q[H].parentNode===e){e.removeChild(q[H])}}}q.length=0;for(var G in O){if(O.hasOwnProperty(G)){var E=z.createElement("style"),D=O[G].join("\n");E.type="text/css";E.media=G;e.insertBefore(E,P.nextSibling);if(E.styleSheet){E.styleSheet.cssText=D}else{E.appendChild(z.createTextNode(D))}q.push(E)}}},m=function(K,w,B){var I=K.replace(u.regex.comments,"").replace(u.regex.keyframes,"").match(u.regex.media),L=I&&I.length||0;w=w.substring(0,w.lastIndexOf("/"));var A=function(M){return M.replace(u.regex.urls,"$1"+w+"$2$3")},C=!L&&B;if(w.length){w+="/"}if(C){L=1}for(var F=0;F<L;F++){var G,H,D,J;if(C){G=B;j.push(A(K))}else{G=I[F].match(u.regex.findStyles)&&RegExp.$1;j.push(RegExp.$2&&A(RegExp.$2))}D=G.split(",");J=D.length;for(var E=0;E<J;E++){H=D[E];if(r(H)){continue}h.push({media:H.split("(")[0].match(u.regex.only)&&RegExp.$2||"all",rules:j.length-1,hasquery:H.indexOf("(")>-1,minw:H.match(u.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:H.match(u.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}i()},x=function(){if(c.length){var w=c.shift();n(w.href,function(A){m(A,w.href,w.media);o[w.href]=true;k.setTimeout(function(){x()},0)})}},a=function(){for(var C=0;C<b.length;C++){var B=b[C],A=B.href,D=B.media,w=B.rel&&B.rel.toLowerCase()==="stylesheet";if(!!A&&w&&!o[A]){if(B.styleSheet&&B.styleSheet.rawCssText){m(B.styleSheet.rawCssText,A,D);o[A]=true}else{if(!/^([a-zA-Z:]*\/\/)/.test(A)&&!f||A.replace(RegExp.$1,"").split("/")[0]===k.location.host){if(A.substring(0,2)==="//"){A=k.location.protocol+A}c.push({href:A,media:D})}}}}x()};a();u.update=a;u.getEmValue=y;function v(){i(true)}if(k.addEventListener){k.addEventListener("resize",v,false)}else{if(k.attachEvent){k.attachEvent("onresize",v)}}})(this); |
@ -0,0 +1,54 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
|
||||
if ($user->hasLogin()) { |
||||
$response->redirect($options->adminUrl); |
||||
} |
||||
$rememberName = htmlspecialchars(Typecho_Cookie::get('__typecho_remember_name')); |
||||
Typecho_Cookie::delete('__typecho_remember_name'); |
||||
|
||||
$bodyClass = 'body-100'; |
||||
|
||||
include 'header.php'; |
||||
?> |
||||
<div class="typecho-login-wrap"> |
||||
<div class="typecho-login"> |
||||
<h1><a href="http://typecho.org" class="i-logo">Typecho</a></h1> |
||||
<form action="<?php $options->loginAction(); ?>" method="post" name="login" role="form">
|
||||
<p> |
||||
<label for="name" class="sr-only"><?php _e('用户名'); ?></label>
|
||||
<input type="text" id="name" name="name" value="<?php echo $rememberName; ?>" placeholder="<?php _e('用户名'); ?>" class="text-l w-100" autofocus />
|
||||
</p> |
||||
<p> |
||||
<label for="password" class="sr-only"><?php _e('密码'); ?></label>
|
||||
<input type="password" id="password" name="password" class="text-l w-100" placeholder="<?php _e('密码'); ?>" />
|
||||
</p> |
||||
<p class="submit"> |
||||
<button type="submit" class="btn btn-l w-100 primary"><?php _e('登录'); ?></button>
|
||||
<input type="hidden" name="referer" value="<?php echo htmlspecialchars($request->get('referer')); ?>" />
|
||||
</p> |
||||
<p> |
||||
<label for="remember"><input type="checkbox" name="remember" class="checkbox" value="1" id="remember" /> <?php _e('下次自动登录'); ?></label>
|
||||
</p> |
||||
</form> |
||||
|
||||
<p class="more-link"> |
||||
<a href="<?php $options->siteUrl(); ?>"><?php _e('返回首页'); ?></a>
|
||||
<?php if($options->allowRegister): ?> |
||||
• |
||||
<a href="<?php $options->registerUrl(); ?>"><?php _e('用户注册'); ?></a>
|
||||
<?php endif; ?> |
||||
</p> |
||||
</div> |
||||
</div> |
||||
<?php
|
||||
include 'common-js.php'; |
||||
?> |
||||
<script> |
||||
$(document).ready(function () { |
||||
$('#name').focus(); |
||||
}); |
||||
</script> |
||||
<?php |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,154 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
Typecho_Widget::widget('Widget_Metas_Category_Admin')->to($categories); |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<div class="row typecho-page-main manage-metas"> |
||||
|
||||
<div class="col-mb-12" role="main"> |
||||
|
||||
<form method="post" name="manage_categories" class="operate-form"> |
||||
<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>
|
||||
<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/metas-category-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
|
||||
<li><a lang="<?php _e('刷新分类可能需要等待较长时间, 你确认要刷新这些分类吗?'); ?>" href="<?php $security->index('/action/metas-category-edit?do=refresh'); ?>"><?php _e('刷新'); ?></a></li>
|
||||
<li class="multiline"> |
||||
<button type="button" class="btn merge btn-s" rel="<?php $security->index('/action/metas-category-edit?do=merge'); ?>"><?php _e('合并到'); ?></button>
|
||||
<select name="merge"> |
||||
<?php $categories->parse('<option value="{mid}">{name}</option>'); ?> |
||||
</select> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
<div class="search" role="search"> |
||||
<?php $categories->backLink(); ?> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="typecho-table-wrap"> |
||||
<table class="typecho-list-table"> |
||||
<colgroup> |
||||
<col width="20"/> |
||||
<col width="30%"/> |
||||
<col width="15%"/> |
||||
<col width="25%"/> |
||||
<col width=""/> |
||||
<col width="10%"/> |
||||
</colgroup> |
||||
<thead> |
||||
<tr class="nodrag"> |
||||
<th> </th> |
||||
<th><?php _e('名称'); ?></th>
|
||||
<th><?php _e('子分类'); ?></th>
|
||||
<th><?php _e('缩略名'); ?></th>
|
||||
<th> </th> |
||||
<th><?php _e('文章数'); ?></th>
|
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<?php if($categories->have()): ?> |
||||
<?php while ($categories->next()): ?> |
||||
<tr id="mid-<?php $categories->theId(); ?>">
|
||||
<td><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><?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><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 endif; ?> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</form> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
?> |
||||
|
||||
<script type="text/javascript"> |
||||
(function () { |
||||
$(document).ready(function () { |
||||
var table = $('.typecho-list-table').tableDnD({ |
||||
onDrop : function () { |
||||
var ids = []; |
||||
|
||||
$('input[type=checkbox]', table).each(function () { |
||||
ids.push($(this).val()); |
||||
}); |
||||
|
||||
$.post('<?php $security->index('/action/metas-category-edit?do=sort'); ?>',
|
||||
$.param({mid : ids})); |
||||
|
||||
$('tr', table).each(function (i) { |
||||
if (i % 2) { |
||||
$(this).addClass('even'); |
||||
} else { |
||||
$(this).removeClass('even'); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
table.tableSelectable({ |
||||
checkEl : 'input[type=checkbox]', |
||||
rowEl : 'tr', |
||||
selectAllEl : '.typecho-table-select-all', |
||||
actionEl : '.dropdown-menu a' |
||||
}); |
||||
|
||||
$('.btn-drop').dropdownMenu({ |
||||
btnEl : '.dropdown-toggle', |
||||
menuEl : '.dropdown-menu' |
||||
}); |
||||
|
||||
$('.dropdown-menu button.merge').click(function () { |
||||
var btn = $(this); |
||||
btn.parents('form').attr('action', btn.attr('rel')).submit(); |
||||
}); |
||||
|
||||
<?php if (isset($request->mid)): ?> |
||||
$('.typecho-mini-panel').effect('highlight', '#AACB36'); |
||||
<?php endif; ?> |
||||
}); |
||||
})(); |
||||
</script> |
||||
<?php include 'footer.php'; ?> |
||||
|
@ -0,0 +1,373 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat'); |
||||
$comments = Typecho_Widget::widget('Widget_Comments_Admin'); |
||||
$isAllComments = ('on' == $request->get('__typecho_all_comments') || 'on' == Typecho_Cookie::get('__typecho_all_comments')); |
||||
?> |
||||
<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="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->cid : '')); ?>"><?php _e('已通过'); ?></a></li>
|
||||
<li<?php if('waiting' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-comments.php?status=waiting' |
||||
. (isset($request->cid) ? '&cid=' . $request->cid : '')); ?>"><?php _e('待审核'); ?> |
||||
<?php if(!$isAllComments && $stat->myWaitingCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->myWaitingCommentsNum(); ?></span>
|
||||
<?php elseif($isAllComments && $stat->waitingCommentsNum > 0 && !isset($request->cid)): ?> |
||||
<span class="balloon"><?php $stat->waitingCommentsNum(); ?></span>
|
||||
<?php elseif(isset($request->cid) && $stat->currentWaitingCommentsNum > 0): ?> |
||||
<span class="balloon"><?php $stat->currentWaitingCommentsNum(); ?></span>
|
||||
<?php endif; ?> |
||||
</a></li> |
||||
<li<?php if('spam' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-comments.php?status=spam' |
||||
. (isset($request->cid) ? '&cid=' . $request->cid : '')); ?>"><?php _e('垃圾'); ?> |
||||
<?php if(!$isAllComments && $stat->mySpamCommentsNum > 0 && !isset($request->cid)): ?>
|
||||
<span class="balloon"><?php $stat->mySpamCommentsNum(); ?></span>
|
||||
<?php elseif($isAllComments && $stat->spamCommentsNum > 0 && !isset($request->cid)): ?> |
||||
<span class="balloon"><?php $stat->spamCommentsNum(); ?></span>
|
||||
<?php elseif(isset($request->cid) && $stat->currentSpamCommentsNum > 0): ?> |
||||
<span class="balloon"><?php $stat->currentSpamCommentsNum(); ?></span>
|
||||
<?php endif; ?> |
||||
</a></li> |
||||
</ul> |
||||
</div> |
||||
|
||||
<div class="typecho-list-operate clearfix"> |
||||
<form method="get"> |
||||
<div class="operate"> |
||||
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
|
||||
<div class="btn-group btn-drop"> |
||||
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
|
||||
<ul class="dropdown-menu"> |
||||
<li><a href="<?php $security->index('/action/comments-edit?do=approved'); ?>"><?php _e('通过'); ?></a></li>
|
||||
<li><a href="<?php $security->index('/action/comments-edit?do=waiting'); ?>"><?php _e('待审核'); ?></a></li>
|
||||
<li><a href="<?php $security->index('/action/comments-edit?do=spam'); ?>"><?php _e('标记垃圾'); ?></a></li>
|
||||
<li><a lang="<?php _e('你确认要删除这些评论吗?'); ?>" href="<?php $security->index('/action/comments-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
|
||||
</ul> |
||||
<?php if('spam' == $request->get('status')): ?> |
||||
<button lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="btn btn-s btn-warn btn-operate" href="<?php $security->index('/action/comments-edit?do=delete-spam'); ?>"><?php _e('删除所有垃圾评论'); ?></button>
|
||||
<?php endif; ?> |
||||
</div> |
||||
</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=' . htmlspecialchars($request->get('status')) : '') . |
||||
(isset($request->cid) ? (isset($request->status) ? '&' : '') . 'cid=' . htmlspecialchars($request->get('cid')) : '') : '')); ?>"><?php _e('« 取消筛选'); ?></a>
|
||||
<?php endif; ?> |
||||
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo htmlspecialchars($request->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 htmlspecialchars($request->get('status')); ?>" name="status" />
|
||||
<?php endif; ?> |
||||
<?php if(isset($request->cid)): ?> |
||||
<input type="hidden" value="<?php echo htmlspecialchars($request->get('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%"/> |
||||
<col width="6%" /> |
||||
<col width="20%"/> |
||||
<col width="71%"/> |
||||
</colgroup> |
||||
<thead> |
||||
<tr> |
||||
<th> </th> |
||||
<th><?php _e('作者'); ?></th>
|
||||
<th> </th> |
||||
<th><?php _e('内容'); ?></th>
|
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
|
||||
<?php if($comments->have()): ?> |
||||
<?php while($comments->next()): ?> |
||||
<tr id="<?php $comments->theId(); ?>" data-comment="<?php |
||||
$comment = array( |
||||
'author' => $comments->author, |
||||
'mail' => $comments->mail, |
||||
'url' => $comments->url, |
||||
'ip' => $comments->ip, |
||||
'type' => $comments->type, |
||||
'text' => $comments->text |
||||
); |
||||
|
||||
echo htmlspecialchars(Json::encode($comment)); |
||||
?>"> |
||||
<td valign="top"> |
||||
<input type="checkbox" value="<?php $comments->coid(); ?>" name="coid[]"/>
|
||||
</td> |
||||
<td valign="top"> |
||||
<div class="comment-avatar"> |
||||
<?php if ('comment' == $comments->type): ?> |
||||
<?php $comments->gravatar(40); ?> |
||||
<?php endif; ?> |
||||
<?php if ('comment' != $comments->type): ?> |
||||
<?php _e('引用'); ?> |
||||
<?php endif; ?> |
||||
</div> |
||||
</td> |
||||
<td valign="top" class="comment-head"> |
||||
<div class="comment-meta"> |
||||
<strong class="comment-author"><?php $comments->author(true); ?></strong>
|
||||
<?php if($comments->mail): ?> |
||||
<br /><span><a href="mailto:<?php $comments->mail(); ?>"><?php $comments->mail(); ?></a></span>
|
||||
<?php endif; ?> |
||||
<?php if($comments->ip): ?> |
||||
<br /><span><?php $comments->ip(); ?></span>
|
||||
<?php endif; ?> |
||||
</div> |
||||
</td> |
||||
<td valign="top" class="comment-body"> |
||||
<div class="comment-date"><?php $comments->dateWord(); ?> 于 <a href="<?php $comments->permalink(); ?>"><?php $comments->title(); ?></a></div>
|
||||
<div class="comment-content"> |
||||
<?php $comments->content(); ?> |
||||
</div> |
||||
<div class="comment-action hidden-by-mouse"> |
||||
<?php if('approved' == $comments->status): ?> |
||||
<span class="weak"><?php _e('通过'); ?></span>
|
||||
<?php else: ?> |
||||
<a href="<?php $security->index('/action/comments-edit?do=approved&coid=' . $comments->coid); ?>" class="operate-approved"><?php _e('通过'); ?></a>
|
||||
<?php endif; ?> |
||||
|
||||
<?php if('waiting' == $comments->status): ?> |
||||
<span class="weak"><?php _e('待审核'); ?></span>
|
||||
<?php else: ?> |
||||
<a href="<?php $security->index('/action/comments-edit?do=waiting&coid=' . $comments->coid); ?>" class="operate-waiting"><?php _e('待审核'); ?></a>
|
||||
<?php endif; ?> |
||||
|
||||
<?php if('spam' == $comments->status): ?> |
||||
<span class="weak"><?php _e('垃圾'); ?></span>
|
||||
<?php else: ?> |
||||
<a href="<?php $security->index('/action/comments-edit?do=spam&coid=' . $comments->coid); ?>" class="operate-spam"><?php _e('垃圾'); ?></a>
|
||||
<?php endif; ?> |
||||
|
||||
<a href="#<?php $comments->theId(); ?>" rel="<?php $security->index('/action/comments-edit?do=edit&coid=' . $comments->coid); ?>" class="operate-edit"><?php _e('编辑'); ?></a>
|
||||
|
||||
<?php if('approved' == $comments->status && 'comment' == $comments->type): ?> |
||||
<a href="#<?php $comments->theId(); ?>" rel="<?php $security->index('/action/comments-edit?do=reply&coid=' . $comments->coid); ?>" class="operate-reply"><?php _e('回复'); ?></a>
|
||||
<?php endif; ?> |
||||
|
||||
<a lang="<?php _e('你确认要删除%s的评论吗?', htmlspecialchars($comments->author)); ?>" href="<?php $security->index('/action/comments-edit?do=delete&coid=' . $comments->coid); ?>" class="operate-delete"><?php _e('删除'); ?></a>
|
||||
</div> |
||||
</td> |
||||
</tr> |
||||
<?php endwhile; ?> |
||||
<?php else: ?> |
||||
<tr> |
||||
<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 htmlspecialchars($request->get('cid')); ?>" name="cid" />
|
||||
<?php endif; ?> |
||||
</form><!-- end .operate-form --> |
||||
|
||||
<div class="typecho-list-operate clearfix"> |
||||
<form method="get"> |
||||
<div class="operate"> |
||||
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
|
||||
<div class="btn-group btn-drop"> |
||||
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
|
||||
<ul class="dropdown-menu"> |
||||
<li><a href="<?php $security->index('/action/comments-edit?do=approved'); ?>"><?php _e('通过'); ?></a></li>
|
||||
<li><a href="<?php $security->index('/action/comments-edit?do=waiting'); ?>"><?php _e('待审核'); ?></a></li>
|
||||
<li><a href="<?php $security->index('/action/comments-edit?do=spam'); ?>"><?php _e('标记垃圾'); ?></a></li>
|
||||
<li><a lang="<?php _e('你确认要删除这些评论吗?'); ?>" href="<?php $security->index('/action/comments-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
|
||||
</ul> |
||||
<?php if('spam' == $request->get('status')): ?> |
||||
<button lang="<?php _e('你确认要删除所有垃圾评论吗?'); ?>" class="btn btn-s btn-warn btn-operate" href="<?php $security->index('/action/comments-edit?do=delete-spam'); ?>"><?php _e('删除所有垃圾评论'); ?></button>
|
||||
<?php endif; ?> |
||||
</div> |
||||
</div> |
||||
<?php if($comments->have()): ?> |
||||
<ul class="typecho-pager"> |
||||
<?php $comments->pageNav(); ?> |
||||
</ul> |
||||
<?php endif; ?> |
||||
</form> |
||||
</div><!-- end .typecho-list-operate --> |
||||
</div><!-- end .typecho-list --> |
||||
</div><!-- end .typecho-page-main --> |
||||
</div> |
||||
</div> |
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'table-js.php'; |
||||
?> |
||||
<script type="text/javascript"> |
||||
$(document).ready(function () { |
||||
// 记住滚动条 |
||||
function rememberScroll () { |
||||
$(window).bind('beforeunload', function () { |
||||
$.cookie('__typecho_comments_scroll', $('body').scrollTop()); |
||||
}); |
||||
} |
||||
|
||||
// 自动滚动 |
||||
(function () { |
||||
var scroll = $.cookie('__typecho_comments_scroll'); |
||||
|
||||
if (scroll) { |
||||
$.cookie('__typecho_comments_scroll', null); |
||||
$('html, body').scrollTop(scroll); |
||||
} |
||||
})(); |
||||
|
||||
$('.operate-delete').click(function () { |
||||
var t = $(this), href = t.attr('href'), tr = t.parents('tr'); |
||||
|
||||
if (confirm(t.attr('lang'))) { |
||||
tr.fadeOut(function () { |
||||
rememberScroll(); |
||||
window.location.href = href; |
||||
}); |
||||
} |
||||
|
||||
return false; |
||||
}); |
||||
|
||||
$('.operate-approved, .operate-waiting, .operate-spam').click(function () { |
||||
rememberScroll(); |
||||
window.location.href = $(this).attr('href'); |
||||
return false; |
||||
}); |
||||
|
||||
$('.operate-reply').click(function () { |
||||
var td = $(this).parents('td'), t = $(this); |
||||
|
||||
if ($('.comment-reply', td).length > 0) { |
||||
$('.comment-reply').remove(); |
||||
} else { |
||||
var form = $('<form method="post" action="' |
||||
+ t.attr('rel') + '" class="comment-reply">' |
||||
+ '<p><label for="text" class="sr-only"><?php _e('内容'); ?></label><textarea id="text" name="text" class="w-90 mono" rows="3"></textarea></p>'
|
||||
+ '<p><button type="submit" class="btn btn-s primary"><?php _e('回复'); ?></button> <button type="button" class="btn btn-s cancel"><?php _e('取消'); ?></button></p>'
|
||||
+ '</form>').insertBefore($('.comment-action', td)); |
||||
|
||||
$('.cancel', form).click(function () { |
||||
$(this).parents('.comment-reply').remove(); |
||||
}); |
||||
|
||||
var textarea = $('textarea', form).focus(); |
||||
|
||||
form.submit(function () { |
||||
var t = $(this), tr = t.parents('tr'), |
||||
reply = $('<div class="comment-reply-content"></div>').insertAfter($('.comment-content', tr)); |
||||
|
||||
reply.html('<p>' + textarea.val() + '</p>'); |
||||
$.post(t.attr('action'), t.serialize(), function (o) { |
||||
reply.html(o.comment.content) |
||||
.effect('highlight'); |
||||
}, 'json'); |
||||
|
||||
t.remove(); |
||||
return false; |
||||
}); |
||||
} |
||||
|
||||
return false; |
||||
}); |
||||
|
||||
$('.operate-edit').click(function () { |
||||
var tr = $(this).parents('tr'), t = $(this), id = tr.attr('id'), comment = tr.data('comment'); |
||||
tr.hide(); |
||||
|
||||
var edit = $('<tr class="comment-edit"><td> </td>' |
||||
+ '<td colspan="2" valign="top"><form method="post" action="' |
||||
+ t.attr('rel') + '" class="comment-edit-info">' |
||||
+ '<p><label for="' + id + '-author"><?php _e('用户名'); ?></label><input class="text-s w-100" id="'
|
||||
+ id + '-author" name="author" type="text"></p>' |
||||
+ '<p><label for="' + id + '-mail"><?php _e('电子邮箱'); ?></label>'
|
||||
+ '<input class="text-s w-100" type="email" name="mail" id="' + id + '-mail"></p>' |
||||
+ '<p><label for="' + id + '-url"><?php _e('个人主页'); ?></label>'
|
||||
+ '<input class="text-s w-100" type="text" name="url" id="' + id + '-url"></p></form></td>' |
||||
+ '<td valign="top"><form method="post" action="' |
||||
+ t.attr('rel') + '" class="comment-edit-content"><p><label for="' + id + '-text"><?php _e('内容'); ?></label>'
|
||||
+ '<textarea name="text" id="' + id + '-text" rows="6" class="w-90 mono"></textarea></p>' |
||||
+ '<p><button type="submit" class="btn btn-s primary"><?php _e('提交'); ?></button> '
|
||||
+ '<button type="button" class="btn btn-s cancel"><?php _e('取消'); ?></button></p></form></td></tr>')
|
||||
.data('id', id).data('comment', comment).insertAfter(tr); |
||||
|
||||
$('input[name=author]', edit).val(comment.author); |
||||
$('input[name=mail]', edit).val(comment.mail); |
||||
$('input[name=url]', edit).val(comment.url); |
||||
$('textarea[name=text]', edit).val(comment.text).focus(); |
||||
|
||||
$('.cancel', edit).click(function () { |
||||
var tr = $(this).parents('tr'); |
||||
|
||||
$('#' + tr.data('id')).show(); |
||||
tr.remove(); |
||||
}); |
||||
|
||||
$('form', edit).submit(function () { |
||||
var t = $(this), tr = t.parents('tr'), |
||||
oldTr = $('#' + tr.data('id')), |
||||
comment = oldTr.data('comment'); |
||||
|
||||
$('form', tr).each(function () { |
||||
var items = $(this).serializeArray(); |
||||
|
||||
for (var i = 0; i < items.length; i ++) { |
||||
var item = items[i]; |
||||
comment[item.name] = item.value; |
||||
} |
||||
}); |
||||
|
||||
var html = '<strong class="comment-author">' |
||||
+ (comment.url ? '<a target="_blank" href="' + comment.url + '">' |
||||
+ comment.author + '</a>' : comment.author) + '</strong>' |
||||
+ ('comment' != comment.type ? '<small><?php _e('引用'); ?></small>' : '')
|
||||
+ (comment.mail ? '<br /><span><a href="mailto:' + comment.mail + '">' |
||||
+ comment.mail + '</a></span>' : '') |
||||
+ (comment.ip ? '<br /><span>' + comment.ip + '</span>' : ''); |
||||
|
||||
$('.comment-meta', oldTr).html(html) |
||||
.effect('highlight'); |
||||
$('.comment-content', oldTr).html('<p>' + comment.text + '</p>'); |
||||
oldTr.data('comment', comment); |
||||
|
||||
$.post(t.attr('action'), comment, function (o) { |
||||
$('.comment-content', oldTr).html(o.comment.content) |
||||
.effect('highlight'); |
||||
}, 'json'); |
||||
|
||||
oldTr.show(); |
||||
tr.remove(); |
||||
|
||||
return false; |
||||
}); |
||||
|
||||
return false; |
||||
}); |
||||
}); |
||||
</script> |
||||
<?php |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,122 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat'); |
||||
?> |
||||
|
||||
<?php Typecho_Widget::widget('Widget_Contents_Attachment_Admin')->to($attachments); ?> |
||||
<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"> |
||||
|
||||
<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('« 取消筛选'); ?></a>
|
||||
<?php endif; ?> |
||||
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo htmlspecialchars($request->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"/> |
||||
<col width="6%"/> |
||||
<col width="30%"/> |
||||
<col width=""/> |
||||
<col width="30%"/> |
||||
<col width="16%"/> |
||||
</colgroup> |
||||
<thead> |
||||
<tr> |
||||
<th> </th> |
||||
<th> </th> |
||||
<th><?php _e('文件名'); ?></th>
|
||||
<th><?php _e('上传者'); ?></th>
|
||||
<th><?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><input type="checkbox" value="<?php $attachments->cid(); ?>" name="cid[]"/></td>
|
||||
<td><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><?php $attachments->author(); ?></td>
|
||||
<td> |
||||
<?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> |
||||
<?php if($attachments->have()): ?> |
||||
<ul class="typecho-pager"> |
||||
<?php $attachments->pageNav(); ?> |
||||
</ul> |
||||
<?php endif; ?>
|
||||
</form> |
||||
</div><!-- end .typecho-list-operate --> |
||||
|
||||
</div> |
||||
</div><!-- end .typecho-page-main --> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'table-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,132 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat'); |
||||
?> |
||||
<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 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>
|
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="search" role="search"> |
||||
<?php if ('' != $request->keywords): ?> |
||||
<a href="<?php $options->adminUrl('manage-pages.php'); ?>"><?php _e('« 取消筛选'); ?></a>
|
||||
<?php endif; ?> |
||||
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo htmlspecialchars($request->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"> |
||||
<div class="typecho-table-wrap"> |
||||
<table class="typecho-list-table"> |
||||
<colgroup> |
||||
<col width="20"/> |
||||
<col width="6%"/> |
||||
<col width="30%"/> |
||||
<col width="30%"/> |
||||
<col width=""/> |
||||
<col width="16%"/> |
||||
</colgroup> |
||||
<thead> |
||||
<tr class="nodrag"> |
||||
<th> </th> |
||||
<th> </th> |
||||
<th><?php _e('标题'); ?></th>
|
||||
<th><?php _e('缩略名'); ?></th>
|
||||
<th><?php _e('作者'); ?></th>
|
||||
<th><?php _e('日期'); ?></th>
|
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<?php Typecho_Widget::widget('Widget_Contents_Page_Admin')->to($pages); ?> |
||||
<?php if($pages->have()): ?> |
||||
<?php while($pages->next()): ?> |
||||
<tr id="<?php $pages->theId(); ?>">
|
||||
<td><input type="checkbox" value="<?php $pages->cid(); ?>" name="cid[]"/></td>
|
||||
<td><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 ($pages->hasSaved || 'page_draft' == $pages->type) { |
||||
echo '<em class="status">' . _t('草稿') . '</em>'; |
||||
} else 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 $pages->slug(); ?></td>
|
||||
<td><?php $pages->author(); ?></td>
|
||||
<td> |
||||
<?php if ($pages->hasSaved): ?> |
||||
<span class="description"> |
||||
<?php $modifyDate = new Typecho_Date($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 endif; ?> |
||||
</tbody> |
||||
</table> |
||||
</div><!-- end .typecho-table-wrap --> |
||||
</form><!-- end .operate-form --> |
||||
</div><!-- end .typecho-list --> |
||||
</div><!-- end .typecho-page-main --> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'table-js.php'; |
||||
?> |
||||
|
||||
<?php if(!isset($request->status) || 'publish' == $request->get('status')): ?> |
||||
<script type="text/javascript"> |
||||
(function () { |
||||
$(document).ready(function () { |
||||
var table = $('.typecho-list-table').tableDnD({ |
||||
onDrop : function () { |
||||
var ids = []; |
||||
|
||||
$('input[type=checkbox]', table).each(function () { |
||||
ids.push($(this).val()); |
||||
}); |
||||
|
||||
$.post('<?php $security->index('/action/contents-page-edit?do=sort'); ?>',
|
||||
$.param({cid : ids})); |
||||
} |
||||
}); |
||||
}); |
||||
})(); |
||||
</script> |
||||
<?php endif; ?> |
||||
|
||||
<?php include 'footer.php'; ?> |
@ -0,0 +1,193 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat'); |
||||
$posts = Typecho_Widget::widget('Widget_Contents_Post_Admin'); |
||||
$isAllPosts = ('on' == $request->get('__typecho_all_posts') || 'on' == Typecho_Cookie::get('__typecho_all_posts')); |
||||
?> |
||||
<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="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'); ?>"><?php _e('所有'); ?></a></li>
|
||||
<li class="<?php if(!$isAllPosts): ?> current<?php endif; ?>"><a href="<?php echo $request->makeUriByRequest('__typecho_all_posts=off'); ?>"><?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' |
||||
. (isset($request->uid) ? '?uid=' . $request->uid : '')); ?>"><?php _e('可用'); ?></a></li>
|
||||
<li<?php if('waiting' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-posts.php?status=waiting' |
||||
. (isset($request->uid) ? '&uid=' . $request->uid : '')); ?>"><?php _e('待审核'); ?> |
||||
<?php if(!$isAllPosts && $stat->myWaitingPostsNum > 0 && !isset($request->uid)): ?> |
||||
<span class="balloon"><?php $stat->myWaitingPostsNum(); ?></span>
|
||||
<?php elseif($isAllPosts && $stat->waitingPostsNum > 0 && !isset($request->uid)): ?> |
||||
<span class="balloon"><?php $stat->waitingPostsNum(); ?></span>
|
||||
<?php elseif(isset($request->uid) && $stat->currentWaitingPostsNum > 0): ?> |
||||
<span class="balloon"><?php $stat->currentWaitingPostsNum(); ?></span>
|
||||
<?php endif; ?> |
||||
</a></li> |
||||
<li<?php if('draft' == $request->get('status')): ?> class="current"<?php endif; ?>><a href="<?php $options->adminUrl('manage-posts.php?status=draft' |
||||
. (isset($request->uid) ? '&uid=' . $request->uid : '')); ?>"><?php _e('草稿'); ?> |
||||
<?php if(!$isAllPosts && $stat->myDraftPostsNum > 0 && !isset($request->uid)): ?> |
||||
<span class="balloon"><?php $stat->myDraftPostsNum(); ?></span>
|
||||
<?php elseif($isAllPosts && $stat->draftPostsNum > 0 && !isset($request->uid)): ?> |
||||
<span class="balloon"><?php $stat->draftPostsNum(); ?></span>
|
||||
<?php elseif(isset($request->uid) && $stat->currentDraftPostsNum > 0): ?> |
||||
<span class="balloon"><?php $stat->currentDraftPostsNum(); ?></span>
|
||||
<?php endif; ?> |
||||
</a></li> |
||||
</ul> |
||||
</div> |
||||
|
||||
<div class="typecho-list-operate clearfix"> |
||||
<form method="get"> |
||||
<div class="operate"> |
||||
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
|
||||
<div class="btn-group btn-drop"> |
||||
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
|
||||
<ul class="dropdown-menu"> |
||||
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>" href="<?php $security->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
|
||||
</ul> |
||||
</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=' . htmlspecialchars($request->get('status')) : '') . |
||||
(isset($request->uid) ? '?uid=' . htmlspecialchars($request->get('uid')) : '') : '')); ?>"><?php _e('« 取消筛选'); ?></a>
|
||||
<?php endif; ?> |
||||
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo htmlspecialchars($request->keywords); ?>" name="keywords" />
|
||||
<select name="category"> |
||||
<option value=""><?php _e('所有分类'); ?></option>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->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 htmlspecialchars($request->get('uid')); ?>" name="uid" />
|
||||
<?php endif; ?> |
||||
<?php if(isset($request->status)): ?> |
||||
<input type="hidden" value="<?php echo htmlspecialchars($request->get('status')); ?>" name="status" />
|
||||
<?php endif; ?> |
||||
</div> |
||||
</form> |
||||
</div><!-- end .typecho-list-operate --> |
||||
|
||||
<form method="post" name="manage_posts" class="operate-form"> |
||||
<div class="typecho-table-wrap"> |
||||
<table class="typecho-list-table"> |
||||
<colgroup> |
||||
<col width="20"/> |
||||
<col width="6%"/> |
||||
<col width="45%"/> |
||||
<col width=""/> |
||||
<col width="18%"/> |
||||
<col width="16%"/> |
||||
</colgroup> |
||||
<thead> |
||||
<tr> |
||||
<th> </th> |
||||
<th> </th> |
||||
<th><?php _e('标题'); ?></th>
|
||||
<th><?php _e('作者'); ?></th>
|
||||
<th><?php _e('分类'); ?></th>
|
||||
<th><?php _e('日期'); ?></th>
|
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<?php if($posts->have()): ?> |
||||
<?php while($posts->next()): ?> |
||||
<tr id="<?php $posts->theId(); ?>">
|
||||
<td><input type="checkbox" value="<?php $posts->cid(); ?>" name="cid[]"/></td>
|
||||
<td><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 ($posts->hasSaved || 'post_draft' == $posts->type) { |
||||
echo '<em class="status">' . _t('草稿') . '</em>'; |
||||
} else if ('hidden' == $posts->status) { |
||||
echo '<em class="status">' . _t('隐藏') . '</em>'; |
||||
} else if ('waiting' == $posts->status) { |
||||
echo '<em class="status">' . _t('待审核') . '</em>'; |
||||
} else if ('private' == $posts->status) { |
||||
echo '<em class="status">' . _t('私密') . '</em>'; |
||||
} else if ($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><a href="<?php $options->adminUrl('manage-posts.php?uid=' . $posts->author->uid); ?>"><?php $posts->author(); ?></a></td>
|
||||
<td><?php $categories = $posts->categories; $length = count($categories); ?> |
||||
<?php foreach ($categories as $key => $val): ?> |
||||
<?php echo '<a href="'; |
||||
$options->adminUrl('manage-posts.php?category=' . $val['mid'] |
||||
. (isset($request->uid) ? '&uid=' . $request->uid : '') |
||||
. (isset($request->status) ? '&status=' . $request->status : '')); |
||||
echo '">' . $val['name'] . '</a>' . ($key < $length - 1 ? ', ' : ''); ?> |
||||
<?php endforeach; ?> |
||||
</td> |
||||
<td> |
||||
<?php if ($posts->hasSaved): ?> |
||||
<span class="description"> |
||||
<?php $modifyDate = new Typecho_Date($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 endif; ?> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</form><!-- end .operate-form --> |
||||
|
||||
<div class="typecho-list-operate clearfix"> |
||||
<form method="get"> |
||||
<div class="operate"> |
||||
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
|
||||
<div class="btn-group btn-drop"> |
||||
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
|
||||
<ul class="dropdown-menu"> |
||||
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>" href="<?php $security->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
|
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
||||
<?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> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'table-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,91 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
Typecho_Widget::widget('Widget_Metas_Tag_Admin')->to($tags); |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<div class="row typecho-page-main manage-metas"> |
||||
|
||||
<div class="col-mb-12 col-tb-8" role="main"> |
||||
|
||||
<form method="post" name="manage_tags" class="operate-form"> |
||||
<div class="typecho-list-operate clearfix"> |
||||
<div class="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/metas-tag-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
|
||||
<li><a lang="<?php _e('刷新标签可能需要等待较长时间, 你确认要刷新这些标签吗?'); ?>" href="<?php $security->index('/action/metas-tag-edit?do=refresh'); ?>"><?php _e('刷新'); ?></a></li>
|
||||
<li class="multiline"> |
||||
<button type="button" class="btn btn-s merge" rel="<?php $security->index('/action/metas-tag-edit?do=merge'); ?>"><?php _e('合并到'); ?></button>
|
||||
<input type="text" name="merge" class="text-s" /> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<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[]"/>
|
||||
<span rel="<?php echo $request->makeUriByRequest('mid=' . $tags->mid); ?>"><?php $tags->name(); ?></span>
|
||||
<a class="tag-edit-link" href="<?php echo $request->makeUriByRequest('mid=' . $tags->mid); ?>"><i class="i-edit"></i></a>
|
||||
</li> |
||||
<?php endwhile; ?> |
||||
<?php else: ?> |
||||
<h6 class="typecho-list-table-title"><?php _e('没有任何标签'); ?></h6>
|
||||
<?php endif; ?> |
||||
</ul> |
||||
<input type="hidden" name="do" value="delete" /> |
||||
</form> |
||||
|
||||
</div> |
||||
<div class="col-mb-12 col-tb-4" role="form"> |
||||
<?php Typecho_Widget::widget('Widget_Metas_Tag_Edit')->form()->render(); ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
?> |
||||
|
||||
<script type="text/javascript"> |
||||
(function () { |
||||
$(document).ready(function () { |
||||
|
||||
$('.typecho-list-notable').tableSelectable({ |
||||
checkEl : 'input[type=checkbox]', |
||||
rowEl : 'li', |
||||
selectAllEl : '.typecho-table-select-all', |
||||
actionEl : '.dropdown-menu a' |
||||
}); |
||||
|
||||
$('.btn-drop').dropdownMenu({ |
||||
btnEl : '.dropdown-toggle', |
||||
menuEl : '.dropdown-menu' |
||||
}); |
||||
|
||||
$('.dropdown-menu button.merge').click(function () { |
||||
var btn = $(this); |
||||
btn.parents('form').attr('action', btn.attr('rel')).submit(); |
||||
}); |
||||
|
||||
<?php if (isset($request->mid)): ?> |
||||
$('.typecho-mini-panel').effect('highlight', '#AACB36'); |
||||
<?php endif; ?> |
||||
}); |
||||
})(); |
||||
</script> |
||||
<?php include 'footer.php'; ?> |
||||
|
@ -0,0 +1,118 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
<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 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 class="search" role="search"> |
||||
<?php if ('' != $request->keywords): ?> |
||||
<a href="<?php $options->adminUrl('manage-users.php'); ?>"><?php _e('« 取消筛选'); ?></a>
|
||||
<?php endif; ?> |
||||
<input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo htmlspecialchars($request->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"> |
||||
<div class="typecho-table-wrap"> |
||||
<table class="typecho-list-table"> |
||||
<colgroup> |
||||
<col width="20"/> |
||||
<col width="6%"/> |
||||
<col width="30%"/> |
||||
<col width=""/> |
||||
<col width="25%"/> |
||||
<col width="15%"/> |
||||
</colgroup> |
||||
<thead> |
||||
<tr> |
||||
<th> </th> |
||||
<th> </th> |
||||
<th><?php _e('用户名'); ?></th>
|
||||
<th><?php _e('昵称'); ?></th>
|
||||
<th><?php _e('电子邮件'); ?></th>
|
||||
<th><?php _e('用户组'); ?></th>
|
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<?php Typecho_Widget::widget('Widget_Users_Admin')->to($users); ?> |
||||
<?php while($users->next()): ?> |
||||
<tr id="user-<?php $users->uid(); ?>">
|
||||
<td><input type="checkbox" value="<?php $users->uid(); ?>" name="uid[]"/></td>
|
||||
<td><a href="<?php $options->adminUrl('manage-posts.php?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><?php $users->screenName(); ?></td>
|
||||
<td><?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 --> |
||||
|
||||
<div class="typecho-list-operate clearfix"> |
||||
<form method="get"> |
||||
<div class="operate"> |
||||
<label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox" class="typecho-table-select-all" /></label>
|
||||
<div class="btn-group btn-drop"> |
||||
<button class="btn dropdown-toggle btn-s" type="button"><i class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i class="i-caret-down"></i></button>
|
||||
<ul class="dropdown-menu"> |
||||
<li><a lang="<?php _e('你确认要删除这些用户吗?'); ?>" href="<?php $security->index('/action/users-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
|
||||
</ul> |
||||
</div> |
||||
</div> |
||||
<?php if($users->have()): ?> |
||||
<ul class="typecho-pager"> |
||||
<?php $users->pageNav(); ?> |
||||
</ul> |
||||
<?php endif; ?> |
||||
</form> |
||||
</div><!-- end .typecho-list-operate --> |
||||
</div><!-- end .typecho-list --> |
||||
</div><!-- end .typecho-page-main --> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'table-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,194 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
$phpMaxFilesize = function_exists('ini_get') ? trim(ini_get('upload_max_filesize')) : 0; |
||||
|
||||
if (preg_match("/^([0-9]+)([a-z]{1,2})$/i", $phpMaxFilesize, $matches)) { |
||||
$phpMaxFilesize = strtolower($matches[1] . $matches[2] . (1 == strlen($matches[2]) ? 'b' : '')); |
||||
} |
||||
|
||||
Typecho_Widget::widget('Widget_Contents_Attachment_Edit')->to($attachment); |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<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>
|
||||
<?php endif; ?> |
||||
|
||||
<p> |
||||
<?php $mime = Typecho_Common::mimeIconType($attachment->attachment->mime); ?> |
||||
<i class="mime-<?php echo $mime; ?>"></i>
|
||||
<a href=""><strong><?php $attachment->attachment->name(); ?></strong></a>
|
||||
<span><?php echo number_format(ceil($attachment->attachment->size / 1024)); ?> Kb</span>
|
||||
</p> |
||||
|
||||
<p> |
||||
<input id="attachment-url" type="text" class="mono w-100" value="<?php $attachment->attachment->url(); ?>" readonly />
|
||||
</p> |
||||
|
||||
<div id="upload-panel" class="p"> |
||||
<div class="upload-area" draggable="true"><?php _e('拖放文件到这里<br>或者 %s选择文件上传%s', '<a href="###" class="upload-file">', '</a>'); ?></div>
|
||||
<ul id="file-list"></ul> |
||||
</div> |
||||
</div> |
||||
<div class="col-mb-12 col-tb-4 edit-media" role="form"> |
||||
<?php $attachment->form()->render(); ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
?> |
||||
<script src="<?php $options->adminStaticUrl('js', 'moxie.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminStaticUrl('js', 'plupload.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script type="text/javascript"> |
||||
$(document).ready(function() { |
||||
$('#attachment-url').click(function () { |
||||
$(this).select(); |
||||
}); |
||||
|
||||
$('.operate-delete').click(function () { |
||||
var t = $(this), href = t.attr('href'); |
||||
|
||||
if (confirm(t.attr('lang'))) { |
||||
window.location.href = href; |
||||
} |
||||
|
||||
return false; |
||||
}); |
||||
|
||||
$('.upload-area').bind({ |
||||
dragenter : function () { |
||||
$(this).parent().addClass('drag'); |
||||
}, |
||||
|
||||
dragover : function (e) { |
||||
$(this).parent().addClass('drag'); |
||||
}, |
||||
|
||||
drop : function () { |
||||
$(this).parent().removeClass('drag'); |
||||
}, |
||||
|
||||
dragend : function () { |
||||
$(this).parent().removeClass('drag'); |
||||
}, |
||||
|
||||
dragleave : function () { |
||||
$(this).parent().removeClass('drag'); |
||||
} |
||||
}); |
||||
|
||||
function fileUploadStart (file) { |
||||
$('<ul id="file-list"></ul>').appendTo('#upload-panel'); |
||||
$('<li id="' + file.id + '" class="loading">' |
||||
+ file.name + '</li>').prependTo('#file-list'); |
||||
} |
||||
|
||||
function fileUploadError (error) { |
||||
var file = error.file, code = error.code, word; |
||||
|
||||
switch (code) { |
||||
case plupload.FILE_SIZE_ERROR: |
||||
word = '<?php _e('文件大小超过限制'); ?>';
|
||||
break; |
||||
case plupload.FILE_EXTENSION_ERROR: |
||||
word = '<?php _e('文件扩展名不被支持'); ?>';
|
||||
break; |
||||
case plupload.FILE_DUPLICATE_ERROR: |
||||
word = '<?php _e('文件已经上传过'); ?>';
|
||||
break; |
||||
case plupload.HTTP_ERROR: |
||||
default: |
||||
word = '<?php _e('上传出现错误'); ?>';
|
||||
break; |
||||
} |
||||
|
||||
var fileError = '<?php _e('%s 上传失败'); ?>'.replace('%s', file.name),
|
||||
li, exist = $('#' + file.id); |
||||
|
||||
if (exist.length > 0) { |
||||
li = exist.removeClass('loading').html(fileError); |
||||
} else { |
||||
$('<ul id="file-list"></ul>').appendTo('#upload-panel'); |
||||
li = $('<li>' + fileError + '<br />' + word + '</li>').prependTo('#file-list'); |
||||
} |
||||
|
||||
li.effect('highlight', {color : '#FBC2C4'}, 2000, function () { |
||||
$(this).remove(); |
||||
}); |
||||
} |
||||
|
||||
function fileUploadComplete (id, url, data) { |
||||
var img = $('.typecho-attachment-photo'); |
||||
|
||||
if (img.length > 0) { |
||||
img.get(0).src = '<?php $attachment->attachment->url(); ?>?' + Math.random();
|
||||
} |
||||
|
||||
$('#' + id).html('<?php _e('文件 %s 已经替换'); ?>'.replace('%s', data.title))
|
||||
.effect('highlight', 1000, function () { |
||||
$(this).remove(); |
||||
$('#file-list').remove(); |
||||
}); |
||||
} |
||||
|
||||
var uploader = new plupload.Uploader({ |
||||
browse_button : $('.upload-file').get(0), |
||||
url : '<?php $security->index('/action/upload?do=modify&cid=' . $attachment->cid); ?>',
|
||||
runtimes : 'html5,flash,html4', |
||||
flash_swf_url : '<?php $options->adminStaticUrl('js', 'Moxie.swf'); ?>',
|
||||
drop_element : $('.upload-area').get(0), |
||||
filters : { |
||||
max_file_size : '<?php echo $phpMaxFilesize ?>',
|
||||
mime_types : [{'title' : '<?php _e('允许上传的文件'); ?>', 'extensions' : '<?php $attachment->attachment->type(); ?>'}],
|
||||
prevent_duplicates : true |
||||
}, |
||||
multi_selection : false, |
||||
|
||||
init : { |
||||
FilesAdded : function (up, files) { |
||||
plupload.each(files, function(file) { |
||||
fileUploadStart(file); |
||||
}); |
||||
|
||||
uploader.start(); |
||||
}, |
||||
|
||||
FileUploaded : function (up, file, result) { |
||||
if (200 == result.status) { |
||||
var data = $.parseJSON(result.response); |
||||
|
||||
if (data) { |
||||
fileUploadComplete(file.id, data[0], data[1]); |
||||
return; |
||||
} |
||||
} |
||||
|
||||
fileUploadError({ |
||||
code : plupload.HTTP_ERROR, |
||||
file : file |
||||
}); |
||||
}, |
||||
|
||||
Error : function (up, error) { |
||||
fileUploadError(error); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
uploader.init(); |
||||
}); |
||||
</script> |
||||
<?php |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,16 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<div class="typecho-head-nav clearfix" role="navigation"> |
||||
<nav id="typecho-nav-list"> |
||||
<?php $menu->output(); ?> |
||||
</nav> |
||||
<div class="operate"> |
||||
<?php Typecho_Plugin::factory('admin/menu.php')->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> |
||||
|
@ -0,0 +1,23 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<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> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,23 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<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> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,24 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<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> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
?> |
||||
|
||||
<?php include 'footer.php'; ?> |
@ -0,0 +1,23 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<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> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,37 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<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> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
?> |
||||
<script> |
||||
$('#frontPage-recent,#frontPage-page,#frontPage-file').change(function () { |
||||
var t = $(this); |
||||
if (t.prop('checked')) { |
||||
if ('frontPage-recent' == t.attr('id')) { |
||||
$('.front-archive').addClass('hidden'); |
||||
} else { |
||||
$('.front-archive').insertAfter(t.parent()).removeClass('hidden'); |
||||
} |
||||
} |
||||
}); |
||||
</script> |
||||
<?php |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,32 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
|
||||
<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"> |
||||
<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 Typecho_Widget::widget('Widget_Themes_Config')->config()->render(); ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,8 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<div class="typecho-page-title"> |
||||
<h2><?php echo $menu->title; ?><?php
|
||||
if (!empty($menu->addLink)) { |
||||
echo "<a href=\"{$menu->addLink}\">" . _t("新增") . "</a>"; |
||||
} |
||||
?></h2> |
||||
</div> |
@ -0,0 +1,127 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
<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"> |
||||
<?php Typecho_Widget::widget('Widget_Plugins_List@activated', 'activated=1')->to($activatedPlugins); ?> |
||||
<?php if ($activatedPlugins->have() || !empty($activatedPlugins->activatedPlugins)): ?> |
||||
<h4 class="typecho-list-table-title"><?php _e('启用的插件'); ?></h4>
|
||||
<div class="typecho-table-wrap"> |
||||
<table class="typecho-list-table"> |
||||
<colgroup> |
||||
<col width="25%"/> |
||||
<col width="45%"/> |
||||
<col width="8%"/> |
||||
<col width="10%"/> |
||||
<col width=""/> |
||||
</colgroup> |
||||
<thead> |
||||
<tr> |
||||
<th><?php _e('名称'); ?></th>
|
||||
<th><?php _e('描述'); ?></th>
|
||||
<th><?php _e('版本'); ?></th>
|
||||
<th><?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): ?> |
||||
<img src="<?php $options->adminUrl('images/notice.gif'); ?>" title="<?php _e('%s 无法在此版本的typecho下正常工作', $activatedPlugins->title); ?>" alt="<?php _e('%s 无法在此版本的typecho下正常工作', $activatedPlugins->title); ?>" class="tiny" />
|
||||
<?php endif; ?> |
||||
</td> |
||||
<td><?php $activatedPlugins->description(); ?></td>
|
||||
<td><?php $activatedPlugins->version(); ?></td>
|
||||
<td><?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>
|
||||
• |
||||
<?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 endwhile; ?> |
||||
|
||||
<?php if (!empty($activatedPlugins->activatedPlugins)): ?> |
||||
<?php foreach ($activatedPlugins->activatedPlugins as $key => $val): ?> |
||||
<tr> |
||||
<td><?php echo $key; ?></td>
|
||||
<td colspan="3"><span class="warning"><?php _e('此插件文件已经损坏或者被不安全移除, 强烈建议你禁用它'); ?></span></td>
|
||||
<td><a lang="<?php _e('你确认要禁用插件 %s 吗?', $key); ?>" href="<?php $security->index('/action/plugins-edit?deactivate=' . $key); ?>"><?php _e('禁用'); ?></a></td>
|
||||
</tr> |
||||
<?php endforeach; ?> |
||||
<?php endif; ?> |
||||
|
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<?php endif; ?> |
||||
|
||||
<?php Typecho_Widget::widget('Widget_Plugins_List@unactivated', 'activated=0')->to($deactivatedPlugins); ?> |
||||
<?php if ($deactivatedPlugins->have() || !$activatedPlugins->have()): ?> |
||||
<h4 class="typecho-list-table-title"><?php _e('禁用的插件'); ?></h4>
|
||||
<div class="typecho-table-wrap"> |
||||
<table class="typecho-list-table deactivate"> |
||||
<colgroup> |
||||
<col width="25%"/> |
||||
<col width="45%"/> |
||||
<col width="8%"/> |
||||
<col width="10%"/> |
||||
<col width=""/> |
||||
</colgroup> |
||||
<thead> |
||||
<tr> |
||||
<th><?php _e('名称'); ?></th>
|
||||
<th><?php _e('描述'); ?></th>
|
||||
<th><?php _e('版本'); ?></th>
|
||||
<th><?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><?php $deactivatedPlugins->version(); ?></td>
|
||||
<td><?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 endif; ?> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<?php endif; ?> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,60 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
$stat = Typecho_Widget::widget('Widget_Stat'); |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<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="' . Typecho_Common::gravatarUrl($user->mail, 220, 'X', 'mm', $request->isSecure()) . '" 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) { |
||||
$logged = new Typecho_Date($user->logged); |
||||
_e('最后登录: %s', $logged->word()); |
||||
} |
||||
?></p> |
||||
</div> |
||||
|
||||
<div class="col-mb-12 col-tb-6 col-tb-offset-1 typecho-content-panel" role="form"> |
||||
<section> |
||||
<h3><?php _e('个人资料'); ?></h3>
|
||||
<?php Typecho_Widget::widget('Widget_Users_Profile')->profileForm()->render(); ?> |
||||
</section> |
||||
|
||||
<?php if($user->pass('contributor', true)): ?> |
||||
<br> |
||||
<section id="writing-option"> |
||||
<h3><?php _e('撰写设置'); ?></h3>
|
||||
<?php Typecho_Widget::widget('Widget_Users_Profile')->optionsForm()->render(); ?> |
||||
</section> |
||||
<?php endif; ?> |
||||
|
||||
<br> |
||||
|
||||
<section id="change-password"> |
||||
<h3><?php _e('密码修改'); ?></h3>
|
||||
<?php Typecho_Widget::widget('Widget_Users_Profile')->passwordForm()->render(); ?> |
||||
</section> |
||||
|
||||
<?php Typecho_Widget::widget('Widget_Users_Profile')->personalFormList(); ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
Typecho_Plugin::factory('admin/profile.php')->bottom(); |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,50 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
|
||||
if ($user->hasLogin() || !$options->allowRegister) { |
||||
$response->redirect($options->siteUrl); |
||||
} |
||||
$rememberName = htmlspecialchars(Typecho_Cookie::get('__typecho_remember_name')); |
||||
$rememberMail = htmlspecialchars(Typecho_Cookie::get('__typecho_remember_mail')); |
||||
Typecho_Cookie::delete('__typecho_remember_name'); |
||||
Typecho_Cookie::delete('__typecho_remember_mail'); |
||||
|
||||
$bodyClass = 'body-100'; |
||||
|
||||
include 'header.php'; |
||||
?> |
||||
<div class="typecho-login-wrap"> |
||||
<div class="typecho-login"> |
||||
<h1><a href="http://typecho.org" class="i-logo">Typecho</a></h1> |
||||
<form action="<?php $options->registerAction(); ?>" method="post" name="register" role="form">
|
||||
<p> |
||||
<label for="name" class="sr-only"><?php _e('用户名'); ?></label>
|
||||
<input type="text" id="name" name="name" placeholder="<?php _e('用户名'); ?>" value="<?php echo $rememberName; ?>" class="text-l w-100" autofocus />
|
||||
</p> |
||||
<p> |
||||
<label for="mail" class="sr-only"><?php _e('Email'); ?></label>
|
||||
<input type="email" id="mail" name="mail" placeholder="<?php _e('Email'); ?>" value="<?php echo $rememberMail; ?>" class="text-l w-100" />
|
||||
</p> |
||||
<p class="submit"> |
||||
<button type="submit" class="btn btn-l w-100 primary"><?php _e('注册'); ?></button>
|
||||
</p> |
||||
</form> |
||||
|
||||
<p class="more-link"> |
||||
<a href="<?php $options->siteUrl(); ?>"><?php _e('返回首页'); ?></a>
|
||||
• |
||||
<a href="<?php $options->adminUrl('login.php'); ?>"><?php _e('用户登录'); ?></a>
|
||||
</p> |
||||
</div> |
||||
</div> |
||||
<?php
|
||||
include 'common-js.php'; |
||||
?> |
||||
<script> |
||||
$(document).ready(function () { |
||||
$('#name').focus(); |
||||
}); |
||||
</script> |
||||
<?php |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,18 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<script> |
||||
(function () { |
||||
$(document).ready(function () { |
||||
$('.typecho-list-table').tableSelectable({ |
||||
checkEl : 'input[type=checkbox]', |
||||
rowEl : 'tr', |
||||
selectAllEl : '.typecho-table-select-all', |
||||
actionEl : '.dropdown-menu a,button.btn-operate' |
||||
}); |
||||
|
||||
$('.btn-drop').dropdownMenu({ |
||||
btnEl : '.dropdown-toggle', |
||||
menuEl : '.dropdown-menu' |
||||
}); |
||||
}); |
||||
})(); |
||||
</script> |
@ -0,0 +1,62 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
Typecho_Widget::widget('Widget_Themes_Files')->to($files); |
||||
?> |
||||
|
||||
<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"> |
||||
<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="submit"> |
||||
<?php if($files->currentIsWriteable()): ?> |
||||
<input type="hidden" name="theme" value="<?php echo $files->currentTheme(); ?>" />
|
||||
<input type="hidden" name="edit" value="<?php echo $files->currentFile(); ?>" />
|
||||
<button type="submit" class="btn primary"><?php _e('保存文件'); ?></button>
|
||||
<?php else: ?> |
||||
<em><?php _e('此文件无法写入'); ?></em>
|
||||
<?php endif; ?> |
||||
</p> |
||||
</form> |
||||
</div> |
||||
<ul class="col-mb-12 col-tb-4 col-3"> |
||||
<li><strong>模板文件</strong></li> |
||||
<?php while($files->next()): ?> |
||||
<li<?php if($files->current): ?> class="current"<?php endif; ?>>
|
||||
<a href="<?php $options->adminUrl('theme-editor.php?theme=' . $files->currentTheme() . '&file=' . $files->file); ?>"><?php $files->file(); ?></a></li>
|
||||
<?php endwhile; ?> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
Typecho_Plugin::factory('admin/theme-editor.php')->bottom($files); |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,69 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
|
||||
<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"> |
||||
<ul class="typecho-option-tabs fix-tabs clearfix"> |
||||
<li class="current"><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; ?> |
||||
<?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 Typecho_Widget::widget('Widget_Themes_List')->to($themes); ?> |
||||
<?php while($themes->next()): ?> |
||||
<tr id="theme-<?php $themes->name(); ?>" class="<?php if($themes->activated): ?>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; ?> <?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): ?> |
||||
<p> |
||||
<?php if (!defined('__TYPECHO_THEME_WRITEABLE__') || __TYPECHO_THEME_WRITEABLE__): ?> |
||||
<a class="edit" href="<?php $options->adminUrl('theme-editor.php?theme=' . $themes->name); ?>"><?php _e('编辑'); ?></a>
|
||||
<?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> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,55 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
|
||||
$errors = $security->systemCheck(); |
||||
?> |
||||
|
||||
<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"> |
||||
<div id="typecho-welcome"> |
||||
<?php if (!empty($errors)): ?> |
||||
<form action="<?php echo Typecho_Common::url('upgrade.php', $options->adminUrl); ?>" method="get">
|
||||
<h3><?php _e('发现安全问题'); ?></h3>
|
||||
<ul> |
||||
<?php foreach ($errors as $error): ?> |
||||
<li class="warning"><?php echo $error; ?></li>
|
||||
<?php endforeach; ?> |
||||
</ul> |
||||
<p><button class="btn primary" type="submit"><?php _e('解决完毕 »'); ?></button></p>
|
||||
</form> |
||||
<?php else: ?> |
||||
<form action="<?php echo $security->getTokenUrl( |
||||
Typecho_Router::url('do', array('action' => 'upgrade', 'widget' => 'Upgrade'), |
||||
Typecho_Common::url('index.php', $options->rootUrl))); ?>" method="post"> |
||||
<h3><?php _e('检测到新版本!'); ?></h3>
|
||||
<ul> |
||||
<li><?php _e('您已经更新了系统程序, 我们还需要执行一些后续步骤来完成升级'); ?></li>
|
||||
<li><?php _e('此程序将把您的系统从 <strong>%s</strong> 升级到 <strong>%s</strong>', $options->version, Typecho_Common::VERSION); ?></li>
|
||||
<li><strong class="warning"><?php _e('在升级之前强烈建议先<a href="%s">备份您的数据</a>', Typecho_Common::url('backup.php', $options->adminUrl)); ?></strong></li>
|
||||
</ul> |
||||
<p><button class="btn primary" type="submit"><?php _e('完成升级 »'); ?></button></p>
|
||||
</form> |
||||
<?php endif; ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
?> |
||||
<script> |
||||
(function () { |
||||
if (window.sessionStorage) { |
||||
sessionStorage.removeItem('update'); |
||||
} |
||||
})(); |
||||
</script> |
||||
<?php include 'footer.php'; ?> |
@ -0,0 +1,23 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
|
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<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> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,36 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
?> |
||||
|
||||
<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"> |
||||
<div id="typecho-welcome" class="message"> |
||||
<form action="<?php $options->adminUrl(); ?>" method="get">
|
||||
<h3><?php _e('欢迎您使用 "%s" 管理后台: ', $options->title); ?></h3>
|
||||
<ol> |
||||
<li><a class="operate-delete" href="<?php $options->adminUrl('profile.php#change-password'); ?>"><?php _e('强烈建议更改你的默认密码'); ?></a></li>
|
||||
<?php if($user->pass('contributor', true)): ?> |
||||
<li><a href="<?php $options->adminUrl('write-post.php'); ?>"><?php _e('撰写第一篇日志'); ?></a></li>
|
||||
<li><a href="<?php $options->siteUrl(); ?>"><?php _e('查看我的站点'); ?></a></li>
|
||||
<?php else: ?> |
||||
<li><a href="<?php $options->siteUrl(); ?>"><?php _e('查看我的站点'); ?></a></li>
|
||||
<?php endif; ?> |
||||
</ol> |
||||
<p><button type="submit" class="btn primary"><?php _e('让我直接开始使用吧 »'); ?></button></p>
|
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,278 @@ |
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?> |
||||
<?php Typecho_Plugin::factory('admin/write-js.php')->write(); ?> |
||||
<?php Typecho_Widget::widget('Widget_Metas_Tag_Cloud', 'sort=count&desc=1&limit=200')->to($tags); ?> |
||||
|
||||
<script src="<?php $options->adminStaticUrl('js', 'timepicker.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminStaticUrl('js', 'tokeninput.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script> |
||||
$(document).ready(function() { |
||||
// 日期时间控件 |
||||
$('#date').mask('9999-99-99 99:99').datetimepicker({ |
||||
currentText : '<?php _e('现在'); ?>',
|
||||
prevText : '<?php _e('上一月'); ?>',
|
||||
nextText : '<?php _e('下一月'); ?>',
|
||||
monthNames : ['<?php _e('一月'); ?>', '<?php _e('二月'); ?>', '<?php _e('三月'); ?>', '<?php _e('四月'); ?>',
|
||||
'<?php _e('五月'); ?>', '<?php _e('六月'); ?>', '<?php _e('七月'); ?>', '<?php _e('八月'); ?>',
|
||||
'<?php _e('九月'); ?>', '<?php _e('十月'); ?>', '<?php _e('十一月'); ?>', '<?php _e('十二月'); ?>'],
|
||||
dayNames : ['<?php _e('星期日'); ?>', '<?php _e('星期一'); ?>', '<?php _e('星期二'); ?>',
|
||||
'<?php _e('星期三'); ?>', '<?php _e('星期四'); ?>', '<?php _e('星期五'); ?>', '<?php _e('星期六'); ?>'],
|
||||
dayNamesShort : ['<?php _e('周日'); ?>', '<?php _e('周一'); ?>', '<?php _e('周二'); ?>', '<?php _e('周三'); ?>',
|
||||
'<?php _e('周四'); ?>', '<?php _e('周五'); ?>', '<?php _e('周六'); ?>'],
|
||||
dayNamesMin : ['<?php _e('日'); ?>', '<?php _e('一'); ?>', '<?php _e('二'); ?>', '<?php _e('三'); ?>',
|
||||
'<?php _e('四'); ?>', '<?php _e('五'); ?>', '<?php _e('六'); ?>'],
|
||||
closeText : '<?php _e('完成'); ?>',
|
||||
timeOnlyTitle : '<?php _e('选择时间'); ?>',
|
||||
timeText : '<?php _e('时间'); ?>',
|
||||
hourText : '<?php _e('时'); ?>',
|
||||
amNames : ['<?php _e('上午'); ?>', 'A'],
|
||||
pmNames : ['<?php _e('下午'); ?>', 'P'],
|
||||
minuteText : '<?php _e('分'); ?>',
|
||||
secondText : '<?php _e('秒'); ?>',
|
||||
|
||||
dateFormat : 'yy-mm-dd', |
||||
timezone : <?php $options->timezone(); ?> / 60,
|
||||
hour : (new Date()).getHours(), |
||||
minute : (new Date()).getMinutes() |
||||
}); |
||||
|
||||
// 聚焦 |
||||
$('#title').select(); |
||||
|
||||
// text 自动拉伸 |
||||
Typecho.editorResize('text', '<?php $security->index('/action/ajax?do=editorResize'); ?>');
|
||||
|
||||
// tag autocomplete 提示 |
||||
var tags = $('#tags'), tagsPre = []; |
||||
|
||||
if (tags.length > 0) { |
||||
var items = tags.val().split(','), result = []; |
||||
for (var i = 0; i < items.length; i ++) { |
||||
var tag = items[i]; |
||||
|
||||
if (!tag) { |
||||
continue; |
||||
} |
||||
|
||||
tagsPre.push({ |
||||
id : tag, |
||||
tags : tag |
||||
}); |
||||
} |
||||
|
||||
tags.tokenInput(<?php
|
||||
$data = array(); |
||||
while ($tags->next()) { |
||||
$data[] = array( |
||||
'id' => $tags->name, |
||||
'tags' => $tags->name |
||||
); |
||||
} |
||||
echo Json::encode($data); |
||||
?>, { |
||||
propertyToSearch: 'tags', |
||||
tokenValue : 'tags', |
||||
searchDelay : 0, |
||||
preventDuplicates : true, |
||||
animateDropdown : false, |
||||
hintText : '<?php _e('请输入标签名'); ?>',
|
||||
noResultsText : '<?php _e('此标签不存在, 按回车创建'); ?>',
|
||||
prePopulate : tagsPre, |
||||
|
||||
onResult : function (result, query, val) { |
||||
if (!query) { |
||||
return result; |
||||
} |
||||
|
||||
if (!result) { |
||||
result = []; |
||||
} |
||||
|
||||
if (!result[0] || result[0]['id'] != query) { |
||||
result.unshift({ |
||||
id : val, |
||||
tags : val |
||||
}); |
||||
} |
||||
|
||||
return result.slice(0, 5); |
||||
} |
||||
}); |
||||
|
||||
// tag autocomplete 提示宽度设置 |
||||
$('#token-input-tags').focus(function() { |
||||
var t = $('.token-input-dropdown'), |
||||
offset = t.outerWidth() - t.width(); |
||||
t.width($('.token-input-list').outerWidth() - offset); |
||||
}); |
||||
} |
||||
|
||||
// 缩略名自适应宽度 |
||||
var slug = $('#slug'); |
||||
|
||||
if (slug.length > 0) { |
||||
var wrap = $('<div />').css({ |
||||
'position' : 'relative', |
||||
'display' : 'inline-block' |
||||
}), |
||||
justifySlug = $('<pre />').css({ |
||||
'display' : 'block', |
||||
'visibility': 'hidden', |
||||
'height' : slug.height(), |
||||
'padding' : '0 2px', |
||||
'margin' : 0 |
||||
}).insertAfter(slug.wrap(wrap).css({ |
||||
'left' : 0, |
||||
'top' : 0, |
||||
'minWidth' : '5px', |
||||
'position' : 'absolute', |
||||
'width' : '100%' |
||||
})), originalWidth = slug.width(); |
||||
|
||||
function justifySlugWidth() { |
||||
var val = slug.val(); |
||||
justifySlug.text(val.length > 0 ? val : ' '); |
||||
} |
||||
|
||||
slug.bind('input propertychange', justifySlugWidth); |
||||
justifySlugWidth(); |
||||
} |
||||
|
||||
// 原始的插入图片和文件 |
||||
Typecho.insertFileToEditor = function (file, url, isImage) { |
||||
var textarea = $('#text'), sel = textarea.getSelection(), |
||||
html = isImage ? '<img src="' + url + '" alt="' + file + '" />' |
||||
: '<a href="' + url + '">' + file + '</a>', |
||||
offset = (sel ? sel.start : 0) + html.length; |
||||
|
||||
textarea.replaceSelection(html); |
||||
textarea.setSelection(offset, offset); |
||||
}; |
||||
|
||||
var submitted = false, form = $('form[name=write_post],form[name=write_page]').submit(function () { |
||||
submitted = true; |
||||
}), savedData = null; |
||||
|
||||
// 计算夏令时偏移 |
||||
var dstOffset = (function () { |
||||
var d = new Date(), |
||||
jan = new Date(d.getFullYear(), 0, 1), |
||||
jul = new Date(d.getFullYear(), 6, 1), |
||||
stdOffset = Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); |
||||
|
||||
return stdOffset - d.getTimezoneOffset(); |
||||
})(); |
||||
|
||||
if (dstOffset > 0) { |
||||
$('<input name="dst" type="hidden" />').appendTo(form).val(dstOffset); |
||||
} |
||||
|
||||
// 时区 |
||||
$('<input name="timezone" type="hidden" />').appendTo(form).val(- (new Date).getTimezoneOffset() * 60); |
||||
|
||||
// 自动保存 |
||||
<?php if ($options->autoSave): ?> |
||||
var locked = false, |
||||
formAction = form.attr('action'), |
||||
idInput = $('input[name=cid]'), |
||||
cid = idInput.val(), |
||||
autoSave = $('<span id="auto-save-message" class="left"></span>').prependTo('.submit'), |
||||
autoSaveOnce = !!cid, |
||||
lastSaveTime = null; |
||||
|
||||
function autoSaveListener () { |
||||
setInterval(function () { |
||||
idInput.val(cid); |
||||
var data = form.serialize(); |
||||
|
||||
if (savedData != data && !locked) { |
||||
locked = true; |
||||
|
||||
autoSave.text('<?php _e('正在保存'); ?>');
|
||||
$.post(formAction, data + '&do=save', function (o) { |
||||
savedData = data; |
||||
lastSaveTime = o.time; |
||||
cid = o.cid; |
||||
autoSave.text('<?php _e('已保存'); ?>' + ' (' + o.time + ')').effect('highlight', 1000);
|
||||
locked = false; |
||||
}, 'json'); |
||||
} |
||||
}, 10000); |
||||
} |
||||
|
||||
if (autoSaveOnce) { |
||||
savedData = form.serialize(); |
||||
autoSaveListener(); |
||||
} |
||||
|
||||
$('#text').bind('input propertychange', function () { |
||||
if (!locked) { |
||||
autoSave.text('<?php _e('尚未保存'); ?>' + (lastSaveTime ? ' (<?php _e('上次保存时间'); ?>: ' + lastSaveTime + ')' : ''));
|
||||
} |
||||
|
||||
if (!autoSaveOnce) { |
||||
autoSaveOnce = true; |
||||
autoSaveListener(); |
||||
} |
||||
}); |
||||
<?php endif; ?> |
||||
|
||||
// 自动检测离开页 |
||||
var lastData = form.serialize(); |
||||
|
||||
$(window).bind('beforeunload', function () { |
||||
if (!!savedData) { |
||||
lastData = savedData; |
||||
} |
||||
|
||||
if (form.serialize() != lastData && !submitted) { |
||||
return '<?php _e('内容已经改变尚未保存, 您确认要离开此页面吗?'); ?>';
|
||||
} |
||||
}); |
||||
|
||||
// 控制选项和附件的切换 |
||||
var fileUploadInit = false; |
||||
$('#edit-secondary .typecho-option-tabs li').click(function() { |
||||
$('#edit-secondary .typecho-option-tabs li').removeClass('active'); |
||||
$(this).addClass('active'); |
||||
$(this).parents('#edit-secondary').find('.tab-content').addClass('hidden'); |
||||
|
||||
var selected_tab = $(this).find('a').attr('href'), |
||||
selected_el = $(selected_tab).removeClass('hidden'); |
||||
|
||||
if (!fileUploadInit) { |
||||
selected_el.trigger('init'); |
||||
fileUploadInit = true; |
||||
} |
||||
|
||||
return false; |
||||
}); |
||||
|
||||
// 高级选项控制 |
||||
$('#advance-panel-btn').click(function() { |
||||
$('#advance-panel').toggle(); |
||||
return false; |
||||
}); |
||||
|
||||
// 自动隐藏密码框 |
||||
$('#visibility').change(function () { |
||||
var val = $(this).val(), password = $('#post-password'); |
||||
console.log(val); |
||||
|
||||
if ('password' == val) { |
||||
password.removeClass('hidden'); |
||||
} else { |
||||
password.addClass('hidden'); |
||||
} |
||||
}); |
||||
|
||||
// 草稿删除确认 |
||||
$('.edit-draft-notice a').click(function () { |
||||
if (confirm('<?php _e('您确认要删除这份草稿吗?'); ?>')) {
|
||||
window.location.href = $(this).attr('href'); |
||||
} |
||||
|
||||
return false; |
||||
}); |
||||
}); |
||||
</script> |
||||
|
@ -0,0 +1,151 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page); |
||||
?> |
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<div class="row typecho-page-main typecho-post-area" role="form"> |
||||
<form action="<?php $security->index('/action/contents-page-edit'); ?>" method="post" name="write_page">
|
||||
<div class="col-mb-12 col-tb-9" role="main"> |
||||
<?php if ($page->draft && $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 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); |
||||
list ($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("/\{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($page->text); ?></textarea>
|
||||
</p> |
||||
|
||||
<?php include 'custom-fields.php'; ?> |
||||
<p class="submit clearfix"> |
||||
<span class="right"> |
||||
<input type="hidden" name="cid" value="<?php $page->cid(); ?>" />
|
||||
<button type="submit" name="do" value="save" id="btn-save" class="btn"><?php _e('保存草稿'); ?></button>
|
||||
<button type="submit" name="do" value="publish" class="btn primary" id="btn-submit"><?php _e('发布页面'); ?></button>
|
||||
<?php if ($options->markdown && (!$page->have() || $page->isMarkdown)): ?> |
||||
<input type="hidden" name="markdown" value="1" /> |
||||
<?php endif; ?> |
||||
</span> |
||||
</p> |
||||
|
||||
<?php Typecho_Plugin::factory('admin/write-page.php')->content($page); ?> |
||||
</div> |
||||
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary"> |
||||
<ul class="typecho-option-tabs clearfix"> |
||||
<li class="active w-50"><a href="#tab-advance"><?php _e('选项'); ?></a></li>
|
||||
<li class="w-50"><a href="#tab-files" id="tab-files-btn"><?php _e('附件'); ?></a></li>
|
||||
</ul> |
||||
|
||||
<div id="tab-advance" class="tab-content"> |
||||
<section class="typecho-post-option" role="application"> |
||||
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
|
||||
<p><input class="typecho-date w-100" type="text" name="date" id="date" value="<?php $page->have() ? $page->date('Y-m-d H:i') : ''; ?>" /></p>
|
||||
</section> |
||||
|
||||
<section class="typecho-post-option"> |
||||
<label for="order" class="typecho-label"><?php _e('页面顺序'); ?></label>
|
||||
<p><input type="text" id="order" name="order" value="<?php $page->order(); ?>" class="w-100" /></p>
|
||||
<p class="description"><?php _e('为你的自定义页面设定一个序列值以后, 能够使得它们按此值从小到大排列'); ?></p>
|
||||
</section> |
||||
|
||||
<section class="typecho-post-option"> |
||||
<label for="template" class="typecho-label"><?php _e('自定义模板'); ?></label>
|
||||
<p> |
||||
<select name="template" id="template"> |
||||
<option value=""><?php _e('不选择'); ?></option>
|
||||
<?php $templates = $page->getTemplates(); foreach ($templates as $template => $name): ?> |
||||
<option value="<?php echo $template; ?>"<?php if($template == $page->template): ?> selected="true"<?php endif; ?>><?php echo $name; ?></option>
|
||||
<?php endforeach; ?> |
||||
</select> |
||||
</p> |
||||
<p class="description"><?php _e('如果你为此页面选择了一个自定义模板, 系统将按照你选择的模板文件展现它'); ?></p>
|
||||
</section> |
||||
|
||||
<?php Typecho_Plugin::factory('admin/write-page.php')->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')->advanceOption($page); ?> |
||||
</div> |
||||
<?php if($page->have()): ?> |
||||
<?php $modified = new Typecho_Date($page->modified); ?> |
||||
<section class="typecho-post-option"> |
||||
<p class="description"> |
||||
<br>—<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> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
include 'write-js.php'; |
||||
|
||||
Typecho_Plugin::factory('admin/write-page.php')->trigger($plugged)->richEditor($page); |
||||
if (!$plugged) { |
||||
include 'editor-js.php'; |
||||
} |
||||
|
||||
include 'file-upload-js.php'; |
||||
include 'custom-fields-js.php'; |
||||
Typecho_Plugin::factory('admin/write-page.php')->bottom($page); |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,180 @@ |
||||
<?php |
||||
include 'common.php'; |
||||
include 'header.php'; |
||||
include 'menu.php'; |
||||
Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post); |
||||
?> |
||||
<div class="main"> |
||||
<div class="body container"> |
||||
<?php include 'page-title.php'; ?> |
||||
<div class="row typecho-page-main typecho-post-area" role="form"> |
||||
<form action="<?php $security->index('/action/contents-post-edit'); ?>" method="post" name="write_post">
|
||||
<div class="col-mb-12 col-tb-9" role="main"> |
||||
<?php if ($post->draft && $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 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); |
||||
list ($scheme, $permalink) = explode(':', $permalink, 2); |
||||
$permalink = ltrim($permalink, '/'); |
||||
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink); |
||||
if ($post->have()) { |
||||
$permalink = str_replace(array( |
||||
'{cid}', '{category}', '{year}', '{month}', '{day}' |
||||
), array( |
||||
$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'; ?> |
||||
|
||||
<p class="submit clearfix"> |
||||
<span class="right"> |
||||
<input type="hidden" name="cid" value="<?php $post->cid(); ?>" />
|
||||
<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')->content($post); ?> |
||||
</div> |
||||
|
||||
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary"> |
||||
<ul class="typecho-option-tabs clearfix"> |
||||
<li class="active w-50"><a href="#tab-advance"><?php _e('选项'); ?></a></li>
|
||||
<li class="w-50"><a href="#tab-files" id="tab-files-btn"><?php _e('附件'); ?></a></li>
|
||||
</ul> |
||||
|
||||
|
||||
<div id="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" value="<?php $post->have() ? $post->date('Y-m-d H:i') : ''; ?>" /></p>
|
||||
</section> |
||||
|
||||
<section class="typecho-post-option category-option"> |
||||
<label class="typecho-label"><?php _e('分类'); ?></label>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?> |
||||
<ul> |
||||
<?php |
||||
if ($post->have()) { |
||||
$categories = Typecho_Common::arrayFlatten($post->categories, 'mid'); |
||||
} else { |
||||
$categories = array(); |
||||
} |
||||
?> |
||||
<?php while($category->next()): ?> |
||||
<li><?php echo str_repeat(' ', $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->tags(',', false); ?>" class="w-100 text" /></p>
|
||||
</section> |
||||
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->option($post); ?> |
||||
|
||||
<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('内容密码'); ?>" />
|
||||
</p> |
||||
</section> |
||||
<?php endif; ?> |
||||
|
||||
<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')->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>—<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> |
||||
</div> |
||||
|
||||
<?php |
||||
include 'copyright.php'; |
||||
include 'common-js.php'; |
||||
include 'form-js.php'; |
||||
include 'write-js.php'; |
||||
|
||||
Typecho_Plugin::factory('admin/write-post.php')->trigger($plugged)->richEditor($post); |
||||
if (!$plugged) { |
||||
include 'editor-js.php'; |
||||
} |
||||
|
||||
include 'file-upload-js.php'; |
||||
include 'custom-fields-js.php'; |
||||
Typecho_Plugin::factory('admin/write-post.php')->bottom($post); |
||||
include 'footer.php'; |
||||
?> |
@ -0,0 +1,64 @@ |
||||
<?php |
||||
/** |
||||
* Typecho Blog Platform |
||||
* |
||||
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org) |
||||
* @license GNU General Public License 2.0 |
||||
* @version $Id$ |
||||
*/ |
||||
|
||||
/** 定义根目录 */ |
||||
define('__TYPECHO_ROOT_DIR__', dirname(__FILE__)); |
||||
|
||||
/** 定义插件目录(相对路径) */ |
||||
define('__TYPECHO_PLUGIN_DIR__', '/usr/plugins'); |
||||
|
||||
/** 定义模板目录(相对路径) */ |
||||
define('__TYPECHO_THEME_DIR__', '/usr/themes'); |
||||
|
||||
/** 后台路径(相对路径) */ |
||||
define('__TYPECHO_ADMIN_DIR__', '/admin/'); |
||||
|
||||
/** 设置包含路径 */ |
||||
@set_include_path(get_include_path() . PATH_SEPARATOR . |
||||
__TYPECHO_ROOT_DIR__ . '/var' . PATH_SEPARATOR . |
||||
__TYPECHO_ROOT_DIR__ . __TYPECHO_PLUGIN_DIR__); |
||||
|
||||
/** 载入API支持 */ |
||||
require_once 'Typecho/Common.php'; |
||||
|
||||
/** 载入Response支持 */ |
||||
require_once 'Typecho/Response.php'; |
||||
|
||||
/** 载入配置支持 */ |
||||
require_once 'Typecho/Config.php'; |
||||
|
||||
/** 载入异常支持 */ |
||||
require_once 'Typecho/Exception.php'; |
||||
|
||||
/** 载入插件支持 */ |
||||
require_once 'Typecho/Plugin.php'; |
||||
|
||||
/** 载入国际化支持 */ |
||||
require_once 'Typecho/I18n.php'; |
||||
|
||||
/** 载入数据库支持 */ |
||||
require_once 'Typecho/Db.php'; |
||||
|
||||
/** 载入路由器支持 */ |
||||
require_once 'Typecho/Router.php'; |
||||
|
||||
/** 程序初始化 */ |
||||
Typecho_Common::init(); |
||||
|
||||
/** 定义数据库参数 */ |
||||
$db = new Typecho_Db('Pdo_Mysql', 'blog_'); |
||||
$db->addServer(array ( |
||||
'host' => '127.0.0.1', |
||||
'user' => 'username', |
||||
'password' => 'password', |
||||
'charset' => 'utf8', |
||||
'port' => '3306', |
||||
'database' => 'databasename', |
||||
), Typecho_Db::READ | Typecho_Db::WRITE); |
||||
Typecho_Db::set($db); |
@ -0,0 +1,38 @@ |
||||
<?php |
||||
|
||||
/* anti ddos *//* |
||||
if(!isset($_COOKIE['_token__']) || $_COOKIE['_token__'] != md5(date('Y-m-d-H').$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT'])) { |
||||
setcookie("_token__",md5(date('Y-m-d-H').$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']),time()+1*3600); |
||||
header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], true, 301); |
||||
} |
||||
*/ |
||||
|
||||
include '/home/lib/php/anti-ddos.php'; |
||||
|
||||
anti_ddos(); |
||||
|
||||
/** |
||||
* Typecho Blog Platform |
||||
* |
||||
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org) |
||||
* @license GNU General Public License 2.0 |
||||
* @version $Id: index.php 1153 2009-07-02 10:53:22Z magike.net $ |
||||
*/ |
||||
|
||||
/** 载入配置支持 */ |
||||
if (!defined('__TYPECHO_ROOT_DIR__') && !@include_once 'config.inc.php') { |
||||
file_exists('./install.php') ? header('Location: install.php') : print('Missing Config File'); |
||||
exit; |
||||
} |
||||
|
||||
/** 初始化组件 */ |
||||
Typecho_Widget::widget('Widget_Init'); |
||||
|
||||
/** 注册一个初始化插件 */ |
||||
Typecho_Plugin::factory('index.php')->begin(); |
||||
|
||||
/** 开始路由分发 */ |
||||
Typecho_Router::dispatch(); |
||||
|
||||
/** 注册一个结束插件 */ |
||||
Typecho_Plugin::factory('index.php')->end(); |
@ -0,0 +1,684 @@ |
||||
<?php if (!file_exists(dirname(__FILE__) . '/config.inc.php')): ?> |
||||
<?php |
||||
/** |
||||
* Typecho Blog Platform |
||||
* |
||||
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org) |
||||
* @license GNU General Public License 2.0 |
||||
* @version $Id$ |
||||
*/ |
||||
|
||||
/** 定义根目录 */ |
||||
define('__TYPECHO_ROOT_DIR__', dirname(__FILE__)); |
||||
|
||||
/** 定义插件目录(相对路径) */ |
||||
define('__TYPECHO_PLUGIN_DIR__', '/usr/plugins'); |
||||
|
||||
/** 定义模板目录(相对路径) */ |
||||
define('__TYPECHO_THEME_DIR__', '/usr/themes'); |
||||
|
||||
/** 后台路径(相对路径) */ |
||||
define('__TYPECHO_ADMIN_DIR__', '/admin/'); |
||||
|
||||
/** 设置包含路径 */ |
||||
@set_include_path(get_include_path() . PATH_SEPARATOR . |
||||
__TYPECHO_ROOT_DIR__ . '/var' . PATH_SEPARATOR . |
||||
__TYPECHO_ROOT_DIR__ . __TYPECHO_PLUGIN_DIR__); |
||||
|
||||
/** 载入API支持 */ |
||||
require_once 'Typecho/Common.php'; |
||||
|
||||
/** 载入Response支持 */ |
||||
require_once 'Typecho/Response.php'; |
||||
|
||||
/** 载入配置支持 */ |
||||
require_once 'Typecho/Config.php'; |
||||
|
||||
/** 载入异常支持 */ |
||||
require_once 'Typecho/Exception.php'; |
||||
|
||||
/** 载入插件支持 */ |
||||
require_once 'Typecho/Plugin.php'; |
||||
|
||||
/** 载入国际化支持 */ |
||||
require_once 'Typecho/I18n.php'; |
||||
|
||||
/** 载入数据库支持 */ |
||||
require_once 'Typecho/Db.php'; |
||||
|
||||
/** 载入路由器支持 */ |
||||
require_once 'Typecho/Router.php'; |
||||
|
||||
/** 程序初始化 */ |
||||
Typecho_Common::init(); |
||||
|
||||
else: |
||||
|
||||
require_once dirname(__FILE__) . '/config.inc.php'; |
||||
|
||||
//判断是否已经安装 |
||||
$db = Typecho_Db::get(); |
||||
try { |
||||
$installed = $db->fetchRow($db->select()->from('table.options')->where('name = ?', 'installed')); |
||||
if (empty($installed) || $installed['value'] == 1) { |
||||
Typecho_Response::setStatus(404); |
||||
exit; |
||||
} |
||||
} catch (Exception $e) { |
||||
// do nothing |
||||
} |
||||
|
||||
endif; |
||||
|
||||
// 挡掉可能的跨站请求 |
||||
if (!empty($_GET) || !empty($_POST)) { |
||||
if (empty($_SERVER['HTTP_REFERER'])) { |
||||
exit; |
||||
} |
||||
|
||||
$parts = parse_url($_SERVER['HTTP_REFERER']); |
||||
if (!empty($parts['port'])) { |
||||
$parts['host'] = "{$parts['host']}:{$parts['port']}"; |
||||
} |
||||
|
||||
if (empty($parts['host']) || $_SERVER['HTTP_HOST'] != $parts['host']) { |
||||
exit; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 获取传递参数 |
||||
* |
||||
* @param string $name 参数名称 |
||||
* @param string $default 默认值 |
||||
* @return string |
||||
*/ |
||||
function _r($name, $default = NULL) { |
||||
return isset($_REQUEST[$name]) ? |
||||
(is_array($_REQUEST[$name]) ? $default : $_REQUEST[$name]) : $default; |
||||
} |
||||
|
||||
/** |
||||
* 获取多个传递参数 |
||||
* |
||||
* @return array |
||||
*/ |
||||
function _rFrom() { |
||||
$result = array(); |
||||
$params = func_get_args(); |
||||
|
||||
foreach ($params as $param) { |
||||
$result[$param] = isset($_REQUEST[$param]) ? |
||||
(is_array($_REQUEST[$param]) ? NULL : $_REQUEST[$param]) : NULL; |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* 输出传递参数 |
||||
* |
||||
* @param string $name 参数名称 |
||||
* @param string $default 默认值 |
||||
* @return string |
||||
*/ |
||||
function _v($name, $default = '') { |
||||
echo _r($name, $default); |
||||
} |
||||
|
||||
/** |
||||
* 判断是否兼容某个环境(perform) |
||||
* |
||||
* @param string $adapter 适配器 |
||||
* @return boolean |
||||
*/ |
||||
function _p($adapter) { |
||||
switch ($adapter) { |
||||
case 'Mysql': |
||||
return Typecho_Db_Adapter_Mysql::isAvailable(); |
||||
case 'Mysqli': |
||||
return Typecho_Db_Adapter_Mysqli::isAvailable(); |
||||
case 'Pdo_Mysql': |
||||
return Typecho_Db_Adapter_Pdo_Mysql::isAvailable(); |
||||
case 'SQLite': |
||||
return Typecho_Db_Adapter_SQLite::isAvailable(); |
||||
case 'Pdo_SQLite': |
||||
return Typecho_Db_Adapter_Pdo_SQLite::isAvailable(); |
||||
case 'Pgsql': |
||||
return Typecho_Db_Adapter_Pgsql::isAvailable(); |
||||
case 'Pdo_Pgsql': |
||||
return Typecho_Db_Adapter_Pdo_Pgsql::isAvailable(); |
||||
default: |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 获取url地址 |
||||
* |
||||
* @return string |
||||
*/ |
||||
function _u() { |
||||
$url = Typecho_Request::getUrlPrefix() . $_SERVER['REQUEST_URI']; |
||||
if (isset($_SERVER['QUERY_STRING'])) { |
||||
$url = str_replace('?' . $_SERVER['QUERY_STRING'], '', $url); |
||||
} |
||||
|
||||
return dirname($url); |
||||
} |
||||
|
||||
$options = new stdClass(); |
||||
$options->generator = 'Typecho ' . Typecho_Common::VERSION; |
||||
list($soft, $currentVersion) = explode(' ', $options->generator); |
||||
|
||||
$options->software = $soft; |
||||
$options->version = $currentVersion; |
||||
|
||||
list($prefixVersion, $suffixVersion) = explode('/', $currentVersion); |
||||
|
||||
/** 获取语言 */ |
||||
$lang = _r('lang', Typecho_Cookie::get('__typecho_lang')); |
||||
$langs = Widget_Options_General::getLangs(); |
||||
|
||||
if (empty($lang) && count($langs) > 1) { |
||||
foreach ($langs as $lang) { |
||||
if ('zh_CN' != $lang) { |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (empty($lang)) { |
||||
$lang = 'zh_CN'; |
||||
} |
||||
|
||||
if ('zh_CN' != $lang) { |
||||
$dir = defined('__TYPECHO_LANG_DIR__') ? __TYPECHO_LANG_DIR__ : __TYPECHO_ROOT_DIR__ . '/usr/langs'; |
||||
Typecho_I18n::setLang($dir . '/' . $lang . '.mo'); |
||||
} |
||||
|
||||
Typecho_Cookie::set('__typecho_lang', $lang); |
||||
|
||||
?><!DOCTYPE HTML> |
||||
<html xmlns="http://www.w3.org/1999/xhtml"> |
||||
<head lang="zh-CN"> |
||||
<meta charset="<?php _e('UTF-8'); ?>" />
|
||||
<title><?php _e('Typecho 安装程序'); ?></title>
|
||||
<link rel="stylesheet" type="text/css" href="admin/css/normalize.css" /> |
||||
<link rel="stylesheet" type="text/css" href="admin/css/grid.css" /> |
||||
<link rel="stylesheet" type="text/css" href="admin/css/style.css" /> |
||||
</head> |
||||
<body> |
||||
<div class="typecho-install-patch"> |
||||
<h1>Typecho</h1> |
||||
<ol class="path"> |
||||
<li<?php if (!isset($_GET['finish']) && !isset($_GET['config'])) : ?> class="current"<?php endif; ?>><span>1</span><?php _e('欢迎使用'); ?></li>
|
||||
<li<?php if (isset($_GET['config'])) : ?> class="current"<?php endif; ?>><span>2</span><?php _e('初始化配置'); ?></li>
|
||||
<li<?php if (isset($_GET['start'])) : ?> class="current"<?php endif; ?>><span>3</span><?php _e('开始安装'); ?></li>
|
||||
<li<?php if (isset($_GET['finish'])) : ?> class="current"<?php endif; ?>><span>4</span><?php _e('安装成功'); ?></li>
|
||||
</ol> |
||||
</div> |
||||
<div class="container"> |
||||
<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'])) : ?> |
||||
<?php if (!isset($db)) : ?> |
||||
<h1 class="typecho-install-title"><?php _e('安装失败!'); ?></h1>
|
||||
<div class="typecho-install-body"> |
||||
<form method="post" action="?config" name="config"> |
||||
<p class="message error"><?php _e('您没有上传 config.inc.php 文件,请您重新安装!'); ?> <button class="btn primary" type="submit"><?php _e('重新安装 »'); ?></button></p>
|
||||
</form> |
||||
</div> |
||||
<?php elseif (!Typecho_Cookie::get('__typecho_config')): ?> |
||||
<h1 class="typecho-install-title"><?php _e('没有安装!'); ?></h1>
|
||||
<div class="typecho-install-body"> |
||||
<form method="post" action="?config" name="config"> |
||||
<p class="message error"><?php _e('您没有执行安装步骤,请您重新安装!'); ?> <button class="btn primary" type="submit"><?php _e('重新安装 »'); ?></button></p>
|
||||
</form> |
||||
</div> |
||||
<?php else : ?> |
||||
<?php |
||||
$db->query($db->update('table.options')->rows(['value' => 1])->where('name = ?', 'installed')); |
||||
?> |
||||
<h1 class="typecho-install-title"><?php _e('安装成功!'); ?></h1>
|
||||
<div class="typecho-install-body"> |
||||
<div class="message success"> |
||||
<?php if(isset($_GET['use_old']) ) : ?> |
||||
<?php _e('您选择了使用原有的数据, 您的用户名和密码和原来的一致'); ?> |
||||
<?php else : ?> |
||||
<?php if (isset($_REQUEST['user']) && isset($_REQUEST['password'])): ?> |
||||
<?php _e('您的用户名是'); ?>: <strong class="mono"><?php echo htmlspecialchars(_r('user')); ?></strong><br>
|
||||
<?php _e('您的密码是'); ?>: <strong class="mono"><?php echo htmlspecialchars(_r('password')); ?></strong>
|
||||
<?php endif;?> |
||||
<?php endif;?> |
||||
</div> |
||||
|
||||
<div class="p message notice"> |
||||
<a target="_blank" href="http://spreadsheets.google.com/viewform?key=pd1Gl4Ur_pbniqgebs5JRIg&hl=en">参与用户调查, 帮助我们完善产品</a> |
||||
</div> |
||||
|
||||
<div class="session"> |
||||
<p><?php _e('您可以将下面两个链接保存到您的收藏夹'); ?>:</p>
|
||||
<ul> |
||||
<?php |
||||
if (isset($_REQUEST['user']) && isset($_REQUEST['password'])) { |
||||
$loginUrl = _u() . '/index.php/action/login?name=' . urlencode(_r('user')) . '&password=' |
||||
. urlencode(_r('password')) . '&referer=' . _u() . '/admin/index.php'; |
||||
$loginUrl = Typecho_Widget::widget('Widget_Security')->getTokenUrl($loginUrl); |
||||
} else { |
||||
$loginUrl = _u() . '/admin/index.php'; |
||||
} |
||||
?> |
||||
<li><a href="<?php echo $loginUrl; ?>"><?php _e('点击这里访问您的控制面板'); ?></a></li>
|
||||
<li><a href="<?php echo _u(); ?>/index.php"><?php _e('点击这里查看您的 Blog'); ?></a></li>
|
||||
</ul> |
||||
</div> |
||||
|
||||
<p><?php _e('希望您能尽情享用 Typecho 带来的乐趣!'); ?></p>
|
||||
</div> |
||||
<?php endif;?> |
||||
<?php elseif (isset($_GET['start'])): ?> |
||||
<?php if (!isset($db)) : ?> |
||||
<h1 class="typecho-install-title"><?php _e('安装失败!'); ?></h1>
|
||||
<div class="typecho-install-body"> |
||||
<form method="post" action="?config" name="config"> |
||||
<p class="message error"><?php _e('您没有上传 config.inc.php 文件,请您重新安装!'); ?> <button class="btn primary" type="submit"><?php _e('重新安装 »'); ?></button></p>
|
||||
</form> |
||||
</div> |
||||
<?php else : ?> |
||||
<?php |
||||
$config = unserialize(base64_decode(Typecho_Cookie::get('__typecho_config'))); |
||||
$type = explode('_', $config['adapter']); |
||||
$type = array_pop($type); |
||||
$type = $type == 'Mysqli' ? 'Mysql' : $type; |
||||
$installDb = $db; |
||||
|
||||
try { |
||||
/** 初始化数据库结构 */ |
||||
$scripts = file_get_contents ('./install/' . $type . '.sql'); |
||||
$scripts = str_replace('typecho_', $config['prefix'], $scripts); |
||||
|
||||
if (isset($config['charset'])) { |
||||
$scripts = str_replace('%charset%', $config['charset'], $scripts); |
||||
} |
||||
|
||||
$scripts = explode(';', $scripts); |
||||
foreach ($scripts as $script) { |
||||
$script = trim($script); |
||||
if ($script) { |
||||
$installDb->query($script, Typecho_Db::WRITE); |
||||
} |
||||
} |
||||
|
||||
/** 全局变量 */ |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'theme', 'user' => 0, 'value' => 'default'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'theme:default', 'user' => 0, 'value' => 'a:2:{s:7:"logoUrl";N;s:12:"sidebarBlock";a:5:{i:0;s:15:"ShowRecentPosts";i:1;s:18:"ShowRecentComments";i:2;s:12:"ShowCategory";i:3;s:11:"ShowArchive";i:4;s:9:"ShowOther";}}'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'timezone', 'user' => 0, 'value' => _t('28800')))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'lang', 'user' => 0, 'value' => $lang))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'charset', 'user' => 0, 'value' => _t('UTF-8')))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'contentType', 'user' => 0, 'value' => 'text/html'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'gzip', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'generator', 'user' => 0, 'value' => $options->generator))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'title', 'user' => 0, 'value' => 'Hello World'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'description', 'user' => 0, 'value' => 'Just So So ...'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'keywords', 'user' => 0, 'value' => 'typecho,php,blog'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'rewrite', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'frontPage', 'user' => 0, 'value' => 'recent'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'frontArchive', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsRequireMail', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsWhitelist', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsRequireURL', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsRequireModeration', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'plugins', 'user' => 0, 'value' => 'a:0:{}'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentDateFormat', 'user' => 0, 'value' => 'F jS, Y \a\t h:i a'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'siteUrl', 'user' => 0, 'value' => $config['siteUrl']))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'defaultCategory', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'allowRegister', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'defaultAllowComment', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'defaultAllowPing', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'defaultAllowFeed', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'pageSize', 'user' => 0, 'value' => 5))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'postsListSize', 'user' => 0, 'value' => 10))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsListSize', 'user' => 0, 'value' => 10))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsHTMLTagAllowed', 'user' => 0, 'value' => NULL))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'postDateFormat', 'user' => 0, 'value' => 'Y-m-d'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'feedFullText', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'editorSize', 'user' => 0, 'value' => 350))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'autoSave', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'markdown', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'xmlrpcMarkdown', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsMaxNestingLevels', 'user' => 0, 'value' => 5))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPostTimeout', 'user' => 0, 'value' => 24 * 3600 * 30))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsUrlNofollow', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsShowUrl', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsMarkdown', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPageBreak', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsThreaded', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPageSize', 'user' => 0, 'value' => 20))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPageDisplay', 'user' => 0, 'value' => 'last'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsOrder', 'user' => 0, 'value' => 'ASC'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsCheckReferer', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsAutoClose', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPostIntervalEnable', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsPostInterval', 'user' => 0, 'value' => 60))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsShowCommentOnly', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsAvatar', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsAvatarRating', 'user' => 0, 'value' => 'G'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'commentsAntiSpam', 'user' => 0, 'value' => 1))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'routingTable', 'user' => 0, 'value' => 'a:25:{s:5:"index";a:3:{s:3:"url";s:1:"/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:7:"archive";a:3:{s:3:"url";s:6:"/blog/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:2:"do";a:3:{s:3:"url";s:22:"/action/[action:alpha]";s:6:"widget";s:9:"Widget_Do";s:6:"action";s:6:"action";}s:4:"post";a:3:{s:3:"url";s:24:"/archives/[cid:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:10:"attachment";a:3:{s:3:"url";s:26:"/attachment/[cid:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:8:"category";a:3:{s:3:"url";s:17:"/category/[slug]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:3:"tag";a:3:{s:3:"url";s:12:"/tag/[slug]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:6:"author";a:3:{s:3:"url";s:22:"/author/[uid:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:6:"search";a:3:{s:3:"url";s:19:"/search/[keywords]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:10:"index_page";a:3:{s:3:"url";s:21:"/page/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:12:"archive_page";a:3:{s:3:"url";s:26:"/blog/page/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:13:"category_page";a:3:{s:3:"url";s:32:"/category/[slug]/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:8:"tag_page";a:3:{s:3:"url";s:27:"/tag/[slug]/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:11:"author_page";a:3:{s:3:"url";s:37:"/author/[uid:digital]/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:11:"search_page";a:3:{s:3:"url";s:34:"/search/[keywords]/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:12:"archive_year";a:3:{s:3:"url";s:18:"/[year:digital:4]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:13:"archive_month";a:3:{s:3:"url";s:36:"/[year:digital:4]/[month:digital:2]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:11:"archive_day";a:3:{s:3:"url";s:52:"/[year:digital:4]/[month:digital:2]/[day:digital:2]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:17:"archive_year_page";a:3:{s:3:"url";s:38:"/[year:digital:4]/page/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:18:"archive_month_page";a:3:{s:3:"url";s:56:"/[year:digital:4]/[month:digital:2]/page/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:16:"archive_day_page";a:3:{s:3:"url";s:72:"/[year:digital:4]/[month:digital:2]/[day:digital:2]/page/[page:digital]/";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:12:"comment_page";a:3:{s:3:"url";s:53:"[permalink:string]/comment-page-[commentPage:digital]";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}s:4:"feed";a:3:{s:3:"url";s:20:"/feed[feed:string:0]";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:4:"feed";}s:8:"feedback";a:3:{s:3:"url";s:31:"[permalink:string]/[type:alpha]";s:6:"widget";s:15:"Widget_Feedback";s:6:"action";s:6:"action";}s:4:"page";a:3:{s:3:"url";s:12:"/[slug].html";s:6:"widget";s:14:"Widget_Archive";s:6:"action";s:6:"render";}}'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'actionTable', 'user' => 0, 'value' => 'a:0:{}'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'panelTable', 'user' => 0, 'value' => 'a:0:{}'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'attachmentTypes', 'user' => 0, 'value' => '@image@'))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'secret', 'user' => 0, 'value' => Typecho_Common::randString(32, true)))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'installed', 'user' => 0, 'value' => 0))); |
||||
$installDb->query($installDb->insert('table.options')->rows(array('name' => 'allowXmlRpc', 'user' => 0, 'value' => 2))); |
||||
|
||||
/** 初始分类 */ |
||||
$installDb->query($installDb->insert('table.metas')->rows(array('name' => _t('默认分类'), 'slug' => 'default', 'type' => 'category', 'description' => _t('只是一个默认分类'), |
||||
'count' => 1, 'order' => 1))); |
||||
|
||||
/** 初始关系 */ |
||||
$installDb->query($installDb->insert('table.relationships')->rows(array('cid' => 1, 'mid' => 1))); |
||||
|
||||
/** 初始内容 */ |
||||
$installDb->query($installDb->insert('table.contents')->rows(array('title' => _t('欢迎使用 Typecho'), 'slug' => 'start', 'created' => Typecho_Date::time(), 'modified' => Typecho_Date::time(), |
||||
'text' => '<!--markdown-->' . _t('如果您看到这篇文章,表示您的 blog 已经安装成功.'), 'authorId' => 1, 'type' => 'post', 'status' => 'publish', 'commentsNum' => 1, 'allowComment' => 1, |
||||
'allowPing' => 1, 'allowFeed' => 1, 'parent' => 0))); |
||||
|
||||
$installDb->query($installDb->insert('table.contents')->rows(array('title' => _t('关于'), 'slug' => 'start-page', 'created' => Typecho_Date::time(), 'modified' => Typecho_Date::time(), |
||||
'text' => '<!--markdown-->' . _t('本页面由 Typecho 创建, 这只是个测试页面.'), 'authorId' => 1, 'order' => 0, 'type' => 'page', 'status' => 'publish', 'commentsNum' => 0, 'allowComment' => 1, |
||||
'allowPing' => 1, 'allowFeed' => 1, 'parent' => 0))); |
||||
|
||||
/** 初始评论 */ |
||||
$installDb->query($installDb->insert('table.comments')->rows(array('cid' => 1, 'created' => Typecho_Date::time(), 'author' => 'Typecho', 'ownerId' => 1, 'url' => 'http://typecho.org', |
||||
'ip' => '127.0.0.1', 'agent' => $options->generator, 'text' => '欢迎加入 Typecho 大家族', 'type' => 'comment', 'status' => 'approved', 'parent' => 0))); |
||||
|
||||
/** 初始用户 */ |
||||
$password = empty($config['userPassword']) ? substr(uniqid(), 7) : $config['userPassword']; |
||||
$hasher = new PasswordHash(8, true); |
||||
|
||||
$installDb->query($installDb->insert('table.users')->rows(array('name' => $config['userName'], 'password' => $hasher->HashPassword($password), 'mail' => $config['userMail'], |
||||
'url' => 'http://www.typecho.org', 'screenName' => $config['userName'], 'group' => 'administrator', 'created' => Typecho_Date::time()))); |
||||
|
||||
unset($_SESSION['typecho']); |
||||
header('Location: ./install.php?finish&user=' . urlencode($config['userName']) |
||||
. '&password=' . urlencode($password)); |
||||
} catch (Typecho_Db_Exception $e) { |
||||
$success = false; |
||||
$code = $e->getCode(); |
||||
?> |
||||
<h1 class="typecho-install-title"><?php _e('安装失败!'); ?></h1>
|
||||
<div class="typecho-install-body"> |
||||
<form method="post" action="?start" name="check"> |
||||
<?php |
||||
if(('Mysql' == $type && (1050 == $code || '42S01' == $code)) || |
||||
('SQLite' == $type && ('HY000' == $code || 1 == $code)) || |
||||
('Pgsql' == $type && '42P07' == $code)) { |
||||
if(_r('delete')) { |
||||
//删除原有数据 |
||||
$dbPrefix = $config['prefix']; |
||||
$tableArray = array($dbPrefix . 'comments', $dbPrefix . 'contents', $dbPrefix . 'fields', $dbPrefix . 'metas', $dbPrefix . 'options', $dbPrefix . 'relationships', $dbPrefix . 'users',); |
||||
foreach($tableArray as $table) { |
||||
if($type == 'Mysql') { |
||||
$installDb->query("DROP TABLE IF EXISTS `{$table}`"); |
||||
} elseif($type == 'Pgsql') { |
||||
$installDb->query("DROP TABLE {$table}"); |
||||
} elseif($type == 'SQLite') { |
||||
$installDb->query("DROP TABLE {$table}"); |
||||
} |
||||
} |
||||
echo '<p class="message success">' . _t('已经删除完原有数据') . '<br /><br /><button class="btn primary" type="submit" class="primary">' |
||||
. _t('继续安装 »') . '</button></p>'; |
||||
} elseif (_r('goahead')) { |
||||
//使用原有数据 |
||||
//但是要更新用户网站 |
||||
$installDb->query($installDb->update('table.options')->rows(array('value' => $config['siteUrl']))->where('name = ?', 'siteUrl')); |
||||
unset($_SESSION['typecho']); |
||||
header('Location: ./install.php?finish&use_old'); |
||||
exit; |
||||
} else { |
||||
echo '<p class="message error">' . _t('安装程序检查到原有数据表已经存在.') |
||||
. '<br /><br />' . '<button type="submit" name="delete" value="1" class="btn btn-warn">' . _t('删除原有数据') . '</button> ' |
||||
. _t('或者') . ' <button type="submit" name="goahead" value="1" class="btn primary">' . _t('使用原有数据') . '</button></p>'; |
||||
} |
||||
} else { |
||||
echo '<p class="message error">' . _t('安装程序捕捉到以下错误: "%s". 程序被终止, 请检查您的配置信息.',$e->getMessage()) . '</p>'; |
||||
} |
||||
?> |
||||
</form> |
||||
</div> |
||||
<?php |
||||
} |
||||
?> |
||||
<?php endif;?> |
||||
<?php elseif (isset($_GET['config'])): ?> |
||||
<?php |
||||
$adapters = array('Mysql', 'Mysqli', 'Pdo_Mysql', 'SQLite', 'Pdo_SQLite', 'Pgsql', 'Pdo_Pgsql'); |
||||
foreach ($adapters as $firstAdapter) { |
||||
if (_p($firstAdapter)) { |
||||
break; |
||||
} |
||||
} |
||||
$adapter = _r('dbAdapter', $firstAdapter); |
||||
$parts = explode('_', $adapter); |
||||
|
||||
$type = $adapter == 'Mysqli' ? 'Mysql' : array_pop($parts); |
||||
?> |
||||
<form method="post" action="?config" name="config"> |
||||
<h1 class="typecho-install-title"><?php _e('确认您的配置'); ?></h1>
|
||||
<div class="typecho-install-body"> |
||||
<h2><?php _e('数据库配置'); ?></h2>
|
||||
<?php |
||||
if ('config' == _r('action')) { |
||||
$success = true; |
||||
|
||||
if (_r('created') && !file_exists('./config.inc.php')) { |
||||
echo '<p class="message error">' . _t('没有检测到您手动创建的配置文件, 请检查后再次创建') . '</p>'; |
||||
$success = false; |
||||
} else { |
||||
if (NULL == _r('userUrl')) { |
||||
$success = false; |
||||
echo '<p class="message error">' . _t('请填写您的网站地址') . '</p>'; |
||||
} else if (NULL == _r('userName')) { |
||||
$success = false; |
||||
echo '<p class="message error">' . _t('请填写您的用户名') . '</p>'; |
||||
} else if (NULL == _r('userMail')) { |
||||
$success = false; |
||||
echo '<p class="message error">' . _t('请填写您的邮箱地址') . '</p>'; |
||||
} else if (32 < strlen(_r('userName'))) { |
||||
$success = false; |
||||
echo '<p class="message error">' . _t('用户名长度超过限制, 请不要超过 32 个字符') . '</p>'; |
||||
} else if (200 < strlen(_r('userMail'))) { |
||||
$success = false; |
||||
echo '<p class="message error">' . _t('邮箱长度超过限制, 请不要超过 200 个字符') . '</p>'; |
||||
} |
||||
} |
||||
|
||||
$_dbConfig = _rFrom('dbHost', 'dbUser', 'dbPassword', 'dbCharset', 'dbPort', 'dbDatabase', 'dbFile', 'dbDsn'); |
||||
|
||||
$_dbConfig = array_filter($_dbConfig); |
||||
$dbConfig = array(); |
||||
foreach ($_dbConfig as $key => $val) { |
||||
$dbConfig[strtolower (substr($key, 2))] = $val; |
||||
} |
||||
|
||||
// 在特殊服务器上的特殊安装过程处理 |
||||
if (_r('config')) { |
||||
$replace = array_keys($dbConfig); |
||||
foreach ($replace as &$key) { |
||||
$key = '{' . $key . '}'; |
||||
} |
||||
|
||||
if (!empty($_dbConfig['dbDsn'])) { |
||||
$dbConfig['dsn'] = str_replace($replace, array_values($dbConfig), $dbConfig['dsn']); |
||||
} |
||||
$config = str_replace($replace, array_values($dbConfig), _r('config')); |
||||
} |
||||
|
||||
if (!isset($config) && $success && !_r('created')) { |
||||
$installDb = new Typecho_Db($adapter, _r('dbPrefix')); |
||||
$installDb->addServer($dbConfig, Typecho_Db::READ | Typecho_Db::WRITE); |
||||
|
||||
|
||||
/** 检测数据库配置 */ |
||||
try { |
||||
$installDb->query('SELECT 1=1'); |
||||
} catch (Typecho_Db_Adapter_Exception $e) { |
||||
$success = false; |
||||
echo '<p class="message error">' |
||||
. _t('对不起,无法连接数据库,请先检查数据库配置再继续进行安装') . '</p>'; |
||||
} catch (Typecho_Db_Exception $e) { |
||||
$success = false; |
||||
echo '<p class="message error">' |
||||
. _t('安装程序捕捉到以下错误: " %s ". 程序被终止, 请检查您的配置信息.',$e->getMessage()) . '</p>'; |
||||
} |
||||
} |
||||
|
||||
if($success) { |
||||
// 重置原有数据库状态 |
||||
if (isset($installDb)) { |
||||
try { |
||||
$installDb->query($installDb->update('table.options') |
||||
->rows(array('value' => 0))->where('name = ?', 'installed')); |
||||
} catch (Exception $e) { |
||||
// do nothing |
||||
} |
||||
} |
||||
|
||||
Typecho_Cookie::set('__typecho_config', base64_encode(serialize(array_merge(array( |
||||
'prefix' => _r('dbPrefix'), |
||||
'userName' => _r('userName'), |
||||
'userPassword' => _r('userPassword'), |
||||
'userMail' => _r('userMail'), |
||||
'adapter' => $adapter, |
||||
'siteUrl' => _r('userUrl') |
||||
), $dbConfig)))); |
||||
|
||||
if (_r('created')) { |
||||
header('Location: ./install.php?start'); |
||||
exit; |
||||
} |
||||
|
||||
/** 初始化配置文件 */ |
||||
$lines = array_slice(file(__FILE__), 1, 52); |
||||
$lines[] = " |
||||
/** 定义数据库参数 */ |
||||
\$db = new Typecho_Db('{$adapter}', '" . _r('dbPrefix') . "'); |
||||
\$db->addServer(" . (empty($config) ? var_export($dbConfig, true) : $config) . ", Typecho_Db::READ | Typecho_Db::WRITE); |
||||
Typecho_Db::set(\$db); |
||||
"; |
||||
$contents = implode('', $lines); |
||||
if (!Typecho_Common::isAppEngine()) { |
||||
@file_put_contents('./config.inc.php', $contents); |
||||
} |
||||
|
||||
if (!file_exists('./config.inc.php')) { |
||||
?> |
||||
<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 mono" readonly><?php echo htmlspecialchars($contents); ?></textarea></p>
|
||||
<p><button name="created" value="1" type="submit" class="btn primary">创建完毕, 继续安装 »</button></p></div> |
||||
<?php |
||||
} else { |
||||
header('Location: ./install.php?start'); |
||||
exit; |
||||
} |
||||
} |
||||
|
||||
// 安装不成功删除配置文件 |
||||
if($success != true && file_exists(__TYPECHO_ROOT_DIR__ . '/config.inc.php')) { |
||||
@unlink(__TYPECHO_ROOT_DIR__ . '/config.inc.php'); |
||||
} |
||||
} |
||||
?> |
||||
<ul class="typecho-option"> |
||||
<li> |
||||
<label for="dbAdapter" class="typecho-label"><?php _e('数据库适配器'); ?></label>
|
||||
<select name="dbAdapter" id="dbAdapter"> |
||||
<?php if (_p('Mysql')): ?><option value="Mysql"<?php if('Mysql' == $adapter): ?> selected="selected"<?php endif; ?>><?php _e('Mysql 原生函数适配器') ?></option><?php endif; ?> |
||||
<?php if (_p('SQLite')): ?><option value="SQLite"<?php if('SQLite' == $adapter): ?> selected="selected"<?php endif; ?>><?php _e('SQLite 原生函数适配器 (SQLite 2.x)') ?></option><?php endif; ?> |
||||
<?php if (_p('Pgsql')): ?><option value="Pgsql"<?php if('Pgsql' == $adapter): ?> selected="selected"<?php endif; ?>><?php _e('Pgsql 原生函数适配器') ?></option><?php endif; ?> |
||||
<?php if (_p('Pdo_Mysql')): ?><option value="Pdo_Mysql"<?php if('Pdo_Mysql' == $adapter): ?> selected="selected"<?php endif; ?>><?php _e('Pdo 驱动 Mysql 适配器') ?></option><?php endif; ?> |
||||
<?php if (_p('Pdo_SQLite')): ?><option value="Pdo_SQLite"<?php if('Pdo_SQLite' == $adapter): ?> selected="selected"<?php endif; ?>><?php _e('Pdo 驱动 SQLite 适配器 (SQLite 3.x)') ?></option><?php endif; ?> |
||||
<?php if (_p('Pdo_Pgsql')): ?><option value="Pdo_Pgsql"<?php if('Pdo_Pgsql' == $adapter): ?> selected="selected"<?php endif; ?>><?php _e('Pdo 驱动 PostgreSql 适配器') ?></option><?php endif; ?> |
||||
</select> |
||||
<p class="description"><?php _e('请根据您的数据库类型选择合适的适配器'); ?></p>
|
||||
</li> |
||||
<?php require_once './install/' . $type . '.php'; ?> |
||||
<li> |
||||
<label class="typecho-label" for="dbPrefix"><?php _e('数据库前缀'); ?></label>
|
||||
<input type="text" class="text" name="dbPrefix" id="dbPrefix" value="<?php _v('dbPrefix', 'typecho_'); ?>" />
|
||||
<p class="description"><?php _e('默认前缀是 "typecho_"'); ?></p>
|
||||
</li> |
||||
</ul> |
||||
|
||||
<script> |
||||
var _select = document.config.dbAdapter; |
||||
_select.onchange = function() { |
||||
setTimeout("window.location.href = 'install.php?config&dbAdapter=" + this.value + "'; ",0); |
||||
} |
||||
</script> |
||||
|
||||
<h2><?php _e('创建您的管理员帐号'); ?></h2>
|
||||
<ul class="typecho-option"> |
||||
<li> |
||||
<label class="typecho-label" for="userUrl"><?php _e('网站地址'); ?></label>
|
||||
<input type="text" name="userUrl" id="userUrl" class="text" value="<?php _v('userUrl', _u()); ?>" />
|
||||
<p class="description"><?php _e('这是程序自动匹配的网站路径, 如果不正确请修改它'); ?></p>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="userName"><?php _e('用户名'); ?></label>
|
||||
<input type="text" name="userName" id="userName" class="text" value="<?php _v('userName', 'admin'); ?>" />
|
||||
<p class="description"><?php _e('请填写您的用户名'); ?></p>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="userPassword"><?php _e('登录密码'); ?></label>
|
||||
<input type="password" name="userPassword" id="userPassword" class="text" value="<?php _v('userPassword'); ?>" />
|
||||
<p class="description"><?php _e('请填写您的登录密码, 如果留空系统将为您随机生成一个'); ?></p>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="userMail"><?php _e('邮件地址'); ?></label>
|
||||
<input type="text" name="userMail" id="userMail" class="text" value="<?php _v('userMail', 'webmaster@yourdomain.com'); ?>" />
|
||||
<p class="description"><?php _e('请填写一个您的常用邮箱'); ?></p>
|
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<input type="hidden" name="action" value="config" /> |
||||
<p class="submit"><button type="submit" class="btn primary"><?php _e('确认, 开始安装 »'); ?></button></p>
|
||||
</form> |
||||
<?php else: ?> |
||||
<form method="post" action="?config"> |
||||
<h1 class="typecho-install-title"><?php _e('欢迎使用 Typecho'); ?></h1>
|
||||
<div class="typecho-install-body"> |
||||
<h2><?php _e('安装说明'); ?></h2>
|
||||
<p><strong><?php _e('本安装程序将自动检测服务器环境是否符合最低配置需求. 如果不符合, 将在上方出现提示信息, 请按照提示信息检查您的主机配置. 如果服务器环境符合要求, 将在下方出现 "开始下一步" 的按钮, 点击此按钮即可一步完成安装.'); ?></strong></p>
|
||||
<h2><?php _e('许可及协议'); ?></h2>
|
||||
<p><?php _e('Typecho 基于 <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> 协议发布, 我们允许用户在 GPL 协议许可的范围内使用, 拷贝, 修改和分发此程序.'); ?> |
||||
<?php _e('在GPL许可的范围内,您可以自由地将其用于商业以及非商业用途.'); ?></p>
|
||||
<p><?php _e('Typecho 软件由其社区提供支持, 核心开发团队负责维护程序日常开发工作以及新特性的制定.'); ?> |
||||
<?php _e('如果您遇到使用上的问题, 程序中的 BUG, 以及期许的新功能, 欢迎您在社区中交流或者直接向我们贡献代码.'); ?> |
||||
<?php _e('对于贡献突出者, 他的名字将出现在贡献者名单中.'); ?></p>
|
||||
</div> |
||||
<p class="submit"> |
||||
<button type="submit" class="btn primary"><?php _e('我准备好了, 开始下一步 »'); ?></button>
|
||||
|
||||
<?php if (count($langs) > 1): ?> |
||||
<select style="float: right" onchange="window.location.href='install.php?lang=' + this.value"> |
||||
<?php foreach ($langs as $key => $val): ?> |
||||
<option value="<?php echo $key; ?>"<?php if ($lang == $key): ?> selected<?php endif; ?>><?php echo $val; ?></option>
|
||||
<?php endforeach; ?> |
||||
</select> |
||||
<?php endif; ?> |
||||
</p> |
||||
</form> |
||||
<?php endif; ?> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<?php |
||||
include 'admin/copyright.php'; |
||||
include 'admin/footer.php'; |
||||
?> |
@ -0,0 +1,175 @@ |
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
|
||||
<?php |
||||
$engine = ''; |
||||
|
||||
if (defined('SAE_MYSQL_DB') && SAE_MYSQL_DB != "app_") { |
||||
$engine = 'SAE'; |
||||
} else if (!!getenv('HTTP_BAE_ENV_ADDR_SQL_IP')) { |
||||
$engine = 'BAE'; |
||||
} else if (ini_get('acl.app_id') && class_exists('Alibaba')) { |
||||
$engine = 'ACE'; |
||||
} else if (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false) { |
||||
$engine = 'GAE'; |
||||
} |
||||
?> |
||||
|
||||
<?php if (!empty($engine)): ?> |
||||
<h3 class="warning"><?php _e('系统将为您自动匹配 %s 环境的安装选项', $engine); ?></h3>
|
||||
<?php endif; ?> |
||||
|
||||
<?php if ('SAE' == $engine): ?> |
||||
<!-- SAE --> |
||||
<input type="hidden" name="config" value="array ( |
||||
'host' => SAE_MYSQL_HOST_M, |
||||
'user' => SAE_MYSQL_USER, |
||||
'password' => SAE_MYSQL_PASS, |
||||
'charset' => '<?php _e('utf8'); ?>',
|
||||
'port' => SAE_MYSQL_PORT, |
||||
'database' => SAE_MYSQL_DB |
||||
)" /> |
||||
<input type="hidden" name="dbHost" value="<?php echo SAE_MYSQL_HOST_M; ?>" />
|
||||
<input type="hidden" name="dbPort" value="<?php echo SAE_MYSQL_PORT; ?>" />
|
||||
<input type="hidden" name="dbUser" value="<?php echo SAE_MYSQL_USER; ?>" />
|
||||
<input type="hidden" name="dbPassword" value="<?php echo SAE_MYSQL_PASS; ?>" />
|
||||
<input type="hidden" name="dbDatabase" value="<?php echo SAE_MYSQL_DB; ?>" />
|
||||
<?php elseif ('BAE' == $engine): |
||||
$baeDbUser = "getenv('HTTP_BAE_ENV_AK')"; |
||||
$baeDbPassword = "getenv('HTTP_BAE_ENV_SK')"; |
||||
?> |
||||
<!-- BAE --> |
||||
<?php if (!getenv('HTTP_BAE_ENV_AK')): $baeDbUser = "'{user}'"; ?> |
||||
<li> |
||||
<label class="typecho-label" for="dbUser"><?php _e('应用API Key'); ?></label>
|
||||
<input type="text" class="text" name="dbUser" id="dbUser" value="<?php _v('dbUser'); ?>" />
|
||||
</li> |
||||
<?php else: ?> |
||||
<input type="hidden" name="dbUser" value="<?php echo getenv('HTTP_BAE_ENV_AK'); ?>" />
|
||||
<?php endif; ?> |
||||
|
||||
<?php if (!getenv('HTTP_BAE_ENV_SK')): $baeDbPassword = "'{password}'"; ?> |
||||
<li> |
||||
<label class="typecho-label" for="dbPassword"><?php _e('应用Secret Key'); ?></label>
|
||||
<input type="text" class="text" name="dbPassword" id="dbPassword" value="<?php _v('dbPassword'); ?>" />
|
||||
</li> |
||||
<?php else: ?> |
||||
<input type="hidden" name="dbPassword" value="<?php echo getenv('HTTP_BAE_ENV_SK'); ?>" />
|
||||
<?php endif; ?> |
||||
|
||||
<li> |
||||
<label class="typecho-label" for="dbDatabase"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" id="dbDatabase" name="dbDatabase" value="<?php _v('dbDatabase'); ?>" />
|
||||
<p class="description"><?php _e('可以在MySQL服务的管理页面看到您创建的数据库名称'); ?></p>
|
||||
</li> |
||||
<input type="hidden" name="config" value="array ( |
||||
'host' => getenv('HTTP_BAE_ENV_ADDR_SQL_IP'), |
||||
'user' => <?php echo $baeDbUser; ?>,
|
||||
'password' => <?php echo $baeDbPassword; ?>,
|
||||
'charset' => '<?php _e('utf8'); ?>',
|
||||
'port' => getenv('HTTP_BAE_ENV_ADDR_SQL_PORT'), |
||||
'database' => '{database}' |
||||
)" /> |
||||
<input type="hidden" name="dbHost" value="<?php echo getenv('HTTP_BAE_ENV_ADDR_SQL_IP'); ?>" />
|
||||
<input type="hidden" name="dbPort" value="<?php echo getenv('HTTP_BAE_ENV_ADDR_SQL_PORT'); ?>" />
|
||||
<?php elseif ('ACE' == $engine): ?> |
||||
<!-- ACE --> |
||||
|
||||
<li> |
||||
<label class="typecho-label" for="dbHost"><?php _e('数据库地址'); ?></label>
|
||||
<input type="text" class="text" name="dbHost" id="dbHost" value="<?php _v('dbHost', 'localhost'); ?>"/>
|
||||
<p class="description"><?php _e('您可以访问 RDS 控制台获取详细信息'); ?></p>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbPort"><?php _e('数据库端口'); ?></label>
|
||||
<input type="text" class="text" name="dbPort" id="dbPort" value="<?php _v('dbPort', 3306); ?>"/>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbUser"><?php _e('数据库用户名'); ?></label>
|
||||
<input type="text" class="text" name="dbUser" id="dbUser" value="<?php _v('dbUser'); ?>" />
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbPassword"><?php _e('数据库密码'); ?></label>
|
||||
<input type="password" class="text" name="dbPassword" id="dbPassword" value="<?php _v('dbPassword'); ?>" />
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbDatabase"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" name="dbDatabase" id="dbDatabase" value="<?php _v('dbDatabase', 'typecho'); ?>" />
|
||||
</li> |
||||
|
||||
<?php elseif ('GAE' == $engine): ?> |
||||
<!-- GAE --> |
||||
<h3 class="warning"><?php _e('系统将为您自动匹配 %s 环境的安装选项', 'GAE'); ?></h3>
|
||||
<?php if (0 === strpos($adapter, 'Pdo_')): ?> |
||||
<li> |
||||
<label class="typecho-label" for="dbHost"><?php _e('数据库实例名'); ?></label>
|
||||
<input type="text" class="text" name="dbHost" id="dbHost" value="<?php _v('dbHost'); ?>"/>
|
||||
<p class="description"><?php _e('请填入您在Cloud SQL面板中创建的数据库实例名称, 示例: %s', '<em class="warning">/cloudsql/typecho-gae:typecho</em>'); ?></p>
|
||||
</li> |
||||
<?php else: ?> |
||||
<li> |
||||
<label class="typecho-label" for="dbHost"><?php _e('数据库实例名'); ?></label>
|
||||
<input type="text" class="text" name="dbHost" id="dbHost" value="<?php _v('dbHost'); ?>"/>
|
||||
<p class="description"><?php _e('请填入您在Cloud SQL面板中创建的数据库实例名称, 示例: %s', '<em class="warning">:/cloudsql/typecho-gae:typecho</em>'); ?></p>
|
||||
</li> |
||||
<?php endif; ?> |
||||
|
||||
<li> |
||||
<label class="typecho-label" for="dbUser"><?php _e('数据库用户名'); ?></label>
|
||||
<input type="text" class="text" name="dbUser" id="dbUser" value="<?php _v('dbUser'); ?>" />
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbPassword"><?php _e('数据库密码'); ?></label>
|
||||
<input type="password" class="text" name="dbPassword" id="dbPassword" value="<?php _v('dbPassword'); ?>" />
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbDatabase"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" name="dbDatabase" id="dbDatabase" value="<?php _v('dbDatabase', 'typecho'); ?>" />
|
||||
<p class="description"><?php _e('请填入您在Cloud SQL的实例中创建的数据库名称'); ?></p>
|
||||
</li> |
||||
|
||||
<?php if (0 === strpos($adapter, 'Pdo_')): ?> |
||||
<input type="hidden" name="dbDsn" value="mysql:dbname={database};unix_socket={host};charset=<?php _e('utf8'); ?>" />
|
||||
<input type="hidden" name="config" value="array ( |
||||
'dsn' => '{dsn}', |
||||
'user' => '{user}', |
||||
'password' => '{password}' |
||||
)" /> |
||||
<?php else: ?> |
||||
<input type="hidden" name="config" value="array ( |
||||
'host' => '{host}', |
||||
'database' => '{database}', |
||||
'user' => '{user}', |
||||
'password' => '{password}' |
||||
)" /> |
||||
<?php endif; ?> |
||||
|
||||
|
||||
<?php else: ?> |
||||
<li> |
||||
<label class="typecho-label" for="dbHost"><?php _e('数据库地址'); ?></label>
|
||||
<input type="text" class="text" name="dbHost" id="dbHost" value="<?php _v('dbHost', 'localhost'); ?>"/>
|
||||
<p class="description"><?php _e('您可能会使用 "%s"', 'localhost'); ?></p>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbPort"><?php _e('数据库端口'); ?></label>
|
||||
<input type="text" class="text" name="dbPort" id="dbPort" value="<?php _v('dbPort', '3306'); ?>"/>
|
||||
<p class="description"><?php _e('如果您不知道此选项的意义, 请保留默认设置'); ?></p>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbUser"><?php _e('数据库用户名'); ?></label>
|
||||
<input type="text" class="text" name="dbUser" id="dbUser" value="<?php _v('dbUser', 'root'); ?>" />
|
||||
<p class="description"><?php _e('您可能会使用 "%s"', 'root'); ?></p>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbPassword"><?php _e('数据库密码'); ?></label>
|
||||
<input type="password" class="text" name="dbPassword" id="dbPassword" value="<?php _v('dbPassword'); ?>" />
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbDatabase"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" name="dbDatabase" id="dbDatabase" value="<?php _v('dbDatabase', 'typecho'); ?>" />
|
||||
<p class="description"><?php _e('请您指定数据库名称'); ?></p>
|
||||
</li> |
||||
|
||||
<?php endif; ?> |
||||
<input type="hidden" name="dbCharset" value="<?php _e('utf8'); ?>" />
|
||||
|
@ -0,0 +1,152 @@ |
||||
-- phpMyAdmin SQL Dump |
||||
-- version 2.11.5 |
||||
-- http://www.phpmyadmin.net |
||||
-- |
||||
-- 主机: localhost |
||||
-- 生成日期: 2008 年 07 月 06 日 18:00 |
||||
-- 服务器版本: 5.0.51 |
||||
-- PHP 版本: 5.2.5 |
||||
|
||||
-- |
||||
-- 数据库: `typecho` |
||||
-- |
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- 表的结构 `typecho_comments` |
||||
-- |
||||
|
||||
CREATE TABLE `typecho_comments` ( |
||||
`coid` int(10) unsigned NOT NULL auto_increment, |
||||
`cid` int(10) unsigned default '0', |
||||
`created` int(10) unsigned default '0', |
||||
`author` varchar(200) default NULL, |
||||
`authorId` int(10) unsigned default '0', |
||||
`ownerId` int(10) unsigned default '0', |
||||
`mail` varchar(200) default NULL, |
||||
`url` varchar(200) default NULL, |
||||
`ip` varchar(64) default NULL, |
||||
`agent` varchar(200) default NULL, |
||||
`text` text, |
||||
`type` varchar(16) default 'comment', |
||||
`status` varchar(16) default 'approved', |
||||
`parent` int(10) unsigned default '0', |
||||
PRIMARY KEY (`coid`), |
||||
KEY `cid` (`cid`), |
||||
KEY `created` (`created`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%; |
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- 表的结构 `typecho_contents` |
||||
-- |
||||
|
||||
CREATE TABLE `typecho_contents` ( |
||||
`cid` int(10) unsigned NOT NULL auto_increment, |
||||
`title` varchar(200) default NULL, |
||||
`slug` varchar(200) default NULL, |
||||
`created` int(10) unsigned default '0', |
||||
`modified` int(10) unsigned default '0', |
||||
`text` longtext, |
||||
`order` int(10) unsigned default '0', |
||||
`authorId` int(10) unsigned default '0', |
||||
`template` varchar(32) default NULL, |
||||
`type` varchar(16) default 'post', |
||||
`status` varchar(16) default 'publish', |
||||
`password` varchar(32) default NULL, |
||||
`commentsNum` int(10) unsigned default '0', |
||||
`allowComment` char(1) default '0', |
||||
`allowPing` char(1) default '0', |
||||
`allowFeed` char(1) default '0', |
||||
`parent` int(10) unsigned default '0', |
||||
PRIMARY KEY (`cid`), |
||||
UNIQUE KEY `slug` (`slug`), |
||||
KEY `created` (`created`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%; |
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- 表的结构 `typecho_fields` |
||||
-- |
||||
|
||||
CREATE TABLE `typecho_fields` ( |
||||
`cid` int(10) unsigned NOT NULL, |
||||
`name` varchar(200) NOT NULL, |
||||
`type` varchar(8) default 'str', |
||||
`str_value` text, |
||||
`int_value` int(10) default '0', |
||||
`float_value` float default '0', |
||||
PRIMARY KEY (`cid`,`name`), |
||||
KEY `int_value` (`int_value`), |
||||
KEY `float_value` (`float_value`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%; |
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- 表的结构 `typecho_metas` |
||||
-- |
||||
|
||||
CREATE TABLE `typecho_metas` ( |
||||
`mid` int(10) unsigned NOT NULL auto_increment, |
||||
`name` varchar(200) default NULL, |
||||
`slug` varchar(200) default NULL, |
||||
`type` varchar(32) NOT NULL, |
||||
`description` varchar(200) default NULL, |
||||
`count` int(10) unsigned default '0', |
||||
`order` int(10) unsigned default '0', |
||||
`parent` int(10) unsigned default '0', |
||||
PRIMARY KEY (`mid`), |
||||
KEY `slug` (`slug`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%; |
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- 表的结构 `typecho_options` |
||||
-- |
||||
|
||||
CREATE TABLE `typecho_options` ( |
||||
`name` varchar(32) NOT NULL, |
||||
`user` int(10) unsigned NOT NULL default '0', |
||||
`value` text, |
||||
PRIMARY KEY (`name`,`user`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%; |
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- 表的结构 `typecho_relationships` |
||||
-- |
||||
|
||||
CREATE TABLE `typecho_relationships` ( |
||||
`cid` int(10) unsigned NOT NULL, |
||||
`mid` int(10) unsigned NOT NULL, |
||||
PRIMARY KEY (`cid`,`mid`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%; |
||||
|
||||
-- -------------------------------------------------------- |
||||
|
||||
-- |
||||
-- 表的结构 `typecho_users` |
||||
-- |
||||
|
||||
CREATE TABLE `typecho_users` ( |
||||
`uid` int(10) unsigned NOT NULL auto_increment, |
||||
`name` varchar(32) default NULL, |
||||
`password` varchar(64) default NULL, |
||||
`mail` varchar(200) default NULL, |
||||
`url` varchar(200) default NULL, |
||||
`screenName` varchar(32) default NULL, |
||||
`created` int(10) unsigned default '0', |
||||
`activated` int(10) unsigned default '0', |
||||
`logged` int(10) unsigned default '0', |
||||
`group` varchar(16) default 'visitor', |
||||
`authCode` varchar(64) default NULL, |
||||
PRIMARY KEY (`uid`), |
||||
UNIQUE KEY `name` (`name`), |
||||
UNIQUE KEY `mail` (`mail`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=%charset%; |
@ -0,0 +1,26 @@ |
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<li> |
||||
<label class="typecho-label" for="dbHost"><?php _e('数据库地址'); ?></label>
|
||||
<input type="text" class="text" name="dbHost" id="dbHost" value="<?php _v('dbHost', 'localhost'); ?>"/>
|
||||
<p class="description"><?php _e('您可能会使用 "%s"', 'localhost'); ?></p>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbPort"><?php _e('数据库端口'); ?></label>
|
||||
<input type="text" class="text" name="dbPort" id="dbPort" value="<?php _v('dbPort', '5432'); ?>"/>
|
||||
<p class="description"><?php _e('如果您不知道此选项的意义, 请保留默认设置'); ?></p>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbUser"><?php _e('数据库用户名'); ?></label>
|
||||
<input type="text" class="text" name="dbUser" id="dbUser" value="<?php _v('dbUser', 'postgres'); ?>" />
|
||||
<p class="description"><?php _e('您可能会使用 "%s"', 'postgres'); ?></p>
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbPassword"><?php _e('数据库密码'); ?></label>
|
||||
<input type="password" class="text" name="dbPassword" id="dbPassword" value="<?php _v('dbPassword'); ?>" />
|
||||
</li> |
||||
<li> |
||||
<label class="typecho-label" for="dbDatabase"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" name="dbDatabase" id="dbDatabase" value="<?php _v('dbDatabase', 'typecho'); ?>" />
|
||||
<p class="description"><?php _e('请您指定数据库名称'); ?></p>
|
||||
</li> |
||||
<input type="hidden" name="dbCharset" value="<?php _e('utf8'); ?>" />
|
@ -0,0 +1,130 @@ |
||||
-- |
||||
-- Table structure for table "typecho_comments" |
||||
-- |
||||
CREATE SEQUENCE "typecho_comments_seq"; |
||||
|
||||
CREATE TABLE "typecho_comments" ( "coid" INT NOT NULL DEFAULT nextval('typecho_comments_seq'), |
||||
"cid" INT NULL DEFAULT '0', |
||||
"created" INT NULL DEFAULT '0', |
||||
"author" VARCHAR(200) NULL DEFAULT NULL, |
||||
"authorId" INT NULL DEFAULT '0', |
||||
"ownerId" INT NULL DEFAULT '0', |
||||
"mail" VARCHAR(200) NULL DEFAULT NULL, |
||||
"url" VARCHAR(200) NULL DEFAULT NULL, |
||||
"ip" VARCHAR(64) NULL DEFAULT NULL, |
||||
"agent" VARCHAR(200) NULL DEFAULT NULL, |
||||
"text" TEXT NULL DEFAULT NULL, |
||||
"type" VARCHAR(16) NULL DEFAULT 'comment', |
||||
"status" VARCHAR(16) NULL DEFAULT 'approved', |
||||
"parent" INT NULL DEFAULT '0', |
||||
PRIMARY KEY ("coid") |
||||
); |
||||
|
||||
CREATE INDEX "typecho_comments_cid" ON "typecho_comments" ("cid"); |
||||
CREATE INDEX "typecho_comments_created" ON "typecho_comments" ("created"); |
||||
|
||||
|
||||
-- |
||||
-- Table structure for table "typecho_contents" |
||||
-- |
||||
|
||||
CREATE SEQUENCE "typecho_contents_seq"; |
||||
|
||||
CREATE TABLE "typecho_contents" ( "cid" INT NOT NULL DEFAULT nextval('typecho_contents_seq'), |
||||
"title" VARCHAR(200) NULL DEFAULT NULL, |
||||
"slug" VARCHAR(200) NULL DEFAULT NULL, |
||||
"created" INT NULL DEFAULT '0', |
||||
"modified" INT NULL DEFAULT '0', |
||||
"text" TEXT NULL DEFAULT NULL, |
||||
"order" INT NULL DEFAULT '0', |
||||
"authorId" INT NULL DEFAULT '0', |
||||
"template" VARCHAR(32) NULL DEFAULT NULL, |
||||
"type" VARCHAR(16) NULL DEFAULT 'post', |
||||
"status" VARCHAR(16) NULL DEFAULT 'publish', |
||||
"password" VARCHAR(32) NULL DEFAULT NULL, |
||||
"commentsNum" INT NULL DEFAULT '0', |
||||
"allowComment" CHAR(1) NULL DEFAULT '0', |
||||
"allowPing" CHAR(1) NULL DEFAULT '0', |
||||
"allowFeed" CHAR(1) NULL DEFAULT '0', |
||||
"parent" INT NULL DEFAULT '0', |
||||
PRIMARY KEY ("cid"), |
||||
UNIQUE ("slug") |
||||
); |
||||
|
||||
CREATE INDEX "typecho_contents_created" ON "typecho_contents" ("created"); |
||||
|
||||
-- |
||||
-- Table structure for table "typecho_fields" |
||||
-- |
||||
|
||||
CREATE TABLE "typecho_fields" ("cid" INT NOT NULL, |
||||
"name" VARCHAR(200) NOT NULL, |
||||
"type" VARCHAR(8) NULL DEFAULT 'str', |
||||
"str_value" TEXT NULL DEFAULT NULL, |
||||
"int_value" INT NULL DEFAULT '0', |
||||
"float_value" REAL NULL DEFAULT '0', |
||||
PRIMARY KEY ("cid","name") |
||||
); |
||||
|
||||
CREATE INDEX "typecho_fields_int_value" ON "typecho_fields" ("int_value"); |
||||
CREATE INDEX "typecho_fields_float_value" ON "typecho_fields" ("float_value"); |
||||
|
||||
-- |
||||
-- Table structure for table "typecho_metas" |
||||
-- |
||||
|
||||
CREATE SEQUENCE "typecho_metas_seq"; |
||||
|
||||
CREATE TABLE "typecho_metas" ( "mid" INT NOT NULL DEFAULT nextval('typecho_metas_seq'), |
||||
"name" VARCHAR(200) NULL DEFAULT NULL, |
||||
"slug" VARCHAR(200) NULL DEFAULT NULL, |
||||
"type" VARCHAR(16) NOT NULL DEFAULT '', |
||||
"description" VARCHAR(200) NULL DEFAULT NULL, |
||||
"count" INT NULL DEFAULT '0', |
||||
"order" INT NULL DEFAULT '0', |
||||
"parent" INT NULL DEFAULT '0', |
||||
PRIMARY KEY ("mid") |
||||
); |
||||
|
||||
CREATE INDEX "typecho_metas_slug" ON "typecho_metas" ("slug"); |
||||
|
||||
|
||||
-- |
||||
-- Table structure for table "typecho_options" |
||||
-- |
||||
|
||||
CREATE TABLE "typecho_options" ( "name" VARCHAR(32) NOT NULL DEFAULT '', |
||||
"user" INT NOT NULL DEFAULT '0', |
||||
"value" TEXT NULL DEFAULT NULL, |
||||
PRIMARY KEY ("name","user") |
||||
); |
||||
|
||||
-- |
||||
-- Table structure for table "typecho_relationships" |
||||
-- |
||||
|
||||
CREATE TABLE "typecho_relationships" ( "cid" INT NOT NULL DEFAULT '0', |
||||
"mid" INT NOT NULL DEFAULT '0', |
||||
PRIMARY KEY ("cid","mid") |
||||
); |
||||
|
||||
-- |
||||
-- Table structure for table "typecho_users" |
||||
-- |
||||
CREATE SEQUENCE "typecho_users_seq"; |
||||
|
||||
CREATE TABLE "typecho_users" ( "uid" INT NOT NULL DEFAULT nextval('typecho_users_seq') , |
||||
"name" VARCHAR(32) NULL DEFAULT NULL, |
||||
"password" VARCHAR(64) NULL DEFAULT NULL, |
||||
"mail" VARCHAR(200) NULL DEFAULT NULL, |
||||
"url" VARCHAR(200) NULL DEFAULT NULL, |
||||
"screenName" VARCHAR(32) NULL DEFAULT NULL, |
||||
"created" INT NULL DEFAULT '0', |
||||
"activated" INT NULL DEFAULT '0', |
||||
"logged" INT NULL DEFAULT '0', |
||||
"group" VARCHAR(16) NULL DEFAULT 'visitor', |
||||
"authCode" VARCHAR(64) NULL DEFAULT NULL, |
||||
PRIMARY KEY ("uid"), |
||||
UNIQUE ("name"), |
||||
UNIQUE ("mail") |
||||
); |
@ -0,0 +1,7 @@ |
||||
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<?php $defaultDir = dirname($_SERVER['SCRIPT_FILENAME']) . '/usr/' . uniqid() . '.db'; ?> |
||||
<li> |
||||
<label class="typecho-label" for="dbFile"><?php _e('数据库文件路径'); ?></label>
|
||||
<input type="text" class="text" name="dbFile" id="dbFile" value="<?php _v('dbFile', $defaultDir); ?>"/>
|
||||
<p class="description"><?php _e('"%s" 是我们为您自动生成的地址', $defaultDir); ?></p>
|
||||
</li> |
@ -0,0 +1,87 @@ |
||||
CREATE TABLE typecho_comments ( "coid" INTEGER NOT NULL PRIMARY KEY, |
||||
"cid" int(10) default '0' , |
||||
"created" int(10) default '0' , |
||||
"author" varchar(200) default NULL , |
||||
"authorId" int(10) default '0' , |
||||
"ownerId" int(10) default '0' , |
||||
"mail" varchar(200) default NULL , |
||||
"url" varchar(200) default NULL , |
||||
"ip" varchar(64) default NULL , |
||||
"agent" varchar(200) default NULL , |
||||
"text" text , |
||||
"type" varchar(16) default 'comment' , |
||||
"status" varchar(16) default 'approved' , |
||||
"parent" int(10) default '0' ); |
||||
|
||||
CREATE INDEX typecho_comments_cid ON typecho_comments ("cid"); |
||||
CREATE INDEX typecho_comments_created ON typecho_comments ("created"); |
||||
|
||||
CREATE TABLE typecho_contents ( "cid" INTEGER NOT NULL PRIMARY KEY, |
||||
"title" varchar(200) default NULL , |
||||
"slug" varchar(200) default NULL , |
||||
"created" int(10) default '0' , |
||||
"modified" int(10) default '0' , |
||||
"text" text , |
||||
"order" int(10) default '0' , |
||||
"authorId" int(10) default '0' , |
||||
"template" varchar(32) default NULL , |
||||
"type" varchar(16) default 'post' , |
||||
"status" varchar(16) default 'publish' , |
||||
"password" varchar(32) default NULL , |
||||
"commentsNum" int(10) default '0' , |
||||
"allowComment" char(1) default '0' , |
||||
"allowPing" char(1) default '0' , |
||||
"allowFeed" char(1) default '0' , |
||||
"parent" int(10) default '0' ); |
||||
|
||||
CREATE UNIQUE INDEX typecho_contents_slug ON typecho_contents ("slug"); |
||||
CREATE INDEX typecho_contents_created ON typecho_contents ("created"); |
||||
|
||||
CREATE TABLE "typecho_fields" ("cid" INTEGER NOT NULL, |
||||
"name" varchar(200) NOT NULL, |
||||
"type" varchar(8) default 'str', |
||||
"str_value" text, |
||||
"int_value" int(10) default '0', |
||||
"float_value" real default '0' |
||||
); |
||||
|
||||
CREATE UNIQUE INDEX typecho_fields_cid_name ON typecho_fields ("cid", "name"); |
||||
CREATE INDEX typecho_fields_int_value ON typecho_fields ("int_value"); |
||||
CREATE INDEX typecho_fields_float_value ON typecho_fields ("float_value"); |
||||
|
||||
CREATE TABLE typecho_metas ( "mid" INTEGER NOT NULL PRIMARY KEY, |
||||
"name" varchar(200) default NULL , |
||||
"slug" varchar(200) default NULL , |
||||
"type" varchar(32) NOT NULL , |
||||
"description" varchar(200) default NULL , |
||||
"count" int(10) default '0' , |
||||
"order" int(10) default '0' , |
||||
"parent" int(10) default '0'); |
||||
|
||||
CREATE INDEX typecho_metas_slug ON typecho_metas ("slug"); |
||||
|
||||
CREATE TABLE typecho_options ( "name" varchar(32) NOT NULL , |
||||
"user" int(10) NOT NULL default '0' , |
||||
"value" text ); |
||||
|
||||
CREATE UNIQUE INDEX typecho_options_name_user ON typecho_options ("name", "user"); |
||||
|
||||
CREATE TABLE typecho_relationships ( "cid" int(10) NOT NULL , |
||||
"mid" int(10) NOT NULL ); |
||||
|
||||
CREATE UNIQUE INDEX typecho_relationships_cid_mid ON typecho_relationships ("cid", "mid"); |
||||
|
||||
CREATE TABLE typecho_users ( "uid" INTEGER NOT NULL PRIMARY KEY, |
||||
"name" varchar(32) default NULL , |
||||
"password" varchar(64) default NULL , |
||||
"mail" varchar(200) default NULL , |
||||
"url" varchar(200) default NULL , |
||||
"screenName" varchar(32) default NULL , |
||||
"created" int(10) default '0' , |
||||
"activated" int(10) default '0' , |
||||
"logged" int(10) default '0' , |
||||
"group" varchar(16) default 'visitor' , |
||||
"authCode" varchar(64) default NULL); |
||||
|
||||
CREATE UNIQUE INDEX typecho_users_name ON typecho_users ("name"); |
||||
CREATE UNIQUE INDEX typecho_users_mail ON typecho_users ("mail"); |
@ -0,0 +1,70 @@ |
||||
<?php |
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; |
||||
/** |
||||
* Hello World |
||||
* |
||||
* @package HelloWorld |
||||
* @author qining |
||||
* @version 1.0.0 |
||||
* @link http://typecho.org |
||||
*/ |
||||
class HelloWorld_Plugin implements Typecho_Plugin_Interface |
||||
{ |
||||
/** |
||||
* 激活插件方法,如果激活失败,直接抛出异常 |
||||
* |
||||
* @access public |
||||
* @return void |
||||
* @throws Typecho_Plugin_Exception |
||||
*/ |
||||
public static function activate() |
||||
{ |
||||
Typecho_Plugin::factory('admin/menu.php')->navBar = array('HelloWorld_Plugin', 'render'); |
||||
} |
||||
|
||||
/** |
||||
* 禁用插件方法,如果禁用失败,直接抛出异常 |
||||
* |
||||
* @static |
||||
* @access public |
||||
* @return void |
||||
* @throws Typecho_Plugin_Exception |
||||
*/ |
||||
public static function deactivate(){} |
||||
|
||||
/** |
||||
* 获取插件配置面板 |
||||
* |
||||
* @access public |
||||
* @param Typecho_Widget_Helper_Form $form 配置面板 |
||||
* @return void |
||||
*/ |
||||
public static function config(Typecho_Widget_Helper_Form $form) |
||||
{ |
||||
/** 分类名称 */ |
||||
$name = new Typecho_Widget_Helper_Form_Element_Text('word', NULL, 'Hello World', _t('说点什么')); |
||||
$form->addInput($name); |
||||
} |
||||
|
||||
/** |
||||
* 个人用户的配置面板 |
||||
* |
||||
* @access public |
||||
* @param Typecho_Widget_Helper_Form $form |
||||
* @return void |
||||
*/ |
||||
public static function personalConfig(Typecho_Widget_Helper_Form $form){} |
||||
|
||||
/** |
||||
* 插件实现方法 |
||||
* |
||||
* @access public |
||||
* @return void |
||||
*/ |
||||
public static function render() |
||||
{ |
||||
echo '<span class="message success">' |
||||
. htmlspecialchars(Typecho_Widget::widget('Widget_Options')->plugin('HelloWorld')->word) |
||||
. '</span>'; |
||||
} |
||||
} |
@ -0,0 +1,16 @@ |
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<?php $this->need('header.php'); ?> |
||||
|
||||
<div class="col-mb-12 col-tb-8 col-tb-offset-2"> |
||||
|
||||
<div class="error-page"> |
||||
<h2 class="post-title">404 - <?php _e('页面没找到'); ?></h2>
|
||||
<p><?php _e('你想查看的页面已被转移或删除了, 要不要搜索看看: '); ?></p>
|
||||
<form method="post"> |
||||
<p><input type="text" name="s" class="text" autofocus /></p> |
||||
<p><button type="submit" class="submit"><?php _e('搜索'); ?></button></p>
|
||||
</form> |
||||
</div> |
||||
|
||||
</div><!-- end #content--> |
||||
<?php $this->need('footer.php'); ?> |
@ -0,0 +1,36 @@ |
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<?php $this->need('header.php'); ?> |
||||
|
||||
<div class="col-mb-12 col-8" id="main" role="main"> |
||||
<h3 class="archive-title"><?php $this->archiveTitle(array( |
||||
'category' => _t('分类 %s 下的文章'), |
||||
'search' => _t('包含关键字 %s 的文章'), |
||||
'tag' => _t('标签 %s 下的文章'), |
||||
'author' => _t('%s 发布的文章') |
||||
), '', ''); ?></h3> |
||||
<?php if ($this->have()): ?> |
||||
<?php while($this->next()): ?> |
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting"> |
||||
<h2 class="post-title" itemprop="name headline"><a itemprop="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
|
||||
<ul class="post-meta"> |
||||
<li itemprop="author" itemscope itemtype="http://schema.org/Person"><?php _e('作者: '); ?><a itemprop="name" href="<?php $this->author->permalink(); ?>" rel="author"><?php $this->author(); ?></a></li>
|
||||
<li><?php _e('时间: '); ?><time datetime="<?php $this->date('c'); ?>" itemprop="datePublished"><?php $this->date(); ?></time></li>
|
||||
<li><?php _e('分类: '); ?><?php $this->category(','); ?></li>
|
||||
<li itemprop="interactionCount"><a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a></li>
|
||||
</ul> |
||||
<div class="post-content" itemprop="articleBody"> |
||||
<?php $this->content('- 阅读剩余部分 -'); ?> |
||||
</div> |
||||
</article> |
||||
<?php endwhile; ?> |
||||
<?php else: ?> |
||||
<article class="post"> |
||||
<h2 class="post-title"><?php _e('没有找到内容'); ?></h2>
|
||||
</article> |
||||
<?php endif; ?> |
||||
|
||||
<?php $this->pageNav('« 前一页', '后一页 »'); ?> |
||||
</div><!-- end #main --> |
||||
|
||||
<?php $this->need('sidebar.php'); ?> |
||||
<?php $this->need('footer.php'); ?> |
@ -0,0 +1,49 @@ |
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<div id="comments"> |
||||
<?php $this->comments()->to($comments); ?> |
||||
<?php if ($comments->have()): ?> |
||||
<h3><?php $this->commentsNum(_t('暂无评论'), _t('仅有一条评论'), _t('已有 %d 条评论')); ?></h3>
|
||||
|
||||
<?php $comments->listComments(); ?> |
||||
|
||||
<?php $comments->pageNav('« 前一页', '后一页 »'); ?> |
||||
|
||||
<?php endif; ?> |
||||
|
||||
<?php if($this->allow('comment')): ?> |
||||
<div id="<?php $this->respondId(); ?>" class="respond">
|
||||
<div class="cancel-comment-reply"> |
||||
<?php $comments->cancelReply(); ?> |
||||
</div> |
||||
|
||||
<h3 id="response"><?php _e('添加新评论'); ?></h3>
|
||||
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
|
||||
<?php if($this->user->hasLogin()): ?> |
||||
<p><?php _e('登录身份: '); ?><a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>. <a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> »</a></p>
|
||||
<?php else: ?> |
||||
<p> |
||||
<label for="author" class="required"><?php _e('称呼'); ?></label>
|
||||
<input type="text" name="author" id="author" class="text" value="<?php $this->remember('author'); ?>" required />
|
||||
</p> |
||||
<p> |
||||
<label for="mail"<?php if ($this->options->commentsRequireMail): ?> class="required"<?php endif; ?>><?php _e('Email'); ?></label>
|
||||
<input type="email" name="mail" id="mail" class="text" value="<?php $this->remember('mail'); ?>"<?php if ($this->options->commentsRequireMail): ?> required<?php endif; ?> />
|
||||
</p> |
||||
<p> |
||||
<label for="url"<?php if ($this->options->commentsRequireURL): ?> class="required"<?php endif; ?>><?php _e('网站'); ?></label>
|
||||
<input type="url" name="url" id="url" class="text" placeholder="<?php _e('http://'); ?>" value="<?php $this->remember('url'); ?>"<?php if ($this->options->commentsRequireURL): ?> required<?php endif; ?> />
|
||||
</p> |
||||
<?php endif; ?> |
||||
<p> |
||||
<label for="textarea" class="required"><?php _e('内容'); ?></label>
|
||||
<textarea rows="8" cols="50" name="text" id="textarea" class="textarea" required ><?php $this->remember('text'); ?></textarea>
|
||||
</p> |
||||
<p> |
||||
<button type="submit" class="submit"><?php _e('提交评论'); ?></button>
|
||||
</p> |
||||
</form> |
||||
</div> |
||||
<?php else: ?> |
||||
<h3><?php _e('评论已关闭'); ?></h3>
|
||||
<?php endif; ?> |
||||
</div> |
@ -0,0 +1,14 @@ |
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
|
||||
</div><!-- end .row --> |
||||
</div> |
||||
</div><!-- end #body --> |
||||
|
||||
<footer id="footer" role="contentinfo"> |
||||
© <?php echo date('Y'); ?> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a>.
|
||||
<?php _e('由 <a href="http://www.typecho.org">Typecho</a> 强力驱动'); ?>.
|
||||
</footer><!-- end #footer --> |
||||
|
||||
<?php $this->footer(); ?> |
||||
</body> |
||||
</html> |
@ -0,0 +1,26 @@ |
||||
<?php |
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; |
||||
|
||||
function themeConfig($form) { |
||||
$logoUrl = new Typecho_Widget_Helper_Form_Element_Text('logoUrl', NULL, NULL, _t('站点 LOGO 地址'), _t('在这里填入一个图片 URL 地址, 以在网站标题前加上一个 LOGO')); |
||||
$form->addInput($logoUrl); |
||||
|
||||
$sidebarBlock = new Typecho_Widget_Helper_Form_Element_Checkbox('sidebarBlock', |
||||
array('ShowRecentPosts' => _t('显示最新文章'), |
||||
'ShowRecentComments' => _t('显示最近回复'), |
||||
'ShowCategory' => _t('显示分类'), |
||||
'ShowArchive' => _t('显示归档'), |
||||
'ShowOther' => _t('显示其它杂项')), |
||||
array('ShowRecentPosts', 'ShowRecentComments', 'ShowCategory', 'ShowArchive', 'ShowOther'), _t('侧边栏显示')); |
||||
|
||||
$form->addInput($sidebarBlock->multiMode()); |
||||
} |
||||
|
||||
|
||||
/* |
||||
function themeFields($layout) { |
||||
$logoUrl = new Typecho_Widget_Helper_Form_Element_Text('logoUrl', NULL, NULL, _t('站点LOGO地址'), _t('在这里填入一个图片URL地址, 以在网站标题前加上一个LOGO')); |
||||
$layout->addItem($logoUrl); |
||||
} |
||||
*/ |
||||
|
@ -0,0 +1,71 @@ |
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<!DOCTYPE HTML> |
||||
<html class="no-js"> |
||||
<head> |
||||
<meta charset="<?php $this->options->charset(); ?>">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<meta name="renderer" content="webkit"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
||||
<title><?php $this->archiveTitle(array( |
||||
'category' => _t('分类 %s 下的文章'), |
||||
'search' => _t('包含关键字 %s 的文章'), |
||||
'tag' => _t('标签 %s 下的文章'), |
||||
'author' => _t('%s 发布的文章') |
||||
), '', ' - '); ?><?php $this->options->title(); ?></title>
|
||||
|
||||
<!-- 使用url函数转换相关路径 --> |
||||
<link rel="stylesheet" href="//cdnjscn.b0.upaiyun.com/libs/normalize/2.1.3/normalize.min.css"> |
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('grid.css'); ?>">
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('style.css'); ?>">
|
||||
|
||||
<!--[if lt IE 9]> |
||||
<script src="//cdnjscn.b0.upaiyun.com/libs/html5shiv/r29/html5.min.js"></script> |
||||
<script src="//cdnjscn.b0.upaiyun.com/libs/respond.js/1.3.0/respond.min.js"></script> |
||||
<![endif]--> |
||||
|
||||
<!-- 通过自有函数输出HTML头部信息 --> |
||||
<?php $this->header(); ?> |
||||
</head> |
||||
<body> |
||||
<!--[if lt IE 8]> |
||||
<div class="browsehappy" role="dialog"><?php _e('当前网页 <strong>不支持</strong> 你正在使用的浏览器. 为了正常的访问, 请 <a href="http://browsehappy.com/">升级你的浏览器</a>'); ?>.</div>
|
||||
<![endif]--> |
||||
|
||||
<header id="header" class="clearfix"> |
||||
<div class="container"> |
||||
<div class="row"> |
||||
<div class="site-name col-mb-12 col-9"> |
||||
<?php if ($this->options->logoUrl): ?> |
||||
<a id="logo" href="<?php $this->options->siteUrl(); ?>">
|
||||
<img src="<?php $this->options->logoUrl() ?>" alt="<?php $this->options->title() ?>" />
|
||||
</a> |
||||
<?php else: ?> |
||||
<a id="logo" href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title() ?></a>
|
||||
<p class="description"><?php $this->options->description() ?></p>
|
||||
<?php endif; ?> |
||||
</div> |
||||
<div class="site-search col-3 kit-hidden-tb"> |
||||
<form id="search" method="post" action="<?php $this->options->siteUrl(); ?>" role="search">
|
||||
<label for="s" class="sr-only"><?php _e('搜索关键字'); ?></label>
|
||||
<input type="text" id="s" name="s" class="text" placeholder="<?php _e('输入关键字搜索'); ?>" />
|
||||
<button type="submit" class="submit"><?php _e('搜索'); ?></button>
|
||||
</form> |
||||
</div> |
||||
<div class="col-mb-12"> |
||||
<nav id="nav-menu" class="clearfix" role="navigation"> |
||||
<a<?php if($this->is('index')): ?> class="current"<?php endif; ?> href="<?php $this->options->siteUrl(); ?>"><?php _e('首页'); ?></a>
|
||||
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?> |
||||
<?php while($pages->next()): ?> |
||||
<a<?php if($this->is('page', $pages->slug)): ?> class="current"<?php endif; ?> href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a>
|
||||
<?php endwhile; ?> |
||||
</nav> |
||||
</div> |
||||
</div><!-- end .row --> |
||||
</div> |
||||
</header><!-- end #header --> |
||||
<div id="body"> |
||||
<div class="container"> |
||||
<div class="row"> |
||||
|
||||
|
||||
|
After Width: | Height: | Size: 303 B |
After Width: | Height: | Size: 437 B |
@ -0,0 +1,35 @@ |
||||
<?php |
||||
/** |
||||
* 这是 Typecho 0.9 系统的一套默认皮肤 |
||||
* |
||||
* @package Typecho Replica Theme |
||||
* @author Typecho Team |
||||
* @version 1.2 |
||||
* @link http://typecho.org |
||||
*/ |
||||
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; |
||||
$this->need('header.php'); |
||||
?> |
||||
|
||||
<div class="col-mb-12 col-8" id="main" role="main"> |
||||
<?php while($this->next()): ?> |
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting"> |
||||
<h2 class="post-title" itemprop="name headline"><a itemprop="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
|
||||
<ul class="post-meta"> |
||||
<li itemprop="author" itemscope itemtype="http://schema.org/Person"><?php _e('作者: '); ?><a itemprop="name" href="<?php $this->author->permalink(); ?>" rel="author"><?php $this->author(); ?></a></li>
|
||||
<li><?php _e('时间: '); ?><time datetime="<?php $this->date('c'); ?>" itemprop="datePublished"><?php $this->date(); ?></time></li>
|
||||
<li><?php _e('分类: '); ?><?php $this->category(','); ?></li>
|
||||
<li itemprop="interactionCount"><a itemprop="discussionUrl" href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a></li>
|
||||
</ul> |
||||
<div class="post-content" itemprop="articleBody"> |
||||
<?php $this->content('- 阅读剩余部分 -'); ?> |
||||
</div> |
||||
</article> |
||||
<?php endwhile; ?> |
||||
|
||||
<?php $this->pageNav('« 前一页', '后一页 »'); ?> |
||||
</div><!-- end #main--> |
||||
|
||||
<?php $this->need('sidebar.php'); ?> |
||||
<?php $this->need('footer.php'); ?> |
@ -0,0 +1,15 @@ |
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<?php $this->need('header.php'); ?> |
||||
|
||||
<div class="col-mb-12 col-8" id="main" role="main"> |
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting"> |
||||
<h1 class="post-title" itemprop="name headline"><a itemprop="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h1>
|
||||
<div class="post-content" itemprop="articleBody"> |
||||
<?php $this->content(); ?> |
||||
</div> |
||||
</article> |
||||
<?php $this->need('comments.php'); ?> |
||||
</div><!-- end #main--> |
||||
|
||||
<?php $this->need('sidebar.php'); ?> |
||||
<?php $this->need('footer.php'); ?> |
@ -0,0 +1,27 @@ |
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<?php $this->need('header.php'); ?> |
||||
|
||||
<div class="col-mb-12 col-8" id="main" role="main"> |
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting"> |
||||
<h1 class="post-title" itemprop="name headline"><a itemprop="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h1>
|
||||
<ul class="post-meta"> |
||||
<li itemprop="author" itemscope itemtype="http://schema.org/Person"><?php _e('作者: '); ?><a itemprop="name" href="<?php $this->author->permalink(); ?>" rel="author"><?php $this->author(); ?></a></li>
|
||||
<li><?php _e('时间: '); ?><time datetime="<?php $this->date('c'); ?>" itemprop="datePublished"><?php $this->date(); ?></time></li>
|
||||
<li><?php _e('分类: '); ?><?php $this->category(','); ?></li>
|
||||
</ul> |
||||
<div class="post-content" itemprop="articleBody"> |
||||
<?php $this->content(); ?> |
||||
</div> |
||||
<p itemprop="keywords" class="tags"><?php _e('标签: '); ?><?php $this->tags(', ', true, 'none'); ?></p>
|
||||
</article> |
||||
|
||||
<?php $this->need('comments.php'); ?> |
||||
|
||||
<ul class="post-near"> |
||||
<li>上一篇: <?php $this->thePrev('%s','没有了'); ?></li>
|
||||
<li>下一篇: <?php $this->theNext('%s','没有了'); ?></li>
|
||||
</ul> |
||||
</div><!-- end #main--> |
||||
|
||||
<?php $this->need('sidebar.php'); ?> |
||||
<?php $this->need('footer.php'); ?> |
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,59 @@ |
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<div class="col-mb-12 col-offset-1 col-3 kit-hidden-tb" id="secondary" role="complementary"> |
||||
<?php if (!empty($this->options->sidebarBlock) && in_array('ShowRecentPosts', $this->options->sidebarBlock)): ?> |
||||
<section class="widget"> |
||||
<h3 class="widget-title"><?php _e('最新文章'); ?></h3>
|
||||
<ul class="widget-list"> |
||||
<?php $this->widget('Widget_Contents_Post_Recent') |
||||
->parse('<li><a href="{permalink}">{title}</a></li>'); ?> |
||||
</ul> |
||||
</section> |
||||
<?php endif; ?> |
||||
|
||||
<?php if (!empty($this->options->sidebarBlock) && in_array('ShowRecentComments', $this->options->sidebarBlock)): ?> |
||||
<section class="widget"> |
||||
<h3 class="widget-title"><?php _e('最近回复'); ?></h3>
|
||||
<ul class="widget-list"> |
||||
<?php $this->widget('Widget_Comments_Recent')->to($comments); ?> |
||||
<?php while($comments->next()): ?> |
||||
<li><a href="<?php $comments->permalink(); ?>"><?php $comments->author(false); ?></a>: <?php $comments->excerpt(35, '...'); ?></li>
|
||||
<?php endwhile; ?> |
||||
</ul> |
||||
</section> |
||||
<?php endif; ?> |
||||
|
||||
<?php if (!empty($this->options->sidebarBlock) && in_array('ShowCategory', $this->options->sidebarBlock)): ?> |
||||
<section class="widget"> |
||||
<h3 class="widget-title"><?php _e('分类'); ?></h3>
|
||||
<?php $this->widget('Widget_Metas_Category_List')->listCategories('wrapClass=widget-list'); ?> |
||||
</section> |
||||
<?php endif; ?> |
||||
|
||||
<?php if (!empty($this->options->sidebarBlock) && in_array('ShowArchive', $this->options->sidebarBlock)): ?> |
||||
<section class="widget"> |
||||
<h3 class="widget-title"><?php _e('归档'); ?></h3>
|
||||
<ul class="widget-list"> |
||||
<?php $this->widget('Widget_Contents_Post_Date', 'type=month&format=F Y') |
||||
->parse('<li><a href="{permalink}">{date}</a></li>'); ?> |
||||
</ul> |
||||
</section> |
||||
<?php endif; ?> |
||||
|
||||
<?php if (!empty($this->options->sidebarBlock) && in_array('ShowOther', $this->options->sidebarBlock)): ?> |
||||
<section class="widget"> |
||||
<h3 class="widget-title"><?php _e('其它'); ?></h3>
|
||||
<ul class="widget-list"> |
||||
<?php if($this->user->hasLogin()): ?> |
||||
<li class="last"><a href="<?php $this->options->adminUrl(); ?>"><?php _e('进入后台'); ?> (<?php $this->user->screenName(); ?>)</a></li>
|
||||
<li><a href="<?php $this->options->logoutUrl(); ?>"><?php _e('退出'); ?></a></li>
|
||||
<?php else: ?> |
||||
<li class="last"><a href="<?php $this->options->adminUrl('login.php'); ?>"><?php _e('登录'); ?></a></li>
|
||||
<?php endif; ?> |
||||
<li><a href="<?php $this->options->feedUrl(); ?>"><?php _e('文章 RSS'); ?></a></li>
|
||||
<li><a href="<?php $this->options->commentsFeedUrl(); ?>"><?php _e('评论 RSS'); ?></a></li>
|
||||
<li><a href="http://www.typecho.org">Typecho</a></li> |
||||
</ul> |
||||
</section> |
||||
<?php endif; ?> |
||||
|
||||
</div><!-- end #sidebar --> |
@ -0,0 +1,16 @@ |
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<?php $this->need('header.php'); ?> |
||||
|
||||
<div class="col-mb-12 col-tb-8 col-tb-offset-2"> |
||||
|
||||
<div class="error-page"> |
||||
<h2 class="post-title">404 - <?php _e('页面没找到'); ?></h2>
|
||||
<p><?php _e('你想查看的页面已被转移或删除了, 要不要搜索看看: '); ?></p>
|
||||
<form method="post"> |
||||
<p><input type="text" name="s" class="text" autofocus /></p> |
||||
<p><button type="submit" class="submit"><?php _e('搜索'); ?></button></p>
|
||||
</form> |
||||
</div> |
||||
|
||||
</div><!-- end #content--> |
||||
<?php $this->need('footer.php'); ?> |
@ -0,0 +1,27 @@ |
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> |
||||
<?php $this->need('header.php'); ?> |
||||
|
||||
<div class="content"> |
||||
<div class="archive-title"> |
||||
<h3 class="archive-title"><?php $this->archiveTitle(array( |
||||
'category' => _t('分类 %s 下的文章'), |
||||
'search' => _t('包含关键字 %s 的文章'), |
||||
'tag' => _t('标签 %s 下的文章'), |
||||
'author' => _t('%s 发布的文章') |
||||
), '', ''); ?></h3> |
||||
</div> |
||||
<?php if ($this->have()): ?> |
||||
<div id="masonry" class="archive row"> |
||||
<?php $this->need('index.list.php'); ?> |
||||
</div> |
||||
<?php $this->pageNav('«', '»'); ?> |
||||
<?php else: ?> |
||||
<div class="archive-msg"> |
||||
<img class="nocontent" src="<?php $this->options->themeUrl('src/nocontent.svg'); ?>">
|
||||
</div> |
||||
<?php endif; ?> |
||||
</div> |
||||
<!-- end #main--> |
||||
|
||||
<?php $this->need('sidebar.php'); ?> |
||||
<?php $this->need('footer.php'); ?> |
@ -0,0 +1,587 @@ |
||||
/*! |
||||
* Bootstrap v3.3.7 (http://getbootstrap.com) |
||||
* Copyright 2011-2016 Twitter, Inc. |
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
||||
*/ |
||||
.btn-default, |
||||
.btn-primary, |
||||
.btn-success, |
||||
.btn-info, |
||||
.btn-warning, |
||||
.btn-danger { |
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, .2); |
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); |
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); |
||||
} |
||||
.btn-default:active, |
||||
.btn-primary:active, |
||||
.btn-success:active, |
||||
.btn-info:active, |
||||
.btn-warning:active, |
||||
.btn-danger:active, |
||||
.btn-default.active, |
||||
.btn-primary.active, |
||||
.btn-success.active, |
||||
.btn-info.active, |
||||
.btn-warning.active, |
||||
.btn-danger.active { |
||||
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); |
||||
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); |
||||
} |
||||
.btn-default.disabled, |
||||
.btn-primary.disabled, |
||||
.btn-success.disabled, |
||||
.btn-info.disabled, |
||||
.btn-warning.disabled, |
||||
.btn-danger.disabled, |
||||
.btn-default[disabled], |
||||
.btn-primary[disabled], |
||||
.btn-success[disabled], |
||||
.btn-info[disabled], |
||||
.btn-warning[disabled], |
||||
.btn-danger[disabled], |
||||
fieldset[disabled] .btn-default, |
||||
fieldset[disabled] .btn-primary, |
||||
fieldset[disabled] .btn-success, |
||||
fieldset[disabled] .btn-info, |
||||
fieldset[disabled] .btn-warning, |
||||
fieldset[disabled] .btn-danger { |
||||
-webkit-box-shadow: none; |
||||
box-shadow: none; |
||||
} |
||||
.btn-default .badge, |
||||
.btn-primary .badge, |
||||
.btn-success .badge, |
||||
.btn-info .badge, |
||||
.btn-warning .badge, |
||||
.btn-danger .badge { |
||||
text-shadow: none; |
||||
} |
||||
.btn:active, |
||||
.btn.active { |
||||
background-image: none; |
||||
} |
||||
.btn-default { |
||||
text-shadow: 0 1px 0 #fff; |
||||
background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%); |
||||
background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0)); |
||||
background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #dbdbdb; |
||||
border-color: #ccc; |
||||
} |
||||
.btn-default:hover, |
||||
.btn-default:focus { |
||||
background-color: #e0e0e0; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-default:active, |
||||
.btn-default.active { |
||||
background-color: #e0e0e0; |
||||
border-color: #dbdbdb; |
||||
} |
||||
.btn-default.disabled, |
||||
.btn-default[disabled], |
||||
fieldset[disabled] .btn-default, |
||||
.btn-default.disabled:hover, |
||||
.btn-default[disabled]:hover, |
||||
fieldset[disabled] .btn-default:hover, |
||||
.btn-default.disabled:focus, |
||||
.btn-default[disabled]:focus, |
||||
fieldset[disabled] .btn-default:focus, |
||||
.btn-default.disabled.focus, |
||||
.btn-default[disabled].focus, |
||||
fieldset[disabled] .btn-default.focus, |
||||
.btn-default.disabled:active, |
||||
.btn-default[disabled]:active, |
||||
fieldset[disabled] .btn-default:active, |
||||
.btn-default.disabled.active, |
||||
.btn-default[disabled].active, |
||||
fieldset[disabled] .btn-default.active { |
||||
background-color: #e0e0e0; |
||||
background-image: none; |
||||
} |
||||
.btn-primary { |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #245580; |
||||
} |
||||
.btn-primary:hover, |
||||
.btn-primary:focus { |
||||
background-color: #265a88; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-primary:active, |
||||
.btn-primary.active { |
||||
background-color: #265a88; |
||||
border-color: #245580; |
||||
} |
||||
.btn-primary.disabled, |
||||
.btn-primary[disabled], |
||||
fieldset[disabled] .btn-primary, |
||||
.btn-primary.disabled:hover, |
||||
.btn-primary[disabled]:hover, |
||||
fieldset[disabled] .btn-primary:hover, |
||||
.btn-primary.disabled:focus, |
||||
.btn-primary[disabled]:focus, |
||||
fieldset[disabled] .btn-primary:focus, |
||||
.btn-primary.disabled.focus, |
||||
.btn-primary[disabled].focus, |
||||
fieldset[disabled] .btn-primary.focus, |
||||
.btn-primary.disabled:active, |
||||
.btn-primary[disabled]:active, |
||||
fieldset[disabled] .btn-primary:active, |
||||
.btn-primary.disabled.active, |
||||
.btn-primary[disabled].active, |
||||
fieldset[disabled] .btn-primary.active { |
||||
background-color: #265a88; |
||||
background-image: none; |
||||
} |
||||
.btn-success { |
||||
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%); |
||||
background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641)); |
||||
background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #3e8f3e; |
||||
} |
||||
.btn-success:hover, |
||||
.btn-success:focus { |
||||
background-color: #419641; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-success:active, |
||||
.btn-success.active { |
||||
background-color: #419641; |
||||
border-color: #3e8f3e; |
||||
} |
||||
.btn-success.disabled, |
||||
.btn-success[disabled], |
||||
fieldset[disabled] .btn-success, |
||||
.btn-success.disabled:hover, |
||||
.btn-success[disabled]:hover, |
||||
fieldset[disabled] .btn-success:hover, |
||||
.btn-success.disabled:focus, |
||||
.btn-success[disabled]:focus, |
||||
fieldset[disabled] .btn-success:focus, |
||||
.btn-success.disabled.focus, |
||||
.btn-success[disabled].focus, |
||||
fieldset[disabled] .btn-success.focus, |
||||
.btn-success.disabled:active, |
||||
.btn-success[disabled]:active, |
||||
fieldset[disabled] .btn-success:active, |
||||
.btn-success.disabled.active, |
||||
.btn-success[disabled].active, |
||||
fieldset[disabled] .btn-success.active { |
||||
background-color: #419641; |
||||
background-image: none; |
||||
} |
||||
.btn-info { |
||||
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); |
||||
background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2)); |
||||
background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #28a4c9; |
||||
} |
||||
.btn-info:hover, |
||||
.btn-info:focus { |
||||
background-color: #2aabd2; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-info:active, |
||||
.btn-info.active { |
||||
background-color: #2aabd2; |
||||
border-color: #28a4c9; |
||||
} |
||||
.btn-info.disabled, |
||||
.btn-info[disabled], |
||||
fieldset[disabled] .btn-info, |
||||
.btn-info.disabled:hover, |
||||
.btn-info[disabled]:hover, |
||||
fieldset[disabled] .btn-info:hover, |
||||
.btn-info.disabled:focus, |
||||
.btn-info[disabled]:focus, |
||||
fieldset[disabled] .btn-info:focus, |
||||
.btn-info.disabled.focus, |
||||
.btn-info[disabled].focus, |
||||
fieldset[disabled] .btn-info.focus, |
||||
.btn-info.disabled:active, |
||||
.btn-info[disabled]:active, |
||||
fieldset[disabled] .btn-info:active, |
||||
.btn-info.disabled.active, |
||||
.btn-info[disabled].active, |
||||
fieldset[disabled] .btn-info.active { |
||||
background-color: #2aabd2; |
||||
background-image: none; |
||||
} |
||||
.btn-warning { |
||||
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); |
||||
background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316)); |
||||
background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #e38d13; |
||||
} |
||||
.btn-warning:hover, |
||||
.btn-warning:focus { |
||||
background-color: #eb9316; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-warning:active, |
||||
.btn-warning.active { |
||||
background-color: #eb9316; |
||||
border-color: #e38d13; |
||||
} |
||||
.btn-warning.disabled, |
||||
.btn-warning[disabled], |
||||
fieldset[disabled] .btn-warning, |
||||
.btn-warning.disabled:hover, |
||||
.btn-warning[disabled]:hover, |
||||
fieldset[disabled] .btn-warning:hover, |
||||
.btn-warning.disabled:focus, |
||||
.btn-warning[disabled]:focus, |
||||
fieldset[disabled] .btn-warning:focus, |
||||
.btn-warning.disabled.focus, |
||||
.btn-warning[disabled].focus, |
||||
fieldset[disabled] .btn-warning.focus, |
||||
.btn-warning.disabled:active, |
||||
.btn-warning[disabled]:active, |
||||
fieldset[disabled] .btn-warning:active, |
||||
.btn-warning.disabled.active, |
||||
.btn-warning[disabled].active, |
||||
fieldset[disabled] .btn-warning.active { |
||||
background-color: #eb9316; |
||||
background-image: none; |
||||
} |
||||
.btn-danger { |
||||
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%); |
||||
background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a)); |
||||
background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #b92c28; |
||||
} |
||||
.btn-danger:hover, |
||||
.btn-danger:focus { |
||||
background-color: #c12e2a; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-danger:active, |
||||
.btn-danger.active { |
||||
background-color: #c12e2a; |
||||
border-color: #b92c28; |
||||
} |
||||
.btn-danger.disabled, |
||||
.btn-danger[disabled], |
||||
fieldset[disabled] .btn-danger, |
||||
.btn-danger.disabled:hover, |
||||
.btn-danger[disabled]:hover, |
||||
fieldset[disabled] .btn-danger:hover, |
||||
.btn-danger.disabled:focus, |
||||
.btn-danger[disabled]:focus, |
||||
fieldset[disabled] .btn-danger:focus, |
||||
.btn-danger.disabled.focus, |
||||
.btn-danger[disabled].focus, |
||||
fieldset[disabled] .btn-danger.focus, |
||||
.btn-danger.disabled:active, |
||||
.btn-danger[disabled]:active, |
||||
fieldset[disabled] .btn-danger:active, |
||||
.btn-danger.disabled.active, |
||||
.btn-danger[disabled].active, |
||||
fieldset[disabled] .btn-danger.active { |
||||
background-color: #c12e2a; |
||||
background-image: none; |
||||
} |
||||
.thumbnail, |
||||
.img-thumbnail { |
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); |
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, .075); |
||||
} |
||||
.dropdown-menu > li > a:hover, |
||||
.dropdown-menu > li > a:focus { |
||||
background-color: #e8e8e8; |
||||
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); |
||||
background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); |
||||
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.dropdown-menu > .active > a, |
||||
.dropdown-menu > .active > a:hover, |
||||
.dropdown-menu > .active > a:focus { |
||||
background-color: #2e6da4; |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.navbar-default { |
||||
background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%); |
||||
background-image: -o-linear-gradient(top, #fff 0%, #f8f8f8 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8)); |
||||
background-image: linear-gradient(to bottom, #fff 0%, #f8f8f8 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-radius: 4px; |
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); |
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); |
||||
} |
||||
.navbar-default .navbar-nav > .open > a, |
||||
.navbar-default .navbar-nav > .active > a { |
||||
background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); |
||||
background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2)); |
||||
background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); |
||||
box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); |
||||
} |
||||
.navbar-brand, |
||||
.navbar-nav > li > a { |
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, .25); |
||||
} |
||||
.navbar-inverse { |
||||
background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%); |
||||
background-image: -o-linear-gradient(top, #3c3c3c 0%, #222 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222)); |
||||
background-image: linear-gradient(to bottom, #3c3c3c 0%, #222 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-radius: 4px; |
||||
} |
||||
.navbar-inverse .navbar-nav > .open > a, |
||||
.navbar-inverse .navbar-nav > .active > a { |
||||
background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%); |
||||
background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f)); |
||||
background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); |
||||
box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); |
||||
} |
||||
.navbar-inverse .navbar-brand, |
||||
.navbar-inverse .navbar-nav > li > a { |
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, .25); |
||||
} |
||||
.navbar-static-top, |
||||
.navbar-fixed-top, |
||||
.navbar-fixed-bottom { |
||||
border-radius: 0; |
||||
} |
||||
@media (max-width: 767px) { |
||||
.navbar .navbar-nav .open .dropdown-menu > .active > a, |
||||
.navbar .navbar-nav .open .dropdown-menu > .active > a:hover, |
||||
.navbar .navbar-nav .open .dropdown-menu > .active > a:focus { |
||||
color: #fff; |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
} |
||||
.alert { |
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, .2); |
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); |
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); |
||||
} |
||||
.alert-success { |
||||
background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); |
||||
background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc)); |
||||
background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #b2dba1; |
||||
} |
||||
.alert-info { |
||||
background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); |
||||
background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0)); |
||||
background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #9acfea; |
||||
} |
||||
.alert-warning { |
||||
background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); |
||||
background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0)); |
||||
background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #f5e79e; |
||||
} |
||||
.alert-danger { |
||||
background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); |
||||
background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3)); |
||||
background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #dca7a7; |
||||
} |
||||
.progress { |
||||
background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); |
||||
background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5)); |
||||
background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar { |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar-success { |
||||
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); |
||||
background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44)); |
||||
background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar-info { |
||||
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); |
||||
background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5)); |
||||
background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar-warning { |
||||
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); |
||||
background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f)); |
||||
background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar-danger { |
||||
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); |
||||
background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c)); |
||||
background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar-striped { |
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); |
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); |
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); |
||||
} |
||||
.list-group { |
||||
border-radius: 4px; |
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); |
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, .075); |
||||
} |
||||
.list-group-item.active, |
||||
.list-group-item.active:hover, |
||||
.list-group-item.active:focus { |
||||
text-shadow: 0 -1px 0 #286090; |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #2b669a; |
||||
} |
||||
.list-group-item.active .badge, |
||||
.list-group-item.active:hover .badge, |
||||
.list-group-item.active:focus .badge { |
||||
text-shadow: none; |
||||
} |
||||
.panel { |
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05); |
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, .05); |
||||
} |
||||
.panel-default > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); |
||||
background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); |
||||
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.panel-primary > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.panel-success > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); |
||||
background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6)); |
||||
background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.panel-info > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); |
||||
background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3)); |
||||
background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.panel-warning > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); |
||||
background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc)); |
||||
background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.panel-danger > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); |
||||
background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc)); |
||||
background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.well { |
||||
background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); |
||||
background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5)); |
||||
background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #dcdcdc; |
||||
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); |
||||
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); |
||||
} |
||||
/*# sourceMappingURL=bootstrap-theme.css.map */ |