Getting Started

Configuration

Administration

Modules

Templates

Integrations

Development

System Architechture

1. Modules

Modules are the basic building blocks of UNA CMS.

1.1 Basic Module Concepts

  • The fundamental unit is the module (class BxDolModule)
  • Create a module object: $oModule = BxDolModule::getInstance($sModuleName);

1.2 Module Interfaces

Modules can inherit multiple interfaces:

  • Profile: Check with bx_srv('system', 'is_module_profile', $sModuleName)
  • Context: Check with bx_srv('system', 'is_module_context', $sModuleName)
  • Content: Check with bx_srv('system', 'is_module_content', $sModuleName)

1.3 Base Module Classes

These abstract classes contain common functions for inherited modules:

  • BxBaseModGeneralModule extends BxDolModule
  • BxBaseModGroupsModule extends BxBaseModProfileModule
  • BxBaseModNotificationsModule extends BxBaseModGeneralModule
  • BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolContentInfoService, iBxDolProfileService
  • BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolContentInfoService

1.4 Available Modules

  • bx_timeline
  • bx_spaces
  • bx_posts
  • bx_polls
  • bx_photos
  • bx_persons
  • bx_notifications
  • bx_organisations
  • bx_messenger
  • bx_invites
  • bx_groups
  • bx_files
  • bx_events
  • bx_channels

Notable Module Fields

  • bx_persons:
    • id, fullname, last_name, gender, birthday (date), added (timestamp)
  • bx_organisations:
    • id, org_name, added (timestamp)

2. Accounts and Profiles

2.1 Accounts (BxDolAccount)

  • Basic user unit in the system
  • Each account is associated with a unique email
  • Create an account object: $oAccount = BxDolAccount::getInstance($mixedAccountId)
    • $mixedAccountId can be email (string) or account_id (int)

Key BxDolAccount Methods

  • getInfo($iAccountId=false): Returns array with account info (id, name, email, email_confirmed, added)
  • id(): Get account ID
  • isConfirmed($iAccountId=false): Check if account is confirmed
  • updateEmailConfirmed($isConfirmed, $isAutoSendConfrmationEmail=true, $iAccountId=false)
  • updatePassword($sPassword, $iAccountId=false)
  • sendConfirmationEmail($iAccountId=false)
  • getEmail($iAccountId=false)
  • isOnline($iAccountId=false)
  • delete($bDeleteWithContent=false)

2.2 Profiles (BxDolProfile)

  • One account can have multiple profiles of different types
  • Create a profile object: $oProfile = BxDolProfile::getInstance($iProfileId);
  • Get current user's profile ID: bx_get_logged_profile_id()

Key BxDolProfile Methods

  • getInfo($iProfileId=0): Returns array with profile info (id, account_id, type, content_id, status)
  • id(): Get profile ID
  • getAccountId($iProfileId=false)
  • getAccountObject($iProfileId=false)
  • getContentId()
  • isActive($iProfileId=false)
  • getDisplayName($iProfileId=0)
  • getUrl($iProfileId=0)
  • getPicture($iProfileId=0)
  • getAvatar($iProfileId=0)
  • delete($ID=false, $bDeleteWithContent=false, $bForceDelete=false)

3. System Functions

3.1 Sending Emails

function sendMail($mRecipientEmails, $sMailSubject, $sMailBody, $iRecipientID = 0, $aPlus = array(), $iEmailType = BX_EMAIL_NOTIFY, $sEmailFlag = 'html', $isDisableAlert = false, $aCustomHeaders = array(), $bAddToQueue = false)

3.2 Sending Messages in Messenger

bx_srv('bx_messenger', 'send_message', [$iRecipient, $sMessage, $iSenderId]);

3.3 Alerts/Triggers

Alerts are triggers activated by certain events to modify data or call additional functions.

function bx_alert($sUnit, $sAction, $iObjectId, $iSender = false, $aExtras = array())
{
    $o = new BxDolAlerts($sUnit, $sAction, $iObjectId, $iSender, $aExtras);
    $o->alert();
}

Parameters:

  • $sUnit: system type
  • $sAction: system action
  • $iObjectId: object id
  • $iSender: sender (action's author) profile id
  • $aExtras: extra parameters