UNA
Loading...
Searching...
No Matches
BxDolPage Class Reference
Inheritance diagram for BxDolPage:
BxDolFactory iBxDolFactoryObject iBxDolReplaceable BxBasePage BxTemplPage BxTemplPage BxAclPageView BxAdsPageLicenses BxAlbumsPageMedia BxAnalyticsPage BxAntispamPage BxBaseCmtsPageView BxBaseModGeneralPageBrowse BxBaseModGeneralPageEntry BxBaseModPaymentPage BxBaseModTextPageAuthor BxBasePageAccount BxBasePageConnections BxBasePageDashboard BxBasePageHome BxBasePageWiki BxCnvPageFolder BxCreditsPageHistory BxCreditsPageOrders BxCreditsPageProfiles BxDonationsPageList BxFaceBookConnectPage BxForumPageFolder BxMarketPageLicenses BxMassMailerPageEntry BxNtfsPageSettings BxNtfsPageView BxOAuthPage BxPaymentPageDetails BxPaymentPageInvoices BxPaymentPageJoin BxPaymentPageOrders BxPaymentPageSubscriptions BxPhotosPageEntryBrief BxStripeConnectPage BxTimelinePageViewItem BxAclPageView BxAdsPageLicenses BxAlbumsPageMedia BxAnalyticsPage BxAntispamPage BxBaseCmtsPageView BxBaseModGeneralPageBrowse BxBaseModGeneralPageEntry BxBaseModPaymentPage BxBaseModTextPageAuthor BxBasePageAccount BxBasePageConnections BxBasePageDashboard BxBasePageHome BxBasePageWiki BxCnvPageFolder BxCreditsPageHistory BxCreditsPageOrders BxCreditsPageProfiles BxDonationsPageList BxFaceBookConnectPage BxForumPageFolder BxMarketPageLicenses BxMassMailerPageEntry BxNtfsPageSettings BxNtfsPageView BxOAuthPage BxPaymentPageDetails BxPaymentPageInvoices BxPaymentPageJoin BxPaymentPageOrders BxPaymentPageSubscriptions BxPhotosPageEntryBrief BxStripeConnectPage BxTimelinePageViewItem

Public Member Functions

 displayPage ($oTemplate=null)
 
 getId ()
 
 getType ()
 
 getModule ()
 
 getSubMenu ()
 
 getMetaDescription ()
 
 getName ()
 
 getObject ()
 
 getInjections ()
 
 setTitle ($sTitle)
 
 addMarkers ($a)
 
 isAvailablePage ()
 
 isVisiblePage ()
 
 isPage ()
 
 isVisiblePageSubmenu ()
 
 isEditAllowed ()
 
 isDeleteAllowed ()
 

Static Public Member Functions

static getObjectInstanceByModuleAndURI ($sModule, $sURI='', $oTemplate=false)
 
static getObjectInstanceByURI ($sURI='', $oTemplate=false, $bRedirectCheck=false)
 
static getObjectInstance ($sObject, $oTemplate=false)
 
static processPageTrigger ($sPageTriggerName)
 
static multisiteLinkCheck ($sLink, $sPageUri='', $sPageModule='', $aQueryParams=[])
 
static getMultisite ($sLink, $sPageUri='', $sPageModule='', $aQueryParams=[])
 
static deleteSeoLink ($sModule, $sContentInfoObject, $sId)
 
static deleteSeoLinkByParam ($sParamName, $sId)
 
static deleteSeoLinkByModule ($sModule)
 
static getPageBySeoLink ($sRequest)
 
static processSeoLink ($sRequest)
 
static transformSeoLink ($sLink, $sPrefix, $aParams=array())
 
static untransformSeoLink ($sSeoLink, $sPrefix)
 
static seoRedirect ()
 
static getSeoHash ($s)
 
static getEmbedData ($sUrl)
 
static isLockedFromUnauthenticated ($sUri)
 
static redirectToLoginForm ()
 
- Static Public Member Functions inherited from iBxDolFactoryObject
static getObjectInstance ($sObject)
 

