MKP Base Core Concepts

Core Concepts

The MKP_Base plugin is based on several core concepts. Understanding these concepts will make using this shortcode handler much easier.

Object Types

This plugin implements a collection of classes that work together to provide power, extensibility and simplicity:

    • MKP_Base provides a large collection of services which are called upon by the other classes. These services include:
      • Generation of diagnostic messages which are written to a text log file
      • Generation of notification messages which appear as popups on the screen
      • Parsing and validating shortcodes
    • The AJAX Handler class extends MKP_Base and manages AJAX calls from the front end
    • The Location Manager also extends MKP_Base and provides functions that convert address information into latitude and longitude.
    • The Data Loader class:
      • Loads the Contacts, Communities and I-Group classes when a shortcode is invoked that uses that code
      • Pulls XML Data from MKP Connect
      • Filters that data according to requests from the other classes
    • The Contact class displays contact lists for regions, areas and communities
    • The Communities class displays community information for regions, areas and communities
    • The I-Group class displays I-Group lists and maps for regions, areas and communities

These classes are shown visually in this diagram:
Each shortcode must begin with the name of the class it is expressing. For example, to display an I-Group map, you must use the mkp_igroups object:

mkp_igroups community=”Puget Sound” map

where mkp_igroups is the object, community=”Puget Sound” is a modifier and map is the action.

Output:

[mkp_igroups community=”Puget Sound” map]

Options:

Options define behavioral values that persist across page turns. For example, if the “verbose” option is set to true, extensive diagnostic information will be written to the corresponding log file on the current and on all subsequent pages. Options are set with the shortcode:

mkp_base option=verbose+true set_option show_options

Output:

[mkp_base option=verbose+true set_option show_options]

Actions & Modifiers

The remainder of each shortcode is a list of modifiers followed by the action they modify. For example, to display a notification message, you would use the message=”contents of the message” type=NOTIFICATION_TYPE_CONFIRMATION sticky=false modifiers followed by the notify action:

mkp_base message=”This is a notification message” type=NOTIFICATION_TYPE_CONFIRMATION sticky=true notify

[mkp_base message=”This is a notification message” type=NOTIFICATION_TYPE_CONFIRMATION sticky=true notify]

Output:

Note that the text of the message does not appear on the page, but it does (or at least should) appear as a popup message in the bottom right corner of the screen.

mkp_base shortcodes <– display shortcodes supported by the MKP Base class

[mkp_base shortcodes]