@@ -167,9 +167,11 @@ |
||
| 167 | 167 | */ |
| 168 | 168 | public function setVocab($vocabid) |
| 169 | 169 | { |
| 170 | - if (strpos($vocabid, ' ') !== false) // if there are multiple vocabularies just storing the string |
|
| 170 | + if (strpos($vocabid, ' ') !== false) { |
|
| 171 | + // if there are multiple vocabularies just storing the string |
|
| 171 | 172 | { |
| 172 | 173 | $this->setVocabids($vocabid); |
| 174 | + } |
|
| 173 | 175 | } else { |
| 174 | 176 | $this->vocab = $this->model->getVocabulary($vocabid); |
| 175 | 177 | } |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Copyright (c) 2012-2013 Aalto University and University of Helsinki |
|
| 4 | - * MIT License |
|
| 5 | - * see LICENSE.txt for more information |
|
| 6 | - */ |
|
| 3 | + * Copyright (c) 2012-2013 Aalto University and University of Helsinki |
|
| 4 | + * MIT License |
|
| 5 | + * see LICENSE.txt for more information |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | /* Register text: namespace needed for jena-text queries */ |
| 9 | 9 | EasyRdf_Namespace::set('text', 'http://jena.apache.org/text#'); |
@@ -461,7 +461,7 @@ |
||
| 461 | 461 | } |
| 462 | 462 | } catch (Exception $e) { |
| 463 | 463 | trigger_error($e->getMessage(), E_USER_WARNING); |
| 464 | - return gettext('skosmos:modified') . ' ' . (string) $this->resource->get('dc:modified') . ' ' . gettext('skosmos:created') . ' ' . (string) $this->resource->get('dc:created'); |
|
| 464 | + return gettext('skosmos:modified') . ' ' . (string)$this->resource->get('dc:modified') . ' ' . gettext('skosmos:created') . ' ' . (string)$this->resource->get('dc:created'); |
|
| 465 | 465 | } |
| 466 | 466 | return $ret; |
| 467 | 467 | } |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Copyright (c) 2012-2013 Aalto University and University of Helsinki |
|
| 4 | - * MIT License |
|
| 5 | - * see LICENSE.txt for more information |
|
| 6 | - */ |
|
| 3 | + * Copyright (c) 2012-2013 Aalto University and University of Helsinki |
|
| 4 | + * MIT License |
|
| 5 | + * see LICENSE.txt for more information |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | /* Register text: namespace needed for jena-text queries */ |
| 9 | 9 | EasyRdf_Namespace::set('text', 'http://jena.apache.org/text#'); |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Copyright (c) 2012-2013 Aalto University and University of Helsinki |
|
| 4 | - * MIT License |
|
| 5 | - * see LICENSE.txt for more information |
|
| 6 | - */ |
|
| 3 | + * Copyright (c) 2012-2013 Aalto University and University of Helsinki |
|
| 4 | + * MIT License |
|
| 5 | + * see LICENSE.txt for more information |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | /* Register text: namespace needed for jena-text queries */ |
| 9 | 9 | EasyRdf_Namespace::set('text', 'http://jena.apache.org/text#'); |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | return Punic\Calendar::formatDate($val, 'short'); |
| 45 | 45 | } catch (Exception $e) { |
| 46 | 46 | trigger_error($e->getMessage(), E_USER_WARNING); |
| 47 | - return (string) $this->literal; |
|
| 47 | + return (string)$this->literal; |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | return $this->literal->getValue(); |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | */ |
| 119 | 119 | public function getEnvLang() |
| 120 | 120 | { |
| 121 | - // get language from locale, same as used by gettext, set by Controller |
|
| 122 | - return substr(getenv("LC_ALL"), 0, 2); |
|
| 121 | + // get language from locale, same as used by gettext, set by Controller |
|
| 122 | + return substr(getenv("LC_ALL"), 0, 2); |
|
| 123 | 123 | } |
| 124 | 124 | } |
@@ -68,10 +68,12 @@ |
||
| 68 | 68 | if ($sortable !== null) { |
| 69 | 69 | uksort($sortable, array($this, 'mycompare')); |
| 70 | 70 | foreach ($sortable as $prop => $vals) { |
| 71 | - if (is_array($prop)) // the ConceptProperty objects have their own sorting methods |
|
| 71 | + if (is_array($prop)) { |
|
| 72 | + // the ConceptProperty objects have their own sorting methods |
|
| 72 | 73 | { |
| 73 | 74 | ksort($sortable[$prop]); |
| 74 | 75 | } |
| 76 | + } |
|
| 75 | 77 | |
| 76 | 78 | } |
| 77 | 79 | } |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Copyright (c) 2012-2013 Aalto University and University of Helsinki |
|
| 4 | - * MIT License |
|
| 5 | - * see LICENSE.txt for more information |
|
| 6 | - */ |
|
| 3 | + * Copyright (c) 2012-2013 Aalto University and University of Helsinki |
|
| 4 | + * MIT License |
|
| 5 | + * see LICENSE.txt for more information |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | /* Register text: namespace needed for jena-text queries */ |
| 9 | 9 | EasyRdf_Namespace::set('text', 'http://jena.apache.org/text#'); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | // register a Twig filter for generating URLs for vocabulary resources (concepts and groups) |
| 75 | 75 | $controller = $this; // for use by anonymous function below |
| 76 | - $urlFilter = new Twig_SimpleFilter('link_url', function ($uri, $vocab, $lang, $type = 'page', $clang = null, $term = null) use ($controller) { |
|
| 76 | + $urlFilter = new Twig_SimpleFilter('link_url', function($uri, $vocab, $lang, $type = 'page', $clang = null, $term = null) use ($controller) { |
|
| 77 | 77 | // $vocab can either be null, a vocabulary id (string) or a Vocabulary object |
| 78 | 78 | if ($vocab === null) { |
| 79 | 79 | // target vocabulary is unknown, best bet is to link to the plain URI |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $this->twig->addFilter($urlFilter); |
| 115 | 115 | |
| 116 | 116 | // register a Twig filter for generating strings from language codes with CLDR |
| 117 | - $langFilter = new Twig_SimpleFilter('lang_name', function ($langcode, $lang) { |
|
| 117 | + $langFilter = new Twig_SimpleFilter('lang_name', function($langcode, $lang) { |
|
| 118 | 118 | return Language::getName($langcode, $lang); |
| 119 | 119 | }); |
| 120 | 120 | $this->twig->addFilter($langFilter); |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | $vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : null; |
| 359 | 359 | $vocabObjects = array(); |
| 360 | 360 | if ($vocids) { |
| 361 | - foreach($vocids as $vocid) { |
|
| 361 | + foreach ($vocids as $vocid) { |
|
| 362 | 362 | $vocabObjects[] = $this->model->getVocabulary($vocid); |
| 363 | 363 | } |
| 364 | 364 | } |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | 'search_count' => $counts, |
| 386 | 386 | 'languages' => $this->languages, |
| 387 | 387 | 'search_results' => $search_results, |
| 388 | - 'rest' => $parameters->getOffset()>0, |
|
| 388 | + 'rest' => $parameters->getOffset() > 0, |
|
| 389 | 389 | 'global_search' => true, |
| 390 | 390 | 'term' => $request->getQueryParam('q'), |
| 391 | 391 | 'lang_list' => $langList, |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | 'vocab' => $vocab, |
| 449 | 449 | 'search_results' => $search_results, |
| 450 | 450 | 'search_count' => $counts, |
| 451 | - 'rest' => $parameters->getOffset()>0, |
|
| 451 | + 'rest' => $parameters->getOffset() > 0, |
|
| 452 | 452 | 'limit_parent' => $parameters->getParentLimit(), |
| 453 | 453 | 'limit_type' => $request->getQueryParam('type'), |
| 454 | 454 | 'limit_group' => $parameters->getGroupLimit(), |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | * Loads and renders the view containing a list of recent changes in the vocabulary. |
| 595 | 595 | * @param Request $request |
| 596 | 596 | */ |
| 597 | - public function invokeChangeList($request, $prop='dc:created') |
|
| 597 | + public function invokeChangeList($request, $prop = 'dc:created') |
|
| 598 | 598 | { |
| 599 | 599 | // set language parameters for gettext |
| 600 | 600 | $this->setLanguageProperties($request->getLang()); |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Copyright (c) 2012 Aalto University and University of Helsinki |
|
| 4 | - * MIT License |
|
| 5 | - * see LICENSE.txt for more information |
|
| 6 | - */ |
|
| 3 | + * Copyright (c) 2012 Aalto University and University of Helsinki |
|
| 4 | + * MIT License |
|
| 5 | + * see LICENSE.txt for more information |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Includes the side wide settings. |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Copyright (c) 2012 Aalto University and University of Helsinki |
|
| 4 | - * MIT License |
|
| 5 | - * see LICENSE.txt for more information |
|
| 6 | - */ |
|
| 3 | + * Copyright (c) 2012 Aalto University and University of Helsinki |
|
| 4 | + * MIT License |
|
| 5 | + * see LICENSE.txt for more information |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Includes the side wide settings. |
@@ -382,7 +382,7 @@ |
||
| 382 | 382 | public function getVocabularyCategories() |
| 383 | 383 | { |
| 384 | 384 | $cats = $this->graph->allOfType('skos:Concept'); |
| 385 | - if(empty($cats)) { |
|
| 385 | + if (empty($cats)) { |
|
| 386 | 386 | return array(new VocabularyCategory($this, null)); |
| 387 | 387 | } |
| 388 | 388 | |
@@ -101,10 +101,12 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | private function initializeNamespaces() { |
| 103 | 103 | foreach ($this->namespaces as $prefix => $full_uri) { |
| 104 | - if ($prefix != '' && EasyRdf_Namespace::get($prefix) === null) // if not already defined |
|
| 104 | + if ($prefix != '' && EasyRdf_Namespace::get($prefix) === null) { |
|
| 105 | + // if not already defined |
|
| 105 | 106 | { |
| 106 | 107 | EasyRdf_Namespace::set($prefix, $full_uri); |
| 107 | 108 | } |
| 109 | + } |
|
| 108 | 110 | } |
| 109 | 111 | } |
| 110 | 112 | |
@@ -379,10 +381,12 @@ discard block |
||
| 379 | 381 | // register vocabulary ids as RDF namespace prefixes |
| 380 | 382 | $prefix = preg_replace('/\W+/', '', $voc->getId()); // strip non-word characters |
| 381 | 383 | try { |
| 382 | - if ($prefix != '' && EasyRdf_Namespace::get($prefix) === null) // if not already defined |
|
| 384 | + if ($prefix != '' && EasyRdf_Namespace::get($prefix) === null) { |
|
| 385 | + // if not already defined |
|
| 383 | 386 | { |
| 384 | 387 | EasyRdf_Namespace::set($prefix, $voc->getUriSpace()); |
| 385 | 388 | } |
| 389 | + } |
|
| 386 | 390 | |
| 387 | 391 | } catch (Exception $e) { |
| 388 | 392 | // not valid as namespace identifier, ignore |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Copyright (c) 2012-2013 Aalto University and University of Helsinki |
|
| 4 | - * MIT License |
|
| 5 | - * see LICENSE.txt for more information |
|
| 6 | - */ |
|
| 3 | + * Copyright (c) 2012-2013 Aalto University and University of Helsinki |
|
| 4 | + * MIT License |
|
| 5 | + * see LICENSE.txt for more information |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | /* Register text: namespace needed for jena-text queries */ |
| 9 | 9 | EasyRdf_Namespace::set('text', 'http://jena.apache.org/text#'); |
@@ -10,6 +10,9 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class VocabularyCategory extends DataObject |
| 12 | 12 | { |
| 13 | + /** |
|
| 14 | + * @param Model $model |
|
| 15 | + */ |
|
| 13 | 16 | public function __construct($model, $resource) |
| 14 | 17 | { |
| 15 | 18 | if (!($model instanceof Model)) { |