Protected Member Functions

 __construct ($aObject)
 
 _replaceMarkers ($mixed, $aAdditionalMarkers=array())
 
 _isVisibleBlock ($a)
 
 _isAvailablePage ($a)
 
 _isVisiblePage ($a)
 

Protected Attributes

 $_sObject
 
 $_aObject
 
 $_oQuery
 
 $_aMarkers = array ()
 

Detailed Description

Pages.

It allows to display pages which are built from studio.

The new system has the following page features:

  • Layouts: page can have any structure, not just columns.
  • SEO: page can have own SEO options, like meta tags and meta keywords, as well as instructions for search bots.
  • Cache: page can be cached on the server.
  • Access control: page access can be controlled using member levels.

Creating the Page object:

  1. add record to 'sys_objects_page' table:
  • object: name of the page object, in the format: vendor prefix, underscore, module prefix, underscore, internal identifier or nothing; for example: bx_profiles_view - profile view page.
  • title: name to display as page title.
  • module: the module this page belongs to.
  • layout_id: page layout to use, this is id of the record from 'sys_pages_layouts' table.
  • visible_for_levels: bit field with set of member level ids. To use member level id in bit field - the level id minus 1 as power of 2 is used, for example:
    • user level id = 1 -> 2^(1-1) = 1
    • user level id = 2 -> 2^(2-1) = 2
    • user level id = 3 -> 2^(3-1) = 4
    • user level id = 4 -> 2^(4-1) = 8
  • visible_for_levels_editable: it determines if 'visible_for_levels' field is editable from page builder, visibility options can be overriden by custom class and shouldn't be editable in this case.
  • url: the page url, if it is static page.
  • content_info: content info object name related to the content on the page, if different from module name
  • meta_description: meta description of the page.
  • meta_keywords: meta keywords of the page.
  • meta_robots: instructions for search bots.
  • cache_lifetime: number of seconds to store cache for.
  • cache_editable: it determines if cache can be edited from page builder.
  • deletable: it determines if page can be deleted from page builder.
  • override_class_name: user defined class name which is derived from BxTemplPage.
  • override_class_file: the location of the user defined class, leave it empty if class is located in system folders.

Page can select appropriate menu automatically if 'module' and 'object' fields in 'sys_objects_page' table are matched with 'module' and 'name' fields in 'sys_menu_items' table.

Page layout are stored in 'sys_pages_layouts' table:

  • name: inner unique layout name.
  • icon: layout icon to display in page builder, it should represent basic view of the layout to help studio operator determine the layout structure.
  • title: layout name to display in page builder.
  • template: template name to use to display page with certain layout.
  • cells_number: number of areas in the layout, page blocks can be places into this areas(cells). To define areas in the layout they should be named as 'cell_N', where N is cell number, starting from 1.
  1. Add page blocks to 'sys_pages_blocks' table:
  • object: page object name this block belongs to.
  • cell_id: cell number in page layout to place block to.
  • module: module name this block belongs to.
  • title: block title.
  • designbox_id: design box to use to diplay page block, it is id of the record from 'sys_pages_design_boxes' table.
  • visible_for_levels: bit field with set of member level ids. To use member level id in bit field - the level id minus 1 as power of 2 is used, for example:
    • user level id = 1 -> 2^(1-1) = 1
    • user level id = 2 -> 2^(2-1) = 2
    • user level id = 3 -> 2^(3-1) = 4
    • user level id = 4 -> 2^(4-1) = 8
  • type: block type
    • raw: HTML block, displayed in page builder as HTML textarea.
    • html: HTML block, displayed in page builder as visual editor, like TinyMCE.
    • lang: translatable language string, displayed in page builder as editable language key.
    • image: just an image, displayed in page builder as HTML upload form.
    • rss: RSS block, displayed in page builder as editable URL to RSS resource, along with number of displayed items.
    • menu: menu block, displayed as menu selector.
    • service: to display block content, the provided service method is used.
  • content: depending on 'type' field:
    • raw: HTML string.
    • html: HTML string.
    • lang: language key.
    • image: image id in the storage and alignment (left, center, right) for example: 36#center
    • rss: URL to RSS with number of displayed items, for example: http://www.example.com/rss#4
    • menu: menu object name.
    • service: serialized array of service call parameters: module - module name, method - service method name, params - array of parameters.
  • deletable: is block deletable from page builder
  • copyable: is block can be copied to any other page from page builder.
  • order: block order in particular cell.

