replace underscore with backslash

This commit is contained in:
joyqi 2021-08-24 14:19:14 +08:00
parent a2e784113a
commit cf9776ee43
39 changed files with 117 additions and 117 deletions

View File

@ -4,10 +4,10 @@ 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)));
\Typecho\Router::url('do', array('action' => 'backup', 'widget' => 'Backup'),
\Typecho\Common::url('index.php', $options->rootUrl)));
$backupFiles = Typecho_Widget::widget('Widget_Backup')->listFiles();
$backupFiles = \Typecho\Widget::widget('Widget_Backup')->listFiles();
?>
<div class="main">

View File

@ -9,7 +9,7 @@ include 'menu.php';
<?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(); ?>
<?php \Typecho\Widget::widget('Widget_Metas_Category_Edit')->form()->render(); ?>
</div>
</div>
</div>

View File

@ -7,13 +7,13 @@
$(document).ready(function() {
// 处理消息机制
(function () {
var prefix = '<?php echo Typecho_Cookie::getPrefix(); ?>',
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(); ?>';
path = '<?php echo \Typecho\Cookie::getPath(); ?>';
if (!!cookies.notice && 'success|notice|error'.indexOf(cookies.noticeType) >= 0) {
var head = $('.typecho-head-nav'),
@ -110,7 +110,7 @@
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)) {
|| /^<?php echo substr(preg_quote(\Typecho\Common::url('s', $options->index), '/'), 0, -1); ?>action\/[_a-zA-Z0-9\/]+.*$/.exec(href)) {
return;
}

View File

@ -12,15 +12,15 @@ if (!defined('__TYPECHO_ROOT_DIR__') && !@include_once __DIR__ . '/../config.inc
}
/** 初始化组件 */
Typecho_Widget::widget('Widget_Init');
\Typecho\Widget::widget('Widget_Init');
/** 注册一个初始化插件 */
Typecho_Plugin::factory('admin/common.php')->begin();
\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);
\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;
@ -33,22 +33,22 @@ if (!empty($currentMenu)) {
$params = parse_url($currentMenu[2]);
$adminFile = basename($params['path']);
if (!$user->logged && !Typecho_Cookie::get('__typecho_first_run')) {
if (!$user->logged && !\Typecho\Cookie::get('__typecho_first_run')) {
if ('welcome.php' != $adminFile) {
$response->redirect(Typecho_Common::url('welcome.php', $options->adminUrl));
$response->redirect(\Typecho\Common::url('welcome.php', $options->adminUrl));
} else {
Typecho_Cookie::set('__typecho_first_run', 1);
\Typecho\Cookie::set('__typecho_first_run', 1);
}
} elseif ($user->pass('administrator', true)) {
/** 检测版本是否升级 */
$mustUpgrade = version_compare(Typecho_Common::VERSION, $options->version, '>');
$mustUpgrade = version_compare(\Typecho\Common::VERSION, $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(\Typecho\Common::url('upgrade.php', $options->adminUrl));
} elseif (!$mustUpgrade && 'upgrade.php' == $adminFile) {
$response->redirect($options->adminUrl);
} else if (!$mustUpgrade && 'welcome.php' == $adminFile && $user->logged) {
} elseif (!$mustUpgrade && 'welcome.php' == $adminFile && $user->logged) {
$response->redirect($options->adminUrl);
}
}

View File

@ -109,7 +109,7 @@ $(document).ready(function () {
}
});
<?php Typecho_Plugin::factory('admin/editor-js.php')->markdownEditor($content); ?>
<?php \Typecho\Plugin::factory('admin/editor-js.php')->markdownEditor($content); ?>
var th = textarea.height(), ph = preview.height(),
uploadBtn = $('<button type="button" id="btn-fullscreen-upload" class="btn btn-link">'

View File

@ -5,7 +5,7 @@ $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);
throw new \Typecho\Plugin\Exception(_t('页面不存在'), 404);
}
list ($pluginName, $file) = explode('/', trim($panel, '/'), 2);

View File

@ -1,8 +1,8 @@
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
<?php
if (isset($post) && $post instanceof Typecho_Widget && $post->have()) {
if (isset($post) && $post instanceof \Typecho\Widget && $post->have()) {
$fileParentContent = $post;
} else if (isset($page) && $page instanceof Typecho_Widget && $page->have()) {
} else if (isset($page) && $page instanceof \Typecho\Widget && $page->have()) {
$fileParentContent = $page;
}

View File

@ -5,9 +5,9 @@ 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);
\Typecho\Widget::widget('Widget_Contents_Attachment_Related', 'parentId=' . $cid)->to($attachment);
} else {
Typecho_Widget::widget('Widget_Contents_Attachment_Unattached')->to($attachment);
\Typecho\Widget::widget('Widget_Contents_Attachment_Unattached')->to($attachment);
}
}
?>

