tp TouchPointWP Meeting - TenthPres/TouchPoint-WP GitHub Wiki

tp\TouchPointWP\Meeting

Handle meeting content, particularly RSVPs.

Constants

POST_TYPE_WO_PRE

const POST_TYPE_WO_PRE = "meeting"

POST_TYPE

const POST_TYPE = \tp\TouchPointWP\TouchPointWP::HOOK_PREFIX . self::POST_TYPE_WO_PRE

MEETING_META_KEY

const MEETING_META_KEY = \tp\TouchPointWP\TouchPointWP::SETTINGS_PREFIX . "mtgId"

MEETING_START_META_KEY

const MEETING_START_META_KEY = \tp\TouchPointWP\TouchPointWP::SETTINGS_PREFIX . "mtgStartDt"

MEETING_END_META_KEY

const MEETING_END_META_KEY = \tp\TouchPointWP\TouchPointWP::SETTINGS_PREFIX . "mtgEndDt"

MEETING_FEAT_META_KEY

const MEETING_FEAT_META_KEY = \tp\TouchPointWP\TouchPointWP::SETTINGS_PREFIX . "mtgFeatured"

MEETING_STATUS_META_KEY

const MEETING_STATUS_META_KEY = \tp\TouchPointWP\TouchPointWP::SETTINGS_PREFIX . "status"

MEETING_INV_ID_META_KEY

const MEETING_INV_ID_META_KEY = \tp\TouchPointWP\TouchPointWP::SETTINGS_PREFIX . "mtgInvId"

STATUS_CANCELLED

const STATUS_CANCELLED = "cancelled"

STATUS_SCHEDULED

const STATUS_SCHEDULED = "scheduled"

STATUS_UNKNOWN

const STATUS_UNKNOWN = "unknown"

MEETING_LOCATION_META_KEY

const MEETING_LOCATION_META_KEY = \tp\TouchPointWP\TouchPointWP::SETTINGS_PREFIX . "locationName"

Properties

startDt

public mixed startDt = null
  • Visibility: public

endDt

public mixed endDt = null
  • Visibility: public

Methods

registerScriptsAndStyles

mixed tp\TouchPointWP\Meeting::registerScriptsAndStyles()

Register scripts and styles to be used on display pages.

  • Visibility: public
  • This method is static.

Returns

  • mixed

getTypeSettings

\tp\TouchPointWP\Involvement_PostTypeSettings tp\TouchPointWP\Meeting::getTypeSettings()

Get the PostTypeSettings object for Meeting Involvements.

  • Visibility: public
  • This method is static.

Returns

  • \tp\TouchPointWP\Involvement_PostTypeSettings -

fromPost

?\tp\TouchPointWP\PostTypeCapable tp\TouchPointWP\PostTypeCapable::fromPost(\WP_Post post)

Create relevant objects from a given post

Arguments

  • post WP_Post

Returns

  • ?\tp\TouchPointWP\PostTypeCapable -

involvementId

int tp\TouchPointWP\Meeting::involvementId()

Get the involvement ID (without necessarily instantiating the Involvement)

  • Visibility: public

Returns

  • int -

involvement

\tp\TouchPointWP\Involvement tp\TouchPointWP\Meeting::involvement()

Get the Involvement object associated with this Meeting.

  • Visibility: public

Returns

  • \tp\TouchPointWP\Involvement -

getParent

mixed tp\TouchPointWP\hierarchical::getParent()

Get the parent of this object which may be an object of a different class.

Returns null if there is no parent.

Returns

  • mixed -

scheduleString

?string tp\TouchPointWP\scheduled::scheduleString(int objId, mixed obj)

Get a description of the schedule in a human-friendly phrase, e.g. Sunday, March 31 at 2:00pm.

These strings should be cached.

Arguments

  • objId int* obj mixed - Needs to be of the type that implements this interface.

Returns

  • ?string -

scheduleStringArray

\tp\TouchPointWP\Utilities\StringableArray tp\TouchPointWP\Meeting::scheduleStringArray()

Get the human-readable schedule for the meeting as a string or set of strings in an array.

  • Visibility: public

Returns

  • \tp\TouchPointWP\Utilities\StringableArray -

notableAttributes

string[] tp\TouchPointWP\PostTypeCapable::notableAttributes(array exclude)

Get notable attributes.

Arguments

  • exclude array - Attributes listed here will be excluded. (e.g. if shown for a parent, not needed here.)

Returns

  • string[] -

getActionButtons

\tp\TouchPointWP\Utilities\StringableArray tp\TouchPointWP\PostTypeCapable::getActionButtons(string|null context, string btnClass, bool withTouchPointLink, bool absoluteLinks)

Arguments

  • context string|null - A string that gives filters some context for where the request is coming from
  • btnClass string - HTML class names to put into the buttons/links
  • withTouchPointLink bool - Whether to include a link to the item within TouchPoint.
  • absoluteLinks bool - Set true to make the links absolute, so they work from apps or emails.

Returns

  • \tp\TouchPointWP\Utilities\StringableArray -

isFeatured

mixed tp\TouchPointWP\Meeting::isFeatured()
  • Visibility: public

Returns

  • mixed

status

string tp\TouchPointWP\Meeting::status()

