Fixed a minor problem with the shortcode builder where it was causing an undefined parameter error.
// use the addOn slugs to access each of the shortcodes
foreach($addOnSlugs as $addOn){
- if ($this->config['addOns'][$addOn]['shortcodes']) {
- $shortCodeList[] = $this->config['addOns'][$addOn]['shortcodes'];
+
+ // Check if the add-on has shortcodes
+ if (isset($this->config['addOns'][$addOn]['shortcodes'])) {
+
+ // It does, so add them to the list
+ if ($this->config['addOns'][$addOn]['shortcodes']) {
+ $shortCodeList[] = $this->config['addOns'][$addOn]['shortcodes'];
+ }
}
}
// Get various pieces of the URL
$urlParts = parse_url(get_bloginfo('url'));
$pageUri = explode('?', $_SERVER['REQUEST_URI']); // Bust this up to access URL path and script name only
-
$WPUploadDir = wp_upload_dir();
// URLs
+define('GLM_MEMBERS_HOSTNAME', $urlParts['host']);
define('GLM_MEMBERS_SITE_BASE_URL', home_url('/') );
define('GLM_MEMBERS_PLUGIN_URL', plugin_dir_url(__FILE__));
define('GLM_MEMBERS_PLUGIN_ADMIN_URL', admin_url('admin.php'));
* @version 0.1
*/
+/*
+ * Adding content to the GLM Associate Dashboard Widget from an Add-on.
+ *
+ * There are three filters in the GLM Associate Dashboard Widget view for adding content into the widget.
+ * These include short warnings, lists of pending user actions, and other notices.
+ *
+ * See "Management" -> "Hooks" then scan down to "Main Dashboard Widget Hooks".
+ *
+ * Here's the best method for providing content to the dashboard widget. There is an example of this in the search add-on.
+ *
+ * 1. Create a Model/View to build additional content for the dashboard widget
+ * a. Add a model for generating the warning/notice to the add-on in, for example, "models/admin/dashboardWidget/search/"
+ * b. Add a view for this model to the add-on in, for example, "views/admin/dashboardWidget/search/"
+ * (see Main Dashboard Widget Hooks descriptions for suggested format)
+ * c. Add the model to "setup/validActions.php" in the add-on
+ *
+ * 2. Place an add_filter() function in the add-on's "setup/adminHooks.php" file, for example...
+ *
+ * // Add content to the main dashboard widget
+ * add_filter( 'glm-member-db-dashboard-widget-warnings', function( $content ) {
+ * $content .= $this->controller('dashboardWidget', 'search');
+ * return $content;
+ * });
+ */
+
// Load Members data abstract
require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMembers.php');
'glm_members_main_menu',
'glm-members-admin-menu-members',
function() {},
- false,
+ GLM_MEMBERS_PLUGIN_ASSETS_URL.'/flame.png',
'3.100'
);
<!-- Hooks Help from glm-member-db Plugin -->
- <tr><td colspan="3" class="glm-notice"><p>Main Member DB Plugin</p></td></tr>
+ <tr><td colspan="3" class="glm-notice"><p><h1>Main Member DB Plugin</h1></p></td></tr>
- <tr><th colspan="3">Add-On Registration Hooks</td></tr>
+ <tr><th colspan="3"><h2>Add-On Registration Hooks</h2></td></tr>
<tr>
<td>glm-member-db-register-addon</td>
<td>Filter</td>
</td>
</tr>
- <tr><th colspan="3">User Permission Hooks</td></tr>
+ <tr><th colspan="3"><h2>User Permission Hooks</h2></td></tr>
<tr>
<td>glm_members_current_logged_in_user</td>
</td>
</tr>
- <tr><th colspan="3">Front-End Output Hooks - Member List Page</td></tr>
+ <tr><th colspan="3"><h2>Front-End Output Hooks - Member List Page</h2></td></tr>
<tr>
<td>glm-member-db-front-members-list-pageTop</td>
</td>
</tr>
- <tr><th colspan="3">Front-End Output Hooks - Member Detail Page</td></tr>
+ <tr><th colspan="3"><h2>Front-End Output Hooks - Member Detail Page</h2></td></tr>
<tr>
<td>glm-member-db-front-members-detail-pageTop</td>
</td>
</tr>
+ <tr><th colspan="3"><h2>Main Dashboard Widget Hooks</h2></td></tr>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ <tr>
+ <td>glm-member-db-dashboard-widget-warnings</td>
+ <td>Filter</td>
+ <td></td>
+ <td>
+ Permits adding critical warnings to the main dashboard GLM Associate widget. Be
+ sure to add content to the end of the string passed along by this filter.
+ <p>
+ Use the following format.
+ <div class="glm-code">
+<h4><span class="glm-error">[Warning Title]</span></h4>
+[warning content]
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td>glm-member-db-dashboard-widget-pendingaction</td>
+ <td>Filter</td>
+ <td></td>
+ <td>
+ Place a list with a title in main dashboard GLM Associate widget. Be
+ sure to add content to the end of the string passed along by this filter.
+ This filter is primarily for placing lists of items that are pending
+ user action.
+ <p>
+ Use the following format.
+ <div class="glm-code">
+<h4><span class="glm-error">[Title for this list]</span></h4>
+<table class="wp-list-table striped glm-admin-table">
+ <tbody>
+[template loop code]
+ <tr>
+ [list entry content including TH and TD tags as desired]
+ </tr>
+[end of template loop code]
+ </tbody>
+</table>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td>glm-member-db-dashboard-widget-othernotices</td>
+ <td>Filter</td>
+ <td></td>
+ <td>
+ Place a list with a title in main dashboard GLM Associate widget. Be
+ sure to add content to the end of the string passed along by this filter.
+ This filter is for adding any other type of information to the dashboard
+ widget.
+ <p>
+ Use the following format.
+ <div class="glm-code">
+<h4><span class="glm-warning">[Notice Title]</span></h4>
+[notice content]
+ </div>
+ </td>
+ </tr>
\ No newline at end of file
</table>
{/if}
+<!-- Critical warnings may be inserted here by other add-ons -->
+{apply_filters('glm-member-db-dashboard-widget-warnings', '')}
+
{if apply_filters('glm_members_permit_admin_widget_warnings', true)}
- {if !$haveMemberTypes || !$haveCategories || !$haveAmenities || !$haveCities || !$haveRegions || $numbMembers == 0}
- <h4><span class="glm-error">Pending {$terms.term_member_cap} Information</span></h4>
<table class="wp-list-table striped glm-admin-table">
+ {if !$haveMemberTypes || !$haveCategories || !$haveAmenities || !$haveCities || !$haveRegions || $numbMembers == 0}
+ <tr><th colspan="2"><h4><span class="glm-error">Pending {$terms.term_member_cap} Information</span></h4></th></tr>
{if !$haveMemberTypes}
<tr>
<th class="glm-error">No {$terms.term_member_cap} Types</th>
<td><a href="{$adminUrl}?page=glm-members-admin-menu-member&glm_action=index&member_id=" class="glm-right">Add a {$terms.term_member_cap}</a></td>
</tr>
{/if}
- </table>
{/if}
+ </table>
{if $haveBadLatLon}
<h4><span class="glm-error">Records with Bad Map Locations</span></h4>
</tbody>
</table>
{/if}
+ <!-- Notices with lists for items pending user action -->
+ {apply_filters('glm-member-db-dashboard-widget-noticewithlist', '')}
{/if}
-{apply_filters('glm-member-db-dashboard-widget-notices', '')}
+{apply_filters('glm-member-db-dashboard-widget-othernotices', '')}