Start building sql for pending query, list comp started
authorLaury GvR <laury@gaslightmedia.com>
Thu, 20 Sep 2018 15:32:33 +0000 (11:32 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 20 Sep 2018 15:32:33 +0000 (11:32 -0400)
models/admin/newDashboard/index.php
views/admin/newDashboard/components/list.html

index b351c7d..f2502fe 100644 (file)
@@ -197,6 +197,8 @@ class GlmMembersAdmin_newDashboard_index extends GlmDataMembers
                 $addons[$a['slug']]['slug'] = $a['slug'];
                 $addons[$a['slug']]['index'] = $a['index'];
                 $addons[$a['slug']]['widgetData'] = apply_filters($a['slug'] . "-dashboard-widget", "");
+
+                $addons[$a['slug']]['widgetData'] = $this->queryWidgetLists($addons[$a['slug']]['widgetData']);
                 
             } else {
                 echo "<br>" . $a['slug'] .  " has no filter called " . $a['slug'] . "-dashboard-widget";
@@ -205,6 +207,8 @@ class GlmMembersAdmin_newDashboard_index extends GlmDataMembers
             
         }
 
+        
+
 
         // Compile template data.
         $templateData = array(
@@ -233,4 +237,24 @@ class GlmMembersAdmin_newDashboard_index extends GlmDataMembers
 
     }
 
+    public function queryWidgetLists( &$widgetData = false ) {
+        foreach ( $widgetData as &$widgetComponent ) {
+            echo "<br>";
+            var_dump($widgetComponent);
+            if ( $widgetComponent['component'] == 'list' && isset($widgetComponent['fields']) && isset($widgetComponent['table']) ) {
+                
+                if ( isset($widgetComponent) ) {
+                    $where = $widgetComponent['where'];
+                } else {
+                    $where = ' TRUE ';
+                }
+                $sql = "'SELECT " . $widgetComponent['fields'] . " FROM " . $widgetComponent['table'] . " WHERE " . $where . "'";
+                $widgetComponent['extra'] = 'test';
+                $widgetComponent['sql'] = $sql;
+
+            }
+        }
+        return $widgetData;
+    }
+
 }
index e69de29..8689523 100644 (file)
@@ -0,0 +1,11 @@
+<br>List component was called
+<div class="{$widgetField}-list list-header"> {$widgetField.title} <a href="#">5</a> </div>
+<ul class="collection">
+{foreach $widgetField as $listFieldName => $listFieldData}
+    <li class="collection-item" style="line-height: 1;padding : 5px 15px;">
+        <a href="#">
+            {$listFieldName} - {$listFieldData}
+        </a>
+    </li>
+{/foreach}
+</ul>
\ No newline at end of file