Skip to content

Commit

Permalink
implement support for service/feedback/about description settings in …
Browse files Browse the repository at this point in the history
…GlobalConfig
  • Loading branch information
osma committed Aug 14, 2024
1 parent e7e3cd2 commit b5a756e
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/model/GlobalConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,33 @@ public function getServiceNameLong($lang)
return $val;
}

/**
* Returns the service description in the requested language.
* @return string the description of the service
*/
public function getServiceDescription($lang)
{
return $this->getLiteral('skosmos:serviceDescription', null, $lang);
}

/**
* Returns the feedback page description in the requested language.
* @return string the description of the feedback page
*/
public function getFeedbackDescription($lang)
{
return $this->getLiteral('skosmos:feedbackDescription', null, $lang);
}

/**
* Returns the about page description in the requested language.
* @return string the description of the about page
*/
public function getAboutDescription($lang)
{
return $this->getLiteral('skosmos:aboutDescription', null, $lang);
}

/**
* @return string
*/
Expand Down
30 changes: 30 additions & 0 deletions tests/GlobalConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,36 @@ public function testGetServiceNameLongNotSetFallback()
$this->assertEquals("Skosmos", $this->configWithDefaults->getServiceNameLong('en'));
}

public function testGetServiceDescription()
{
$this->assertEquals("Description of Skosmos being tested", $this->config->getServiceDescription('en'));
}

public function testGetServiceDescriptionNotInLanguage()
{
$this->assertNull($this->config->getServiceDescription('fr'));
}

public function testGetFeedbackDescription()
{
$this->assertEquals("Feedback page for Skosmos being tested", $this->config->getFeedbackDescription('en'));
}

public function testGetFeedbackDescriptionNotInLanguage()
{
$this->assertNull($this->config->getFeedbackDescription('fr'));
}

public function testGetAboutDescription()
{
$this->assertEquals("About page for Skosmos being tested", $this->config->getAboutDescription('en'));
}

public function testGetAboutDescriptionNotInLanguage()
{
$this->assertNull($this->config->getAboutDescription('fr'));
}

public function testGetBaseHref()
{
$this->assertEquals("http://tests.localhost/Skosmos/", $this->configWithBaseHref->getBaseHref());
Expand Down
3 changes: 3 additions & 0 deletions tests/testconfig.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
# customize the service name
skosmos:serviceName "Skosmos being tested" ;
skosmos:serviceNameLong "Skosmos being tested, long title"@en, "Skosmos-long" ;
skosmos:serviceDescription "Description of Skosmos being tested"@en ;
skosmos:feedbackDescription "Feedback page for Skosmos being tested"@en ;
skosmos:aboutDescription "About page for Skosmos being tested"@en ;
# customize the base element. Set this if the automatic base url detection doesn't work. For example setups behind a proxy.
#skosmos:baseHref "http://localhost/Skosmos/" ;
# interface languages available, and the corresponding system locales
Expand Down

0 comments on commit b5a756e

Please sign in to comment.