Skip to content
This repository
Browse code

fix more cs issues

  • Loading branch information...
commit 8aa53924cfb738f6897c8f092251c68e585949b9 1 parent 691439d
Sebastian Tramp authored September 17, 2012
40  extensions/navigation/NavigationHelper.php
@@ -19,8 +19,8 @@ class NavigationHelper extends OntoWiki_Component_Helper
19 19
     public static function getInstancesTriples($uri, $setup)
20 20
     {
21 21
         $searchVar = new Erfurt_Sparql_Query2_Var('resourceUri');
22  
-        $classVar = new Erfurt_Sparql_Query2_Var('classUri');
23  
-        $elements = array();
  22
+        $classVar  = new Erfurt_Sparql_Query2_Var('classUri');
  23
+        $elements  = array();
24 24
 
25 25
         // init union var
26 26
         $union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();
@@ -39,6 +39,7 @@ public static function getInstancesTriples($uri, $setup)
39 39
                 $union->addElement($ggp);
40 40
             }
41 41
         }
  42
+
42 43
         // parse config
43 44
         if (isset($setup->config->instanceRelation->out)) {
44 45
             foreach (self::a($setup->config->instanceRelation->out) as $rel) {
@@ -56,9 +57,10 @@ public static function getInstancesTriples($uri, $setup)
56 57
         }
57 58
         $elements[] = $union;
58 59
 
59  
-        $owApp = OntoWiki::getInstance();
  60
+        $owApp    = OntoWiki::getInstance();
60 61
         $modelIRI = (string)$owApp->selectedModel;
61  
-        $store = $owApp->erfurt->getStore();
  62
+        $store    = $owApp->erfurt->getStore();
  63
+
62 64
         // get all subclass of the super class
63 65
         $classes = array();
64 66
         if (isset($setup->config->hierarchyRelations->out)) {
@@ -73,9 +75,9 @@ public static function getInstancesTriples($uri, $setup)
73 75
         }
74 76
 
75 77
         // create filter for types
76  
-        $filter_type = array();
77  
-        $filterUris = array();
78  
-        $counted = array();
  78
+        $filterType = array();
  79
+        $filterUris  = array();
  80
+        $counted     = array();
79 81
         foreach ($classes as $class) {
80 82
             // get uri
81 83
             $uri = ($class['parent'] != '')?$class['parent']:$class['node'];
@@ -93,7 +95,7 @@ public static function getInstancesTriples($uri, $setup)
93 95
 
94 96
             $uriElem = new Erfurt_Sparql_Query2_IriRef($uri);
95 97
             $filterUris[] = $uriElem;
96  
-            $filter_type[] = new Erfurt_Sparql_Query2_sameTerm($classVar, $uriElem);
  98
+            $filterType[] = new Erfurt_Sparql_Query2_sameTerm($classVar, $uriElem);
97 99
 
98 100
             // add uri to counted
99 101
             $counted[] = $uri;
@@ -106,10 +108,10 @@ public static function getInstancesTriples($uri, $setup)
106 108
         } else { // sameTerm || sameTerm ... as supported by EfZendDb adapter
107 109
             // add filter
108 110
             $elements[] = new Erfurt_Sparql_Query2_Filter(
109  
-                new Erfurt_Sparql_Query2_ConditionalOrExpression($filter_type)
  111
+                new Erfurt_Sparql_Query2_ConditionalOrExpression($filterType)
110 112
             );
111 113
         }
112  
-        
  114
+
113 115
         return $elements;
114 116
     }
115 117
 
@@ -271,16 +273,16 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
271 273
                 //$mainUnion->addElement($unionSub);
272 274
                 if ($unionSub->size() > 0) $optional->addElement($unionSub);
273 275
                 $elements[] = $optional;
274  
-                
  276
+
275 277
                 // create filter for types
276  
-                $filter_type = array();
  278
+                $filterType = array();
277 279
                 $filterUris = array();
