* adjust doc module.
This commit is contained in:
@@ -13,11 +13,12 @@ $config->doc->create->requiredFields = 'title';
|
||||
$config->doc->edit->requiredFields = 'title';
|
||||
|
||||
$config->doc->editor = new stdclass();
|
||||
$config->doc->editor->create = array('id' => 'content,digest', 'tools' => 'fullTools');
|
||||
$config->doc->editor->edit = array('id' => 'content,digest,comment', 'tools' => 'fullTools');
|
||||
$config->doc->editor->create = array('id' => 'content', 'tools' => 'fullTools');
|
||||
$config->doc->editor->edit = array('id' => 'content', 'tools' => 'fullTools');
|
||||
$config->doc->editor->view = array('id' => 'comment,lastComment', 'tools' => 'fullTools');
|
||||
|
||||
$config->doc->markdown = new stdclass();
|
||||
$config->doc->markdown->create = array('id' => 'contentMarkdown,digestMarkdown');
|
||||
$config->doc->markdown->create = array('id' => 'contentMarkdown', 'tools' => 'withchange');
|
||||
|
||||
$config->doc->search['module'] = 'doc';
|
||||
$config->doc->search['fields']['title'] = $lang->doc->title;
|
||||
|
||||
+16
-15
@@ -146,6 +146,7 @@ class doc extends control
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->type = $type;
|
||||
$this->view->crumb = $this->doc->getCrumbs($libID, $moduleID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -297,7 +298,7 @@ class doc extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->setMenu($this->libs, $libID);
|
||||
$this->doc->setMenu($this->libs, $libID, $type);
|
||||
}
|
||||
|
||||
$libs = $this->libs;
|
||||
@@ -332,21 +333,24 @@ class doc extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($docID)
|
||||
public function edit($docID, $comment = false)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$result = $this->doc->update($docID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$changes = $result['changes'];
|
||||
$files = $result['files'];
|
||||
if($comment == false)
|
||||
{
|
||||
$result = $this->doc->update($docID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$changes = $result['changes'];
|
||||
$files = $result['files'];
|
||||
}
|
||||
if($this->post->comment != '' or !empty($changes) or !empty($files))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$fileAction = '';
|
||||
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
|
||||
$actionID = $this->action->create('doc', $docID, $action, $fileAction . $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
die(js::locate($this->createLink('doc', 'view', "docID=$docID"), 'parent'));
|
||||
}
|
||||
@@ -355,16 +359,12 @@ class doc extends control
|
||||
$doc = $this->doc->getById($docID);
|
||||
$libID = $doc->lib;
|
||||
|
||||
if($doc->type == 'markdown')
|
||||
{
|
||||
$this->config->doc->markdown->edit = array('id' => 'content,digest');
|
||||
$this->config->doc->editor->edit['id'] = 'comment';
|
||||
}
|
||||
if($doc->contentType == 'markdown') $this->config->doc->markdown->edit = array('id' => 'content', 'tools' => 'toolbar');
|
||||
|
||||
$lib = $this->doc->getLibByID($libID);
|
||||
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
|
||||
$this->libs = $this->doc->getLibs($type);
|
||||
$this->doc->setMenu($this->libs, $libID);
|
||||
$this->doc->setMenu($this->libs, $libID, $type);
|
||||
|
||||
$this->view->title = $this->libs[$libID] . $this->lang->colon . $this->lang->doc->edit;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $this->libs[$libID]);
|
||||
@@ -392,7 +392,7 @@ class doc extends control
|
||||
$doc = $this->doc->getById($docID, $version, true);
|
||||
if(!$doc) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
|
||||
if($doc->type == 'markdown')
|
||||
if($doc->contentType == 'markdown')
|
||||
{
|
||||
$hyperdown = $this->app->loadClass('hyperdown');
|
||||
$doc->content = $hyperdown->makeHtml($doc->content);
|
||||
@@ -419,6 +419,7 @@ class doc extends control
|
||||
$this->view->users = $this->user->getPairs('noclosed,noletter');
|
||||
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('doc', $docID);
|
||||
$this->view->keTableCSS = $this->doc->extractKETableCSS($doc->content);
|
||||
$this->view->crumb = $this->doc->getCrumbs($lib->id, $doc->module, $docID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -651,7 +652,7 @@ class doc extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function allLibs($type, $extra = '', $recTotal = 0, $recPerPage = 21, $pageID = 1)
|
||||
public function allLibs($type, $extra = '', $recTotal = 0, $recPerPage = 30, $pageID = 1)
|
||||
{
|
||||
$libName = isset($this->lang->doc->systemLibs[$type]) ? $this->lang->doc->systemLibs[$type] : $this->lang->doc->custom;
|
||||
$this->doc->setMenu(array($this->lang->doclib->select), 0, $type);
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#libs table td{border-right:1px solid #ddd; width:33%;vertical-align: top; padding:0px; overflow:hidden}
|
||||
#libs table td.none{border-right:0px}
|
||||
@@ -1,20 +1,9 @@
|
||||
.outer{overflow:auto}
|
||||
.libs-heading {display: block; margin: 10px 0; background: #f1f1f1; color: #808080; position: relative;}
|
||||
.libs-heading-text {display: inline-block; padding: 8px 12px; font-weight: bold; color: #2e6dad}
|
||||
.libs-heading:hover {background-color: #EBF2F9}
|
||||
.libs-heading:hover .libs-heading-text {background-color: #2e6dad; color: #fff}
|
||||
.libs-heading > .icon {display: block; right: 0; top: 0; bottom: 0; position: absolute; line-height: 33px; width: 34px; text-align: center; opacity: .6}
|
||||
.libs-heading:hover > .icon {opacity: 1}
|
||||
.libs-group-heading {color: #808080; margin: 10px 0}
|
||||
.libs {margin-bottom: 15px;}
|
||||
.libs.collapsed .libs-group,
|
||||
.libs.collapsed .libs-group-heading {display: none}
|
||||
.libs.collapsed .libs-heading {background: #ddd;}
|
||||
.libs.collapsed .libs-heading > .icon {opacity: 1}
|
||||
.libs.collapsed .libs-heading > .icon:before {content: '\e726'}
|
||||
.lib {float: left; display: block; margin: 0 15px 0 0; padding: 10px 15px; text-align: center; color: #333; border-radius: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
.libs-group-heading {color: #808080; border-bottom:1px solid #ddd; padding:8px; text-align:center; background:#DDF3F5}
|
||||
.libs-group{padding:10px 10px 10px 10px;}
|
||||
.lib {float: left; display: block; width:80px; padding: 5px; margin:0px 3px; text-align: center; color: #333; overflow: hidden; text-overflow: ellipsis;}
|
||||
.lib .file-icon{font-size:30px;}
|
||||
.lib .lib-name{height: 2em; line-height: 14px; overflow: hidden;}
|
||||
.lib:hover, .lib:focus, .lib:active {border-color: #2e6dad; background-color: #EBF2F9; color: #2e6dad}
|
||||
.col-md-4{overflow:hidden;}
|
||||
|
||||
#modulemenu .nav > li > .dropdown > a#libType{display:inline-block;}
|
||||
#modulemenu .nav > li > .dropdown.open > a#libType{background:#e5e5e5;}
|
||||
|
||||
@@ -1 +1,9 @@
|
||||
.lib-heading{border-right:1px solid #ddd;}
|
||||
#libs table td.row{padding:0px;}
|
||||
#libs table td.lib-more{border-left:1px solid #ddd;}
|
||||
.table.project,.table.product{border:0px;}
|
||||
.table.project tbody td,.table.product tbody td{border-right:1px solid #ddd; width:33.3%;vertical-align: top; padding:0px;}
|
||||
.table.project tbody tr > td:first-child,.table.product tbody tr > td:first-child{padding:0px;}
|
||||
.table.project tbody tr > td:last-child,.table.product tbody tr > td:last-child{padding:0px;}
|
||||
.table.project td:last-child,.table.product td:last-child{border-right:0px;}
|
||||
.table.project tbody > tr:last-child td,.table.product tbody > tr:last-child td{border-bottom:0px;}
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
.lib-file .card-heading > .icon-download {opacity: .5; position: relative; top: 2px}
|
||||
.lib-file .card-heading {color: #114f8e}
|
||||
.lib-file .card-heading:hover {background-color: #EBF2F9; color: #2e6dad}
|
||||
.lib-file .card-heading > .delete {opacity: 0; margin-top:-1px; margin-right:5px}
|
||||
.lib-file .card-heading > .delete .icon{font-size:16px;}
|
||||
.lib-file .card-heading:hover > .delete{opacity:1}
|
||||
.lib-file .media-wrapper > .icon-holder {font-size: 105px; opacity: 1; color: rgba(255,255,255,.7); opacity: .6}
|
||||
.lib-file .media-wrapper > .icon-holder.icon-file {background-color: #999}
|
||||
.lib-file .media-wrapper > .icon-holder.icon-file-archive {background-color: #8666B8}
|
||||
|
||||
@@ -1 +1 @@
|
||||
#url-content{v:expressio !important}
|
||||
#titlebar > .heading > strong.crumb > i.icon-angle-right{display:inline;}
|
||||
|
||||
+26
-11
@@ -1,22 +1,37 @@
|
||||
$(function()
|
||||
{
|
||||
toggleAcl($('#acl').val());
|
||||
window.editor['content'].addListener('focus', function()
|
||||
{
|
||||
this.ui.setFullScreen(true);
|
||||
});
|
||||
$('#type').change(function()
|
||||
$('input[name="type"]').change(function()
|
||||
{
|
||||
var type = $(this).val();
|
||||
if(type == 'html')
|
||||
if(type == 'text')
|
||||
{
|
||||
$('.contenthtml').removeClass('hidden');
|
||||
$('.contentmarkdown').addClass('hidden');
|
||||
$('#contentBox').removeClass('hidden');
|
||||
$('#urlBox').addClass('hidden');
|
||||
}
|
||||
else if(type == 'markdown')
|
||||
else if(type == 'url')
|
||||
{
|
||||
$('.contenthtml').addClass('hidden');
|
||||
$('.contentmarkdown').removeClass('hidden');
|
||||
$('#contentBox').addClass('hidden');
|
||||
$('#urlBox').removeClass('hidden');
|
||||
}
|
||||
})
|
||||
window.editor['content'].addListener('ready', function()
|
||||
{
|
||||
$('div#content .edui-toolbar').append("<div class='edui-box edui-button edui-for-markdown edui-default'><button type='button' class='edui-default' onclick='toggleEditor(\"markdown\")'>Markdown</button></div>");
|
||||
});
|
||||
})
|
||||
|
||||
function toggleEditor(type)
|
||||
{
|
||||
if(type == 'html')
|
||||
{
|
||||
$('.contenthtml').removeClass('hidden');
|
||||
$('.contentmarkdown').addClass('hidden');
|
||||
}
|
||||
else if(type == 'markdown')
|
||||
{
|
||||
$('.contenthtml').addClass('hidden');
|
||||
$('.contentmarkdown').removeClass('hidden');
|
||||
}
|
||||
$('#contentType').val(type);
|
||||
}
|
||||
|
||||
+12
-5
@@ -1,11 +1,18 @@
|
||||
$(function()
|
||||
{
|
||||
toggleAcl($('#acl').val());
|
||||
if(typeof(window.editor['content']) != 'undefined')
|
||||
$('input[name="type"]').change(function()
|
||||
{
|
||||
window.editor['content'].addListener('focus', function()
|
||||
var type = $(this).val();
|
||||
if(type == 'text')
|
||||
{
|
||||
this.ui.setFullScreen(true);
|
||||
});
|
||||
}
|
||||
$('#contentBox').removeClass('hidden');
|
||||
$('#urlBox').addClass('hidden');
|
||||
}
|
||||
else if(type == 'url')
|
||||
{
|
||||
$('#contentBox').addClass('hidden');
|
||||
$('#urlBox').removeClass('hidden');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -73,7 +73,7 @@ $lang->doc->libTypeList['custom'] = 'Custom library';
|
||||
$lang->doc->systemLibs['product'] = "{$lang->productCommon} doc";
|
||||
$lang->doc->systemLibs['project'] = "{$lang->projectCommon} doc";
|
||||
|
||||
$lang->doc->aclList['public'] = 'Public';
|
||||
$lang->doc->aclList['open'] = 'Public';
|
||||
$lang->doc->aclList['custom'] = 'Custom';
|
||||
$lang->doc->aclList['private'] = 'Private';
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ $lang->doc->browse = '文档列表';
|
||||
$lang->doc->view = '文档详情';
|
||||
$lang->doc->diff = '对比';
|
||||
$lang->doc->manageType = '维护分类';
|
||||
$lang->doc->editType = '编辑分类';
|
||||
$lang->doc->deleteType = '删除分类';
|
||||
$lang->doc->addType = '增加分类';
|
||||
|
||||
$lang->doc->libName = '文档库名称';
|
||||
@@ -73,7 +75,7 @@ $lang->doc->libTypeList['custom'] = '自定义文档库';
|
||||
$lang->doc->systemLibs['product'] = $lang->productCommon . '文档库';
|
||||
$lang->doc->systemLibs['project'] = $lang->projectCommon . '文档库';
|
||||
|
||||
$lang->doc->aclList['public'] = '公开';
|
||||
$lang->doc->aclList['open'] = '公开';
|
||||
$lang->doc->aclList['custom'] = '自定义';
|
||||
$lang->doc->aclList['private'] = '私有';
|
||||
|
||||
|
||||
+66
-28
@@ -84,7 +84,14 @@ class docModel extends model
|
||||
{
|
||||
if($type == 'product' or $type == 'project')
|
||||
{
|
||||
$stmt = $this->dao->select('*')->from(TABLE_DOCLIB)->where($type)->ne(0)->andWhere('deleted')->eq(0)->orderBy('id desc')->query();
|
||||
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
|
||||
$stmt = $this->dao->select('t1.*')->from(TABLE_DOCLIB)->alias('t1')
|
||||
->leftJoin($table)->alias('t2')->on("t1.$type=t2.id")
|
||||
->where("t1.$type")->ne(0)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->orderBy("t2.order desc, t1.id")
|
||||
->query();
|
||||
$objects = $this->dao->select('id,name')->from($table)->where('deleted')->eq('0')->fetchPairs('id', 'name');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -94,7 +101,12 @@ class docModel extends model
|
||||
$libPairs = array();
|
||||
while($lib = $stmt->fetch())
|
||||
{
|
||||
if($this->checkPriv($lib)) $libPairs[$lib->id] = $lib->name;
|
||||
if($this->checkPriv($lib))
|
||||
{
|
||||
$libName = $lib->name;
|
||||
if(($type == 'product' or $type == 'project') and $lib->main == 0 and isset($objects[$lib->$type])) $libName = $objects[$lib->$type] . ' / ' . $libName;
|
||||
$libPairs[$lib->id] = $libName;
|
||||
}
|
||||
}
|
||||
return $libPairs;
|
||||
}
|
||||
@@ -289,10 +301,10 @@ class docModel extends model
|
||||
$this->dao->update(TABLE_DOC)->set('version')->eq($doc->version)->where('id')->eq($doc->id)->exec();
|
||||
}
|
||||
|
||||
$doc->title = isset($docContent->title) ? $docContent->title : '';
|
||||
$doc->digest = isset($docContent->digest) ? $docContent->digest : '';
|
||||
$doc->content = isset($docContent->content) ? $docContent->content : '';
|
||||
$doc->type = isset($docContent->type) ? $docContent->type : '';
|
||||
$doc->title = isset($docContent->title) ? $docContent->title : '';
|
||||
$doc->digest = isset($docContent->digest) ? $docContent->digest : '';
|
||||
$doc->content = isset($docContent->content) ? $docContent->content : '';
|
||||
$doc->contentType = isset($docContent->type) ? $docContent->type : '';
|
||||
if($setImgSize) $doc->content = $this->loadModel('file')->setImgSize($doc->content);
|
||||
$doc->files = $docFiles;
|
||||
|
||||
@@ -336,23 +348,22 @@ class docModel extends model
|
||||
$doc = $this->loadModel('file')->processEditor($doc, $this->config->doc->editor->create['id'], $this->post->uid);
|
||||
$doc->product = $lib->product;
|
||||
$doc->project = $lib->project;
|
||||
if($doc->type == 'url')
|
||||
{
|
||||
$doc->content = $doc->url;
|
||||
$doc->contentType = 'html';
|
||||
}
|
||||
|
||||
$docContent = new stdclass();
|
||||
$docContent->title = $doc->title;
|
||||
$docContent->digest = $doc->type == 'html' ? $doc->digest : $doc->digestMarkdown;
|
||||
$docContent->content = $doc->type == 'html' ? $doc->content : $doc->contentMarkdown;
|
||||
$docContent->type = $doc->type;
|
||||
$docContent->content = $doc->contentType == 'html' ? $doc->content : $doc->contentMarkdown;
|
||||
$docContent->type = $doc->contentType;
|
||||
$docContent->version = 1;
|
||||
if($doc->type == 'markdown')
|
||||
{
|
||||
$docContent->content = str_replace('>', '>', $docContent->content);
|
||||
$docContent->digest = str_replace('>', '>', $docContent->digest);
|
||||
}
|
||||
unset($doc->digest);
|
||||
unset($doc->digestMarkdown);
|
||||
if($doc->contentType == 'markdown') $docContent->content = str_replace('>', '>', $docContent->content);
|
||||
unset($doc->content);
|
||||
unset($doc->contentMarkdown);
|
||||
unset($doc->type);
|
||||
unset($doc->contentType);
|
||||
unset($doc->url);
|
||||
|
||||
$this->dao->insert(TABLE_DOC)->data($doc)->autoCheck()
|
||||
->batchCheck($this->config->doc->create->requiredFields, 'notempty')
|
||||
@@ -392,16 +403,14 @@ class docModel extends model
|
||||
->remove('comment,files,labels,uid')
|
||||
->get();
|
||||
if($doc->acl == 'private') $doc->users = $oldDoc->addedBy;
|
||||
if($oldDoc->type == 'markdown')
|
||||
{
|
||||
$doc->content = str_replace('>', '>', $doc->content);
|
||||
$doc->digest = str_replace('>', '>', $doc->digest);
|
||||
}
|
||||
if($oldDoc->contentType == 'markdown') $doc->content = str_replace('>', '>', $doc->content);
|
||||
|
||||
$lib = $this->getLibByID($doc->lib);
|
||||
$doc = $this->loadModel('file')->processEditor($doc, $this->config->doc->editor->edit['id'], $this->post->uid);
|
||||
$doc->product = $lib->product;
|
||||
$doc->project = $lib->project;
|
||||
if($doc->type == 'url') $doc->content = $doc->url;
|
||||
unset($doc->url);
|
||||
|
||||
$files = $this->file->saveUpload('doc', $docID);
|
||||
$changes = common::createChanges($oldDoc, $doc);
|
||||
@@ -409,7 +418,7 @@ class docModel extends model
|
||||
if($files) $changed = true;
|
||||
foreach($changes as $change)
|
||||
{
|
||||
if($change['field'] == 'content' or $change['field'] == 'title' or $change['field'] == 'digest') $changed = true;
|
||||
if($change['field'] == 'content' or $change['field'] == 'title') $changed = true;
|
||||
}
|
||||
|
||||
if($changed)
|
||||
@@ -419,7 +428,6 @@ class docModel extends model
|
||||
$docContent = new stdclass();
|
||||
$docContent->doc = $docID;
|
||||
$docContent->title = $doc->title;
|
||||
$docContent->digest = $doc->digest;
|
||||
$docContent->content = $doc->content;
|
||||
$docContent->version = $doc->version;
|
||||
$docContent->type = $oldDocContent->type;
|
||||
@@ -428,8 +436,8 @@ class docModel extends model
|
||||
$docContent->files = trim($docContent->files, ',');
|
||||
$this->dao->insert(TABLE_DOCCONTENT)->data($docContent)->exec();
|
||||
}
|
||||
unset($doc->digest);
|
||||
unset($doc->content);
|
||||
unset($doc->contentType);
|
||||
|
||||
$this->dao->update(TABLE_DOC)->data($doc)
|
||||
->autoCheck()
|
||||
@@ -582,7 +590,7 @@ class docModel extends model
|
||||
*/
|
||||
public function checkPriv($object)
|
||||
{
|
||||
if($object->acl == 'public') return true;
|
||||
if($object->acl == 'open') return true;
|
||||
|
||||
$account = ',' . $this->app->user->account . ',';
|
||||
if(strpos($this->app->company->admins, $account) !== false) return true;
|
||||
@@ -713,7 +721,7 @@ class docModel extends model
|
||||
*/
|
||||
public function getSubLibGroups($type, $idList)
|
||||
{
|
||||
$libGroups = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->in($idList)->orderBy('id desc')->fetchGroup($type, 'id');
|
||||
$libGroups = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->in($idList)->orderBy('id')->fetchGroup($type, 'id');
|
||||
if($type == 'product')
|
||||
{
|
||||
$hasProject = $this->dao->select('DISTINCT product')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
@@ -821,7 +829,7 @@ class docModel extends model
|
||||
$account = ',' . $this->app->user->account . ',';
|
||||
if(strpos($this->app->company->admins, $account) === false)
|
||||
{
|
||||
$condition .= "{$table}acl='public'";
|
||||
$condition .= "{$table}acl='open'";
|
||||
$condition .= " OR ({$table}acl='private' and {$table}users='{$this->app->user->account}')";
|
||||
$condition .= " OR ({$table}acl='custom' and (";
|
||||
foreach($this->app->user->groups as $groupID) $condition .= "(CONCAT(',', {$table}groups, ',') like '%,$groupID,%') OR ";
|
||||
@@ -1065,4 +1073,34 @@ class docModel extends model
|
||||
|
||||
return array($showNumber, $action, 'number' => $showNumber, 'action' => $action);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get crumbs.
|
||||
*
|
||||
* @param int $libID
|
||||
* @param int $moduleID
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getCrumbs($libID, $moduleID = 0, $docID = 0)
|
||||
{
|
||||
$lib = $this->getLibById($libID);
|
||||
$parents = $moduleID ? $this->loadModel('tree')->getParents($moduleID) : array();
|
||||
$doc = $docID ? $this->getById($docID) : array();
|
||||
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom');
|
||||
$objectName = '';
|
||||
if($type != 'custom' and empty($lib->main))
|
||||
{
|
||||
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
|
||||
$objectName = $this->dao->select('name')->from($table)->where('id')->eq($lib->$type)->fetch('name');
|
||||
}
|
||||
$crumb = '';
|
||||
if($objectName) $crumb .= $objectName . $this->lang->arrow;
|
||||
$crumb .= html::a(helper::createLink('doc', 'browse', "libID=$libID"), $lib->name);
|
||||
foreach($parents as $module) $crumb .= $this->lang->arrow . html::a(helper::createLink('doc', 'browse', "libID=$libID&browseType=byModule¶m=$module->id"), $module->name);
|
||||
if($doc) $crumb .= $this->lang->arrow . $doc->title;
|
||||
|
||||
return $crumb;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='featurebar'><strong><?php echo isset($lang->doc->systemLibs[$type]) ? $lang->doc->systemLibs[$type] : $lang->doc->custom?></strong></div>
|
||||
<div class='libs'>
|
||||
<div id='libs'>
|
||||
<?php if(($type == 'project' or $type == 'product')):?>
|
||||
<?php $i = 0;?>
|
||||
<table class='table'>
|
||||
<table class='table table-data'>
|
||||
<?php foreach($libs as $lib):?>
|
||||
<?php if(isset($subLibs[$lib->id])): ?>
|
||||
<?php if($i % 3 == 0) echo "<tr><td class='row'>"?>
|
||||
<div class='col-md-4'>
|
||||
<div class='libs-group-heading libs-<?php echo $type?>-heading'><i class='icon <?php echo $type == 'product' ? 'icon-cube-alt' : 'icon-folder-close-alt'?>'></i> <strong><?php echo $lib->name?></strong></div>
|
||||
<?php if($i % 3 == 0) echo "<tr>"?>
|
||||
<td>
|
||||
<div class='libs-group-heading libs-<?php echo $type?>-heading'><strong><?php echo $lib->name?></strong></div>
|
||||
<div class='libs-group clearfix'>
|
||||
<?php foreach($subLibs[$lib->id] as $subLibID => $subLibName):?>
|
||||
<?php
|
||||
@@ -28,14 +28,28 @@
|
||||
elseif($subLibID == 'files') $libLink = inlink('showFiles', "type=$type&objectID=$lib->id");
|
||||
else $libLink = inlink('browse', "libID=$subLibID");
|
||||
?>
|
||||
<a class='lib' title='<?php echo $subLibName?>' href='<?php echo $libLink ?>'><?php echo $subLibName?></a>
|
||||
<a class='lib' title='<?php echo $subLibName?>' href='<?php echo $libLink ?>'>
|
||||
<i class='file-icon icon icon-folder-close-alt'></i>
|
||||
<div class='lib-name' title='<?php echo $subLibName?>'><?php echo $subLibName?></div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php $i++;?>
|
||||
<?php if($i % 3 == 0) echo "</td></tr>"?>
|
||||
<?php if($i % 3 == 0) echo "</tr>"?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php
|
||||
if($i % 3 != 0)
|
||||
{
|
||||
while($i % 3 != 0)
|
||||
{
|
||||
echo "<td class='none'></td>";
|
||||
$i++;
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class='libs-group clearfix'>
|
||||
|
||||
@@ -25,13 +25,23 @@ var browseType = '<?php echo $browseType;?>';
|
||||
<?php include __DIR__ . '/browsebytree.html.php';?>
|
||||
<?php else:?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<div class='crumb pull-left'><i class='icon icon-tags'></i> <?php echo $crumb;?></div>
|
||||
<div class='actions'>
|
||||
<ul class='btn-group nav'>
|
||||
<li id='allTab'><?php echo html::a(inlink('browse', "libID=$libID&browseType=all¶m=0&orderBy=$orderBy"), $lang->doc->allDoc)?></li>
|
||||
<li id='bymoduleTab'><?php echo html::a(inlink('browse', "libID=$libID&browseType=byModule¶m=0&orderBy=$orderBy"), $lang->doc->moduleDoc)?></li>
|
||||
<li id='openedbymeTab'><?php echo html::a(inlink('browse', "libID=$libID&browseType=openedByMe¶m=0&orderBy=$orderBy"), $lang->doc->openedByMe)?></li>
|
||||
<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> <?php echo $lang->doc->searchDoc;?></a></li>
|
||||
</ul>
|
||||
<div class='actions'>
|
||||
</ul>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"><i class='icon icon-ellipsis-h'></i> <?php echo $lang->actions?> <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<?php
|
||||
if(common::hasPriv('doc', 'editLib')) echo '<li>' . html::a(inlink('editLib', "rootID=$libID"), $lang->doc->editLib, '', "data-toggle='modal' data-type='iframe' data-width='600px'") . '</li>';
|
||||
if(common::hasPriv('doc', 'deleteLib')) echo '<li>' . html::a(inlink('deleteLib', "rootID=$libID"), $lang->doc->deleteLib, 'hiddenwin') . '</li>';
|
||||
?>
|
||||
<li><?php echo html::a(inlink('ajaxFixedMenu', "libID=$libID&type=" . ($fixedMenu ? 'remove' : 'fixed')), $fixedMenu ? $lang->doc->removeMenu : $lang->doc->fixedMenu, "hiddenwin");?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"><i class='icon icon-list'></i> <?php echo $lang->doc->browseTypeList['list']?> <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
@@ -51,12 +61,7 @@ var browseType = '<?php echo $browseType;?>';
|
||||
<div class='panel-heading nobr'><?php echo html::icon('folder-close-alt');?> <strong><?php echo $libName;?></strong></div>
|
||||
<div class='panel-body'>
|
||||
<?php echo $moduleTree;?>
|
||||
<div class='text-right'>
|
||||
<?php common::printLink('doc', 'editLib', "rootID=$libID", $lang->edit, '', "data-toggle='modal' data-type='iframe' data-width='600px'");?>
|
||||
<?php common::printLink('doc', 'deleteLib', "rootID=$libID", $lang->delete, 'hiddenwin');?>
|
||||
<?php common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType);?>
|
||||
<?php echo '<br />' . html::a(inlink('ajaxFixedMenu', "libID=$libID&type=" . ($fixedMenu ? 'remove' : 'fixed')), $fixedMenu ? $lang->doc->removeMenu : $lang->doc->fixedMenu, "hiddenwin");?>
|
||||
</div>
|
||||
<div class='text-right'><?php common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType);?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#filesPanel .panel-footer > a:hover {background-color: #e5e5e5;}
|
||||
#filesPanel .pager {position: absolute; top: 4px; right: 4px}
|
||||
#filesPanel .panel-heading > a {font-weight: bold;}
|
||||
#filesPanel .file {float: left; width: 150px; position: relative; background-color: transparent; margin: 0 10px 10px 0; border: 1px solid transparent; transition: all .2s;}
|
||||
#filesPanel .file {float: left; width: 90px; position: relative; background-color: transparent; margin: 0 10px 10px 0; border: 1px solid transparent; transition: all .2s;}
|
||||
#filesPanel .file:hover {border-color: #ddd; background-color: #EBF2F9}
|
||||
#filesPanel .file > a {display: block;}
|
||||
#filesPanel .file-icon {display: block; height: 120px; text-align: center; line-height: 120px; font-size: 91px; opacity: .7}
|
||||
#filesPanel .file-icon {display: block; height: 60px; text-align: center; line-height: 60px; font-size: 50px; opacity: .7}
|
||||
#filesPanel .file:hover .file-icon {opacity: 1}
|
||||
#filesPanel .file-name {text-align: center; height: 2em; line-height: 14px; overflow: hidden;}
|
||||
#filesPanel .file > .actions {position: absolute; bottom: -30px; left: -1px; right: -1px; background-color: #333; background-color: rgba(0,0,0,.5); margin: 0; opacity: 0; transition: opacity .2s;}
|
||||
@@ -19,10 +19,29 @@
|
||||
#filesPanel .file > .actions > a {line-height: 30px; display: inline-block; padding: 0 8px; color: #fff;}
|
||||
</style>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> <?php echo $lang->doc->searchDoc;?></a></li>
|
||||
</ul>
|
||||
<div class='crumb pull-left'><i class='icon icon-tags'></i> <?php echo $crumb;?></div>
|
||||
<div class='actions'>
|
||||
<ul class='nav'>
|
||||
<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> <?php echo $lang->doc->searchDoc;?></a></li>
|
||||
</ul>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"><i class='icon icon-ellipsis-h'></i> <?php echo $lang->actions?> <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<?php if(empty($moduleID)):?>
|
||||
<?php
|
||||
if(common::hasPriv('doc', 'editLib')) echo '<li>' . html::a(inlink('editLib', "rootID=$libID"), $lang->doc->editLib, '', "data-toggle='modal' data-type='iframe' data-width='600px'") . '</li>';
|
||||
if(common::hasPriv('doc', 'deleteLib')) echo '<li>' . html::a(inlink('deleteLib', "rootID=$libID"), $lang->doc->deleteLib, 'hiddenwin') . '</li>';
|
||||
?>
|
||||
<?php else:?>
|
||||
<?php
|
||||
if(common::hasPriv('tree', 'edit')) echo '<li>' . html::a($this->createLink('tree', 'edit', "moduleID={$moduleID}&type=doc"), $lang->doc->editType, '', " class='' data-toggle='modal' data-type='ajax'") . '</li>';
|
||||
if(common::hasPriv('tree', 'delete')) echo '<li>' . html::a($this->createLink('tree', 'delete', "rootID=$libID&moduleID=$moduleID"), $lang->doc->deleteType, 'hiddenwin') . '</li>';
|
||||
?>
|
||||
<?php endif;?>
|
||||
<?php if(common::hasPriv('tree', 'browse')) echo '<li>' . html::a($this->createLink('tree', 'browse', "rootID=$libID&view=doc"), $lang->doc->manageType) . '</li>';?>
|
||||
<li><?php echo html::a(inlink('ajaxFixedMenu', "libID=$libID&type=" . ($fixedMenu ? 'remove' : 'fixed')), $fixedMenu ? $lang->doc->removeMenu : $lang->doc->fixedMenu, "hiddenwin");?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"><i class='icon icon-th'></i> <?php echo $lang->doc->browseTypeList['menu']?> <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
@@ -36,13 +55,8 @@
|
||||
<div id='querybox' class='<?php if($browseType == 'bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<div class='main'>
|
||||
<?php if($modules or $docs):?>
|
||||
<div class='panel' id='filesPanel'>
|
||||
<div class='panel-heading'>
|
||||
<?php echo html::a(inlink('browse', "libID=$libID"), "<i class='icon icon-folder-open-alt'></i> " . $libName) . ' / ';?>
|
||||
<?php foreach($parents as $module):?>
|
||||
<?php echo html::a(inlink('browse', "libID=$libID&browseType=bymenu¶m=$module->id"), $module->name) . ' / '?>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<div class='panel-body clearfix'>
|
||||
<?php foreach($modules as $module):?>
|
||||
<div class='file file-dir'>
|
||||
@@ -50,12 +64,6 @@
|
||||
<i class='file-icon icon icon-folder-close-alt'></i>
|
||||
<div class='file-name' title='<?php echo $module->name?>'><?php echo $module->name?></div>
|
||||
</a>
|
||||
<div class='actions'>
|
||||
<?php
|
||||
if(common::hasPriv('tree', 'edit')) echo html::a($this->createLink('tree', 'edit', "moduleID={$module->id}&type=doc"), '<i class="icon-pencil"></i>', '', " class='' data-toggle='modal' data-type='ajax' title='$lang->edit'");
|
||||
if(common::hasPriv('tree', 'delete')) echo html::a($this->createLink('tree', 'delete', "rootID=$libID&moduleID=$module->id"), '<i class="icon-remove"></i>', 'hiddenwin', "class='' title='{$lang->delete}'");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<?php foreach($docs as $doc):?>
|
||||
@@ -64,21 +72,12 @@
|
||||
<i class='file-icon icon icon-file'></i>
|
||||
<div class='file-name' title='<?php echo $doc->title?>'><?php echo $doc->title?></div>
|
||||
</a>
|
||||
<div class='actions'>
|
||||
<?php
|
||||
if(common::hasPriv('doc', 'edit')) echo html::a($this->createLink('doc', 'edit', "docID={$doc->id}"), '<i class="icon-pencil"></i>', '', " class='' data-toggle='tooltip' title='$lang->edit'");
|
||||
if(common::hasPriv('doc', 'delete')) echo html::a($this->createLink('doc', 'delete', "docID=$doc->id"), '<i class="icon-remove"></i>', 'hiddenwin', "class='' title='{$lang->delete}'");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<div class='panel-footer'>
|
||||
<?php common::printLink('doc', 'editLib', "rootID=$libID", $lang->doc->editLib, '', "data-toggle='modal' data-type='iframe' data-width='600px'");?>
|
||||
<?php common::printLink('doc', 'deleteLib', "rootID=$libID", $lang->doc->deleteLib, 'hiddenwin');?>
|
||||
<?php common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType);?>
|
||||
<?php echo html::a(inlink('ajaxFixedMenu', "libID=$libID&type=" . ($fixedMenu ? 'remove' : 'fixed')), $fixedMenu ? $lang->doc->removeMenu : $lang->doc->fixedMenu, "hiddenwin");?>
|
||||
<?php $pager->show();?>
|
||||
</div>
|
||||
<?php if($docs):?>
|
||||
<div class='panel-footer'><?php $pager->show();?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -31,8 +31,19 @@
|
||||
#docTree.tree ul > li.item-type-doc > .tree-item-wrapper > a {cursor: pointer;}
|
||||
</style>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'><li><?php echo $lang->doc->browseTypeList['tree']?></li></ul>
|
||||
<div class='crumb pull-left'><i class='icon icon-tags'></i> <?php echo $crumb;?></div>
|
||||
<div class='actions'>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"><i class='icon icon-ellipsis-h'></i> <?php echo $lang->actions?> <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<?php
|
||||
if(common::hasPriv('doc', 'editLib')) echo '<li>' . html::a(inlink('editLib', "rootID=$libID"), $lang->doc->editLib, '', "data-toggle='modal' data-type='iframe' data-width='600px'") . '</li>';
|
||||
if(common::hasPriv('doc', 'deleteLib')) echo '<li>' . html::a(inlink('deleteLib', "rootID=$libID"), $lang->doc->deleteLib, 'hiddenwin') . '</li>';
|
||||
?>
|
||||
<?php if(common::hasPriv('tree', 'browse')) echo '<li>' . html::a($this->createLink('tree', 'browse', "rootID=$libID&view=doc"), $lang->doc->manageType) . '</li>';?>
|
||||
<li><?php echo html::a(inlink('ajaxFixedMenu', "libID=$libID&type=" . ($fixedMenu ? 'remove' : 'fixed')), $fixedMenu ? $lang->doc->removeMenu : $lang->doc->fixedMenu, "hiddenwin");?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"><i class='icon icon-tags'></i> <?php echo $lang->doc->browseTypeList['tree']?> <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
@@ -46,15 +57,6 @@
|
||||
</div>
|
||||
<div class='main'>
|
||||
<div class='panel'>
|
||||
<div class='panel-heading'>
|
||||
<i class='icon icon-folder-close-alt'></i> <strong><?php echo $libName;?></strong>
|
||||
<div class='panel-actions pull-right' id='treeActions'>
|
||||
<?php common::printLink('doc', 'editLib', "rootID=$libID", $lang->doc->editLib, '', "class='btn btn-sm btn-link' data-toggle='modal' data-type='iframe' data-width='600px'");?>
|
||||
<?php common::printLink('doc', 'deleteLib', "rootID=$libID", $lang->doc->deleteLib, 'hiddenwin', "class='btn btn-sm btn-link'");?>
|
||||
<?php common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType, '', "class='btn btn-sm btn-link'");?>
|
||||
<?php echo html::a(inlink('ajaxFixedMenu', "libID=$libID&type=" . ($fixedMenu ? 'remove' : 'fixed')), $fixedMenu ? $lang->doc->removeMenu : $lang->doc->fixedMenu, "hiddenwin", "class='btn btn-sm btn-link'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<ul id='docTree' class='tree-lines'></ul>
|
||||
</div>
|
||||
|
||||
@@ -24,63 +24,64 @@
|
||||
</div>
|
||||
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin' id='dataform'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->doc->lib;?></th>
|
||||
<td class='w-400px'><?php echo html::select('lib', $libs, $libID, "class='form-control chosen' onchange='loadModules(this.value)'");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->doc->module;?></th>
|
||||
<td><span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></span></td><td></td>
|
||||
<td class='w-400px'>
|
||||
<?php echo html::hidden('lib', $libID);?>
|
||||
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></span>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->title;?></th>
|
||||
<td colspan='2'><?php echo html::input('title', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->contentType;?></th>
|
||||
<td><?php echo html::select('type', $lang->doc->contentTypeList, 'html', "class='form-control'");?></td>
|
||||
<th><?php echo $lang->doc->keywords;?></th>
|
||||
<td colspan='2'><?php echo html::input('keywords', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->type;?></th>
|
||||
<td><?php echo html::radio('type', $lang->doc->types, 'text');?></td>
|
||||
</tr>
|
||||
<tr id='contentBox'>
|
||||
<th><?php echo $lang->doc->content;?></th>
|
||||
<td colspan='2'>
|
||||
<div class='contenthtml'><?php echo html::textarea('content', '', "style='width:100%;height:200px'");?></div>
|
||||
<div class='contentmarkdown hidden'><?php echo html::textarea('contentMarkdown', '', "style='width:100%;height:200px'");?></div>
|
||||
<?php echo html::hidden('contentType', 'html');?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->digest;?></th>
|
||||
<tr id='urlBox' class='hidden'>
|
||||
<th><?php echo $lang->doc->url;?></th>
|
||||
<td colspan='2'>
|
||||
<div class='contenthtml'><?php echo html::textarea('digest', '', "style='width:100%' rows=3");?></div>
|
||||
<div class='contentmarkdown hidden'><?php echo html::textarea('digestMarkdown', '', "style='width:100%' rows=3");?></div>
|
||||
<?php echo html::input('url', '', "class='form-control'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->keywords;?></th>
|
||||
<td colspan='2'><?php echo html::input('keywords', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr id='fileBox'>
|
||||
<th><?php echo $lang->doc->files;?></th>
|
||||
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doclib->control;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->acl?></span>
|
||||
<?php echo html::select('acl', $lang->doc->aclList, 'public', "class='form-control' onchange='toggleAcl(this.value)'")?>
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo html::radio('acl', $lang->doc->aclList, 'open', "onchange='toggleAcl(this.value)'")?></td>
|
||||
</tr>
|
||||
<tr id='whiteListBox' class='hidden'>
|
||||
<th><?php echo $lang->doc->whiteList;?></th>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, '', "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
|
||||
<?php echo html::select('users[]', $users, '', "class='form-control chosen' multiple")?>
|
||||
<div class='row-table'>
|
||||
<div class='col-table w-p50'>
|
||||
<div class='input-group w-p100'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, '', "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-table'>
|
||||
<div class='input-group w-p100'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
|
||||
<?php echo html::select('users[]', $users, '', "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -39,23 +39,24 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doclib->control;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->acl?></span>
|
||||
<?php echo html::select('acl', $lang->doc->aclList, 'public', "class='form-control' onchange='toggleAcl(this.value)'")?>
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo html::radio('acl', $lang->doc->aclList, 'open', "onchange='toggleAcl(this.value)'")?></td>
|
||||
</tr>
|
||||
<tr id='whiteListBox' class='hidden'>
|
||||
<th><?php echo $lang->doc->whiteList;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, '', "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
|
||||
<?php echo html::select('users[]', $users, '', "class='form-control chosen' multiple")?>
|
||||
<div class='row-table'>
|
||||
<div class='col-table w-p50'>
|
||||
<div class='input-group w-p100'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, '', "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-table'>
|
||||
<div class='input-group w-p100'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
|
||||
<?php echo html::select('users[]', $users, '', "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/ueditor.html.php';?>
|
||||
<?php if($doc->type == 'markdown') include '../../common/view/markdown.html.php';?>
|
||||
<?php if($doc->contentType == 'html') include '../../common/view/ueditor.html.php';?>
|
||||
<?php if($doc->contentType == 'markdown') include '../../common/view/markdown.html.php';?>
|
||||
<?php js::set('type', $type)?>
|
||||
<div class='container mw-1400px'>
|
||||
<div id='titlebar'>
|
||||
@@ -25,32 +25,31 @@
|
||||
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin' id='dataform'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->doc->lib;?></th>
|
||||
<td class='w-400px'><?php echo html::select('lib', $libs, $doc->lib, "class='form-control chosen' onchange='loadModules(this.value)'");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->module;?></th>
|
||||
<td><span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $doc->module, "class='form-control chosen'");?></span></td><td></td>
|
||||
<th class='w-80px'><?php echo $lang->doc->module;?></th>
|
||||
<td class='w-400px'>
|
||||
<?php echo html::hidden('lib', $doc->lib)?>
|
||||
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $doc->module, "class='form-control chosen'");?></span>
|
||||
</td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->title;?></th>
|
||||
<td colspan='2'><?php echo html::input('title', $doc->title, "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr id='contentBox'>
|
||||
<th><?php echo $lang->doc->content;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('content', $doc->content, "style='width:100%; height:200px'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->digest;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('digest', $doc->digest, "style='width:100%;' rows=2");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->comment;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('comment','', "style='width:100%;' rows=2");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->keywords;?></th>
|
||||
<td colspan='2'><?php echo html::input('keywords', $doc->keywords, "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->type;?></th>
|
||||
<td><?php echo html::radio('type', $lang->doc->types, $doc->type);?></td>
|
||||
</tr>
|
||||
<tr id='contentBox' <?php if($doc->type == 'url') echo "class='hidden'"?>>
|
||||
<th><?php echo $lang->doc->content;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('content', htmlspecialchars($doc->content), "style='width:100%; height:200px'") . html::hidden('contentType', $doc->contentType);?></td>
|
||||
</tr>
|
||||
<tr id='urlBox' <?php if($doc->type != 'url') echo "class='hidden'"?>>
|
||||
<th><?php echo $lang->doc->url;?></th>
|
||||
<td colspan='2'><?php echo html::input('url', $doc->type == 'url' ? $doc->content : '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr id='fileBox'>
|
||||
<th><?php echo $lang->doc->files;?></th>
|
||||
@@ -58,23 +57,24 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doclib->control;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->acl?></span>
|
||||
<?php echo html::select('acl', $lang->doc->aclList, $doc->lib, "class='form-control' onchange='toggleAcl(this.value)'")?>
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo html::radio('acl', $lang->doc->aclList, $doc->acl, "onchange='toggleAcl(this.value)'")?></td>
|
||||
</tr>
|
||||
<tr id='whiteListBox' class='hidden'>
|
||||
<th><?php echo $lang->doc->whiteList;?></th>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, $doc->groups, "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
|
||||
<?php echo html::select('users[]', $users, $doc->users, "class='form-control chosen' multiple")?>
|
||||
<div class='row-table'>
|
||||
<div class='col-table w-p50'>
|
||||
<div class='input-group w-p100'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, $doc->groups, "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-table'>
|
||||
<div class='input-group w-p100'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
|
||||
<?php echo html::select('users[]', $users, $doc->users, "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -39,23 +39,24 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doclib->control;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->acl?></span>
|
||||
<?php echo html::select('acl', $lang->doc->aclList, $lib->acl, "class='form-control' onchange='toggleAcl(this.value)'")?>
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo html::radio('acl', $lang->doc->aclList, $lib->acl, "onchange='toggleAcl(this.value)'")?></td>
|
||||
</tr>
|
||||
<tr id='whiteListBox' class='hidden'>
|
||||
<th><?php echo $lang->doc->whiteList?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, $lib->groups, "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
|
||||
<?php echo html::select('users[]', $users, $lib->users, "class='form-control chosen' multiple")?>
|
||||
<div class='row-table'>
|
||||
<div class='col-table w-p50'>
|
||||
<div class='input-group w-p100'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, $lib->groups, "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-table'>
|
||||
<div class='input-group w-p100'>
|
||||
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
|
||||
<?php echo html::select('users[]', $users, $lib->users, "class='form-control chosen' multiple")?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -21,14 +21,17 @@
|
||||
$libs['custom'] = $customLibs;
|
||||
?>
|
||||
<?php foreach ($libs as $libsName => $libs):?>
|
||||
<?php $i = 0;?>
|
||||
<tr>
|
||||
<th class='w-100px lib-heading'><?php echo $lang->doc->libTypeList[$libsName]?></th>
|
||||
<td class='row'>
|
||||
<?php if($libsName === 'product'): ?>
|
||||
<table class='table product table-data'>
|
||||
<?php foreach($libs as $product):?>
|
||||
<?php if(isset($subLibs['product'][$product->id])):?>
|
||||
<div class='col-md-4'>
|
||||
<div class='libs-group-heading libs-product-heading'><i class='icon icon-cube-alt'></i> <strong><?php echo $product->name?></strong></div>
|
||||
<?php if($i % 3 == 0) echo '<tr>'?>
|
||||
<td>
|
||||
<div class='libs-group-heading libs-product-heading'><strong><?php echo $product->name?></strong></div>
|
||||
<div class='libs-group clearfix'>
|
||||
<?php foreach($subLibs['product'][$product->id] as $libID => $libName):?>
|
||||
<?php
|
||||
@@ -36,36 +39,77 @@
|
||||
elseif($libID == 'files') $libLink = inlink('showFiles', "type=product&objectID=$product->id");
|
||||
else $libLink = inlink('browse', "libID=$libID");
|
||||
?>
|
||||
<a class='lib' title='<?php echo $libName?>' href='<?php echo $libLink ?>'><?php echo $libName?></a>
|
||||
<a class='lib' title='<?php echo $libName?>' href='<?php echo $libLink ?>'>
|
||||
<i class='file-icon icon icon-folder-close-alt'></i>
|
||||
<div class='lib-name' title='<?php echo $libName?>'><?php echo $libName?></div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php $i ++;?>
|
||||
<?php if($i % 3 == 0) echo '</tr>'?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php
|
||||
if($i % 3 != 0)
|
||||
{
|
||||
while($i % 3 != 0)
|
||||
{
|
||||
echo "<td class='none'></td>";
|
||||
$i++;
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php elseif($libsName === 'project'): ?>
|
||||
<table class='table project table-data'>
|
||||
<?php foreach($libs as $project):?>
|
||||
<?php if(isset($subLibs['project'][$project->id])):?>
|
||||
<div class='col-md-4'>
|
||||
<div class='libs-group-heading libs-project-heading'><i class='icon icon-folder-close-alt'></i> <strong><?php echo $project->name?></strong></div>
|
||||
<?php if($i % 3 == 0) echo '<tr>'?>
|
||||
<td>
|
||||
<div class='libs-group-heading libs-project-heading'><strong><?php echo $project->name?></strong></div>
|
||||
<div class='libs-group clearfix'>
|
||||
<?php foreach($subLibs['project'][$project->id] as $libID => $libName):?>
|
||||
<?php
|
||||
if($libID == 'files') $libLink = inlink('showFiles', "type=project&objectID=$project->id");
|
||||
else $libLink = inlink('browse', "libID=$libID");
|
||||
?>
|
||||
<a class='lib' title='<?php echo $libName?>' href='<?php echo $libLink ?>'><?php echo $libName?></a>
|
||||
<a class='lib' title='<?php echo $libName?>' href='<?php echo $libLink ?>'>
|
||||
<i class='file-icon icon icon-folder-close-alt'></i>
|
||||
<div class='lib-name' title='<?php echo $libName?>'><?php echo $libName?></div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php $i++;?>
|
||||
<?php if($i % 3 == 0) echo "</td>";?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php
|
||||
if($i % 3 != 0)
|
||||
{
|
||||
while($i % 3 != 0)
|
||||
{
|
||||
echo "<td class='none'></td>";
|
||||
$i++;
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class='libs-group'>
|
||||
<?php foreach($libs as $libID => $libName):?>
|
||||
<a class='lib' title='<?php echo $libName?>' href='<?php echo inlink('browse', "libID=$libID") ?>'><?php echo $libName?></a>
|
||||
<a class='lib' title='<?php echo $libName?>' href='<?php echo inlink('browse', "libID=$libID") ?>'>
|
||||
<i class='file-icon icon icon-folder-close-alt'></i>
|
||||
<div class='lib-name' title='<?php echo $libName?>'><?php echo $libName?></div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php echo html::a(inlink('allLibs', "type=$libsName"), "<i class='icon icon-double-angle-right'></i>", '', "title='$lang->more' class='more'")?></td>
|
||||
<td class='w-20px lib-more'><?php echo html::a(inlink('allLibs', "type=$libsName"), $lang->more, '', "title='$lang->more' class='more'")?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<?php if(empty($file->pathname)) continue;?>
|
||||
<div class='col-md-3'>
|
||||
<div class='card lib-file'>
|
||||
<a class='media-wrapper' target='_blank' href='<?php echo $this->createLink('file', 'download', "fileID=$file->id&mouse=left") ?>'>
|
||||
<a class='media-wrapper' title='<?php echo $file->title . '.' . $file->extension?>' target='_blank' href='<?php echo $this->createLink('file', 'download', "fileID=$file->id&mouse=left") ?>'>
|
||||
<?php
|
||||
$downloadLink = $this->createLink('file', 'download', "fileID=$file->id&mouse=left");
|
||||
if(in_array($file->extension, $config->file->imageExtensions))
|
||||
@@ -44,7 +44,11 @@
|
||||
?>
|
||||
<i class='icon icon-download'></i>
|
||||
</a>
|
||||
<a class='card-heading' href='<?php echo $this->createLink($file->objectType, 'view', "objectID=$file->objectID"); ?>'><?php echo $lang->doc->fileObject . ' ' . strtoupper($file->objectType) . ' #' . $file->objectID ?> <i class='icon icon-chevron-right pull-right'></i></a>
|
||||
<div class='card-heading'>
|
||||
<a href='<?php echo $this->createLink($file->objectType, 'view', "objectID=$file->objectID"); ?>'><?php echo $lang->doc->fileObject . ' ' . strtoupper($file->objectType) . ' #' . $file->objectID ?></a>
|
||||
<i class='icon icon-chevron-right pull-right'></i>
|
||||
<a href='<?php echo $this->createLink('file', 'delete', "fileID=$file->id"); ?>' target='hiddenwin' title='<?php echo $lang->delete?>' class='delete pull-right'><i class='icon icon-remove'></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
|
||||
@@ -11,11 +11,12 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/ueditor.html.php';?>
|
||||
<?php echo css::internal($keTableCSS);?>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'>
|
||||
<span class='prefix' title='DOC'><?php echo html::icon($lang->icons['doc']);?> <strong><?php echo $doc->id;?></strong></span>
|
||||
<strong><?php echo $doc->title;?></strong>
|
||||
<strong class='crumb'><?php echo $crumb;?></strong>
|
||||
<?php if($doc->deleted):?>
|
||||
<span class='label label-danger'><?php echo $lang->doc->deleted;?></span>
|
||||
<?php endif; ?>
|
||||
@@ -41,20 +42,21 @@
|
||||
if(!$doc->deleted)
|
||||
{
|
||||
ob_start();
|
||||
if($doc->version > 1 and common::hasPriv('doc', 'diff'))
|
||||
{
|
||||
echo "<div class='btn-group'>";
|
||||
echo "<button data-toggle='dropdown' type='button' class='btn dropdown-toggle'>{$lang->doc->diff} <span class='caret'></span></button>";
|
||||
echo "<ul class='dropdown-menu'>";
|
||||
for($i = $doc->version; $i >= 1; $i --)
|
||||
{
|
||||
if($i == $version) continue;
|
||||
echo '<li>' . html::a(inlink('diff', "docID=$doc->id&newVersion=$version&version=$i"), '#' . $i) . '</li>';
|
||||
}
|
||||
echo "</ul>";
|
||||
echo "</div>";
|
||||
}
|
||||
//if($doc->version > 1 and common::hasPriv('doc', 'diff'))
|
||||
//{
|
||||
// echo "<div class='btn-group'>";
|
||||
// echo "<button data-toggle='dropdown' type='button' class='btn dropdown-toggle'>{$lang->doc->diff} <span class='caret'></span></button>";
|
||||
// echo "<ul class='dropdown-menu'>";
|
||||
// for($i = $doc->version; $i >= 1; $i --)
|
||||
// {
|
||||
// if($i == $version) continue;
|
||||
// echo '<li>' . html::a(inlink('diff', "docID=$doc->id&newVersion=$version&version=$i"), '#' . $i) . '</li>';
|
||||
// }
|
||||
// echo "</ul>";
|
||||
// echo "</div>";
|
||||
//}
|
||||
echo "<div class='btn-group'>";
|
||||
common::printCommentIcon('doc');
|
||||
common::printIcon('doc', 'edit', $params);
|
||||
common::printIcon('doc', 'delete', $params, '', 'button', '', 'hiddenwin');
|
||||
echo '</div>';
|
||||
@@ -79,15 +81,15 @@
|
||||
<legend><?php echo $lang->doc->content;?></legend>
|
||||
<div class='content'>
|
||||
<?php
|
||||
preg_match_all('/^<a +.*href="([^"]+)".*>[^<]+<\/a>$/Ui', trim($doc->content), $output);
|
||||
$href = isset($output[1][0]) ? $output[1][0] : '';
|
||||
$content = $doc->content;
|
||||
if($doc->type == 'url')
|
||||
{
|
||||
$url = $doc->content;
|
||||
if(!preg_match('/^https?:\/\//', $doc->content)) $url = 'http://' . $url;
|
||||
$content = html::a($url, $doc->content, '_blank');
|
||||
}
|
||||
echo $content;
|
||||
?>
|
||||
<?php echo $doc->content;?>
|
||||
<?php if($href):?>
|
||||
<!-- Remove referer -->
|
||||
<iframe src="javascript:location.replace('<?php echo $href;?>' + (parent.location.hash||''))" width='100%'frameborder='0' id='url-content'></iframe>
|
||||
<?php endif;?>
|
||||
|
||||
<?php foreach($doc->files as $file):?>
|
||||
<?php if(in_array($file->extension, $config->file->imageExtensions)):?>
|
||||
<a href="<?php echo $file->webPath?>" target="_blank">
|
||||
@@ -103,6 +105,14 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class='actions'><?php if(!$doc->deleted) echo $actionLinks;?></div>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
<fieldset id='commentBox' class='hide'>
|
||||
<legend><?php echo $lang->comment;?></legend>
|
||||
<form method='post' action='<?php echo inlink('edit', "docID=$doc->id&comment=true")?>'>
|
||||
<div class="form-group"><?php echo html::textarea('comment', '',"style='width:100%;height:100px'");?></div>
|
||||
<?php echo html::submitButton() . html::backButton();?>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-side'>
|
||||
@@ -152,7 +162,6 @@
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user