From: Laury GvR Date: Thu, 20 Sep 2018 20:46:08 +0000 (-0400) Subject: Nest all components of the filter into a components hierarchy X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=5ea3a0cc11f7ed498b4a020546581732f74bd6f0;p=WP-Plugins%2Fglm-member-db-packaging.git Nest all components of the filter into a components hierarchy --- diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 937cfdf..ff2e0c7 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -50,88 +50,96 @@ add_filter( $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"; $packagingEditPage = GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE.'member&glm_action=packaging&option=edit'; + + /* + * For list components: pass ref_type and ref_dest as part of the 'fields' string if you want to + * make these options part of the href of each
  • link + * + */ + $content = [ 'title' => 'Packaging', - 'buttons' => [ - 'order' => -1, - 'component' => 'buttons', + 'components' => [ 'buttons' => [ - 'add-package' => [ - 'content' => 'Add Package', - 'url' => $packagingIndexPage . "&option=add", - 'classes' => '', + 'order' => -1, + 'template' => 'buttons', + 'buttons' => [ + 'add-package' => [ + 'content' => 'Add Package', + 'url' => $packagingIndexPage . "&option=add", + 'classes' => '', + ], ], ], - ], - 'quickLinks' => [ - 'order' => 0, - 'component' => 'quickLinks', 'quickLinks' => [ - 'dashboard' => [ - 'content' => 'Dashboard', - 'url' => $packagingIndexPage . "&option=dashboard", + 'order' => 0, + 'template' => 'quickLinks', + 'quickLinks' => [ + 'dashboard' => [ + 'content' => 'Dashboard', + 'url' => $packagingIndexPage . "&option=dashboard", + ], + 'search' => [ + 'content' => 'Advanced Search', + 'url' => $packagingIndexPage . "&option=search", + ], + 'settings' => [ + 'content' => 'Settings', + 'url' => '#set', + ] ], - 'search' => [ - 'content' => 'Advanced Search', - 'url' => $packagingIndexPage . "&option=search", - ], - 'settings' => [ - 'content' => 'Settings', - 'url' => '#set', - ] ], - ], - 'entityAmount' => [ - 'order' => 1, - 'component' => 'entityAmount', - 'table' => $packagesTable, - 'url' => $packagingIndexPage . "&option=search", - ], - 'textSearch' => [ - 'order' => 2, - 'component' => 'textSearch', - 'entityID' => 'packageID', - 'table' => $packagesTable, - 'fields' => "id, title as name, image, ref_dest", - 'where' => 'title', - 'resultUrl' => $packagingEditPage, - ], - 'active' => [ - 'title' => "Active Packages", - 'slug' => "active-packages", - 'order' => 3, - 'component' => 'list', - 'entityID' => 'packageID', - 'table' => $packagesTable, - 'fields' => "id, title, ref_type, ref_dest", - 'where' => 'status='.$this->config['status_numb']['Active'], - 'resultUrl' => $packagingEditPage, - ], - 'pending' => [ - 'title' => "Pending Packages", - 'slug' => "pending-packages", - 'order' => 3, - 'component' => 'list', - 'entityID' => 'packageID', - 'table' => $packagesTable, - 'fields' => "id, title, ref_type, ref_dest", - 'where' => 'status='.$this->config['status_numb']['Pending'], - 'resultUrl' => $packagingEditPage, - ], - 'expired' => [ - 'title' => "Expired Packages", - 'slug' => "expired-packages", - 'order' => 4, - 'component' => 'list', - 'entityID' => 'packageID', - 'table' => $packagesTable, - 'fields' => "id, title, ref_type, ref_dest", - // 'fields' => [ - // 'id', - // 'title', - // 'ref_dest', - // ], - //'where' => 'status = '.$this->config['status_numb']['Expired'] + 'entityAmount' => [ + 'order' => 1, + 'template' => 'entityAmount', + 'table' => $packagesTable, + 'url' => $packagingIndexPage . "&option=search", + ], + 'textSearch' => [ + 'order' => 2, + 'template' => 'textSearch', + 'entityID' => 'packageID', + 'table' => $packagesTable, + 'fields' => "id, title as name, image", + 'resultUrl' => $packagingEditPage, + ], + 'active' => [ + 'title' => "Active Packages", + 'slug' => "active-packages", + 'order' => 5, + 'template' => 'list', + 'entityID' => 'packageID', + 'table' => $packagesTable, + 'fields' => "id, title, ref_type, ref_dest", + 'where' => 'status='.$this->config['status_numb']['Active'], + 'resultUrl' => $packagingEditPage, + ], + 'pending' => [ + 'title' => "Pending Packages", + 'slug' => "pending-packages", + 'order' => 4, + 'template' => 'list', + 'entityID' => 'packageID', + 'table' => $packagesTable, + 'fields' => "id, title, ref_type, ref_dest", + 'where' => 'status='.$this->config['status_numb']['Pending'], + 'resultUrl' => $packagingEditPage, + ], + 'expired' => [ + 'title' => "Expired Packages", + 'slug' => "expired-packages", + 'order' => 3, + 'template' => 'list', + 'entityID' => 'packageID', + 'table' => $packagesTable, + 'fields' => "id, title, ref_type, ref_dest", + // 'fields' => [ + // 'id', + // 'title', + // 'ref_dest', + // ], + //'where' => 'status = '.$this->config['status_numb']['Expired'] + ], ] ];