mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-02-02 14:41:55 +00:00
add support for dropdown menu of folder/document actions
This commit is contained in:
parent
7e6ceb83e3
commit
a2bca1f68f
|
|
@ -641,41 +641,68 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
echo $content;
|
||||
} /* }}} */
|
||||
|
||||
protected function showButtonwithMenu($button, $options=array()) { /* {{{ */
|
||||
protected function getMenu($menuitems=[], $options=[]) { /* {{{ */
|
||||
$content = '';
|
||||
$content .= '
|
||||
<ul class="dropdown-menu'.(!empty($options['class']) ? ' '.$options['class'] : '').'" role="menu"'.(!empty($options['id']) ? ' id="'.$options['id'].'"' : '').'>
|
||||
';
|
||||
foreach($menuitems as $menuitem) {
|
||||
if(is_array($menuitem)) {
|
||||
$content .= '
|
||||
<li><a ';
|
||||
if(!empty($menuitem['link']))
|
||||
$content .= 'href="'.$menuitem['link'].'" ';
|
||||
$content .= 'class="dropdown-item';
|
||||
if (!empty($menuitem['class']))
|
||||
$content .= ' '.$menuitem['class'];
|
||||
$content .= '" ';
|
||||
if (!empty($menuitem['msg']))
|
||||
$content .= 'msg="'.$menuitem['msg'].'" ';
|
||||
if (!empty($menuitem['confirmmsg']))
|
||||
$content .= 'confirmmsg="'.$menuitem['confirmmsg'].'" ';
|
||||
if (!empty($menuitem['rel']))
|
||||
$content .= 'rel="'.$menuitem['rel'].'" ';
|
||||
if(!empty($menuitem['onclick']))
|
||||
$content .= ' onclick="'.$menuitem['onclick'].'" ';
|
||||
if (!empty($menuitem['data-formtoken']))
|
||||
$content .= 'data-formtoken="'.$menuitem['data-formtoken'].'" ';
|
||||
$content .= '>';
|
||||
if (!empty($menuitem['icon']))
|
||||
$content .= '<i class="fa fa-'.$menuitem['icon'].'"></i> ';
|
||||
$content .= $menuitem['label'].'</a><li>
|
||||
';
|
||||
} else {
|
||||
// $content .= $menuitem;
|
||||
}
|
||||
}
|
||||
$content .= '
|
||||
</ul>
|
||||
';
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
protected function getButtonWithMenu($button, $options=array()) { /* {{{ */
|
||||
$content = '';
|
||||
if ($button['menuitems']) {
|
||||
$content .= '
|
||||
<div class="btn-group">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
'.$button['label'].'
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
';
|
||||
if($button['menuitems']) {
|
||||
$content .= '
|
||||
<ul class="dropdown-menu">
|
||||
';
|
||||
foreach($button['menuitems'] as $menuitem) {
|
||||
if(is_array($menuitem)) {
|
||||
$content .= '
|
||||
<li><a';
|
||||
if(!empty($menuitem['link']))
|
||||
$content .= ' href="'.$menuitem['link'].'"';
|
||||
if(!empty($menuitem['onclick']))
|
||||
$content .= ' onclick="'.$menuitem['onclick'].'"';
|
||||
$content .= '>'.$menuitem['label'].'</a><li>
|
||||
';
|
||||
} else {
|
||||
$content .= $menuitem;
|
||||
}
|
||||
if($button['menuitems']) {
|
||||
$content .= $this->getMenu($button['menuitems'], $options);
|
||||
}
|
||||
$content .= '
|
||||
</ul>
|
||||
';
|
||||
}
|
||||
$content .= '
|
||||
</div>
|
||||
';
|
||||
echo $content;
|
||||
}
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
protected function showButtonWithMenu($button, $options=array()) { /* {{{ */
|
||||
echo $this->getButtonWithMenu($button, $options);
|
||||
} /* }}} */
|
||||
|
||||
protected function showPaneHeader($name, $title, $isactive) { /* {{{ */
|
||||
|
|
@ -1465,8 +1492,9 @@ function getOverallStatusIcon($status) { /* {{{ */
|
|||
function getModalBoxLinkAttributes($config) { /* {{{ */
|
||||
$attrs = array();
|
||||
$attrs[] = array('data-target', '#'.$config['target']);
|
||||
if(isset($config['remote']))
|
||||
if(isset($config['remote'])) {
|
||||
$attrs[] = array('href', $config['remote']);
|
||||
}
|
||||
$attrs[] = array('data-toggle', 'modal');
|
||||
$attrs[] = array('role', 'button');
|
||||
if(isset($config['class'])) {
|
||||
|
|
@ -2392,7 +2420,6 @@ $(document).ready(function() {
|
|||
} else {
|
||||
$tree[] = $node;
|
||||
}
|
||||
|
||||
} else {
|
||||
if($root = $this->params['dms']->getFolder($this->params['rootfolderid']))
|
||||
$tree = array(array('label'=>$root->getName(), 'id'=>$root->getID(), 'load_on_demand'=>false, 'is_folder'=>true));
|
||||
|
|
@ -2626,6 +2653,11 @@ $(function() {
|
|||
return '';
|
||||
} /* }}} */
|
||||
|
||||
function getDeleteDocumentButton($document, $msg, $return=false){ /* {{{ */
|
||||
$docid = $document->getID();
|
||||
return ['class'=>'delete-document-btn', 'rel'=>$docid, 'msg'=>getMLText($msg), 'confirmmsg'=>htmlspecialchars(getMLText("confirm_rm_document", array ("documentname" => htmlspecialchars($document->getName()))), ENT_QUOTES), 'title'=>getMLText('delete'), 'label'=>getMLText('delete'), 'icon'=>'remove'];
|
||||
} /* }}} */
|
||||
|
||||
function printDeleteDocumentButtonJs(){ /* {{{ */
|
||||
echo "
|
||||
$(document).ready(function () {
|
||||
|
|
@ -2700,6 +2732,11 @@ $(function() {
|
|||
return '';
|
||||
} /* }}} */
|
||||
|
||||
function getDeleteFolderButton($folder, $msg, $return=false){ /* {{{ */
|
||||
$folderid = $folder->getID();
|
||||
return ['class'=>'delete-folder-btn', 'rel'=>$folderid, 'msg'=>getMLText($msg), 'confirmmsg'=>htmlspecialchars(getMLText("confirm_rm_folder", array ("foldername" => htmlspecialchars($folder->getName()))), ENT_QUOTES), 'title'=>getMLText("delete"), 'label'=>getMLText("delete"), 'label'=>getMLText("delete"), 'icon'=>'remove'];
|
||||
} /* }}} */
|
||||
|
||||
function printDeleteFolderButtonJs(){ /* {{{ */
|
||||
echo "
|
||||
$(document).ready(function () {
|
||||
|
|
@ -2770,6 +2807,7 @@ $(function() {
|
|||
}
|
||||
$content = '';
|
||||
$content .= '<a class="lock-document-btn" rel="'.$docid.'" msg="'.getMLText($msg).'" title="'.getMLText($title).'" data-formtoken="'.createFormKey('tooglelockdocument').'"><i class="fa fa-'.$icon.'"></i></a>';
|
||||
$content = ['class'=>'lock-document-btn', 'rel'=>$docid, 'msg'=>getMLText($msg), 'title'=>getMLText($title), 'label'=>getMLText($title), 'data-formtoken'=>createFormKey('tooglelockdocument'), 'icon'=>$icon];
|
||||
if($return)
|
||||
return $content;
|
||||
else
|
||||
|
|
@ -2782,11 +2820,15 @@ $(function() {
|
|||
$content = '';
|
||||
$objid = $object->getId();
|
||||
if($object->isType('document')) {
|
||||
if($accessobject->check_view_access('DocumentAccess'))
|
||||
$content .= '<a class="access-document-btn" href="'.$this->params['settings']->_httpRoot.'out/out.DocumentAccess.php?documentid='.$objid.'" title="'.getMLText('edit_document_access').'"><i class="fa fa-bolt"></i></a>';
|
||||
if($accessobject->check_view_access('DocumentAccess')) {
|
||||
// $content .= '<a class="access-document-btn" href="'.$this->params['settings']->_httpRoot.'out/out.DocumentAccess.php?documentid='.$objid.'" title="'.getMLText('edit_document_access').'"><i class="fa fa-bolt"></i></a>';
|
||||
$content = ['class'=>'access-document-btn', 'link'=>$this->params['settings']->_httpRoot.'out/out.DocumentAccess.php?documentid='.$objid, 'title'=>getMLText('edit_document_access'), 'label'=>getMLText('edit_document_access'), 'icon'=>'bolt'];
|
||||
}
|
||||
} elseif($object->isType('folder')) {
|
||||
if($accessobject->check_view_access('FolderAccess'))
|
||||
$content .= '<a class="access-folder-btn" href="'.$this->params['settings']->_httpRoot.'out/out.FolderAccess.php?folderid='.$objid.'" title="'.getMLText('edit_folder_access').'"><i class="fa fa-bolt"></i></a>';
|
||||
if($accessobject->check_view_access('FolderAccess')) {
|
||||
// $content .= '<a class="access-folder-btn" href="'.$this->params['settings']->_httpRoot.'out/out.FolderAccess.php?folderid='.$objid.'" title="'.getMLText('edit_folder_access').'"><i class="fa fa-bolt"></i></a>';
|
||||
$content = ['class'=>'access-folder-btn', 'link'=>$this->params['settings']->_httpRoot.'out/out.FolderAccess.php?folderid='.$objid, 'title'=>getMLText('edit_folder_access'), 'label'=>getMLText('edit_folder_access'), 'icon'=>'bolt'];
|
||||
}
|
||||
}
|
||||
if($return)
|
||||
return $content;
|
||||
|
|
@ -3245,14 +3287,15 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$content .= $extracontent['begin_action_list'];
|
||||
if($accessop->check_view_access('RemoveDocument')) {
|
||||
if($document->getAccessMode($user, 'removeDocument') >= M_ALL) {
|
||||
$actions['remove_document'] = $this->printDeleteDocumentButton($document, 'splash_rm_document', true);
|
||||
$actions['remove_document'] = $this->getDeleteDocumentButton($document, 'splash_rm_document', true);
|
||||
} else {
|
||||
$actions['remove_document'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-remove"></i></span>';
|
||||
}
|
||||
}
|
||||
$docID = $document->getID();
|
||||
if($document->getAccessMode($user) >= M_READWRITE) {
|
||||
$actions['edit_document'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.EditDocument.php?documentid='.$docID.'" title="'.getMLText("edit_document_props").'"><i class="fa fa-edit"></i></a>';
|
||||
// $actions['edit_document'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.EditDocument.php?documentid='.$docID.'" title="'.getMLText("edit_document_props").'"><i class="fa fa-edit"></i></a>';
|
||||
$actions['edit_document'] = ['link'=>$this->params['settings']->_httpRoot.'out/out.EditDocument.php?documentid='.$docID, 'title'=>getMLText("edit_document_props"), 'label'=>getMLText("edit_document_props"), 'icon'=>'edit'];
|
||||
} else {
|
||||
$actions['edit_document'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-edit"></i></span>';
|
||||
}
|
||||
|
|
@ -3263,13 +3306,18 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$actions['document_access'] = $this->printAccessButton($document, true);
|
||||
}
|
||||
if($enableClipboard) {
|
||||
if($session->isOnClipboard($document))
|
||||
$actions['remove_from_clipboard'] = '<a class="removefromclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
else
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
if($session->isOnClipboard($document)) {
|
||||
// $actions['remove_from_clipboard'] = '<a class="removefromclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
$actions['remove_from_clipboard'] = ['class'=>'removefromclipboard', 'rel'=>'D'.$docID, 'msg'=>getMLText('splash_removed_from_clipboard'), 'title'=>getMLText("remove_from_clipboard"), 'label'=>getMLText("remove_from_clipboard"), 'icon'=>'clipboard'];
|
||||
} else {
|
||||
// $actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
$actions['add_to_clipboard'] = ['class'=>'addtoclipboard', 'rel'=>'D'.$docID, 'msg'=>getMLText('splash_added_to_clipboard'), 'title'=>getMLText("add_to_clipboard"), 'label'=>getMLText("add_to_clipboard"), 'icon'=>'clipboard'];
|
||||
}
|
||||
}
|
||||
if($onepage) {
|
||||
// $actions['view_document'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.ViewDocument.php?documentid='.$docID.'" title="'.getMLText("view_document").'"><i class="fa fa-eye"></i></a>';
|
||||
$actions['view_document'] = ['link'=>$this->params['settings']->_httpRoot.'out/out.ViewDocument.php?documentid='.$docID, 'title'=>getMLText("view_document"), 'label'=>getMLText("view_document"), 'icon'=>'eye'];
|
||||
}
|
||||
if($onepage)
|
||||
$actions['view_document'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.ViewDocument.php?documentid='.$docID.'" title="'.getMLText("view_document").'"><i class="fa fa-eye"></i></a>';
|
||||
|
||||
/* Do not use $this->callHook() because $menuitems must be returned by the the
|
||||
* first hook and passed to next hook. $this->callHook() will just pass
|
||||
|
|
@ -3282,14 +3330,61 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
}
|
||||
}
|
||||
|
||||
foreach($actions as $action) {
|
||||
if(is_string($action))
|
||||
$content .= $action;
|
||||
if (empty($this->params['settings']->_actiondropdown)) {
|
||||
foreach($actions as $action) {
|
||||
if(is_string($action))
|
||||
$content .= $action;
|
||||
elseif(is_array($action)) {
|
||||
$content .= '<a ';
|
||||
if (!empty($action['link']))
|
||||
$content .= 'href="'.$action['link'].'" ';
|
||||
if (!empty($action['title']))
|
||||
$content .= 'title="'.$action['title'].'" ';
|
||||
if (!empty($action['class']))
|
||||
$content .= 'class="'.$action['class'].'" ';
|
||||
if (!empty($action['msg']))
|
||||
$content .= 'msg="'.$action['msg'].'" ';
|
||||
if (!empty($action['confirmmsg']))
|
||||
$content .= 'confirmmsg="'.$action['confirmmsg'].'" ';
|
||||
if (!empty($action['rel']))
|
||||
$content .= 'rel="'.$action['rel'].'" ';
|
||||
if (!empty($action['data-formtoken']))
|
||||
$content .= 'data-formtoken="'.$action['data-formtoken'].'" ';
|
||||
$content .= '><i class="fa fa-'.$action['icon'].'"></i></a>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$content .= $this->getButtonWithMenu(['label'=>'<i class="fa fa-navicon"></i>', 'menuitems'=>$actions], ['class'=>'pull-right']);
|
||||
}
|
||||
|
||||
if(!empty($extracontent['end_action_list']))
|
||||
$content .= $extracontent['end_action_list'];
|
||||
$content .= "</div>";
|
||||
|
||||
if (0) {
|
||||
$content .= '<ul class="dropdown-menu contextmenu" role="menu" id="contextmenu-d'.$docID.'" style="display: none; position: absolute;">';
|
||||
foreach($actions as $action) {
|
||||
if(is_array($action)) {
|
||||
$content .= '<li><a ';
|
||||
if (!empty($action['link']))
|
||||
$content .= 'href="'.$action['link'].'" ';
|
||||
$content .= 'class="dropdown-item';
|
||||
if (!empty($action['class']))
|
||||
$content .= ' '.$action['class'];
|
||||
$content .= '" ';
|
||||
if (!empty($action['msg']))
|
||||
$content .= 'msg="'.$action['msg'].'" ';
|
||||
if (!empty($action['confirmmsg']))
|
||||
$content .= 'confirmmsg="'.$action['confirmmsg'].'" ';
|
||||
if (!empty($action['rel']))
|
||||
$content .= 'rel="'.$action['rel'].'" ';
|
||||
if (!empty($action['data-formtoken']))
|
||||
$content .= 'data-formtoken="'.$action['data-formtoken'].'" ';
|
||||
$content .= '><i class="fa fa-'.$action['icon'].'"></i> '.$action['title'].'</a></li>';
|
||||
}
|
||||
}
|
||||
$content .= '</ul>';
|
||||
}
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
|
|
@ -3298,7 +3393,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
*
|
||||
* @param object $document
|
||||
* @param object $previewer
|
||||
* @param boolean $skipcont set to true if embrasing tr shall be skipped
|
||||
* @param boolean $skipcont set to true if embrasing tr shall be skipped.
|
||||
* In that case call documentListRowStart() before and documentListRowEnd()
|
||||
* after this method.
|
||||
*/
|
||||
|
|
@ -3469,13 +3564,14 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$subFolderAccessMode = $subFolder->getAccessMode($user);
|
||||
if ($accessop->check_view_access('RemoveFolder')) {
|
||||
if($subFolderAccessMode >= M_ALL) {
|
||||
$actions['remove_folder'] = $this->printDeleteFolderButton($subFolder, 'splash_rm_folder', true);
|
||||
$actions['remove_folder'] = $this->getDeleteFolderButton($subFolder, 'splash_rm_folder', true);
|
||||
} else {
|
||||
$actions['remove_folder'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-remove"></i></span>';
|
||||
}
|
||||
}
|
||||
if($subFolderAccessMode >= M_READWRITE) {
|
||||
$actions['edit_folder'] = '<a class_="btn btn-mini" href="'.$this->params['settings']->_httpRoot.'out/out.EditFolder.php?folderid='.$subFolder->getID().'" title="'.getMLText("edit_folder_props").'"><i class="fa fa-edit"></i></a>';
|
||||
// $actions['edit_folder'] = '<a class_="btn btn-mini" href="'.$this->params['settings']->_httpRoot.'out/out.EditFolder.php?folderid='.$subFolder->getID().'" title="'.getMLText("edit_folder_props").'"><i class="fa fa-edit"></i></a>';
|
||||
$actions['edit_folder'] = ['link'=>$this->params['settings']->_httpRoot.'out/out.EditFolder.php?folderid='.$subFolder->getID(), 'title'=>getMLText('edit_folder_props'), 'label'=>getMLText('edit_folder_props'), 'icon'=>'edit'];
|
||||
} else {
|
||||
$actions['edit_folder'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-edit"></i></span>';
|
||||
}
|
||||
|
|
@ -3484,12 +3580,14 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
}
|
||||
if($enableClipboard) {
|
||||
if($session->isOnClipboard($subFolder))
|
||||
$actions['add_to_clipboard'] = '<a class="removefromclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
// $actions['add_to_clipboard'] = '<a class="removefromclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
$actions['add_to_clipboard'] = ['class'=>'removefromclipboard', 'title'=>getMLText('remove_from_clipboard'), 'label'=>getMLText('remove_from_clipboard'), 'rel'=>'F'.$subFolder->getID(), 'msg'=>getMLText('splash_removed_from_clipboard'), 'icon'=>'clipboard'];
|
||||
else
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
// $actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
$actions['add_to_clipboard'] = ['class'=>'addtoclipboard', 'title'=>getMLText('add_to_clipboard'), 'label'=>getMLText('add_to_clipboard'), 'rel'=>'F'.$subFolder->getID(), 'msg'=>getMLText('splash_added_to_clipboard'), 'icon'=>'clipboard'];
|
||||
}
|
||||
if($onepage)
|
||||
$actions['view_folder'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.ViewFolder.php?folderid='.$subFolder->getID().'" title="'.getMLText("view_folder").'"><i class="fa fa-eye"></i></a>';
|
||||
$actions['view_folder'] = ['link'=>$this->params['settings']->_httpRoot.'out/out.ViewFolder.php?folderid='.$subFolder->getID(), 'title'=>getMLText("view_folder"), 'label'=>getMLText("view_folder"), 'icon'=>'eye'];
|
||||
|
||||
/* Do not use $this->callHook() because $menuitems must be returned by the the
|
||||
* first hook and passed to next hook. $this->callHook() will just pass
|
||||
|
|
@ -3502,14 +3600,61 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
}
|
||||
}
|
||||
|
||||
foreach($actions as $action) {
|
||||
if(is_string($action))
|
||||
$content .= $action;
|
||||
if (empty($this->params['settings']->_actiondropdown)) {
|
||||
foreach($actions as $action) {
|
||||
if(is_string($action))
|
||||
$content .= $action;
|
||||
elseif(is_array($action)) {
|
||||
$content .= '<a ';
|
||||
if (!empty($action['link']))
|
||||
$content .= 'href="'.$action['link'].'" ';
|
||||
if (!empty($action['title']))
|
||||
$content .= 'title="'.$action['title'].'" ';
|
||||
if (!empty($action['class']))
|
||||
$content .= 'class="'.$action['class'].'" ';
|
||||
if (!empty($action['msg']))
|
||||
$content .= 'msg="'.$action['msg'].'" ';
|
||||
if (!empty($action['confirmmsg']))
|
||||
$content .= 'confirmmsg="'.$action['confirmmsg'].'" ';
|
||||
if (!empty($action['rel']))
|
||||
$content .= 'rel="'.$action['rel'].'" ';
|
||||
if (!empty($action['data-formtoken']))
|
||||
$content .= 'data-formtoken="'.$action['data-formtoken'].'" ';
|
||||
$content .= '><i class="fa fa-'.$action['icon'].'"></i></a>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$content .= $this->getButtonWithMenu(['label'=>'<i class="fa fa-navicon"></i>', 'menuitems'=>$actions], ['class'=>'pull-right']);
|
||||
}
|
||||
|
||||
if(!empty($extracontent['end_action_list']))
|
||||
$content .= $extracontent['end_action_list'];
|
||||
$content .= "</div>";
|
||||
|
||||
if (0) {
|
||||
$content .= '<ul class="dropdown-menu contextmenu" role="menu" id="contextmenu-f'.$subFolder->getId().'" style="display: none; position: absolute;">';
|
||||
foreach($actions as $action) {
|
||||
if(is_array($action)) {
|
||||
$content .= '<li><a ';
|
||||
if (!empty($action['link']))
|
||||
$content .= 'href="'.$action['link'].'" ';
|
||||
$content .= 'class="dropdown-item';
|
||||
if (!empty($action['class']))
|
||||
$content .= ' '.$action['class'];
|
||||
$content .= '" ';
|
||||
if (!empty($action['msg']))
|
||||
$content .= 'msg="'.$action['msg'].'" ';
|
||||
if (!empty($action['confirmmsg']))
|
||||
$content .= 'confirmmsg="'.$action['confirmmsg'].'" ';
|
||||
if (!empty($action['rel']))
|
||||
$content .= 'rel="'.$action['rel'].'" ';
|
||||
if (!empty($action['data-formtoken']))
|
||||
$content .= 'data-formtoken="'.$action['data-formtoken'].'" ';
|
||||
$content .= '><i class="fa fa-'.$action['icon'].'"></i> '.$action['title'].'</a></li>';
|
||||
}
|
||||
}
|
||||
$content .= "</ul>";
|
||||
}
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
|
|
|
|||
|
|
@ -647,41 +647,71 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
echo $content;
|
||||
} /* }}} */
|
||||
|
||||
protected function showButtonwithMenu($button, $options=array()) { /* {{{ */
|
||||
protected function getMenu($menuitems=[], $options=[]) { /* {{{ */
|
||||
$content = '';
|
||||
$content .= '
|
||||
<div class="btn-group" role="group">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
'.$button['label'].'
|
||||
</button>
|
||||
<div class="dropdown-menu'.(!empty($options['class']) ? ' '.$options['class'] : '').'" role="menu"'.(!empty($options['id']) ? ' id="'.$options['id'].'"' : '').'>
|
||||
';
|
||||
if($button['menuitems']) {
|
||||
$content .= '
|
||||
<div class="dropdown-menu">
|
||||
foreach($menuitems as $menuitem) {
|
||||
if(is_array($menuitem)) {
|
||||
$content .= '
|
||||
<a ';
|
||||
if(!empty($menuitem['link']))
|
||||
$content .= 'href="'.$menuitem['link'].'" ';
|
||||
$content .= 'class="dropdown-item';
|
||||
if (!empty($menuitem['class']))
|
||||
$content .= ' '.$menuitem['class'];
|
||||
$content .= '" ';
|
||||
if (!empty($menuitem['msg']))
|
||||
$content .= 'msg="'.$menuitem['msg'].'" ';
|
||||
if (!empty($menuitem['confirmmsg']))
|
||||
$content .= 'confirmmsg="'.$menuitem['confirmmsg'].'" ';
|
||||
if (!empty($menuitem['rel']))
|
||||
$content .= 'rel="'.$menuitem['rel'].'" ';
|
||||
if(!empty($menuitem['onclick']))
|
||||
$content .= ' onclick="'.$menuitem['onclick'].'"';
|
||||
if (!empty($menuitem['data-formtoken']))
|
||||
$content .= 'data-formtoken="'.$menuitem['data-formtoken'].'" ';
|
||||
$content .= '>';
|
||||
if (!empty($menuitem['icon']))
|
||||
$content .= '<i class="fa fa-'.$menuitem['icon'].'"></i> ';
|
||||
$content .= $menuitem['label'].'</a>
|
||||
';
|
||||
foreach($button['menuitems'] as $menuitem) {
|
||||
if(is_array($menuitem)) {
|
||||
$content .= '
|
||||
<a class="dropdown-item"';
|
||||
if(!empty($menuitem['link']))
|
||||
$content .= ' href="'.$menuitem['link'].'"';
|
||||
if(!empty($menuitem['onclick']))
|
||||
$content .= ' onclick="'.$menuitem['onclick'].'"';
|
||||
$content .= '>'.$menuitem['label'].'</a>
|
||||
';
|
||||
} else {
|
||||
$content .= $menuitem;
|
||||
}
|
||||
} else {
|
||||
// $content .= $menuitem;
|
||||
}
|
||||
$content .= '
|
||||
</div>
|
||||
';
|
||||
}
|
||||
$content .= '
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
echo $content;
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
protected function getButtonWithMenu($button, $options=array()) { /* {{{ */
|
||||
$content = '';
|
||||
if ($button['menuitems']) {
|
||||
$content .= '
|
||||
<div class="btn-group" role="group">
|
||||
<div class="btn-group" role="group">
|
||||
<span type="button" class="'.(!empty($button['type']) ? '' : 'btn btn-secondary').' dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
'.$button['label'].'
|
||||
</span>
|
||||
';
|
||||
if($button['menuitems']) {
|
||||
$content .= $this->getMenu($button['menuitems'], $options);
|
||||
}
|
||||
$content .= '
|
||||
</div>
|
||||
';
|
||||
$content .= '
|
||||
</div>
|
||||
';
|
||||
}
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
protected function showButtonWithMenu($button, $options=array()) { /* {{{ */
|
||||
echo $this->getButtonWithMenu($button, $options);
|
||||
} /* }}} */
|
||||
|
||||
protected function showPaneHeader($name, $title, $isactive) { /* {{{ */
|
||||
|
|
@ -1242,6 +1272,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
((isset($value['value']) && is_string($value['value'])) || !empty($value['value']) ? ' value="'.$value['value'].'"' : '').
|
||||
(!empty($value['placeholder']) ? ' placeholder="'.$value['placeholder'].'"' : '').
|
||||
(!empty($value['autocomplete']) ? ' autocomplete="'.$value['autocomplete'].'"' : '').
|
||||
(isset($value['min']) ? ' min="'.$value['min'].'"' : '').
|
||||
(!empty($value['checked']) ? ' checked' : '').
|
||||
(!empty($value['required']) ? ' required="required"' : '');
|
||||
if(!empty($value['attributes']) && is_array($value['attributes']))
|
||||
|
|
@ -2653,6 +2684,11 @@ $(function() {
|
|||
return '';
|
||||
} /* }}} */
|
||||
|
||||
function getDeleteDocumentButton($document, $msg, $return=false){ /* {{{ */
|
||||
$docid = $document->getID();
|
||||
return ['class'=>'delete-document-btn', 'rel'=>$docid, 'msg'=>getMLText($msg), 'confirmmsg'=>htmlspecialchars(getMLText("confirm_rm_document", array ("documentname" => htmlspecialchars($document->getName()))), ENT_QUOTES), 'title'=>getMLText('delete'), 'label'=>getMLText('delete'), 'icon'=>'remove'];
|
||||
} /* }}} */
|
||||
|
||||
function printDeleteDocumentButtonJs(){ /* {{{ */
|
||||
echo "
|
||||
$(document).ready(function () {
|
||||
|
|
@ -2733,6 +2769,11 @@ $(function() {
|
|||
return '';
|
||||
} /* }}} */
|
||||
|
||||
function getDeleteFolderButton($folder, $msg, $return=false){ /* {{{ */
|
||||
$folderid = $folder->getID();
|
||||
return ['class'=>'delete-folder-btn', 'rel'=>$folderid, 'msg'=>getMLText($msg), 'confirmmsg'=>htmlspecialchars(getMLText("confirm_rm_folder", array ("foldername" => htmlspecialchars($folder->getName()))), ENT_QUOTES), 'title'=>getMLText("delete"), 'label'=>getMLText("delete"), 'label'=>getMLText("delete"), 'icon'=>'remove'];
|
||||
} /* }}} */
|
||||
|
||||
function printDeleteFolderButtonJs(){ /* {{{ */
|
||||
echo "
|
||||
$(document).ready(function () {
|
||||
|
|
@ -2809,6 +2850,7 @@ $(function() {
|
|||
}
|
||||
$content = '';
|
||||
$content .= '<a class="lock-document-btn" rel="'.$docid.'" msg="'.getMLText($msg).'" title="'.getMLText($title).'" data-formtoken="'.createFormKey('tooglelockdocument').'"><i class="fa fa-'.$icon.'"></i></a>';
|
||||
$content = ['class'=>'lock-document-btn', 'rel'=>$docid, 'msg'=>getMLText($msg), 'title'=>getMLText($title), 'label'=>getMLText($title), 'data-formtoken'=>createFormKey('tooglelockdocument'), 'icon'=>$icon];
|
||||
if($return)
|
||||
return $content;
|
||||
else
|
||||
|
|
@ -2821,11 +2863,15 @@ $(function() {
|
|||
$content = '';
|
||||
$objid = $object->getId();
|
||||
if($object->isType('document')) {
|
||||
if($accessobject->check_view_access('DocumentAccess'))
|
||||
$content .= '<a class="access-document-btn" href="'.$this->params['settings']->_httpRoot.'out/out.DocumentAccess.php?documentid='.$objid.'" title="'.getMLText('edit_document_access').'"><i class="fa fa-bolt"></i></a>';
|
||||
if($accessobject->check_view_access('DocumentAccess')) {
|
||||
// $content .= '<a class="access-document-btn" href="'.$this->params['settings']->_httpRoot.'out/out.DocumentAccess.php?documentid='.$objid.'" title="'.getMLText('edit_document_access').'"><i class="fa fa-bolt"></i></a>';
|
||||
$content = ['class'=>'access-document-btn', 'link'=>$this->params['settings']->_httpRoot.'out/out.DocumentAccess.php?documentid='.$objid, 'title'=>getMLText('edit_document_access'), 'label'=>getMLText('edit_document_access'), 'icon'=>'bolt'];
|
||||
}
|
||||
} elseif($object->isType('folder')) {
|
||||
if($accessobject->check_view_access('FolderAccess'))
|
||||
$content .= '<a class="access-folder-btn" href="'.$this->params['settings']->_httpRoot.'out/out.FolderAccess.php?folderid='.$objid.'" title="'.getMLText('edit_folder_access').'"><i class="fa fa-bolt"></i></a>';
|
||||
if($accessobject->check_view_access('FolderAccess')) {
|
||||
// $content .= '<a class="access-folder-btn" href="'.$this->params['settings']->_httpRoot.'out/out.FolderAccess.php?folderid='.$objid.'" title="'.getMLText('edit_folder_access').'"><i class="fa fa-bolt"></i></a>';
|
||||
$content = ['class'=>'access-folder-btn', 'link'=>$this->params['settings']->_httpRoot.'out/out.FolderAccess.php?folderid='.$objid, 'title'=>getMLText('edit_folder_access'), 'label'=>getMLText('edit_folder_access'), 'icon'=>'bolt'];
|
||||
}
|
||||
}
|
||||
if($return)
|
||||
return $content;
|
||||
|
|
@ -3296,14 +3342,15 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$content .= $extracontent['begin_action_list'];
|
||||
if($accessop->check_view_access('RemoveDocument')) {
|
||||
if($document->getAccessMode($user, 'removeDocument') >= M_ALL) {
|
||||
$actions['remove_document'] = $this->printDeleteDocumentButton($document, 'splash_rm_document', true);
|
||||
$actions['remove_document'] = $this->getDeleteDocumentButton($document, 'splash_rm_document', true);
|
||||
} else {
|
||||
$actions['remove_document'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-remove"></i></span>';
|
||||
}
|
||||
}
|
||||
$docID = $document->getID();
|
||||
if($document->getAccessMode($user) >= M_READWRITE) {
|
||||
$actions['edit_document'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.EditDocument.php?documentid='.$docID.'" title="'.getMLText("edit_document_props").'"><i class="fa fa-edit"></i></a>';
|
||||
// $actions['edit_document'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.EditDocument.php?documentid='.$docID.'" title="'.getMLText("edit_document_props").'"><i class="fa fa-edit"></i></a>';
|
||||
$actions['edit_document'] = ['link'=>$this->params['settings']->_httpRoot.'out/out.EditDocument.php?documentid='.$docID, 'title'=>getMLText("edit_document_props"), 'label'=>getMLText("edit_document_props"), 'icon'=>'edit'];
|
||||
} else {
|
||||
$actions['edit_document'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-edit"></i></span>';
|
||||
}
|
||||
|
|
@ -3314,13 +3361,18 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$actions['document_access'] = $this->printAccessButton($document, true);
|
||||
}
|
||||
if($enableClipboard) {
|
||||
if($session->isOnClipboard($document))
|
||||
$actions['remove_from_clipboard'] = '<a class="removefromclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
else
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
if($session->isOnClipboard($document)) {
|
||||
// $actions['remove_from_clipboard'] = '<a class="removefromclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
$actions['remove_from_clipboard'] = ['class'=>'removefromclipboard', 'rel'=>'D'.$docID, 'msg'=>getMLText('splash_removed_from_clipboard'), 'title'=>getMLText("remove_from_clipboard"), 'label'=>getMLText("remove_from_clipboard"), 'icon'=>'clipboard'];
|
||||
} else {
|
||||
// $actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="D'.$docID.'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
$actions['add_to_clipboard'] = ['class'=>'addtoclipboard', 'rel'=>'D'.$docID, 'msg'=>getMLText('splash_added_to_clipboard'), 'title'=>getMLText("add_to_clipboard"), 'label'=>getMLText("add_to_clipboard"), 'icon'=>'clipboard'];
|
||||
}
|
||||
}
|
||||
if($onepage) {
|
||||
// $actions['view_document'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.ViewDocument.php?documentid='.$docID.'" title="'.getMLText("view_document").'"><i class="fa fa-eye"></i></a>';
|
||||
$actions['view_document'] = ['link'=>$this->params['settings']->_httpRoot.'out/out.ViewDocument.php?documentid='.$docID, 'title'=>getMLText("view_document"), 'label'=>getMLText("view_document"), 'icon'=>'eye'];
|
||||
}
|
||||
if($onepage)
|
||||
$actions['view_document'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.ViewDocument.php?documentid='.$docID.'" title="'.getMLText("view_document").'"><i class="fa fa-eye"></i></a>';
|
||||
|
||||
/* Do not use $this->callHook() because $menuitems must be returned by the the
|
||||
* first hook and passed to next hook. $this->callHook() will just pass
|
||||
|
|
@ -3333,13 +3385,61 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
}
|
||||
}
|
||||
|
||||
foreach($actions as $action) {
|
||||
if(is_string($action))
|
||||
$content .= $action;
|
||||
if (empty($this->params['settings']->_actiondropdown)) {
|
||||
foreach($actions as $action) {
|
||||
if(is_string($action))
|
||||
$content .= $action;
|
||||
elseif(is_array($action)) {
|
||||
$content .= '<a ';
|
||||
if (!empty($action['link']))
|
||||
$content .= 'href="'.$action['link'].'" ';
|
||||
if (!empty($action['title']))
|
||||
$content .= 'title="'.$action['title'].'" ';
|
||||
if (!empty($action['class']))
|
||||
$content .= 'class="'.$action['class'].'" ';
|
||||
if (!empty($action['msg']))
|
||||
$content .= 'msg="'.$action['msg'].'" ';
|
||||
if (!empty($action['confirmmsg']))
|
||||
$content .= 'confirmmsg="'.$action['confirmmsg'].'" ';
|
||||
if (!empty($action['rel']))
|
||||
$content .= 'rel="'.$action['rel'].'" ';
|
||||
if (!empty($action['data-formtoken']))
|
||||
$content .= 'data-formtoken="'.$action['data-formtoken'].'" ';
|
||||
$content .= '><i class="fa fa-'.$action['icon'].'"></i></a>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$content .= $this->getButtonWithMenu(['label'=>'<i class="fa fa-navicon"></i>', 'type'=>'plain', 'menuitems'=>$actions], ['class'=>'dropdown-menu-right']);
|
||||
}
|
||||
|
||||
if(!empty($extracontent['end_action_list']))
|
||||
$content .= $extracontent['end_action_list'];
|
||||
$content .= "</div>";
|
||||
|
||||
if (0) {
|
||||
$content .= '<div class="dropdown-menu contextmenu" id="contextmenu-d'.$docID.'" style="display: none; position: absolute;">';
|
||||
foreach($actions as $action) {
|
||||
if(is_array($action)) {
|
||||
$content .= '<a ';
|
||||
if (!empty($action['link']))
|
||||
$content .= 'href="'.$action['link'].'" ';
|
||||
$content .= 'class="dropdown-item';
|
||||
if (!empty($action['class']))
|
||||
$content .= ' '.$action['class'];
|
||||
$content .= '" ';
|
||||
if (!empty($action['msg']))
|
||||
$content .= 'msg="'.$action['msg'].'" ';
|
||||
if (!empty($action['confirmmsg']))
|
||||
$content .= 'confirmmsg="'.$action['confirmmsg'].'" ';
|
||||
if (!empty($action['rel']))
|
||||
$content .= 'rel="'.$action['rel'].'" ';
|
||||
if (!empty($action['data-formtoken']))
|
||||
$content .= 'data-formtoken="'.$action['data-formtoken'].'" ';
|
||||
$content .= '><i class="fa fa-'.$action['icon'].'"></i> '.$action['label'].'</a>';
|
||||
}
|
||||
}
|
||||
$content .= '</div>';
|
||||
}
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
|
|
@ -3505,6 +3605,120 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
return "</tr>\n";
|
||||
} /* }}} */
|
||||
|
||||
function folderListRowAction($subFolder, $skipcont=false, $extracontent=array()) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$session = $this->params['session'];
|
||||
// $folder = $this->params['folder'];
|
||||
$showtree = $this->params['showtree'];
|
||||
$enableRecursiveCount = $this->params['enableRecursiveCount'];
|
||||
$maxRecursiveCount = $this->params['maxRecursiveCount'];
|
||||
$enableClipboard = $this->params['enableclipboard'];
|
||||
$accessop = $this->params['accessobject'];
|
||||
$onepage = $this->params['onepage'];
|
||||
|
||||
$content = '';
|
||||
$content .= "<div class=\"list-action\">";
|
||||
$actions = array();
|
||||
if(!empty($extracontent['begin_action_list']))
|
||||
$content .= $extracontent['begin_action_list'];
|
||||
$subFolderAccessMode = $subFolder->getAccessMode($user);
|
||||
if ($accessop->check_view_access('RemoveFolder')) {
|
||||
if($subFolderAccessMode >= M_ALL) {
|
||||
$actions['remove_folder'] = $this->getDeleteFolderButton($subFolder, 'splash_rm_folder', true);
|
||||
} else {
|
||||
$actions['remove_folder'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-remove"></i></span>';
|
||||
}
|
||||
}
|
||||
if($subFolderAccessMode >= M_READWRITE) {
|
||||
// $actions['edit_folder'] = '<a class_="btn btn-mini" href="'.$this->params['settings']->_httpRoot.'out/out.EditFolder.php?folderid='.$subFolder->getID().'" title="'.getMLText("edit_folder_props").'"><i class="fa fa-edit"></i></a>';
|
||||
$actions['edit_folder'] = ['link'=>$this->params['settings']->_httpRoot.'out/out.EditFolder.php?folderid='.$subFolder->getID(), 'title'=>getMLText('edit_folder_props'), 'label'=>getMLText('edit_folder_props'), 'icon'=>'edit'];
|
||||
} else {
|
||||
$actions['edit_folder'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-edit"></i></span>';
|
||||
}
|
||||
if($subFolderAccessMode >= M_READWRITE) {
|
||||
$actions['folder_access'] = $this->printAccessButton($subFolder, true);
|
||||
}
|
||||
if($enableClipboard) {
|
||||
if($session->isOnClipboard($subFolder))
|
||||
// $actions['add_to_clipboard'] = '<a class="removefromclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
$actions['add_to_clipboard'] = ['class'=>'removefromclipboard', 'title'=>getMLText('remove_from_clipboard'), 'label'=>getMLText('remove_from_clipboard'), 'rel'=>'F'.$subFolder->getID(), 'msg'=>getMLText('splash_removed_from_clipboard'), 'icon'=>'clipboard'];
|
||||
else
|
||||
// $actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
$actions['add_to_clipboard'] = ['class'=>'addtoclipboard', 'title'=>getMLText('add_to_clipboard'), 'label'=>getMLText('add_to_clipboard'), 'rel'=>'F'.$subFolder->getID(), 'msg'=>getMLText('splash_added_to_clipboard'), 'icon'=>'clipboard'];
|
||||
}
|
||||
if($onepage)
|
||||
$actions['view_folder'] = ['link'=>$this->params['settings']->_httpRoot.'out/out.ViewFolder.php?folderid='.$subFolder->getID(), 'title'=>getMLText("view_folder"), 'label'=>getMLText("view_folder"), 'icon'=>'eye'];
|
||||
|
||||
/* Do not use $this->callHook() because $menuitems must be returned by the the
|
||||
* first hook and passed to next hook. $this->callHook() will just pass
|
||||
* the menuitems to each single hook. Hence, the last hook will win.
|
||||
*/
|
||||
$hookObjs = $this->getHookObjects();
|
||||
foreach($hookObjs as $hookObj) {
|
||||
if (method_exists($hookObj, 'folderRowAction')) {
|
||||
$actions = $hookObj->folderRowAction($this, $subFolder, $actions);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->params['settings']->_actiondropdown)) {
|
||||
foreach($actions as $action) {
|
||||
if(is_string($action))
|
||||
$content .= $action;
|
||||
elseif(is_array($action)) {
|
||||
$content .= '<a ';
|
||||
if (!empty($action['link']))
|
||||
$content .= 'href="'.$action['link'].'" ';
|
||||
if (!empty($action['title']))
|
||||
$content .= 'title="'.$action['title'].'" ';
|
||||
if (!empty($action['class']))
|
||||
$content .= 'class="'.$action['class'].'" ';
|
||||
if (!empty($action['msg']))
|
||||
$content .= 'msg="'.$action['msg'].'" ';
|
||||
if (!empty($action['confirmmsg']))
|
||||
$content .= 'confirmmsg="'.$action['confirmmsg'].'" ';
|
||||
if (!empty($action['rel']))
|
||||
$content .= 'rel="'.$action['rel'].'" ';
|
||||
if (!empty($action['data-formtoken']))
|
||||
$content .= 'data-formtoken="'.$action['data-formtoken'].'" ';
|
||||
$content .= '><i class="fa fa-'.$action['icon'].'"></i></a>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$content .= $this->getButtonWithMenu(['label'=>'<i class="fa fa-navicon"></i>', 'type'=>'plain', 'menuitems'=>$actions], ['class'=>'dropdown-menu-right']);
|
||||
}
|
||||
|
||||
if(!empty($extracontent['end_action_list']))
|
||||
$content .= $extracontent['end_action_list'];
|
||||
$content .= "</div>";
|
||||
|
||||
if (0) {
|
||||
$content .= '<div class="dropdown-menu contextmenu" id="contextmenu-f'.$subFolder->getId().'" style="display: none; position: absolute;">';
|
||||
foreach($actions as $action) {
|
||||
if(is_array($action)) {
|
||||
$content .= '<a ';
|
||||
if (!empty($action['link']))
|
||||
$content .= 'href="'.$action['link'].'" ';
|
||||
$content .= 'class="dropdown-item';
|
||||
if (!empty($action['class']))
|
||||
$content .= ' '.$action['class'];
|
||||
$content .= '" ';
|
||||
if (!empty($action['msg']))
|
||||
$content .= 'msg="'.$action['msg'].'" ';
|
||||
if (!empty($action['confirmmsg']))
|
||||
$content .= 'confirmmsg="'.$action['confirmmsg'].'" ';
|
||||
if (!empty($action['rel']))
|
||||
$content .= 'rel="'.$action['rel'].'" ';
|
||||
if (!empty($action['data-formtoken']))
|
||||
$content .= 'data-formtoken="'.$action['data-formtoken'].'" ';
|
||||
$content .= '><i class="fa fa-'.$action['icon'].'"></i> '.$action['label'].'</a>';
|
||||
}
|
||||
}
|
||||
$content .= "</div>";
|
||||
}
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
function folderListRowStatus($subFolder) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
|
|
@ -3552,70 +3766,6 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
function folderListRowAction($subFolder, $skipcont=false, $extracontent=array()) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$session = $this->params['session'];
|
||||
// $folder = $this->params['folder'];
|
||||
$showtree = $this->params['showtree'];
|
||||
$enableRecursiveCount = $this->params['enableRecursiveCount'];
|
||||
$maxRecursiveCount = $this->params['maxRecursiveCount'];
|
||||
$enableClipboard = $this->params['enableclipboard'];
|
||||
$accessop = $this->params['accessobject'];
|
||||
$onepage = $this->params['onepage'];
|
||||
|
||||
$content = '';
|
||||
$content .= "<div class=\"list-action\">";
|
||||
$actions = array();
|
||||
if(!empty($extracontent['begin_action_list']))
|
||||
$content .= $extracontent['begin_action_list'];
|
||||
$subFolderAccessMode = $subFolder->getAccessMode($user);
|
||||
if ($accessop->check_view_access('RemoveFolder')) {
|
||||
if($subFolderAccessMode >= M_ALL) {
|
||||
$actions['remove_folder'] = $this->printDeleteFolderButton($subFolder, 'splash_rm_folder', true);
|
||||
} else {
|
||||
$actions['remove_folder'] = '<span style="padding: 2px; color: #CCC;"><i class="fa fa-remove"></i></span>';
|
||||
}
|
||||
}
|
||||
if($subFolderAccessMode >= M_READWRITE) {
|
||||
$actions['edit_folder'] = '<a class_="btn btn-mini" href="'.$this->params['settings']->_httpRoot.'out/out.EditFolder.php?folderid='.$subFolder->getID().'" title="'.getMLText("edit_folder_props").'"><i class="fa fa-edit"></i></a>';
|
||||
} else {
|
||||
$content .= '<span style="padding: 2px; color: #CCC;"><i class="fa fa-edit"></i></span>';
|
||||
}
|
||||
if($subFolderAccessMode >= M_READWRITE) {
|
||||
$actions['folder_access'] = $this->printAccessButton($subFolder, true);
|
||||
}
|
||||
if($enableClipboard) {
|
||||
if($session->isOnClipboard($subFolder))
|
||||
$actions['add_to_clipboard'] = '<a class="removefromclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_removed_from_clipboard').'" title="'.getMLText("remove_from_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
else
|
||||
$actions['add_to_clipboard'] = '<a class="addtoclipboard" rel="F'.$subFolder->getID().'" msg="'.getMLText('splash_added_to_clipboard').'" title="'.getMLText("add_to_clipboard").'"><i class="fa fa-copy"></i></a>';
|
||||
}
|
||||
if($onepage)
|
||||
$actions['view_folder'] = '<a href="'.$this->params['settings']->_httpRoot.'out/out.ViewFolder.php?folderid='.$subFolder->getID().'" title="'.getMLText("view_folder").'"><i class="fa fa-eye"></i></a>';
|
||||
|
||||
/* Do not use $this->callHook() because $menuitems must be returned by the the
|
||||
* first hook and passed to next hook. $this->callHook() will just pass
|
||||
* the menuitems to each single hook. Hence, the last hook will win.
|
||||
*/
|
||||
$hookObjs = $this->getHookObjects();
|
||||
foreach($hookObjs as $hookObj) {
|
||||
if (method_exists($hookObj, 'folderRowAction')) {
|
||||
$actions = $hookObj->folderRowAction($this, $subFolder, $actions);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($actions as $action) {
|
||||
if(is_string($action))
|
||||
$content .= $action;
|
||||
}
|
||||
|
||||
if(!empty($extracontent['end_action_list']))
|
||||
$content .= $extracontent['end_action_list'];
|
||||
$content .= "</div>";
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
function folderListRow($subFolder, $skipcont=false, $extracontent=array()) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user