子分类支持

This commit is contained in:
joyqi
2014-02-24 18:55:56 +08:00
parent b4d1a3a067
commit 854bfdafef
21 changed files with 727 additions and 151 deletions
+23
View File
@@ -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';
?>
+1 -1
View File
@@ -124,7 +124,7 @@ $(document).ready(function() {
. (isset($fileParentContent) ? '?cid=' . $fileParentContent->cid : '')); ?>',
runtimes : 'html5,flash,silverlight,html4',
flash_swf_url : '<?php $options->adminUrl('js/Moxie.swf'); ?>',
silverlight_swf_url : '<?php $options->adminUrl('js/Moxie.xap'); ?>',
silverlight_xap_url : '<?php $options->adminUrl('js/Moxie.xap'); ?>',
drop_element : $('.upload-area').get(0),
filters : {
max_file_size : '<?php echo $phpMaxFilesize ?>',
+25 -61
View File
@@ -3,7 +3,7 @@ include 'common.php';
include 'header.php';
include 'menu.php';
Typecho_Widget::widget('Widget_Metas_Category_List')->to($categories);
Typecho_Widget::widget('Widget_Metas_Category_Admin')->to($categories);
?>
<div class="main">
@@ -11,7 +11,7 @@ Typecho_Widget::widget('Widget_Metas_Category_List')->to($categories);
<?php include 'page-title.php'; ?>
<div class="row typecho-page-main manage-metas">
<div class="col-mb-12 col-tb-8" role="main">
<div class="col-mb-12" role="main">
<form method="post" name="manage_categories" class="operate-form">
<div class="typecho-list-operate clearfix">
@@ -31,21 +31,26 @@ Typecho_Widget::widget('Widget_Metas_Category_List')->to($categories);
</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="35%"/>
<col width="30%"/>
<col width=""/>
<col width="15%"/>
<col width="25%"/>
<col width=""/>
<col width="10%"/>
</colgroup>
<thead>
<tr>
<th> </th>
<th><?php _e('名称'); ?></th>
<th><?php _e('子分类'); ?></th>
<th><?php _e('缩略名'); ?></th>
<th> </th>
<th><?php _e('文章数'); ?></th>
@@ -56,9 +61,17 @@ Typecho_Widget::widget('Widget_Metas_Category_List')->to($categories);
<?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 echo $request->makeUriByRequest('mid=' . $categories->mid); ?>"><?php $categories->name(); ?></a>
<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 ($categories->children > 0): ?>
<a href="<?php $options->adminUrl('manage-categories.php?parent=' . $categories->mid); ?>"><?php echo _n('一个分类', '%n个分类', $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): ?>
@@ -72,7 +85,7 @@ Typecho_Widget::widget('Widget_Metas_Category_List')->to($categories);
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="5"><h6 class="typecho-list-table-title"><?php _e('没有任何分类'); ?></h6></td>
<td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何分类'); ?></h6></td>
</tr>
<?php endif; ?>
</tbody>
@@ -81,9 +94,6 @@ Typecho_Widget::widget('Widget_Metas_Category_List')->to($categories);
</form>
</div>
<div class="col-mb-12 col-tb-4" role="form">
<?php Typecho_Widget::widget('Widget_Metas_Category_Edit')->form()->render(); ?>
</div>
</div>
</div>
</div>
@@ -117,41 +127,12 @@ include 'common-js.php';
}
});
if (table.length > 0) {
table.tableSelectable({
checkEl : 'input[type=checkbox]',
rowEl : 'tr',
selectAllEl : '.typecho-table-select-all',
actionEl : '.dropdown-menu a'
});
} else {
$('.typecho-list-notable').tableSelectable({
checkEl : 'input[type=checkbox]',
rowEl : 'li',
selectAllEl : '.typecho-table-select-all',
actionEl : '.dropdown-menu a'
});
// $('.typecho-table-select-all').click(function () {
// var selection = $('.tag-selection');
// if (0 == selection.length) {
// selection = $('<div class="tag-selection clearfix" />').prependTo('.typecho-mini-panel');
// }
// selection.html('');
// if ($(this).prop('checked')) {
// $('.typecho-list-notable li').each(function () {
// var span = $('span', this),
// a = $('<a class="button" href="' + span.attr('rel') + '">' + span.text() + '</a>');
// this.aHref = a;
// selection.append(a);
// });
// }
// });
}
table.tableSelectable({
checkEl : 'input[type=checkbox]',
rowEl : 'tr',
selectAllEl : '.typecho-table-select-all',
actionEl : '.dropdown-menu a'
});
$('.btn-drop').dropdownMenu({
btnEl : '.dropdown-toggle',
@@ -163,23 +144,6 @@ include 'common-js.php';
btn.parents('form').attr('action', btn.attr('rel')).submit();
});
// $('.typecho-list-notable li').click(function () {
// var selection = $('.tag-selection'), span = $('span', this),
// a = $('<a class="button" href="' + span.attr('rel') + '">' + span.text() + '</a>'),
// li = $(this);
// if (0 == selection.length) {
// selection = $('<div class="tag-selection clearfix" />').prependTo('.typecho-mini-panel');
// }
// if (li.hasClass('checked')) {
// this.aHref = a;
// a.appendTo(selection);
// } else {
// this.aHref.remove();
// }
// });
<?php if (isset($request->mid)): ?>
$('.typecho-mini-panel').effect('highlight', '#AACB36');
<?php endif; ?>
+1 -1
View File
@@ -3,7 +3,7 @@ include 'common.php';
include 'header.php';
include 'menu.php';
Typecho_Widget::widget('Widget_Metas_Tag_Cloud', 'sort=mid&desc=0')->to($tags);
Typecho_Widget::widget('Widget_Metas_Tag_Admin')->to($tags);
?>
<div class="main">
+2 -1
View File
@@ -147,13 +147,14 @@ $(document).ready(function() {
url : '<?php $options->index('/action/upload?do=modify&cid=' . $attachment->cid); ?>',
runtimes : 'html5,flash,silverlight,html4',
flash_swf_url : '<?php $options->adminUrl('js/Moxie.swf'); ?>',
silverlight_swf_url : '<?php $options->adminUrl('js/Moxie.xap'); ?>',
silverlight_xap_url : '<?php $options->adminUrl('js/Moxie.xap'); ?>',
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) {