View File

@ -3,4 +3,4 @@
</html>
<?php
/** 注册一个结束插件 */
Typecho_Plugin::factory('admin/footer.php')->end();
\Typecho\Plugin::factory('admin/footer.php')->end();

View File

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

View File

@ -3,7 +3,7 @@ include 'common.php';
include 'header.php';
include 'menu.php';
$stat = Typecho_Widget::widget('Widget_Stat');
$stat = \Typecho\Widget::widget('Widget_Stat');
?>
<div class="main">
<div class="container typecho-dashboard">
@ -48,7 +48,7 @@ $stat = Typecho_Widget::widget('Widget_Stat');
<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); ?>
<?php \Typecho\Widget::widget('Widget_Contents_Post_Recent', 'pageSize=10')->to($posts); ?>
<ul>
<?php if($posts->have()): ?>
<?php while($posts->next()): ?>
@ -68,7 +68,7 @@ $stat = Typecho_Widget::widget('Widget_Stat');
<section class="latest-link">
<h3><?php _e('最近得到的回复'); ?></h3>
<ul>
<?php Typecho_Widget::widget('Widget_Comments_Recent', 'pageSize=10')->to($comments); ?>
<?php \Typecho\Widget::widget('Widget_Comments_Recent', 'pageSize=10')->to($comments); ?>
<?php if($comments->have()): ?>
<?php while($comments->next()): ?>
<li>

View File

@ -4,8 +4,8 @@ include 'common.php';
if ($user->hasLogin()) {
$response->redirect($options->adminUrl);
}
$rememberName = htmlspecialchars(Typecho_Cookie::get('__typecho_remember_name'));
Typecho_Cookie::delete('__typecho_remember_name');
$rememberName = htmlspecialchars(\Typecho\Cookie::get('__typecho_remember_name'));
\Typecho\Cookie::delete('__typecho_remember_name');
$bodyClass = 'body-100';

View File

@ -3,7 +3,7 @@ include 'common.php';
include 'header.php';
include 'menu.php';
Typecho_Widget::widget('Widget_Metas_Category_Admin')->to($categories);
\Typecho\Widget::widget('Widget_Metas_Category_Admin')->to($categories);
?>
<div class="main">
@ -80,7 +80,7 @@ Typecho_Widget::widget('Widget_Metas_Category_Admin')->to($categories);
<a class="hidden-by-mouse" href="<?php $security->index('/action/metas-category-edit?do=default&mid=' . $categories->mid); ?>" title="<?php _e('设为默认'); ?>"><?php _e('默认'); ?></a>
<?php endif; ?>
</td>
<td class="kit-hidden-mb"><a class="balloon-button left size-<?php echo Typecho_Common::splitByCount($categories->count, 1, 10, 20, 50, 100); ?>" href="<?php $options->adminUrl('manage-posts.php?category=' . $categories->mid); ?>"><?php $categories->count(); ?></a></td>
<td class="kit-hidden-mb"><a class="balloon-button left size-<?php echo \Typecho\Common::splitByCount($categories->count, 1, 10, 20, 50, 100); ?>" href="<?php $options->adminUrl('manage-posts.php?category=' . $categories->mid); ?>"><?php $categories->count(); ?></a></td>
</tr>
<?php endwhile; ?>
<?php else: ?>

