Skip to content

Commit

Permalink
a more descriptive function name and documentation for the classifica…
Browse files Browse the repository at this point in the history
…tion label function, related to #151
  • Loading branch information
henriyli committed Dec 8, 2014
1 parent 9134c79 commit 8056f2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion controller/WebController.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function invokeVocabularies($lang)
$template = $this->twig->loadTemplate('light.twig');
// set template variables
$requestUri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$categoryLabel = $this->model->getCategoryLabel($lang);
$categoryLabel = $this->model->getClassificationLabel($lang);
$vocabList = $this->model->getVocabularyList();
// render template
echo $template
Expand Down
7 changes: 3 additions & 4 deletions model/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,14 @@ public function getVocabularyCategories()
}

/**
* Creates dataobjects of all the different vocabulary categories (Health etc.).
* Returns the label defined in vocabularies.ttl with the appropriate language.
* @param string $lang language code of returned labels, eg. 'fi'
* @return string the label for vocabulary categories.
*/
public function getCategoryLabel($lang)
public function getClassificationLabel($lang)
{
$cats = $this->graph->allOfType('skos:ConceptScheme');
if ($cats)
$label = $cats[0]->label($lang);
$label = $cats ? $cats[0]->label($lang) : null;

return $label;
}
Expand Down

0 comments on commit 8056f2e

Please sign in to comment.