Block design boxes are stored in 'sys_pages_design_boxes' table:

  • id: consistent id, there are the following defines can be used in the code for each system block style:
    • 0 - BX_DB_CONTENT_ONLY: design box with content only - no borders, no background, no caption.
    • 1 - BX_DB_DEF: default design box with content, borders and caption.
    • 2 - BX_DB_EMPTY: just empty design box, without anything.
    • 3 - BX_DB_NO_CAPTION: design box with content, like BX_DB_DEF but without caption.
    • 10 - BX_DB_PADDING_CONTENT_ONLY: design box with content only wrapped with default padding - no borders, no background, no caption; it can be used to just wrap content with default padding.
    • 11 - BX_DB_PADDING_DEF: default design box with content wrapped with default padding, borders and caption.
    • 13 - BX_DB_PADDING_NO_CAPTION: design box with content wrapped with default padding, like BX_DB_DEF but without caption.
  • title: block name which is displayed in studio, describes block styles.
  • template: template name to use to display page block.
  1. Display Page. Use the following sample code to display page:
    $oPage = BxDolPage::getObjectInstance('sample'); // 'sample' is 'object' field from 'sys_objects_page' table, it automatically creates instance of default or custom class by object name
    if ($oPage)
    echo $oPage->getCode(); // print page
    static getObjectInstance($sObject, $oTemplate=false)
    Definition BxDolPage.php:181

Constructor & Destructor Documentation

◆ __construct()

BxDolPage::__construct ( $aObject)
protected

Constructor

Parameters
$aObjectarray of page options

Member Function Documentation

◆ _isAvailablePage()

BxDolPage::_isAvailablePage ( $a)
protected

Check if page is available.

Parameters
type$a- page object.
Returns
boolean true if available, false or a string with error message otherwise.

Reimplemented in BxBaseCmtsPageView, BxBaseModGeneralPageEntry, BxBaseModGroupsPageEntry, BxBaseModTextPageEntry, BxMarketPageEntry, BxPhotosPageEntryBrief, BxStrmPageEntry, and BxTimelinePageViewItem.

◆ _isVisibleBlock()

BxDolPage::_isVisibleBlock ( $a)
protected

Check if page block is visible.

◆ _isVisiblePage()

BxDolPage::_isVisiblePage ( $a)
protected

Check if page is visible.

Parameters
array$a- page object.
Returns
boolean true if visible, false or a string with error message otherwise.

Reimplemented in BxBaseModGeneralPageEntry, BxBaseModGroupsPageEntry, BxBaseModProfilePageEntry, BxBasePageAccount, BxPhotosPageEntryBrief, and BxTimelinePageViewItem.

◆ _replaceMarkers()

BxDolPage::_replaceMarkers ( $mixed,
$aAdditionalMarkers = array() )
protected

Replace provided markers in a string

Parameters
$mixedstring or array to replace markers in
Returns
string where all occured markers are replaced

◆ addMarkers()

BxDolPage::addMarkers ( $a)

Add replace markers. Markers are replaced in raw, html, lang blocks and page title, description, keywords and block titles.

Parameters
$aarray of markers as key => value
Returns
true on success or false on error

Implements iBxDolReplaceable.

◆ deleteSeoLink()

static BxDolPage::deleteSeoLink ( $sModule,
$sContentInfoObject,
$sId )
static

Delete SEO link

Parameters
$sModulemodule name
$sContentInfoObjectcontent info object
$sIdcontent id
Returns
number of affected rows

◆ deleteSeoLinkByModule()

static BxDolPage::deleteSeoLinkByModule ( $sModule)
static

Delete SEO links by module

Parameters
$sModulemodule name
Returns
number of affected rows

◆ deleteSeoLinkByParam()

static BxDolPage::deleteSeoLinkByParam ( $sParamName,
$sId )
static

