This commit is contained in:
Yagami
2019-02-27 09:23:40 +08:00
5 changed files with 46 additions and 15 deletions
+2
View File
@@ -14,6 +14,8 @@ $config->doc->edit->requiredFields = 'title';
$config->doc->customObjectLibs = 'files,customFiles';
$config->doc->notArticleType = '';
$config->doc->canCreateOffice = false;
$config->doc->officeTypes = 'word,ppt,excel';
$config->doc->custom = new stdclass();
$config->doc->custom->objectLibs = $config->doc->customObjectLibs;
+4
View File
@@ -122,6 +122,9 @@ $lang->doc->aclList['private'] = '私有';
$lang->doc->typeList['html'] = '富文本';
$lang->doc->typeList['markdown'] = 'Markdown';
$lang->doc->typeList['url'] = '链接';
$lang->doc->typeList['word'] = 'Word';
$lang->doc->typeList['ppt'] = 'PPT';
$lang->doc->typeList['excel'] = 'Excel';
$lang->doc->types['text'] = '文档';
$lang->doc->types['url'] = '链接';
@@ -160,6 +163,7 @@ $lang->doc->errorMainSysLib = "该系统文档库不能删除!";
$lang->doc->accessDenied = "您没有权限访问!";
$lang->doc->versionNotFount = '该版本文档不存在';
$lang->doc->noDoc = '暂时没有文档。';
$lang->doc->cannotCreateOffice = '对不起,企业版才能创建%s文档。';
$lang->doc->noSearchedDoc = '没有搜索到任何文档。';
$lang->doc->noEditedDoc = '您还没有编辑任何文档。';
$lang->doc->noOpenedDoc = '您还没有创建任何文档。';
+2 -1
View File
@@ -58,7 +58,8 @@ var browseType = '<?php echo $browseType;?>';
<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i> <?php echo $lang->doc->create;?> <span class='caret'></span></button>
<ul class='dropdown-menu'>
<?php foreach($lang->doc->typeList as $typeKey => $typeName):?>
<li><?php echo html::a($this->createLink('doc', 'create', "libID=$libID&moduleID=$moduleID&type=$typeKey"), $typeName);?></li>
<?php $class = strpos($config->doc->officeTypes, $typeKey) !== false ? 'iframe' : '';?>
<li><?php echo html::a($this->createLink('doc', 'create', "libID=$libID&moduleID=$moduleID&type=$typeKey"), $typeName, '', "class='$class'");?></li>
<?php endforeach;?>
</ul>
</div>
+14
View File
@@ -10,6 +10,19 @@
* @link http://www.zentao.net
*/
?>
<?php if(strpos($config->doc->officeTypes, $docType) !== false and !$config->doc->canCreateOffice):?>
<?php include '../../common/view/header.lite.html.php';?>
<div id="mainContent" class="main-content">
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->doc->create;?></h2>
</div>
<div class='alert alert-warning strong'><?php printf($lang->doc->cannotCreateOffice, zget($lang->doc->typeList, $docType));?></div>
</div>
</div>
</body>
</html>
<?php else:?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/ueditor.html.php';?>
<?php include '../../common/view/markdown.html.php';?>
@@ -98,3 +111,4 @@
<?php js::set('docType', $docType);?>
<?php js::set('noticeAcl', $lang->doc->noticeAcl['doc']);?>
<?php include '../../common/view/footer.html.php';?>
<?php endif;?>
+24 -14
View File
@@ -169,8 +169,8 @@ if(empty($type)) $type = 'product';
<?php
if(common::hasPriv('doc', 'sort'))
{
echo html::a('###', "<i class='icon-sort'></i> {$lang->doc->orderLib}", '', "id='orderLib' class='text-secondary small " . (($type != 'product' and $type !='project') ? '' : 'hidden') . "'");
echo html::a('javascript:saveOrder()', "<i class='icon-checked icon-sm'></i> {$lang->save}", '', "id='saveOrder' class='text-primary small hidden'");
echo html::a('###', "<i class='icon-sort'></i> {$lang->doc->orderLib}", '', "id='orderLib' class='text-secondary small " . (($type != 'product' and $type !='project') ? '' : 'hidden') . "' style='padding-left:5px;'");
echo html::a('javascript:saveOrder()', "<i class='icon-checked'></i> {$lang->save}", '', "id='saveOrder' class='text-secondary small hidden' style='padding-left:10px;'");
}
?>
</span>
@@ -220,23 +220,33 @@ $(function()
{
var href = $(this).attr('href');
var canOrder = !(href.indexOf('product') > 0 || href.indexOf('project') > 0);
$(this).closest('.side-col').find('.side-footer #orderLib').toggleClass('hidden', !canOrder);
$(this).closest('.side-col').find('.side-footer #saveOrder').toggleClass('hidden', !canOrder);
if(!canOrder)
{
$(this).closest('.side-col').find('.side-footer #orderLib').addClass('hidden');
$(this).closest('.side-col').find('.side-footer #saveOrder').addClass('hidden');
}
var $orderLib = $(this).closest('.side-col').find('.side-footer #orderLib');
var $saveOrder = $(this).closest('.side-col').find('.side-footer #saveOrder');
$(this).on('shown.zui.tab', function(e)
var execute = false;
$(this).on('shown.zui.tab', function()
{
var $tabPane = $('#mainRow .side-col .tabs .tab-content .tab-pane.active');
if($tabPane.find('.libs-group.sort').length > 0 && canOrder)
if(!execute)
{
$orderLib.addClass('hidden');
$saveOrder.removeClass('hidden');
}
if($tabPane.find('.libs-group.sort').length == 0 && canOrder)
{
$orderLib.removeClass('hidden');
$saveOrder.addClass('hidden');
var $tabPane = $('#mainRow .side-col .tabs .tab-content .tab-pane.active');
if($tabPane.find('.libs-group.sort').length > 0 && canOrder)
{
$orderLib.addClass('hidden');
$saveOrder.removeClass('hidden');
execute = true;
}
if($tabPane.find('.libs-group.sort').length == 0 && canOrder)
{
$orderLib.removeClass('hidden');
$saveOrder.addClass('hidden');
execute = true;
}
}
});
});