mirror of
https://github.com/typecho/typecho.git
synced 2025-04-15 07:13:05 +02:00
clean some unused widgets
This commit is contained in:
parent
8c3d36d1b2
commit
5e32925a94
@ -1,7 +1,7 @@
|
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
|
||||
<script src="<?php $options->adminUrl('js/jquery.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminUrl('js/jquery-ui.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminUrl('js/typecho.js?v=' . $suffixVersion); ?>"></script>
|
||||
<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() {
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
|
||||
<?php $content = !empty($post) ? $post : $page; if ($options->markdown): ?>
|
||||
<script src="<?php $options->adminUrl('js/pagedown.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminUrl('js/pagedown-extra.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminUrl('js/diff.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'),
|
||||
|
@ -13,8 +13,8 @@ if (preg_match("/^([0-9]+)([a-z]{1,2})$/i", $phpMaxFilesize, $matches)) {
|
||||
}
|
||||
?>
|
||||
|
||||
<script src="<?php $options->adminUrl('js/moxie.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminUrl('js/plupload.js?v=' . $suffixVersion); ?>"></script>
|
||||
<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 () {
|
||||
@ -123,7 +123,7 @@ $(document).ready(function() {
|
||||
url : '<?php $security->index('/action/upload'
|
||||
. (isset($fileParentContent) ? '?cid=' . $fileParentContent->cid : '')); ?>',
|
||||
runtimes : 'html5,flash,html4',
|
||||
flash_swf_url : '<?php $options->adminUrl('js/Moxie.swf'); ?>',
|
||||
flash_swf_url : '<?php $options->adminStaticUrl('js', 'Moxie.swf'); ?>',
|
||||
drop_element : $('.upload-area').get(0),
|
||||
filters : {
|
||||
max_file_size : '<?php echo $phpMaxFilesize ?>',
|
||||
|
@ -3,12 +3,12 @@ if (!defined('__TYPECHO_ADMIN__')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$header = '<link rel="stylesheet" href="' . Typecho_Common::url('css/normalize.css?v=' . $suffixVersion, $options->adminUrl) . '">
|
||||
<link rel="stylesheet" href="' . Typecho_Common::url('css/grid.css?v=' . $suffixVersion, $options->adminUrl) . '">
|
||||
<link rel="stylesheet" href="' . Typecho_Common::url('css/style.css?v=' . $suffixVersion, $options->adminUrl) . '">
|
||||
$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('js/html5shiv.js?v=' . $suffixVersion, $options->adminUrl) . '"></script>
|
||||
<script src="' . Typecho_Common::url('js/respond.js?v=' . $suffixVersion, $options->adminUrl) . '"></script>
|
||||
<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]-->';
|
||||
|
||||
/** 注册一个初始化插件 */
|
||||
|
@ -48,8 +48,8 @@ Typecho_Widget::widget('Widget_Contents_Attachment_Edit')->to($attachment);
|
||||
include 'copyright.php';
|
||||
include 'common-js.php';
|
||||
?>
|
||||
<script src="<?php $options->adminUrl('js/moxie.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminUrl('js/plupload.js?v=' . $suffixVersion); ?>"></script>
|
||||
<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 () {
|
||||
@ -146,7 +146,7 @@ $(document).ready(function() {
|
||||
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->adminUrl('js/Moxie.swf'); ?>',
|
||||
flash_swf_url : '<?php $options->adminStaticUrl('js', 'Moxie.swf'); ?>',
|
||||
drop_element : $('.upload-area').get(0),
|
||||
filters : {
|
||||
max_file_size : '<?php echo $phpMaxFilesize ?>',
|
||||
|
@ -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')->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_Deactivated')->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">
|
||||
|
@ -2,8 +2,8 @@
|
||||
<?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->adminUrl('js/timepicker.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script src="<?php $options->adminUrl('js/tokeninput.js?v=' . $suffixVersion); ?>"></script>
|
||||
<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() {
|
||||
// 日期时间控件
|
||||
|
@ -486,7 +486,7 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg
|
||||
public function getDefaultFieldItems()
|
||||
{
|
||||
$defaultFields = array();
|
||||
$configFile = __TYPECHO_ROOT_DIR__ . __TYPECHO_THEME_DIR__ . '/' . $this->options->theme . '/functions.php';
|
||||
$configFile = $this->options->themeFile($this->options->theme, 'functions.php');
|
||||
$layout = new Typecho_Widget_Helper_Layout();
|
||||
$fields = new Typecho_Config();
|
||||
|
||||
|
@ -487,6 +487,24 @@ class Widget_Options extends Typecho_Widget
|
||||
echo Typecho_Common::url($path, $this->adminUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取或输出后台静态文件路径
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $file
|
||||
* @return void|string
|
||||
*/
|
||||
public function adminStaticUrl($type, $file = NULL)
|
||||
{
|
||||
$url = Typecho_Common::url($type, $this->adminUrl);
|
||||
|
||||
if (empty($file)) {
|
||||
return $url;
|
||||
}
|
||||
|
||||
echo Typecho_Common::url($file, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码输出允许出现在评论中的html标签
|
||||
*
|
||||
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
|
||||
/**
|
||||
* Typecho Blog Platform
|
||||
*
|
||||
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
|
||||
* @license GNU General Public License 2.0
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* 启用插件列表组件
|
||||
*
|
||||
* @author qining
|
||||
* @category typecho
|
||||
* @package Widget
|
||||
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
|
||||
* @license GNU General Public License 2.0
|
||||
*/
|
||||
class Widget_Plugins_List_Activated extends Widget_Plugins_List
|
||||
{
|
||||
/**
|
||||
* 执行函数
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$this->parameter->activated = true;
|
||||
parent::execute();
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
|
||||
/**
|
||||
* Typecho Blog Platform
|
||||
*
|
||||
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
|
||||
* @license GNU General Public License 2.0
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* 禁用插件列表组件
|
||||
*
|
||||
* @author qining
|
||||
* @category typecho
|
||||
* @package Widget
|
||||
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
|
||||
* @license GNU General Public License 2.0
|
||||
*/
|
||||
class Widget_Plugins_List_Deactivated extends Widget_Plugins_List
|
||||
{
|
||||
/**
|
||||
* 执行函数
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$this->parameter->activated = false;
|
||||
parent::execute();
|
||||
}
|
||||
}
|
@ -73,7 +73,7 @@ class Widget_Themes_List extends Typecho_Widget
|
||||
$info['screen'] = Typecho_Common::url(trim(__TYPECHO_THEME_DIR__, '/') .
|
||||
'/' . $info['name'] . '/' . basename(current($screen)), $siteUrl);
|
||||
} else {
|
||||
$info['screen'] = Typecho_Common::url('/img/noscreen.png', $adminUrl);
|
||||
$info['screen'] = Typecho_Common::url('noscreen.png', $options->adminStaticUrl('img'));
|
||||
}
|
||||
|
||||
$result[$key] = $info;
|
||||
|
@ -184,12 +184,12 @@ class Widget_Users_Profile extends Widget_Users_Edit implements Widget_Interface
|
||||
*/
|
||||
public function personalFormList()
|
||||
{
|
||||
$this->widget('Widget_Plugins_List_Activated')->to($plugins);
|
||||
$this->widget('Widget_Plugins_List@personalPlugins', 'activated=1')->to($plugins);
|
||||
while ($plugins->next()) {
|
||||
if ($plugins->personalConfig) {
|
||||
echo '<h3>' . $plugins->title . '</h3>';
|
||||
list($pluginFileName, $className) = Typecho_Plugin::portal($plugins->name,
|
||||
__TYPECHO_ROOT_DIR__ . '/' . __TYPECHO_PLUGIN_DIR__);
|
||||
$this->options->pluginDir($plugins->name));
|
||||
|
||||
$form = $this->personalForm($plugins->name, $className, $pluginFileName, $group);
|
||||
if ($this->user->pass($group, true)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user