View File

@ -3,9 +3,9 @@ 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'));
$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">

View File

@ -3,10 +3,10 @@ include 'common.php';
include 'header.php';
include 'menu.php';
$stat = Typecho_Widget::widget('Widget_Stat');
$stat = \Typecho\Widget::widget('Widget_Stat');
?>
<?php Typecho_Widget::widget('Widget_Contents_Attachment_Admin')->to($attachments); ?>
<?php \Typecho\Widget::widget('Widget_Contents_Attachment_Admin')->to($attachments); ?>
<div class="main">
<div class="body container">
<?php include 'page-title.php'; ?>
@ -59,10 +59,10 @@ $stat = Typecho_Widget::widget('Widget_Stat');
<tbody>
<?php if($attachments->have()): ?>
<?php while($attachments->next()): ?>
<?php $mime = Typecho_Common::mimeIconType($attachments->attachment->mime); ?>
<?php $mime = \Typecho\Common::mimeIconType($attachments->attachment->mime); ?>
<tr id="<?php $attachments->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $attachments->cid(); ?>" name="cid[]"/></td>
<td class="kit-hidden-mb"><a href="<?php $options->adminUrl('manage-comments.php?cid=' . $attachments->cid); ?>" class="balloon-button size-<?php echo Typecho_Common::splitByCount($attachments->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $attachments->commentsNum(); ?></a></td>
<td class="kit-hidden-mb"><a href="<?php $options->adminUrl('manage-comments.php?cid=' . $attachments->cid); ?>" class="balloon-button size-<?php echo \Typecho\Common::splitByCount($attachments->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $attachments->commentsNum(); ?></a></td>
<td>
<i class="mime-<?php echo $mime; ?>"></i>
<a href="<?php $options->adminUrl('media.php?cid=' . $attachments->cid); ?>"><?php $attachments->title(); ?></a>

View File

@ -3,7 +3,7 @@ include 'common.php';
include 'header.php';
include 'menu.php';
$stat = Typecho_Widget::widget('Widget_Stat');
$stat = \Typecho\Widget::widget('Widget_Stat');
?>
<div class="main">
<div class="body container">
@ -56,12 +56,12 @@ $stat = Typecho_Widget::widget('Widget_Stat');
</tr>
</thead>
<tbody>
<?php Typecho_Widget::widget('Widget_Contents_Page_Admin')->to($pages); ?>
<?php \Typecho\Widget::widget('Widget_Contents_Page_Admin')->to($pages); ?>
<?php if($pages->have()): ?>
<?php while($pages->next()): ?>
<tr id="<?php $pages->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $pages->cid(); ?>" name="cid[]"/></td>
<td class="kit-hidden-mb"><a href="<?php $options->adminUrl('manage-comments.php?cid=' . $pages->cid); ?>" class="balloon-button size-<?php echo Typecho_Common::splitByCount($pages->commentsNum, 1, 10, 20, 50, 100); ?>" title="<?php $pages->commentsNum(); ?> <?php _e('评论'); ?>"><?php $pages->commentsNum(); ?></a></td>
<td class="kit-hidden-mb"><a href="<?php $options->adminUrl('manage-comments.php?cid=' . $pages->cid); ?>" class="balloon-button size-<?php echo \Typecho\Common::splitByCount($pages->commentsNum, 1, 10, 20, 50, 100); ?>" title="<?php $pages->commentsNum(); ?> <?php _e('评论'); ?>"><?php $pages->commentsNum(); ?></a></td>
<td>
<a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"><?php $pages->title(); ?></a>
<?php
@ -83,7 +83,7 @@ $stat = Typecho_Widget::widget('Widget_Stat');
<td>
<?php if ($pages->hasSaved): ?>
<span class="description">
<?php $modifyDate = new Typecho_Date($pages->modified); ?>
<?php $modifyDate = new \Typecho\Date($pages->modified); ?>
<?php _e('保存于 %s', $modifyDate->word()); ?>
</span>
<?php else: ?>

