N°2875 - Improve global implementation and integration with the trigger system

This commit is contained in:
Molkobain
2020-12-09 23:19:39 +01:00
parent c22f019ea1
commit e96400c43b
8 changed files with 656 additions and 34 deletions

View File

@@ -1969,6 +1969,7 @@ EOF
);
break;
// TODO 3.0.0: Isn't this part obsolete now that we have the activity panel or should we keep it for devs using it in custom extensions?
case 'CaseLog':
$aStyles = array();
$sStyle = '';
@@ -2014,26 +2015,7 @@ EOF
// b) or override some of the configuration settings, using the second parameter of ckeditor()
$aConfig = utils::GetCkeditorPref();
$aConfig['placeholder'] = Dict::S('UI:CaseLogTypeYourTextHere');
// - Mentions
// TODO 3.0.0: Should this be in the utils::GetCkeditorPref() as well? (Note that if we do so, we should warn that the endpoints are defaults only and should be overloaded by other GUIs such as the end-users portal)
$sMentionsEndpoint = utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php?operation=cke_mentions&target_class=Person&needle={encodedQuery}';
$sMentionItemUrl = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=details&class=Person&id={id}';
$sMentionItemTemplate = <<<HTML
<li class="mentions_item" data-id="{id}"><span role="image" style="background-image: url('{picture_url}');"></span><span role="friendlyname">{friendlyname}</span></li>
HTML;
$sMentionOutputTemplate = <<<HTML
<a href="$sMentionItemUrl">{friendlyname}</a>
HTML;
$aConfig['mentions'] = array(
array(
'feed' => $sMentionsEndpoint,
'marker' => '@',
'minChars' => MetaModel::GetConfig()->Get('min_autocomplete_chars'),
'itemTemplate' => $sMentionItemTemplate,
'outputTemplate' => $sMentionOutputTemplate,
'throttle' => 500,
),
);
// - Final config
$sConfigJS = json_encode($aConfig);