Newsroom finalization & integration tests.

This commit is contained in:
Denis Flaven
2018-12-06 15:38:29 +01:00
parent 35752a8041
commit 540bc3a54b
8 changed files with 227 additions and 8 deletions

View File

@@ -835,6 +835,7 @@ EOF
'fetch_url' => $oProvider->GetFetchURL(),
'view_all_url' => $oProvider->GetViewAllURL(),
'mark_all_as_read_url' => $oProvider->GetMarkAllAsReadURL(),
'placeholders' => $oProvider->GetPlaceholders(),
'ttl' => $oProvider->GetTTL(),
);
}
@@ -842,7 +843,7 @@ EOF
if (count($aProviderParams) > 0)
{
$sImageUrl= '../images/newsroom_menu.png';
$sPlaceholderImageUrl= '../images/news-32x32.png';
$sPlaceholderImageUrl= '../images/newsroom-message.svg';
$aParams = array(
'image_url' => $sImageUrl,
'placeholder_image_url' => $sPlaceholderImageUrl,

View File

@@ -65,6 +65,13 @@ interface iNewsroomProvider
*/
public function GetPreferencesUrl();
/**
* Return an array key => value to be replaced in URL of the messages
* Example: '%itop_root%' => utils::GetAbsoluteUrlAppRoot();
* @return string[]
*/
public function GetPlaceholders();
/**
* The duration between to refreshes of the cache (in seconds)
* @return int
@@ -136,6 +143,15 @@ abstract class NewsroomProviderBase implements iNewsroomProvider
return false;
}
/**
* {@inheritDoc}
* @see iNewsroomProvider::GetPlaceholders()
*/
public function GetPlaceholders()
{
return array(); // By default, empty set of placeholders
}
public function GetTTL()
{
return 10*60; // Refresh every 10 minutes