View File

@ -3,9 +3,9 @@ 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'));
$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">
@ -72,7 +72,7 @@ $isAllPosts = ('on' == $request->get('__typecho_all_posts') || 'on' == Typecho_C
<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 \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; ?>
@ -114,7 +114,7 @@ $isAllPosts = ('on' == $request->get('__typecho_all_posts') || 'on' == Typecho_C
<?php while($posts->next()): ?>
<tr id="<?php $posts->theId(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $posts->cid(); ?>" name="cid[]"/></td>
<td class="kit-hidden-mb"><a href="<?php $options->adminUrl('manage-comments.php?cid=' . ($posts->parentId ? $posts->parentId : $posts->cid)); ?>" class="balloon-button size-<?php echo Typecho_Common::splitByCount($posts->commentsNum, 1, 10, 20, 50, 100); ?>" title="<?php $posts->commentsNum(); ?> <?php _e('评论'); ?>"><?php $posts->commentsNum(); ?></a></td>
<td class="kit-hidden-mb"><a href="<?php $options->adminUrl('manage-comments.php?cid=' . ($posts->parentId ? $posts->parentId : $posts->cid)); ?>" class="balloon-button size-<?php echo \Typecho\Common::splitByCount($posts->commentsNum, 1, 10, 20, 50, 100); ?>" title="<?php $posts->commentsNum(); ?> <?php _e('评论'); ?>"><?php $posts->commentsNum(); ?></a></td>
<td>
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"><?php $posts->title(); ?></a>
<?php
@ -150,7 +150,7 @@ $isAllPosts = ('on' == $request->get('__typecho_all_posts') || 'on' == Typecho_C
<td>
<?php if ($posts->hasSaved): ?>
<span class="description">
<?php $modifyDate = new Typecho_Date($posts->modified); ?>
<?php $modifyDate = new \Typecho\Date($posts->modified); ?>
<?php _e('保存于 %s', $modifyDate->word()); ?>
</span>
<?php else: ?>

View File

@ -3,7 +3,7 @@ include 'common.php';
include 'header.php';
include 'menu.php';
Typecho_Widget::widget('Widget_Metas_Tag_Admin')->to($tags);
\Typecho\Widget::widget('Widget_Metas_Tag_Admin')->to($tags);
?>
<div class="main">
@ -49,7 +49,7 @@ Typecho_Widget::widget('Widget_Metas_Tag_Admin')->to($tags);
</div>
<div class="col-mb-12 col-tb-4" role="form">
<?php Typecho_Widget::widget('Widget_Metas_Tag_Edit')->form()->render(); ?>
<?php \Typecho\Widget::widget('Widget_Metas_Tag_Edit')->form()->render(); ?>
</div>
</div>
</div>

View File

@ -51,11 +51,11 @@ include 'menu.php';
</tr>
</thead>
<tbody>
<?php Typecho_Widget::widget('Widget_Users_Admin')->to($users); ?>
<?php \Typecho\Widget::widget('Widget_Users_Admin')->to($users); ?>
<?php while($users->next()): ?>
<tr id="user-<?php $users->uid(); ?>">
<td class="kit-hidden-mb"><input type="checkbox" value="<?php $users->uid(); ?>" name="uid[]"/></td>
<td class="kit-hidden-mb"><a href="<?php $options->adminUrl('manage-posts.php?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 class="kit-hidden-mb"><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>

View File

@ -9,7 +9,7 @@ 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);
\Typecho\Widget::widget('Widget_Contents_Attachment_Edit')->to($attachment);
?>
<div class="main">
@ -22,7 +22,7 @@ Typecho_Widget::widget('Widget_Contents_Attachment_Edit')->to($attachment);
<?php endif; ?>
<p>
<?php $mime = Typecho_Common::mimeIconType($attachment->attachment->mime); ?>
<?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>

View File

@ -5,9 +5,9 @@
<?php $menu->output(); ?>
</nav>
<div class="operate">
<?php Typecho_Plugin::factory('admin/menu.php')->navBar(); ?><a title="<?php
<?php \Typecho\Plugin::factory('admin/menu.php')->navBar(); ?><a title="<?php
if ($user->logged > 0) {
$logged = new Typecho_Date($user->logged);
$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>

View File

@ -9,7 +9,7 @@ include 'menu.php';
<?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(); ?>
<?php \Typecho\Widget::widget('Widget_Options_Discussion')->form()->render(); ?>
</div>
</div>
</div>

View File

@ -9,7 +9,7 @@ include 'menu.php';
<?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(); ?>
<?php \Typecho\Widget::widget('Widget_Options_General')->form()->render(); ?>
</div>
</div>
</div>

View File

@ -9,7 +9,7 @@ include 'menu.php';
<?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(); ?>
<?php \Typecho\Widget::widget('Widget_Options_Permalink')->form()->render(); ?>
</div>
</div>
</div>

View File

@ -9,7 +9,7 @@ include 'menu.php';
<?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(); ?>
<?php \Typecho\Widget::widget('Widget_Plugins_Config')->config()->render(); ?>
</div>
</div>
</div>

View File

@ -9,7 +9,7 @@ include 'menu.php';
<?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(); ?>
<?php \Typecho\Widget::widget('Widget_Options_Reading')->form()->render(); ?>
</div>
</div>
</div>

View File

@ -18,7 +18,7 @@ include 'menu.php';
</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(); ?>
<?php \Typecho\Widget::widget('Widget_Themes_Config')->config()->render(); ?>
</div>
</div>
</div>

View File

@ -8,7 +8,7 @@ include 'menu.php';
<?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 \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">
@ -70,7 +70,7 @@ include 'menu.php';
</div>
<?php endif; ?>
<?php Typecho_Widget::widget('Widget_Plugins_List@unactivated', 'activated=0')->to($deactivatedPlugins); ?>
<?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">

View File

@ -3,7 +3,7 @@
include 'common.php';
/** 获取内容 Widget */
Typecho_Widget::widget('Widget_Archive', 'type=single&checkPermalink=0&preview=1')->to($content);
\Typecho\Widget::widget('Widget_Archive', 'type=single&checkPermalink=0&preview=1')->to($content);
/** 检测是否存在 */
if (!$content->have()) {

View File

@ -3,7 +3,7 @@ include 'common.php';
include 'header.php';
include 'menu.php';
$stat = Typecho_Widget::widget('Widget_Stat');
$stat = \Typecho\Widget::widget('Widget_Stat');
?>
<div class="main">
@ -11,14 +11,14 @@ $stat = Typecho_Widget::widget('Widget_Stat');
<?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>
<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);
$logged = new \Typecho\Date($user->logged);
_e('最后登录: %s', $logged->word());
}
?></p>
@ -27,14 +27,14 @@ $stat = Typecho_Widget::widget('Widget_Stat');
<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(); ?>
<?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(); ?>
<?php \Typecho\Widget::widget('Widget_Users_Profile')->optionsForm()->render(); ?>
</section>
<?php endif; ?>
@ -42,10 +42,10 @@ $stat = Typecho_Widget::widget('Widget_Stat');
<section id="change-password">
<h3><?php _e('密码修改'); ?></h3>
<?php Typecho_Widget::widget('Widget_Users_Profile')->passwordForm()->render(); ?>
<?php \Typecho\Widget::widget('Widget_Users_Profile')->passwordForm()->render(); ?>
</section>
<?php Typecho_Widget::widget('Widget_Users_Profile')->personalFormList(); ?>
<?php \Typecho\Widget::widget('Widget_Users_Profile')->personalFormList(); ?>
</div>
</div>
</div>
@ -55,6 +55,6 @@ $stat = Typecho_Widget::widget('Widget_Stat');
include 'copyright.php';
include 'common-js.php';
include 'form-js.php';
Typecho_Plugin::factory('admin/profile.php')->bottom();
\Typecho\Plugin::factory('admin/profile.php')->bottom();
include 'footer.php';
?>

View File

@ -4,10 +4,10 @@ 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');
$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';

View File

@ -3,7 +3,7 @@ include 'common.php';
include 'header.php';
include 'menu.php';
Typecho_Widget::widget('Widget_Themes_Files')->to($files);
\Typecho\Widget::widget('Widget_Themes_Files')->to($files);
?>
<div class="main">
@ -57,6 +57,6 @@ Typecho_Widget::widget('Widget_Themes_Files')->to($files);
<?php
include 'copyright.php';
include 'common-js.php';
Typecho_Plugin::factory('admin/theme-editor.php')->bottom($files);
\Typecho\Plugin::factory('admin/theme-editor.php')->bottom($files);
include 'footer.php';
?>

View File

@ -32,7 +32,7 @@ include 'menu.php';
</thead>
<tbody>
<?php Typecho_Widget::widget('Widget_Themes_List')->to($themes); ?>
<?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>

View File

@ -13,7 +13,7 @@ $errors = $security->systemCheck();
<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">
<form action="<?php echo \Typecho\Common::url('upgrade.php', $options->adminUrl); ?>" method="get">
<h3><?php _e('发现安全问题'); ?></h3>
<ul>
<?php foreach ($errors as $error): ?>
@ -24,13 +24,13 @@ $errors = $security->systemCheck();
</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">
\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>
<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('完成升级 &raquo;'); ?></button></p>
</form>

View File

@ -9,7 +9,7 @@ include 'menu.php';
<?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(); ?>
<?php \Typecho\Widget::widget('Widget_Users_Edit')->form()->render(); ?>
</div>
</div>
</div>

View File

@ -1,6 +1,6 @@
<?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); ?>
<?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'); ?>"></script>
<script src="<?php $options->adminStaticUrl('js', 'tokeninput.js'); ?>"></script>

View File

@ -2,7 +2,7 @@
include 'common.php';
include 'header.php';
include 'menu.php';
Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
\Typecho\Widget::widget('Widget_Contents_Page_Edit')->to($page);
?>
<div class="main">
<div class="body container">
@ -12,7 +12,7 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
<div class="col-mb-12 col-tb-9" role="main">
<?php if ($page->draft): ?>
<?php if ($page->draft['cid'] != $page->cid): ?>
<?php $pageModifyDate = new Typecho_Date($page->draft['modified']); ?>
<?php $pageModifyDate = new \Typecho\Date($page->draft['modified']); ?>
<cite class="edit-draft-notice"><?php _e('当前正在编辑的是保存于%s的草稿, 你可以<a href="%s">删除它</a>', $pageModifyDate->word(),
$security->getIndex('/action/contents-page-edit?do=deleteDraft&cid=' . $page->cid)); ?></cite>
<?php else: ?>
@ -25,7 +25,7 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
<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);
<?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);
@ -59,7 +59,7 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
</span>
</p>
<?php Typecho_Plugin::factory('admin/write-page.php')->content($page); ?>
<?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">
@ -92,7 +92,7 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
<p class="description"><?php _e('如果你为此页面选择了一个自定义模板, 系统将按照你选择的模板文件展现它'); ?></p>
</section>
<?php Typecho_Plugin::factory('admin/write-page.php')->option($page); ?>
<?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">
@ -118,15 +118,15 @@ Typecho_Widget::widget('Widget_Contents_Page_Edit')->to($page);
</ul>
</section>
<?php Typecho_Plugin::factory('admin/write-page.php')->advanceOption($page); ?>
<?php \Typecho\Plugin::factory('admin/write-page.php')->advanceOption($page); ?>
</div>
<?php if($page->have()): ?>
<?php $modified = new Typecho_Date($page->modified); ?>
<?php $modified = new \Typecho\Date($page->modified); ?>
<section class="typecho-post-option">
<p class="description">
<br>&mdash;<br>
<?php _e('本页面由 <a href="%s">%s</a> 创建',
Typecho_Common::url('manage-pages.php?uid=' . $page->author->uid, $options->adminUrl), $page->author->screenName); ?><br>
\Typecho\Common::url('manage-pages.php?uid=' . $page->author->uid, $options->adminUrl), $page->author->screenName); ?><br>
<?php _e('最后更新于 %s', $modified->word()); ?>
</p>
</section>
@ -148,13 +148,13 @@ include 'common-js.php';
include 'form-js.php';
include 'write-js.php';
Typecho_Plugin::factory('admin/write-page.php')->trigger($plugged)->richEditor($page);
\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);
\Typecho\Plugin::factory('admin/write-page.php')->bottom($page);
include 'footer.php';
?>