278 280
                 foreach (self::a($setup->config->hierarchyTypes) as $type) {
279 281
                     $uriElem = new Erfurt_Sparql_Query2_IriRef($type);
280 282
                     $filterUris[] = $uriElem;
281  
-                    $filter_type[] = new Erfurt_Sparql_Query2_sameTerm($classVar, $uriElem);
  283
+                    $filterType[] = new Erfurt_Sparql_Query2_sameTerm($classVar, $uriElem);
282 284
                 }
283  
-                
  285
+
284 286
                 $owApp = OntoWiki::getInstance();
285 287
                 $store = $owApp->erfurt->getStore();
286 288
                 if ($store->isInSyntaxSupported()) { // e.g. Virtuoso
@@ -290,7 +292,7 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
290 292
                 } else { // sameTerm || sameTerm ... as supported by EfZendDb adapter
291 293
                     // add filter
292 294
                     $elements[] = new Erfurt_Sparql_Query2_Filter(
293  
-                        new Erfurt_Sparql_Query2_ConditionalOrExpression($filter_type)
  295
+                        new Erfurt_Sparql_Query2_ConditionalOrExpression($filterType)
294 296
                     );
295 297
                 }
296 298
             } else {
@@ -347,7 +349,7 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
347 349
                     $ggp = new Erfurt_Sparql_Query2_GroupGraphPattern();
348 350
                     // add triplen
349 351
                     $ggp->addTriple(
350  
-                        $searchVar, 
  352
+                        $searchVar,
351 353
                         new Erfurt_Sparql_Query2_IriRef($rel), //EF_RDF_TYPE),
352 354
                         new Erfurt_Sparql_Query2_IriRef($setup->config->rootElement)
353 355
                     );
@@ -435,7 +437,7 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
435 437
             if ($backend == "zenddb") {
436 438
                 $queryUnion = new Erfurt_Sparql_Query2_OptionalGraphPattern();
437 439
             } else {
438  
-                $queryUnion = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern(); 
  440
+                $queryUnion = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();
439 441
             }
440 442
             if (isset($setup->config->hierarchyRelations->in)) {
441 443
                 if (count(self::a($setup->config->hierarchyRelations->in)) > 1) {
@@ -511,7 +513,6 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
511 513
                     $queryOptional->addElement($queryUnion);
512 514
                     $elements[] = $queryOptional;
513 515
                 }
514  
-                
515 516
 
516 517
                 $filter[] = new Erfurt_Sparql_Query2_Regex(
517 518
                     new Erfurt_Sparql_Query2_Str(new Erfurt_Sparql_Query2_Var('super')),
@@ -540,7 +541,8 @@ public static function getSearchTriples($setup, $forImplicit = false, $backend =
540 541
         return $elements;
541 542
     }
542 543
 
543  
-    protected static function a($a){
  544
+    protected static function a($a)
  545
+    {
544 546
         return OntoWiki_Extension_Manager::doapArrayFixer($a);
545 547
     }
546 548
 }
40  extensions/navigation/NavigationModule.php
@@ -11,22 +11,20 @@
11 11
  *
12 12
  * this is the main navigation module
13 13
  *
14  
- * @category   OntoWiki
15  
- * @package    Extensions_Navigation
16  
- * @author     Sebastian Dietzold <sebastian@dietzold.de>
17  
- * @copyright  Copyright (c) 2012, {@link http://aksw.org AKSW}
18  
- * @license    http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
  14
+ * @category OntoWiki
  15
+ * @package  Extensions_Navigation
  16
+ * @author   {@link http://sebastian.tramp.name Sebastian Tramp}
19 17
  */
20 18
 class NavigationModule extends OntoWiki_Module
21 19
 {
22 20
     protected $_session = null;
23 21
 
24  
-    public function init() 
  22
+    public function init()
25 23
     {
26 24
         $this->_session = $this->_owApp->session;
27 25
     }
28 26
 
29  
-    public function getTitle() 
  27
+    public function getTitle()
30 28
     {
31 29
         return "Navigation";
32 30
     }
@@ -37,13 +35,13 @@ public function getTitle()
37 35
      *
38 36
      * @return string
39 37
      */
40  
-    public function getMenu() 
  38
+    public function getMenu()
41 39
     {
42 40
         // check if menu must be shown
43 41
         if (!$this->_privateConfig->defaults->showMenu) {
44 42
             return new OntoWiki_Menu();
45 43
         }
46  
-		
  44
+
47 45
         // build main menu (out of sub menus below)
48 46
         $mainMenu = new OntoWiki_Menu();
49 47
 
@@ -100,11 +98,11 @@ public function getMenu()
100 98
 
101 99
         return $mainMenu;
102 100
     }
103  
-    
  101
+
104 102
     /**
105 103
      * Returns the content
106 104
      */
107  
-    public function getContents() 
  105
+    public function getContents()
108 106
     {
109 107
         // scripts and css only if module is visible
110 108
         $this->view->headScript()->appendFile($this->view->moduleUrl . 'navigation.js');
@@ -122,8 +120,8 @@ public function getContents()
122 120
                 'var navigationConfig = '.json_encode($this->_privateConfig->toArray()) . ';' .PHP_EOL
123 121
             );
124 122
         }
125  
-        
126  
-        $sessionKey = 'Navigation'.(isset($config->_session->identifier) ? $config->_session->identifier : '');        
  123
+
  124
+        $sessionKey = 'Navigation'.(isset($config->_session->identifier) ? $config->_session->identifier : '');
127 125
         $stateSession = new Zend_Session_Namespace($sessionKey);
128 126
         if (isset($stateSession) && ( $stateSession->model == (string)$this->_owApp->selectedModel)) {
129 127
             // load setup
@@ -138,17 +136,17 @@ public function getContents()
138 136
                 '$(document).ready(function() { navigationPrepareList(); } );'.PHP_EOL
139 137
             );
140 138
         }
141  
-        
  139
+
142 140
         // init view from scratch
143 141
         $this->view->inlineScript()->prependScript(
144 142
             '$(document).ready(function() { navigationEvent(\'init\'); } );'.PHP_EOL
145 143
         );
146 144
 
147 145
         $data['session'] = $this->_session->navigation;
148  
-        $content = $this->render('navigation', $data, 'data'); // 
  146
+        $content = $this->render('navigation', $data, 'data'); //
149 147
         return $content;
150 148
     }
151  
-	
  149
+
152 150
     public function shouldShow()
153 151
     {
154 152
         return isset($this->_owApp->selectedModel);
@@ -156,10 +154,9 @@ public function shouldShow()
156 154
 
157 155
     private function checkConfig($config)
158 156
     {
159  
-        $resVar = new Erfurt_Sparql_Query2_Var('resourceUri');
  157
+        $resVar  = new Erfurt_Sparql_Query2_Var('resourceUri');
160 158
         $typeVar = new Erfurt_Sparql_Query2_IriRef(EF_RDF_TYPE);
161  
-
162  
-        $query = new Erfurt_Sparql_Query2();
  159
+        $query   = new Erfurt_Sparql_Query2();
163 160
         $query->addProjectionVar($resVar)->setDistinct(true);
164 161
 
165 162
         $union = new Erfurt_Sparql_Query2_GroupOrUnionGraphPattern();
@@ -189,9 +186,8 @@ private function checkConfig($config)
189 186
         return count($allResults);
190 187
     }
191 188
 
192  
-    protected static function a($a){
  189
+    protected static function a($a)
  190
+    {
193 191
         return OntoWiki_Extension_Manager::doapArrayFixer($a);
194 192
     }
195 193
 }
196  
-
197  
-
7  extensions/navigation/navigation.phtml
@@ -8,7 +8,6 @@
8 8
 
9 9
 /**
10 10
  * OntoWiki navigation template
11  
- *
12 11
  */
13 12
 
14 13
 #var_dump($this->data);
@@ -25,9 +24,9 @@
25 24
         name="navigation-input"/>
26 25
 </form>
27 26
 <div id="navigation-content" class="width99 init-me-please">
28  
-<?php 
  27
+<?php
29 28
 if( isset($this->stateView) ){
30 29
     echo $this->stateView;
31  
-} 
32  
-?>    
  30
+}
  31
+?>
33 32
 </div>

0 notes on commit 8aa5392

Please sign in to comment.
Something went wrong with that request. Please try again.