Get the status of the meeting, in a code-oriented name (for css, etc.)

  • Visibility: public

Returns

  • string -

status_i18n

string|null tp\TouchPointWP\Meeting::status_i18n(bool excludeScheduled)
  • Visibility: public

Arguments

  • excludeScheduled bool - "Scheduled" is the default (and correct) status for most events. Set this to true to return null instead of "Scheduled".

Returns

  • string|null -

filterThumbnailId

mixed tp\TouchPointWP\Meeting::filterThumbnailId(int|false thumbnail_id, int|\WP_Post|null post)

Filters the post thumbnail ID. Allows meetings to have the image of their parent without having an image themselves.

  • Visibility: public
  • This method is static.

Arguments

  • thumbnail_id int|false - Post thumbnail ID or false if the post does not exist.
  • post int|WP_Post|null - Post ID or WP_Post object. Default is global $post.

Returns

  • mixed

api

bool tp\TouchPointWP\api::api(array uri)

Handle API requests

Arguments

  • uri array - The request URI already parsed by parse_url()

Returns

  • bool - False if endpoint is not found. Should print the result.

getJsInstantiationString

string tp\TouchPointWP\Meeting::getJsInstantiationString()

Get the JS for instantiation.

  • Visibility: public
  • This method is abstract.
  • This method is static.

Returns

  • string -

getTouchPointId

int tp\TouchPointWP\PostTypeCapable::getTouchPointId()

Gets a TouchPoint item ID number, regardless of what type of object this is.

Returns

  • int -

getRsvpButton

string tp\TouchPointWP\Meeting::getRsvpButton(string btnClass)
  • Visibility: public

Arguments

  • btnClass string

Returns

  • string -

getRsvpLink

string tp\TouchPointWP\Meeting::getRsvpLink(string btnClass)

Get a link to RSVP for the meeting that can be used in emails, apps, or other contexts. This is a link to the RSVP function in WordPress, not an RSVP magic link used in TouchPoint emails.

  • Visibility: public

Arguments

  • btnClass string

Returns

  • string -

postIsType

bool tp\TouchPointWP\PostTypeCapable::postIsType(\WP_Post post)

Indicates if the given post can be instantiated as the given post type.

Arguments

  • post WP_Post

Returns

  • bool -

load

bool tp\TouchPointWP\module::load()

Loads the module and initializes the other actions.

Returns

  • bool -

init

mixed tp\TouchPointWP\Meeting::init()
  • Visibility: public
  • This method is static.

Returns

  • mixed

tense

string tp\TouchPointWP\Meeting::tense()

Indicate the tense of the meeting.

  • Visibility: public

Returns

  • string -

isMultiDay

bool tp\TouchPointWP\Meeting::isMultiDay()

Indicates if the meeting is multi-day.

  • Visibility: public

Returns

  • bool -

isAllDay

bool tp\TouchPointWP\Meeting::isAllDay()

Indicates if the meeting is labeled as all-day.

Currently, TouchPoint doesn't have the capacity for this.

TODO When TouchPoint supports an all-day marker, add it here. #184

  • Visibility: public

Returns

  • bool -

dateString

string tp\TouchPointWP\Meeting::dateString()

Get the date portion for the meeting start, formatted.

  • Visibility: public

Returns

  • string -

startTimeString

?string tp\TouchPointWP\Meeting::startTimeString()

Get the time portion for the meeting start, formatted.

  • Visibility: public

Returns

  • ?string -

endTimeString

?string tp\TouchPointWP\Meeting::endTimeString()

Get the time portion for the meeting end, formatted. Null if no end is defined or end is same as start.

  • Visibility: public

Returns

  • ?string -

hasGeo

bool tp\TouchPointWP\hasGeo::hasGeo()

Indicates whether a map of a single item can be displayed.

Returns

  • bool -

asGeoIFace

object|null tp\TouchPointWP\hasGeo::asGeoIFace(string type)

Returns a standardized stdObject, or null if not viable.

Return object properties are lat, lng, human, and type.

Arguments

  • type string - 'loc' for navigator location, or 'ip' for ip address location

Returns

  • object|null -

locationName

?string tp\TouchPointWP\hasGeo::locationName()

Get the name of the location.

Returns

  • ?string -

post_id

int tp\TouchPointWP\PostTypeCapable::post_id()

Get the Post_id.

Returns

  • int -

getPost

\WP_Post|null tp\TouchPointWP\storedAsPost::getPost(bool create)

Get the WP_Post object corresponding to the object.

Arguments

  • create bool - Set true if the post should be created if it doesn't exist. This would need to be implemented in each module, and is not implemented in most.

Returns

  • \WP_Post|null -

permalink

string tp\TouchPointWP\PostTypeCapable::permalink()

Get the link for the post.

Returns

  • string -

requireAllObjectsInJs

mixed tp\TouchPointWP\Meeting::requireAllObjectsInJs(bool require)

If all objects need to be included in the JS,

  • Visibility: public
  • This method is static.

Arguments

  • require bool - Whether all objects should be required. Almost always should be left with the default.

Returns

  • mixed

jsonSerialize

object tp\TouchPointWP\Meeting::jsonSerialize()

Get the JS for instantiation.

  • Visibility: public

Returns

  • object -