Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix more cs issues

  • Loading branch information...
commit 8aa53924cfb738f6897c8f092251c68e585949b9 1 parent 691439d
@seebi seebi authored
View
40 extensions/navigation/NavigationHelper.php
@@ -19,8 +19,8 @@ class NavigationHelper extends OntoWiki_Component_Helper
public static function getInstancesTriples($uri, $setup)
{
$searchVar = new Erfurt_Sparql_Query2_Var('resourceUri');
- $classVar = new Erfurt_Sparql_Query2_Var('classUri');
- $elements = array();
+ $classVar = new Erfurt_Sparql_Query2_Var('classUri');
+ $elements = array();
// init union var
$union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();
@@ -39,6 +39,7 @@ public static function getInstancesTriples($uri, $setup)
$union->addElement($ggp);
}
}
+
// parse config
if (isset($setup->config->instanceRelation->out)) {
foreach (self::a($setup->config->instanceRelation->out) as $rel) {
@@ -56,9 +57,10 @@ public static function getInstancesTriples($uri, $setup)
}
$elements[] = $union;
- $owApp = OntoWiki::getInstance();
+ $owApp = OntoWiki::getInstance();
$modelIRI = (string)$owApp->selectedModel;
- $store = $owApp->erfurt->getStore();
+ $store = $owApp->erfurt->getStore();
+
// get all subclass of the super class
$classes = array();
if (isset($setup->config->hierarchyRelations->out)) {
@@ -73,9 +75,9 @@ public static function getInstancesTriples($uri, $setup)
}
// create filter for types
- $filter_type = array();
- $filterUris = array();
- $counted = array();
+ $filterType = array();
+ $filterUris = array();
+ $counted = array();
foreach ($classes as $class) {
// get uri
$uri = ($class['parent'] != '')?$class['parent']:$class['node'];
@@ -93,7 +95,7 @@ public static function getInstancesTriples($uri, $setup)
$uriElem = new Erfurt_Sparql_Query2_IriRef($uri);
$filterUris[] = $uriElem;
- $filter_type[] = new Erfurt_Sparql_Query2_sameTerm($classVar, $uriElem);
+ $filterType[] = new Erfurt_Sparql_Query2_sameTerm($classVar, $uriElem);
// add uri to counted
$counted[] = $uri;
@@ -106,10 +108,10 @@ public static function getInstancesTriples($uri, $setup)
} else { // sameTerm || sameTerm ... as supported by EfZendDb adapter
// add filter
$elements[] = new Erfurt_Sparql_Query2_Filter(
- new Erfurt_Sparql_Query2_ConditionalOrExpression($filter_type)
+ new Erfurt_Sparql_Query2_ConditionalOrExpression($filterType)
);
}
-
+
return $elements;
}
@@ -271,16 +273,16 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
//$mainUnion->addElement($unionSub);
if ($unionSub->size() > 0) $optional->addElement($unionSub);
$elements[] = $optional;
-
+
// create filter for types
- $filter_type = array();
+ $filterType = array();
$filterUris = array();
foreach (self::a($setup->config->hierarchyTypes) as $type) {
$uriElem = new Erfurt_Sparql_Query2_IriRef($type);
$filterUris[] = $uriElem;
- $filter_type[] = new Erfurt_Sparql_Query2_sameTerm($classVar, $uriElem);
+ $filterType[] = new Erfurt_Sparql_Query2_sameTerm($classVar, $uriElem);
}
-
+
$owApp = OntoWiki::getInstance();
$store = $owApp->erfurt->getStore();
if ($store->isInSyntaxSupported()) { // e.g. Virtuoso
@@ -290,7 +292,7 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
} else { // sameTerm || sameTerm ... as supported by EfZendDb adapter
// add filter
$elements[] = new Erfurt_Sparql_Query2_Filter(
- new Erfurt_Sparql_Query2_ConditionalOrExpression($filter_type)
+ new Erfurt_Sparql_Query2_ConditionalOrExpression($filterType)
);
}
} else {
@@ -347,7 +349,7 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
$ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();
// add triplen
$ggp->addTriple(
- $searchVar,
+ $searchVar,
new Erfurt_Sparql_Query2_IriRef($rel), //EF_RDF_TYPE),
new Erfurt_Sparql_Query2_IriRef($setup->config->rootElement)
);
@@ -435,7 +437,7 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
if ($backend == "zenddb") {
$queryUnion = new Erfurt_Sparql_Query2_OptionalGraphPattern();
} else {
- $queryUnion = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();
+ $queryUnion = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();
}
if (isset($setup->config->hierarchyRelations->in)) {
if (count(self::a($setup->config->hierarchyRelations->in)) > 1) {
@@ -511,7 +513,6 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
$queryOptional->addElement($queryUnion);
$elements[] = $queryOptional;
}
-
$filter[] = new Erfurt_Sparql_Query2_Regex(
new Erfurt_Sparql_Query2_Str(new Erfurt_Sparql_Query2_Var('super')),
@@ -540,7 +541,8 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
return $elements;
}
- protected static function a($a){
+ protected static function a($a)
+ {
return OntoWiki_Extension_Manager::doapArrayFixer($a);
}
}
View
40 extensions/navigation/NavigationModule.php
@@ -11,22 +11,20 @@
*
* this is the main navigation module
*
- * @category OntoWiki
- * @package Extensions_Navigation
- * @author Sebastian Dietzold <sebastian@dietzold.de>
- * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}
- * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
+ * @category OntoWiki
+ * @package Extensions_Navigation
+ * @author {@link http://sebastian.tramp.name Sebastian Tramp}
*/
class NavigationModule extends OntoWiki_Module
{
protected $_session = null;
- public function init()
+ public function init()
{
$this->_session = $this->_owApp->session;
}
- public function getTitle()
+ public function getTitle()
{
return "Navigation";
}
@@ -37,13 +35,13 @@ public function getTitle()
*
* @return string
*/
- public function getMenu()
+ public function getMenu()
{
// check if menu must be shown
if (!$this->_privateConfig->defaults->showMenu) {
return new OntoWiki_Menu();
}
-
+
// build main menu (out of sub menus below)
$mainMenu = new OntoWiki_Menu();
@@ -100,11 +98,11 @@ public function getMenu()
return $mainMenu;
}
-
+
/**
* Returns the content
*/
- public function getContents()
+ public function getContents()
{
// scripts and css only if module is visible
$this->view->headScript()->appendFile($this->view->moduleUrl . 'navigation.js');
@@ -122,8 +120,8 @@ public function getContents()
'var navigationConfig = '.json_encode($this->_privateConfig->toArray()) . ';' .PHP_EOL
);
}
-
- $sessionKey = 'Navigation'.(isset($config->_session->identifier) ? $config->_session->identifier : '');
+
+ $sessionKey = 'Navigation'.(isset($config->_session->identifier) ? $config->_session->identifier : '');
$stateSession = new Zend_Session_Namespace($sessionKey);
if (isset($stateSession) && ( $stateSession->model == (string)$this->_owApp->selectedModel)) {
// load setup
@@ -138,17 +136,17 @@ public function getContents()
'$(document).ready(function() { navigationPrepareList(); } );'.PHP_EOL
);
}
-
+
// init view from scratch
$this->view->inlineScript()->prependScript(
'$(document).ready(function() { navigationEvent(\'init\'); } );'.PHP_EOL
);
$data['session'] = $this->_session->navigation;
- $content = $this->render('navigation', $data, 'data'); //
+ $content = $this->render('navigation', $data, 'data'); //
return $content;
}
-
+
public function shouldShow()
{
return isset($this->_owApp->selectedModel);
@@ -156,10 +154,9 @@ public function shouldShow()
private function checkConfig($config)
{
- $resVar = new Erfurt_Sparql_Query2_Var('resourceUri');
+ $resVar = new Erfurt_Sparql_Query2_Var('resourceUri');
$typeVar = new Erfurt_Sparql_Query2_IriRef(EF_RDF_TYPE);
-
- $query = new Erfurt_Sparql_Query2();
+ $query = new Erfurt_Sparql_Query2();
$query->addProjectionVar($resVar)->setDistinct(true);
$union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();
@@ -189,9 +186,8 @@ private function checkConfig($config)
return count($allResults);
}
- protected static function a($a){
+ protected static function a($a)
+ {
return OntoWiki_Extension_Manager::doapArrayFixer($a);
}
}
-
-
View
7 extensions/navigation/navigation.phtml
@@ -8,7 +8,6 @@
/**
* OntoWiki navigation template
- *
*/
#var_dump($this->data);
@@ -25,9 +24,9 @@
name="navigation-input"/>
</form>
<div id="navigation-content" class="width99 init-me-please">
-<?php
+<?php
if( isset($this->stateView) ){
echo $this->stateView;
-}
-?>
+}
+?>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.