From c8ad7bedcd3e1a2c8c9a2c629b8742eae79e6523 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 20 Sep 2018 11:35:48 -0400 Subject: [PATCH] URLs for links passed into filter, send usable data for textSearch and list queries --- setup/adminHooks.php | 58 ++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 3b76050..3566ac4 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -43,40 +43,36 @@ add_filter('glm-member-db-admin-management-hooksHelp', function($content) { 10, 2 ); + add_filter( GLM_MEMBERS_PACKAGING_PLUGIN_SLUG .'-dashboard-widget', function ( $member = null ) { - //$content = GLM_MEMBERS_PACKAGING_PLUGIN_SLUG; + $packagingIndexPage = GLM_MEMBERS_PACKAGING_PLUGIN_ADMIN_URL . '?page=glm-members-admin-menu-packaging-index&glm_action=index'; + $packagesTable = GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX . "packages"; $content = [ 'title' => 'Packaging', 'buttons' => [ 'order' => -1, - 'type' => 'buttons', + 'component' => 'buttons', 'buttons' => [ 'add-package' => [ 'content' => 'Add Package', - 'url' => '#AP', + 'url' => $packagingIndexPage . "&option=add", 'classes' => '', ], - 'second-button' => [ - 'content' => 'Do Other Stuff', - 'url' => '#DOS', - 'classes' => '', - 'styles' => 'top: 50px;', - ] ], ], 'quickLinks' => [ 'order' => 0, - 'type' => 'quickLinks', + 'component' => 'quickLinks', 'quickLinks' => [ 'dashboard' => [ 'content' => 'Dashboard', - 'url' => '#dbd', + 'url' => $packagingIndexPage . "&option=dashboard", ], 'search' => [ 'content' => 'Advanced Search', - 'url' => '#DOS', + 'url' => $packagingIndexPage . "&option=search", ], 'settings' => [ 'content' => 'Settings', @@ -86,13 +82,14 @@ add_filter( ], 'entityAmount' => [ 'order' => 1, - 'type' => 'entityAmount', - 'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages", + 'component' => 'entityAmount', + 'table' => $packagesTable, + 'url' => $packagingIndexPage . "&option=search", ], 'textSearch' => [ 'order' => 2, - 'type' => 'textSearch', - 'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages", + 'component' => 'textSearch', + 'table' => $packagesTable, 'fields' => [ 'id', 'title', @@ -101,23 +98,26 @@ add_filter( ] ], 'pending' => [ + 'title' => "Pending Packages", + 'slug' => "pending-packages", 'order' => 3, - 'type' => 'list', - 'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages", - 'fields' => [ - 'id', - 'title', - ], - 'where' => 'status = '.$this->config['status_numb']['Pending'] + 'component' => 'list', + 'table' => $packagesTable, + 'fields' => "id, title, ref_dest", + 'where' => 'status = '.$this->config['status_numb']['Pending'], ], 'expired' => [ + 'title' => "Expired Packages", + 'slug' => "expired-packages", 'order' => 4, - 'type' => 'list', - 'table' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."packages", - 'fields' => [ - 'id', - 'title', - ], + 'component' => 'list', + 'table' => $packagesTable, + 'fields' => "id, title, ref_dest", + // 'fields' => [ + // 'id', + // 'title', + // 'ref_dest', + // ], //'where' => 'status = '.$this->config['status_numb']['Expired'] ] ]; -- 2.17.1