SocialComponent
extends Component
in package
implements
CrawlConstants
Provides activities to AdminController related to creating, updating blogs (and blog entries), static web pages, and crawl mixes.
Tags
Interfaces, Classes, Traits and Enums
- CrawlConstants
- Shared constants and enums used by components that are involved in the crawling process
Table of Contents
- RECOMMENDATION_FILE = \seekquarry\yioop\configs\APP_DIR . "/resources/recommendation.txt"
- File to tell RecommendationJob the paths of eligible wiki resources description files
- UPLOAD_FAILED = 0
- Constant for when attempt to handle file uploads and not all of the file upload information was present
- UPLOAD_NO_FILES = -1
- Constant for when attempt to handle file uploads and no files were uploaded
- UPLOAD_SUCCESS = 1
- Constant for when attempt to handle file uploads and file were successfully uploaded
- $parent : object
- Reference to the controller this component lives on
- __construct() : mixed
- Sets up this component by storing in its parent field a reference to controller this component lives on
- addActivityInfoToGroups() : mixed
- addGroup() : mixed
- Used to add a group to a user's list of group or to request membership in a group if the group is By Request or Public Request
- calculateGroupedFeeds() : mixed
- Used to set up GroupfeedView to draw a users group feeds grouped by group names as opposed to as a linear list of thread and post titles
- calculateRecentFeedsAndThread() : mixed
- Used to add to $data information about the most recently view threads and groups of the current user. This will be used to populate the navigation dropdown in WikiView or WikiElement
- getGroupUsersData() : mixed
- Uses $_REQUEST and $user_id to look up all the users that a group has to subject to $_REQUEST['user_limit'] and $_REQUEST['user_filter']. Information about these roles is added as fields to $data[NUM_USERS_GROUP'] and $data['GROUP_USERS']
- groupFeeds() : array<string|int, mixed>
- Used to support requests related to posting, editing, modifying, and deleting group feed items.
- handleResourceUploads() : mixed
- Used to handle file uploads either to message posts or wiki pages
- importDiscussions() : mixed
- Used to import group discussion thread from another grouping or bulletin site that has the ability to show the group as rss or atom. Examples of such site are: phpBB, google groups, phorum
- initCrawlBadges() : mixed
- Used to compute statistics for badges related for the manage crawls, mix crawls, and manage machine buttons shown typically to admin accounts
- initializeWikiEditor() : mixed
- Called to include the Javascript Wiki Editor (wiki.js) on a page and to send any localizations needed from PHP to Javascript-land It is used by both Crawl and SocialComponent
- initSocialBadges() : mixed
- Used to compute the impression statistics for badges on the social controls button for $user_id. These badges display the number of unread messages, the number of unread group post and the number of groups the user belongs to
- initUserResourcePreferences() : mixed
- Extracts from session information about resource sort, layout, etc, so that WikiElement can draw resources correctly
- makeImpressionChart() : mixed
- Used to handle request related to usage statistics for groups
- manageGroups() : array<string|int, mixed>
- Used to handle the manage group activity.
- mediaWiki() : mixed
- Used to set up the partially processed wiki page, before media inserted, needed to display a single media item on a media list. The name of the media item to be display is expected to come from $_REQUEST['n'].
- mediaWikiDetail() : mixed
- processWikiFormData() : mixed
- Used to process form data associated with a wiki page with a form on it.
- socialPrivacy() : mixed
- Used to add Differential Privacy for each group
- sortWikiResources() : mixed
- Used to sort the resources on a wiki pages either for display in case of reading a media list or to help find resources in the case of a user using edit mode
- updateGroup() : mixed
- Used by $this->manageGroups to check and clean $_REQUEST variables related to groups, to check that a user has the correct permissions if the current group is to be modified, and if so, to call model to handle the update
- userMessages() : mixed
- Handles requests for the user messages subsystem of yioop that allows users to directly send messages to each other. This involves for a user request gettting a list of user contacts, getttingmessages of the currently selected user and handles any new messages posted.
- wiki() : array<string|int, mixed>
- Handles requests to reading, editing, viewing history, reverting, etc wiki pages
- addAnyBotResponses() : mixed
- This follows up to the thread post $thread_id to $group_id any response that $bots following this group might have
- addContact() : mixed
- Contains the logic need to add a contact $data['CONTACT_ID'] to the list of $user_id's contacts for messaging.
- blockContact() : mixed
- When a contact request is made the receiving user can either accept, ignore, or block. Accept means connection is made, ignore means the connection request is removed from the list of request, but the requestor could send a new request, and block means that a new request will automatically be discarded. This method implements the block connection request for a user with id $user_id from a user $data['CONTACT_ID'].
- computeBotPattern() : array<string|int, mixed>
- Determines which, if any, chat bot patterns of chat bot $bot_id are applicable to the post $post given the current state of the chat bot for the user who made $post.
- editWiki() : mixed
- Used to handle edit settings and resources actions for the wiki() activity
- getRequestedBots() : array<string|int, mixed>
- Determines a list of posts that might need to reply to a post in a group
- ignoreContact() : mixed
- When a contact request is made the receiving user can either accept, ignore, or block. Accept means connection is made, ignore means the connection request is removed from the list of request, but the requestor could send a new request, and block means that a new request will automatically be discarded. This method implements the ignore connection request for a user with id $user_id from a user $data['CONTACT_ID'].
- initCommonWikiArrays() : mixed
- Used to initialize arrays for dropdowns in WikiElement as well as various arrays for cleaning request variables
- initializeFeedItems() : mixed
- Used to compute set up a list of feed items to be displayed by the groupFeeds activity
- initializeReadMode() : mixed
- Sets up view variables for wiki pages when in read mode. If a user send a command to indicate a media resource on a media list is not viewed, then also update session accordingly
- initializeWikiPageToggle() : mixed
- Used to create Javascript used to toggle a wiki page's settings control
- interpolateBotVariables() : string
- Given a string $to_interpolate with variables in it (strings of word characters beginning with a $) and given an array of variable => value, replaces the variables in $to_inpolate with their corresponding value, returning the resulting string
- marshallContactInfo() : array<string|int, mixed>
- Gets an array of contact details including USER_NAME, ICON_URL, NUM_UNREAD_MESSAGES for an array of contact ids for $user_id, subject to a filter.
- messagesStatus() : array<string|int, mixed>
- Get messages since $_REQUEST['conversation_time'] for the conversation betwene $user_id and $data['CONTACT_ID'].
- newMessage() : mixed
- Sends a message cleaned $_REQUEST["description"] from user with id $user_id to user with $data['CONTACT_ID']
- updateGetWikiImpressionInfo() : mixed
- Used to populate recent page and group activity dropdowns for a wiki page and to update the recent page impressions so that this can be calculated
Constants
RECOMMENDATION_FILE
File to tell RecommendationJob the paths of eligible wiki resources description files
public
mixed
RECOMMENDATION_FILE
= \seekquarry\yioop\configs\APP_DIR . "/resources/recommendation.txt"
UPLOAD_FAILED
Constant for when attempt to handle file uploads and not all of the file upload information was present
public
mixed
UPLOAD_FAILED
= 0
UPLOAD_NO_FILES
Constant for when attempt to handle file uploads and no files were uploaded
public
mixed
UPLOAD_NO_FILES
= -1
UPLOAD_SUCCESS
Constant for when attempt to handle file uploads and file were successfully uploaded
public
mixed
UPLOAD_SUCCESS
= 1
Properties
$parent
Reference to the controller this component lives on
public
object
$parent
= null
Methods
__construct()
Sets up this component by storing in its parent field a reference to controller this component lives on
public
__construct(object $parent_controller) : mixed
Parameters
- $parent_controller : object
-
reference to the controller this component lives on
Return values
mixed —addActivityInfoToGroups()
public
addActivityInfoToGroups(array<string|int, mixed> &$data) : mixed
Parameters
- $data : array<string|int, mixed>
Return values
mixed —addGroup()
Used to add a group to a user's list of group or to request membership in a group if the group is By Request or Public Request
public
addGroup(array<string|int, mixed> &$data, int $add_id, int $register) : mixed
Parameters
- $data : array<string|int, mixed>
-
field variables to be drawn to view, we modify the SCRIPT component of this with a message regarding success of not of add attempt.
- $add_id : int
-
group id to be added
- $register : int
-
the registration type of the group
Return values
mixed —calculateGroupedFeeds()
Used to set up GroupfeedView to draw a users group feeds grouped by group names as opposed to as a linear list of thread and post titles
public
calculateGroupedFeeds(int $user_id, int $limit, int $results_per_page, string $controller_name, array<string|int, mixed> $data) : mixed
Parameters
- $user_id : int
-
id of current user
- $limit : int
-
lower bound on the groups to display feed data for
- $results_per_page : int
-
number of groups to display feed data for
- $controller_name : string
-
name of controller on which this this component lives (either admin or group). Used by view to draw expand or collapse link
- $data : array<string|int, mixed>
-
field data for view to draw itself
Return values
mixed —calculateRecentFeedsAndThread()
Used to add to $data information about the most recently view threads and groups of the current user. This will be used to populate the navigation dropdown in WikiView or WikiElement
public
calculateRecentFeedsAndThread(array<string|int, mixed> &$data, int $user_id) : mixed
Parameters
- $data : array<string|int, mixed>
-
associative array of values to be echoed by the view
- $user_id : int
-
id of user requesting thread info
Return values
mixed —getGroupUsersData()
Uses $_REQUEST and $user_id to look up all the users that a group has to subject to $_REQUEST['user_limit'] and $_REQUEST['user_filter']. Information about these roles is added as fields to $data[NUM_USERS_GROUP'] and $data['GROUP_USERS']
public
getGroupUsersData(array<string|int, mixed> &$data, int $group_id) : mixed
Parameters
- $data : array<string|int, mixed>
-
data for the manageGroups view.
- $group_id : int
-
group to look up users for
Return values
mixed —groupFeeds()
Used to support requests related to posting, editing, modifying, and deleting group feed items.
public
groupFeeds() : array<string|int, mixed>
Return values
array<string|int, mixed> —$data fields to be used by GroupfeedElement
handleResourceUploads()
Used to handle file uploads either to message posts or wiki pages
public
handleResourceUploads(string $group_id, string $store_id[, string $sub_path = "" ]) : mixed
Parameters
- $group_id : string
-
the group the message or wiki page is associated with
- $store_id : string
-
the id of the message post or wiki page
- $sub_path : string = ""
-
used to specify sub-folder of default resource folder to copy to
Return values
mixed —importDiscussions()
Used to import group discussion thread from another grouping or bulletin site that has the ability to show the group as rss or atom. Examples of such site are: phpBB, google groups, phorum
public
importDiscussions(int $group_id, int $user_id, string $feed_data) : mixed
Parameters
- $group_id : int
-
id of group that thread post data will be imported into
- $user_id : int
-
id of person doing the importing (should be owner of group)
- $feed_data : string
-
an rss or atom feed containing forum/group posts
Return values
mixed —initCrawlBadges()
Used to compute statistics for badges related for the manage crawls, mix crawls, and manage machine buttons shown typically to admin accounts
public
initCrawlBadges(int $user_id, array<string|int, mixed> &$data) : mixed
Parameters
- $user_id : int
-
of user - used to determin the mix crawl list
- $data : array<string|int, mixed>
-
associative array of data to send to the view. This method adds three new field NUM_MIXES, CRAWL_MANAGER, "NUM_MACHINES, CRAWLS_RUNNING, and NUM_CLOSED_CRAWLS
Return values
mixed —initializeWikiEditor()
Called to include the Javascript Wiki Editor (wiki.js) on a page and to send any localizations needed from PHP to Javascript-land It is used by both Crawl and SocialComponent
public
initializeWikiEditor(array<string|int, mixed> &$data[, $id = "" ]) : mixed
Parameters
- $data : array<string|int, mixed>
-
an asscoiative array of data to be used by the view and layout that the wiki editor will be drawn on This method tacks on to INCLUDE_SCRIPTS to make the layout load wiki.js.
- $id : = ""
-
if "" then all textareas on page will get editor buttons, if -1 then sets up translations, but does not add any button, otherwise, add buttons to textarea $id will. (Can call this method multiple times, if want more than one but not all)
Return values
mixed —initSocialBadges()
Used to compute the impression statistics for badges on the social controls button for $user_id. These badges display the number of unread messages, the number of unread group post and the number of groups the user belongs to
public
initSocialBadges(int $user_id, array<string|int, mixed> &$data) : mixed
Parameters
- $user_id : int
-
id of user to compute statistics for
- $data : array<string|int, mixed>
-
associative array of data to send to the view. This method adds three new field NUM_GROUPS, UNREAD_POSTS, and UNREAD_MESSAGES
Return values
mixed —initUserResourcePreferences()
Extracts from session information about resource sort, layout, etc, so that WikiElement can draw resources correctly
public
initUserResourcePreferences(array<string|int, mixed> &$data) : mixed
Parameters
- $data : array<string|int, mixed>
-
associative array of values to be echoed by the view
Return values
mixed —makeImpressionChart()
Used to handle request related to usage statistics for groups
public
makeImpressionChart(array<string|int, mixed> &$data, int $impression_type, int $period, int $item_id[, mixed $chart_name = "chart" ][, mixed $chart_id = "chart" ]) : mixed
Parameters
- $data : array<string|int, mixed>
-
fields to be sent to the view with chart data
- $impression_type : int
-
what type $item_id is. Could have values: C\WIKI_IMPRESSION, C\THREAD_IMPRESSION, C\GROUP_IMPRESSION, C\QUERY_IMPRESSION
- $period : int
-
C\ONE_HOUR, C\ONE_DAY, etc that the chart is drawn should be for
- $item_id : int
-
id of group, wiki page, thread, chart should be for
- $chart_name : mixed = "chart"
- $chart_id : mixed = "chart"
Return values
mixed —manageGroups()
Used to handle the manage group activity.
public
manageGroups() : array<string|int, mixed>
This activity allows new groups to be created out of a set of users. It allows admin rights for the group to be transferred and it allows roles to be added to a group. One can also delete groups and roles from groups.
Return values
array<string|int, mixed> —$data information about groups in the system
mediaWiki()
Used to set up the partially processed wiki page, before media inserted, needed to display a single media item on a media list. The name of the media item to be display is expected to come from $_REQUEST['n'].
public
mediaWiki(array<string|int, mixed> &$data, int $group_id, int $page_id[, string $sub_path = "" ]) : mixed
Parameters
- $data : array<string|int, mixed>
-
array of field variables for view will be modified by this function
- $group_id : int
-
id of group wiki page belongs to
- $page_id : int
-
id of wiki page
- $sub_path : string = ""
-
sub-resource folder that is being used, if any, to get resources from
Return values
mixed —mediaWikiDetail()
public
mediaWikiDetail(array<string|int, mixed> &$data, int $group_id, int $page_id[, string $sub_path = "" ]) : mixed
Parameters
- $data : array<string|int, mixed>
-
array of field variables for view will be modified by this function
- $group_id : int
-
id of group wiki page belongs to
- $page_id : int
-
id of wiki page
- $sub_path : string = ""
-
sub-resource folder that is being used, if any, that resource is from
Return values
mixed —processWikiFormData()
Used to process form data associated with a wiki page with a form on it.
public
processWikiFormData(array<string|int, mixed> $data, int $user_id, int $group_id, string $sub_path) : mixed
Such a form's data is stored in a CSV file
Parameters
- $data : array<string|int, mixed>
-
associative array of values to be echoed by the view
- $user_id : int
-
id of user requesting a wiki page
- $group_id : int
-
group in which wiki page belongs
- $sub_path : string
-
any path within wiki page folder for resources
Return values
mixed —socialPrivacy()
Used to add Differential Privacy for each group
public
socialPrivacy(object &$data) : mixed
Parameters
- $data : object
-
contains fields which will be sent to the view
Return values
mixed —sortWikiResources()
Used to sort the resources on a wiki pages either for display in case of reading a media list or to help find resources in the case of a user using edit mode
public
sortWikiResources(array<string|int, mixed> &$data) : mixed
Parameters
- $data : array<string|int, mixed>
-
data to be sent to the view. The $data["RESOURCES_INFO"]['resources'] array of resources will be sorted according to the wiki page's settings as given in $data["HEAD"]['sort']
Return values
mixed —updateGroup()
Used by $this->manageGroups to check and clean $_REQUEST variables related to groups, to check that a user has the correct permissions if the current group is to be modified, and if so, to call model to handle the update
public
updateGroup(array<string|int, mixed> &$data, array<string|int, mixed> &$group, array<string|int, mixed> $update_fields) : mixed
Parameters
- $data : array<string|int, mixed>
-
used to add any information messages for the view about changes or non-changes to the model
- $group : array<string|int, mixed>
-
current group which might be altered
- $update_fields : array<string|int, mixed>
-
which fields in the current group might be changed. Elements of this array are triples, the name of the group field, name of the request field to use for data, and an array of allowed values for the field
Return values
mixed —userMessages()
Handles requests for the user messages subsystem of yioop that allows users to directly send messages to each other. This involves for a user request gettting a list of user contacts, getttingmessages of the currently selected user and handles any new messages posted.
public
userMessages() : mixed
This data is the sent to UsermessagesElement for display.
Return values
mixed —wiki()
Handles requests to reading, editing, viewing history, reverting, etc wiki pages
public
wiki() : array<string|int, mixed>
Return values
array<string|int, mixed> —$data an associative array of form variables used to draw the appropriate wiki page
addAnyBotResponses()
This follows up to the thread post $thread_id to $group_id any response that $bots following this group might have
private
addAnyBotResponses(int $thread_id, int $group_id, array<string|int, mixed> $bots, string $title, array<string|int, mixed> $posts) : mixed
Parameters
- $thread_id : int
-
id of the thread post to follow up
- $group_id : int
-
of group thread post was posted to
- $bots : array<string|int, mixed>
-
list of chat bot users following group
- $title : string
-
title of thread post to follow up
- $posts : array<string|int, mixed>
-
for each bot the contents of message applicable to that bot
Return values
mixed —addContact()
Contains the logic need to add a contact $data['CONTACT_ID'] to the list of $user_id's contacts for messaging.
private
addContact(int $user_id, array<string|int, mixed> $data) : mixed
Parameters
- $user_id : int
-
id of user adding contact to
- $data : array<string|int, mixed>
-
current data to be sent to view after processing needs to contain a field $data['CONTACT_ID'] with the contact_id of user to add to contacts
Return values
mixed —blockContact()
When a contact request is made the receiving user can either accept, ignore, or block. Accept means connection is made, ignore means the connection request is removed from the list of request, but the requestor could send a new request, and block means that a new request will automatically be discarded. This method implements the block connection request for a user with id $user_id from a user $data['CONTACT_ID'].
private
blockContact(int $user_id, array<string|int, mixed> $data) : mixed
Parameters
- $user_id : int
-
id of user who is doing the blocking
- $data : array<string|int, mixed>
-
current data to be sent to view after processing needs to contain a field $data['CONTACT_ID'] with the contact_id of user to block
Return values
mixed —computeBotPattern()
Determines which, if any, chat bot patterns of chat bot $bot_id are applicable to the post $post given the current state of the chat bot for the user who made $post.
private
computeBotPattern(int $bot_id, string $post) : array<string|int, mixed>
Parameters
- $bot_id : int
-
of chat bot to look for applicable pattern
- $post : string
-
messages to compare against pattern request expressions
Return values
array<string|int, mixed> —$pattern first pattern that matches. Its ['VARS'] field will contain any binding values that were made to make the match
editWiki()
Used to handle edit settings and resources actions for the wiki() activity
private
editWiki(array<string|int, mixed> &$data, int $user_id, int $group_id, array<string|int, mixed> $group, int $page_id, string $page_name, string $page, array<string|int, mixed> $page_defaults, string $sub_path, string $edit_reason, array<string|int, mixed> $missing_fields, string $read_address, array<string|int, mixed> $additional_substitutions) : mixed
This method was pulled out of the giant switch case in wiki() and the refactoring still needs some work. Hence, the awkward parameter list below.
Parameters
- $data : array<string|int, mixed>
-
$data data to be sent to the view, will be modified according to the edit action.
- $user_id : int
-
id of the user requesting to change the given wiki page
- $group_id : int
-
id of the group the wiki page belongs to
- $group : array<string|int, mixed>
-
associative array of info about the group wiki page belongs to
- $page_id : int
-
if of wiki page being edited
- $page_name : string
-
string name of wiki page being edited
- $page : string
-
cleaned wiki page that came from $_REQUEST, if any
- $page_defaults : array<string|int, mixed>
-
associative array system-wide defaults for page settings of any wiki page
- $sub_path : string
-
sub resource folder being edited of wiki page, if any
- $edit_reason : string
-
reason for performing update on wiki page
- $missing_fields : array<string|int, mixed>
-
fields missing from the request that might be needed to perform edit
- $read_address : string
-
url base addressed to use in performing some wiki substitutions to generate a html page from a wiki page.
- $additional_substitutions : array<string|int, mixed>
-
additional preg_replace substitutions to make in going from wiki page to html
Return values
mixed —getRequestedBots()
Determines a list of posts that might need to reply to a post in a group
private
getRequestedBots(int $group_id, string $description) : array<string|int, mixed>
Parameters
- $group_id : int
-
get chat bots following this group
- $description : string
-
post message to see if called any bots by using a phrase like: @bot_name some request
Return values
array<string|int, mixed> —[array of bots referred to in post, array of post portions for each robot]
ignoreContact()
When a contact request is made the receiving user can either accept, ignore, or block. Accept means connection is made, ignore means the connection request is removed from the list of request, but the requestor could send a new request, and block means that a new request will automatically be discarded. This method implements the ignore connection request for a user with id $user_id from a user $data['CONTACT_ID'].
private
ignoreContact(int $user_id, array<string|int, mixed> $data) : mixed
Parameters
- $user_id : int
-
id of user who is doing the ignoring
- $data : array<string|int, mixed>
-
current data to be sent to view after processing needs to contain a field $data['CONTACT_ID'] with the contact_id of user to ignore
Return values
mixed —initCommonWikiArrays()
Used to initialize arrays for dropdowns in WikiElement as well as various arrays for cleaning request variables
private
initCommonWikiArrays(string $controller_name, string $base_url) : mixed
Parameters
- $controller_name : string
-
used to set up variables for view elements should be either admin, api, or group depending on which controller is being used to handle wiki interaction
- $base_url : string
-
to use in creating link targets
Return values
mixed —initializeFeedItems()
Used to compute set up a list of feed items to be displayed by the groupFeeds activity
private
initializeFeedItems(array<string|int, mixed> &$data, array<string|int, mixed> $pages, int $user_id, array<string|int, mixed> $search_array, int $for_group, string $sort, int &$limit, int $results_per_page) : mixed
Parameters
- $data : array<string|int, mixed>
-
associative array of values to be echoed by the view this method might add to INCLUDE_SCRIPT formatting scripts such as for math which might be used to help draw feed items
- $pages : array<string|int, mixed>
-
contains feed items corresponding to first join dates to various groups. Other feed items will be added to this array
- $user_id : int
-
id of user requesting thread info
- $search_array : array<string|int, mixed>
-
associative array used to determine where clause of what threads, groups, or user posts to get feed items for
- $for_group : int
-
if this value is set it is a assumed that group_items are being returned for only one group and that they should be grouped by thread
- $sort : string
-
either ksort or krsort to specify final sort direction of feed items
- $limit : int
-
index of first feed item out of all applicable items to display
- $results_per_page : int
-
number of feed items to display feed data for
Return values
mixed —initializeReadMode()
Sets up view variables for wiki pages when in read mode. If a user send a command to indicate a media resource on a media list is not viewed, then also update session accordingly
private
initializeReadMode(array<string|int, mixed> &$data, int $user_id, int $group_id, string $sub_path) : mixed
Parameters
- $data : array<string|int, mixed>
-
associative array of values to be echoed by the view
- $user_id : int
-
id of user requesting a wiki page
- $group_id : int
-
group in which wiki page belongs
- $sub_path : string
-
any path within wiki page folder for resources
Return values
mixed —initializeWikiPageToggle()
Used to create Javascript used to toggle a wiki page's settings control
private
initializeWikiPageToggle(array<string|int, mixed> &$data) : mixed
Parameters
- $data : array<string|int, mixed>
-
will contain in SCRIPT field necessary Javascript to pass to view.
Return values
mixed —interpolateBotVariables()
Given a string $to_interpolate with variables in it (strings of word characters beginning with a $) and given an array of variable => value, replaces the variables in $to_inpolate with their corresponding value, returning the resulting string
private
interpolateBotVariables(string $to_interpolate, array<string|int, mixed> $bot_variables) : string
Parameters
- $to_interpolate : string
-
string to replace variables in
- $bot_variables : array<string|int, mixed>
-
sequence of variable => value pairs to replace in string.
Return values
string —$to_interpolate after substitutions have been made
marshallContactInfo()
Gets an array of contact details including USER_NAME, ICON_URL, NUM_UNREAD_MESSAGES for an array of contact ids for $user_id, subject to a filter.
private
marshallContactInfo(mixed $user_id, array<string|int, mixed> $contact_ids[, string $contact_filter = "" ]) : array<string|int, mixed>
Parameters
- $user_id : mixed
- $contact_ids : array<string|int, mixed>
-
id's that contact details are desired of
- $contact_filter : string = ""
-
a substring of user_names to restrict the returned details to (i.e., only contacts whose user name's match this substring)
Return values
array<string|int, mixed> —$contacts array of contact details (which in turn is an array with fields USER_NAME, ICON_URL, ...) for ids with user names matching the filter
messagesStatus()
Get messages since $_REQUEST['conversation_time'] for the conversation betwene $user_id and $data['CONTACT_ID'].
private
messagesStatus(int $user_id, array<string|int, mixed> $data) : array<string|int, mixed>
Add them to a list in $data['MESSAGES']
Parameters
- $user_id : int
-
user we are trying to update conversation of
- $data : array<string|int, mixed>
-
this will be data sent to the view, but should be called after the 'CONTACT_ID' field has been set to the value of the person who $user_id is have a messaging exchange
Return values
array<string|int, mixed> —$data updated view data with new messages (if any)
newMessage()
Sends a message cleaned $_REQUEST["description"] from user with id $user_id to user with $data['CONTACT_ID']
private
newMessage(int $user_id, array<string|int, mixed> $data) : mixed
Expects a message $_REQUEST["description"] coming from message form to to send.
Parameters
- $user_id : int
-
id of user who is sending the message
- $data : array<string|int, mixed>
-
current data to be sent to view after processing needs to contain a field $data['CONTACT_ID'] with the contact_id of user to send to
Return values
mixed —updateGetWikiImpressionInfo()
Used to populate recent page and group activity dropdowns for a wiki page and to update the recent page impressions so that this can be calculated
private
updateGetWikiImpressionInfo(array<string|int, mixed> &$data, int $user_id, int $group_id) : mixed
Parameters
- $data : array<string|int, mixed>
-
$data data to be sent to the view, will be modified according to impression info.
- $user_id : int
-
id of the user requesting to change the given wiki page
- $group_id : int
-
id of the group the wiki page belongs to