Added mostly valid data passed into the filter used for the dashboard widget display
authorLaury GvR <laury@gaslightmedia.com>
Wed, 19 Sep 2018 17:06:41 +0000 (13:06 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 19 Sep 2018 17:06:41 +0000 (13:06 -0400)
setup/adminHooks.php

index 8766786..38a3022 100644 (file)
@@ -46,8 +46,59 @@ add_filter('glm-member-db-admin-management-hooksHelp', function($content) {
 add_filter(
     GLM_MEMBERS_PACKAGING_PLUGIN_SLUG .'-dashboard-widget',
     function ( $member = null ) {
-        $content = GLM_MEMBERS_PACKAGING_PLUGIN_SLUG;
-        return $content;
+        //$content = GLM_MEMBERS_PACKAGING_PLUGIN_SLUG;
+        $content = [
+            'buttons' => [
+                'order' => -1,
+                'type' => 'button',
+                'Add Package' => '#',
+            ],
+            'quicklinks' => [
+                'order' => 0,
+                'type' => 'quicklinks',
+                'Dashboard' => '#db',
+                'Advanced Search' => '#as',
+                'Settings' => '#st',
+            ],
+            'entity_amount' => [
+                'order' => 1,
+                'type' => 'entity_amount',
+                'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages",
+            ],
+            'search' => [
+                'order' => 2,
+                'type' => 'textsearch',
+                'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages",
+                'fields' => [
+                    'id',
+                    'name',
+                ]
+            ],
+            'pending' => [
+                'order' => 3,
+                'type' => 'list',
+                'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages",
+                'fields' => [
+                    'id',
+                    'name',
+                ],
+                'where' => 'status = '.$this->config['status_numb']['Pending']
+            ],
+            'expired' => [
+                'order' => 4,
+                'type' => 'list',
+                'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages",
+                'fields' => [
+                    'id',
+                    'name',
+                ],
+                //'where' => 'status = '.$this->config['status_numb']['Expired']
+            ]
+        ];
+
+         return $content;
+        
+
     },
     13,
     1