diff --git a/api/js/egw_action/egw_action.js b/api/js/egw_action/egw_action.js index 9ad17adad9..2727b83f94 100644 --- a/api/js/egw_action/egw_action.js +++ b/api/js/egw_action/egw_action.js @@ -198,6 +198,7 @@ function egwAction(_parent, _id, _caption, _iconUrl, _onExecute, _allowOnMultipl this.set_onExecute(_onExecute); } this.hideOnMobile = false; + this.disableIfNoEPL = false; } /** @@ -680,6 +681,11 @@ egwAction.prototype.set_hideOnMobile = function(_value) this.hideOnMobile = _value; }; +egwAction.prototype.set_disableIfNoEPL = function(_value) +{ + this.disableIfNoEPL = _value; +}; + egwAction.prototype.set_data = function(_value) { this.data = _value; diff --git a/api/js/egw_action/egw_menu_dhtmlx.js b/api/js/egw_action/egw_menu_dhtmlx.js index cf56ea272b..cdfdd3e230 100644 --- a/api/js/egw_action/egw_menu_dhtmlx.js +++ b/api/js/egw_action/egw_menu_dhtmlx.js @@ -95,6 +95,15 @@ function egwMenuImpl(_structure) //Translate the given structure to the dhtmlx object structure this._translateStructure(_structure, this.dhtmlxmenu.topId, 0); + + // Add disableIfNoEPL class to the relevant action's DOM + for(var i in this.dhtmlxmenu.idPull) + { + if (this.dhtmlxmenu.userData[i+'_egw_menu'] && this.dhtmlxmenu.userData[i+'_egw_menu']['data']['disableIfNoEPL']) + { + this.dhtmlxmenu.idPull[i].className += ' disableIfNoEPL'; + } + } } egwMenuImpl.prototype._translateStructure = function(_structure, _parentId, _idCnt) diff --git a/api/src/Etemplate/Widget/Nextmatch.php b/api/src/Etemplate/Widget/Nextmatch.php index 7688be956b..814a37d538 100644 --- a/api/src/Etemplate/Widget/Nextmatch.php +++ b/api/src/Etemplate/Widget/Nextmatch.php @@ -822,6 +822,15 @@ class Nextmatch extends Etemplate\Widget { continue; // no need to send this action to client, specially document actions can be huge } + if (!empty($action['disableIfNoEPL']) && $action['disableIfNoEPL'] && !$GLOBALS['egw_info']['apps']['stylite']) + { + $action['enabled'] = false; + $action['hint'] = Lang("This feature is only available in EPL version."); + } + else if(!empty($action['disableIfNoEPL'])) + { + unset($action['disableIfNoEPL']); + } // in case it's only selectbox id => label pairs if (!is_array($action)) $action = array('caption' => $action); if ($default_attrs) $action += $default_attrs; diff --git a/api/templates/default/etemplate2.css b/api/templates/default/etemplate2.css index 426f115b48..8aa5aef42b 100644 --- a/api/templates/default/etemplate2.css +++ b/api/templates/default/etemplate2.css @@ -2964,4 +2964,30 @@ div.eml div.emlDelete:hover, div.eml div.emlEdit:hover { margin-left: 0; } #api\.vfsSelectUI_app {width:177px} -#api\.vfsSelectUI_name {padding-right: 4px;} \ No newline at end of file +#api\.vfsSelectUI_name {padding-right: 4px;} + +tr.disableIfNoEPL { + box-shadow: inset 1px 1px 1px 1px #b9b9b9bf; +} +.disableIfNoEPL td { + opacity: 0.6; +} +.disableIfNoEPL:after { + content: 'EPL ONLY'; + color: #ffffff; + position: absolute; + opacity: 0.5; + height: 10px; + background: rgb(6, 32, 56); + font-weight: bold; + padding: 2px; + line-height: 8px; + font-size: 7pt; + text-align: center; + right: 0; + margin-top: 2px; + margin-right: 1px; + border-radius: 1px; +} + +.inactive_blur > * {opacity: 0.4; filter:blur(2px); pointer-events: none;} \ No newline at end of file