From 07d449d49cb6deeeeea18f1dcbaf58113ea9ade4 Mon Sep 17 00:00:00 2001
From: alangrafu <alvaro@graves.cl>
Date: Thu, 29 Sep 2011 22:50:01 -0700
Subject: [PATCH] Change syntax for templates

instead of {{r[.INNERFILE].value.VARIABLE}}

now it will be {{r[.INNERFILE].VARIABLE.value}}
---
 classes/Utils.php                 | 10 +++++-----
 views/default.view.html           | 16 ++++++++--------
 views/special.index.view.html     |  6 +++---
 views/special.instances.view.html |  2 +-
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/classes/Utils.php b/classes/Utils.php
index 9110b396..e8349e88 100644
--- a/classes/Utils.php
+++ b/classes/Utils.php
@@ -82,13 +82,13 @@ class Utils{
   	  	foreach($aux as $w){
   	  	  $row = array();
   	  	  foreach($w as $k => $v){
-  	  	  	$row['value'][$k] = $v['value'];
+  	  	  	$row[$k]['value'] = $v['value'];
   	  	  	if($v['type'] == 'uri'){
-  	  	  	  $row['curie'][$k] = Utils::uri2curie($v['value']);
-  	  	  	  $row['uri'][$k] = 1;
+  	  	  	  $row[$k]['curie'] = Utils::uri2curie($v['value']);
+  	  	  	  $row[$k]['uri'] = 1;
   	  	  	}elseif($v['type'] == 'bnode'){
-  	  	  	  $row['curie'][$k] = 'blankNode';
-  	  	  	}
+  	  	  	  $row[$k]['curie'] = 'blankNode';
+  	  	  	}  	  	  	
   	  	  }
   	  	  /*if(sizeof($aux) == 1){
   	  	  $obj = $row;
diff --git a/views/default.view.html b/views/default.view.html
index df6c224d..93b1b95d 100644
--- a/views/default.view.html
+++ b/views/default.view.html
@@ -14,14 +14,14 @@
     <table> 
     {% for row in r %}
 
-      {% if row.value.s1 != null %}
+      {% if row.s1.value != null %}
       <tr>
-        <td><a href='{{ row.value.s1 }}'>{{row.curie.s1}}</a></td>
+        <td><a href='{{ row.s1.value }}'>{{row.s1.curie}}</a></td>
     
-        {% if row.uri.p1 == 1 %}
-        <td><a rel='{{row.curie.s1}}' href='{{row.value.p1}}'>{{row.curie.p1}}</a></td>
+        {% if row.p1.uri == 1 %}
+        <td><a rel='{{row.s1.curie}}' href='{{row.p1.value}}'>{{row.p1.curie}}</a></td>
         {% else %}
-        <td><span property='{{row.curie.s1}}'>{{row.value.p1}}</span></td>
+        <td><span property='{{row.s1.curie}}'>{{row.p1.value}}</span></td>
         {% endif %}
      
         </tr>
@@ -32,10 +32,10 @@
     <h2>Information pointing to {{base.this.curie}}</h2>
     <table> 
     {% for row in r %}
-      {% if row.value.p2 != null %}
+      {% if row.p2.value != null %}
     <tr>
-        <td><a href='{{row.value.s2 }}'>{{ row.curie.s2 }}</a></td>
-        <td><a rev='{{row.value.s2}}' href='{{row.value.p2}}'>{{row.curie.p2}}</a></td>
+        <td><a href='{{row.s2.value}}'>{{ row.s2.curie}}</a></td>
+        <td><a rev='{{row.s2.value}}' href='{{row.p2.value}}'>{{row.p2.curie}}</a></td>
     </tr>
     {%endif %}
     {% endfor %}
diff --git a/views/special.index.view.html b/views/special.index.view.html
index 19eb8a36..9b1b67d6 100644
--- a/views/special.index.view.html
+++ b/views/special.index.view.html
@@ -12,11 +12,11 @@
 	<ul>
 	{% if r.value.resource != null %}
 	    <!-- Only one class available -->
-        <li><a href='{{base.baseUrl}}special/instances/{{ r.curie.resource }}'>{{r.curie.resource}}</a></li>
+        <li><a href='{{base.baseUrl}}special/instances/{{ r.resource.curie }}'>{{r.resource.curie}}</a></li>
     {% endif %}
     {% for row in r %}
-      {% if row.value.resource %}
-        <li><a href='{{base.baseUrl}}special/instances/{{ row.curie.resource }}'>{{row.curie.resource}}</a></li>
+      {% if row.resource.value %}
+        <li><a href='{{base.baseUrl}}special/instances/{{ row.resource.curie }}'>{{row.resource.curie}}</a></li>
       {% endif %}
     {% endfor %}
     </ul>
diff --git a/views/special.instances.view.html b/views/special.instances.view.html
index 11f5bdba..3a8247c1 100644
--- a/views/special.instances.view.html
+++ b/views/special.instances.view.html
@@ -11,7 +11,7 @@
     <h1>Instances of {{base.args.arg0}}</h1>
 	<ul>
 	{% for row in r %}
-        <li><a href='{{ row.value.resource }}'>{{row.curie.resource}}</a></li>
+        <li><a href='{{ row.resource.value }}'>{{row.resource.curie}}</a></li>
         {% endfor %}
     </ul>
   </body>
-- 
GitLab