Delete SEO links by param

Parameters
$sParamNameGET param name
$sIdcontent id
Returns
number of affected rows

◆ displayPage()

BxDolPage::displayPage ( $oTemplate = null)

Display complete page

◆ getEmbedData()

static BxDolPage::getEmbedData ( $sUrl)
static

Static method to Get embed code

Returns
string.

◆ getMultisite()

static BxDolPage::getMultisite ( $sLink,
$sPageUri = '',
$sPageModule = '',
$aQueryParams = [] )
static

Get multisite link

Parameters
$sLinklink to check
Returns
return multisite link if provided link is multisite, or false is other case

◆ getObjectInstance()

static BxDolPage::getObjectInstance ( $sObject,
$oTemplate = false )
static

Get page object instance by object name

Parameters
$sObjectobject name
Returns
object instance or false on error

◆ getObjectInstanceByModuleAndURI()

static BxDolPage::getObjectInstanceByModuleAndURI ( $sModule,
$sURI = '',
$oTemplate = false )
static

Get page object instance by Module name and page URI

Parameters
$sModulemodule name
$sURIunique page URI
Returns
object instance or false on error

◆ getObjectInstanceByURI()

static BxDolPage::getObjectInstanceByURI ( $sURI = '',
$oTemplate = false,
$bRedirectCheck = false )
static

Get page object instance by page URI

Parameters
$sURIunique page URI
Returns
object instance or false on error

◆ getPageBySeoLink()

static BxDolPage::getPageBySeoLink ( $sRequest)
static

Get page object by SEO link. It takes request part from SEO link and returns page object

Parameters
$sRequestrequest URI with SEO link
Returns
false - if page wasn't found,
page object - on success,
string URL - if permanent redirect is needed

◆ isPage()

BxDolPage::isPage ( )

Check if page can be seen by viewer.

Parameters
array$a- page object.
Returns
type boolean (true or false).

◆ processPageTrigger()

static BxDolPage::processPageTrigger ( $sPageTriggerName)
static

Process page triggers. Page triggers allow to automatically add page blocks to modules with no different if dependant module was install before or after the module page block belongs to. For example module "Notes" adds page blocks to all profiles modules (Persons, Organizations, etc) with no difference if persons module was installed before or after "Notes" module was installed.

Parameters
$sPageTriggerNametrigger name to process, usually specified in module installer class -
See also
BxBaseModGeneralInstaller
Returns
always true, always success

◆ processSeoLink()

static BxDolPage::processSeoLink ( $sRequest)
static

Process SEO links. It takes request part from SEO link and process it to make it work as regular page link

Parameters
$sRequestrequest URI with SEO link
Returns
true - if page was found and processed correctly, false - if page wasn't found

◆ seoRedirect()

static BxDolPage::seoRedirect ( )
static

Perform SEO redorect from regular pages if needed

Parameters
$sSeoLinkSEO link
$sPrefixprefix to add to the final URL, usually BX_DOL_URL_ROOT
Returns
unSEO link string on success, false if no transform is needed

◆ transformSeoLink()

static BxDolPage::transformSeoLink ( $sLink,
$sPrefix,
$aParams = array() )
static

Transform regular link to SEO link. It takes regular list as param and return SEO link.

Parameters
$sLinkregular link
$sPrefixprefix to add to the final URL, usually BX_DOL_URL_ROOT
$aParamsadditional GET params
Returns
SEO link string on success, false if transform failed or not necessary

Hooks:

'system', 'uri_generate' - hook to override SEO URI generated for a page

  • $unit_name - equals system
  • $action - equals uri_generate
  • $object_id - not used
  • $sender_id - not used
  • $extra_params - array of additional params with the following array keys:

◆ untransformSeoLink()

static BxDolPage::untransformSeoLink ( $sSeoLink,
$sPrefix )
static

Transform SEO regular link into regular link with permalinks off.

Parameters
$sSeoLinkSEO link
$sPrefixprefix to add to the final URL, usually BX_DOL_URL_ROOT
Returns
unSEO link string on success, false if no transform is needed

The documentation for this class was generated from the following file: