From d5aacd190de826d342627e4013646411a28b5cd0 Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 30 Mar 2021 10:12:29 -0600 Subject: [PATCH] Add 'no_quick_add' link registry setting so apps can opt out of the quick add --- api/js/jsapi/egw_links.js | 4 ++++ api/src/Link.php | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/js/jsapi/egw_links.js b/api/js/jsapi/egw_links.js index c6b8f1fbef..12e11c5906 100644 --- a/api/js/jsapi/egw_links.js +++ b/api/js/jsapi/egw_links.js @@ -478,6 +478,10 @@ egw.extend('links', egw.MODULE_GLOBAL, function() var apps = self.link_app_list('add'); for(var app in apps) { + if(egw.link_get_registry(app, 'no_quick_add')) + { + continue; + } var option = jQuery(document.createElement('option')).attr('value', app) .text(self.lang(self.link_get_registry(app,'entry') || apps[app])); select.append(option); diff --git a/api/src/Link.php b/api/src/Link.php index 1c9154e184..4518d99e1d 100644 --- a/api/src/Link.php +++ b/api/src/Link.php @@ -57,7 +57,8 @@ namespace EGroupware\Api; * ), * 'add_app' => 'link_app', // name of get parameter to add links to other app * 'add_id' => 'link_id', // --------------------- " ------------------- id - * 'add_popup' => '400x300', // size of popup (XxY), if add is in popup + * 'add_popup' => '400x300', // size of popup (XxY), if add is in popup + * 'no_quick_add' => false, // App does not want to be in quick add selectbox, defaults to false * 'notify' => 'app.class.method', // method to be called if an other applications links or unlinks with app: notify(array $data) * 'file_access' => 'app.class.method', // method to be called to check file access rights of a given user, see links_stream_wrapper class * // boolean file_access(string $id,int $check,string $rel_path=null,int $user=null) @@ -299,7 +300,7 @@ class Link extends Link\Storage { $to_json[$app] = array_intersect_key($data, array_flip(array( 'view','view_id','view_popup', - 'add','add_app','add_id','add_popup', + 'add','add_app','add_id','add_popup','no_quick_add', 'edit','edit_id','edit_popup', 'list','list_popup', 'name','icon','query', @@ -1156,6 +1157,8 @@ class Link extends Link\Storage $reg[$name] = $app.'/navbar'; } break; + case 'quick_add': + $reg[$name] = true; } }