View File

@ -2,7 +2,7 @@
include 'common.php';
include 'header.php';
include 'menu.php';
Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
\Typecho\Widget::widget('Widget_Contents_Post_Edit')->to($post);
?>
<div class="main">
<div class="body container">
@ -12,7 +12,7 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
<div class="col-mb-12 col-tb-9" role="main">
<?php if ($post->draft): ?>
<?php if ($post->draft['cid'] != $post->cid): ?>
<?php $postModifyDate = new Typecho_Date($post->draft['modified']); ?>
<?php $postModifyDate = new \Typecho\Date($post->draft['modified']); ?>
<cite class="edit-draft-notice"><?php _e('你正在编辑的是保存于 %s 的草稿, 你也可以 <a href="%s">删除它</a>', $postModifyDate->word(),
$security->getIndex('/action/contents-post-edit?do=deleteDraft&cid=' . $post->cid)); ?></cite>
<?php else: ?>
@ -25,7 +25,7 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
<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);
<?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);
@ -64,7 +64,7 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
</span>
</p>
<?php Typecho_Plugin::factory('admin/write-post.php')->content($post); ?>
<?php \Typecho\Plugin::factory('admin/write-post.php')->content($post); ?>
</div>
<div id="edit-secondary" class="col-mb-12 col-tb-3" role="complementary">
@ -82,7 +82,7 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
<section class="typecho-post-option category-option">
<label class="typecho-label"><?php _e('分类'); ?></label>
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?>
<?php \Typecho\Widget::widget('Widget_Metas_Category_List')->to($category); ?>
<ul>
<?php
if ($post->have()) {
@ -103,7 +103,7 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
<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); ?>
<?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">
@ -146,16 +146,16 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
<p class="description"><?php _e('每一行一个引用地址, 用回车隔开'); ?></p>
</section>
<?php Typecho_Plugin::factory('admin/write-post.php')->advanceOption($post); ?>
<?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); ?>
<?php $modified = new \Typecho\Date($post->modified); ?>
<section class="typecho-post-option">
<p class="description">
<br>&mdash;<br>
<?php _e('本文由 <a href="%s">%s</a> 撰写',
Typecho_Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?><br>
\Typecho\Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?><br>
<?php _e('最后更新于 %s', $modified->word()); ?>
</p>
</section>
@ -177,13 +177,13 @@ include 'common-js.php';
include 'form-js.php';
include 'write-js.php';
Typecho_Plugin::factory('admin/write-post.php')->trigger($plugged)->richEditor($post);
\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);
\Typecho\Plugin::factory('admin/write-post.php')->bottom($post);
include 'footer.php';
?>

View File

@ -14,13 +14,13 @@ if (!defined('__TYPECHO_ROOT_DIR__') && !@include_once 'config.inc.php') {
}
/** 初始化组件 */
Typecho_Widget::widget('Widget_Init');
\Typecho\Widget::widget('Widget_Init');
/** 注册一个初始化插件 */
Typecho_Plugin::factory('index.php')->begin();
\Typecho\Plugin::factory('index.php')->begin();
/** 开始路由分发 */
Typecho_Router::dispatch();
\Typecho\Router::dispatch();
/** 注册一个结束插件 */
Typecho_Plugin::factory('index.php')->end();
\Typecho\Plugin::factory('index.php')->end();