class vB_Library_Site extends vB_Library

vB_Library_Site

Traits

Properties

static protected $instance from vB_Library
protected $assertor
protected $fields
protected $cleanerObj
protected $sitescache
protected array $channelInfo Array of cached channelInfo, used by getChannelType
protected array $requiredPhrases Phrases that need to be cached for the navbar/footer items
protected array $phraseCache Cached phrases used for navbar/footer items

Methods

__sleep()

No description

__wakeup()

No description

__construct()

Initializes an Api Site object

static vB_PageCache
instance($class)

Returns singleton instance of self.

static 
getLibraryClassNameInternal($controller)

No description

static 
getContentInstance($contenttypeid)

No description

static 
clearCache()

No description

boolean
saveHeaderNavbar(int $siteId, mixed $data)

Stores the header navbar data.

boolean
saveFooterNavbar(int $siteId, mixed $data)

Stores the footer navbar data.

mixed
loadHeaderNavbar(int $siteId, string $url = false, int $edit = false, int $channelId = 0)

Gets the header navbar data

mixed
loadFooterNavbar(int $siteId, string $url = false, int $edit = false)

Gets the footer navbar data

string|false
getChannelType(int $channelId)

Returns the channel type for the given channel ID

cachePhrases($edit = false)

No description

addPhrasesToData($data)

No description

hasEmptyData(mixed $data)

Check if data array is empty

cleanData($data)

No description

saveNavbarPhrase($element, $phrases)

No description

array
getSiteStatistics()

Returns an array of general statistics for the site

clearSiteCache()

Clears the internal site cache.

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 74
__construct()

Initializes an Api Site object

in vB_Library at line 35
static vB_PageCache instance($class)

Returns singleton instance of self.

Parameters

$class

Return Value

vB_PageCache
  • Reference to singleton instance of the cache handler

in vB_Library at line 52
static protected getLibraryClassNameInternal($controller)

Parameters

$controller

in vB_Library at line 91
static getContentInstance($contenttypeid)

Parameters

$contenttypeid

in vB_Library at line 99
static clearCache()

at line 100
boolean saveHeaderNavbar(int $siteId, mixed $data)

Stores the header navbar data.

Parameters

int $siteId The storing data siteid (currently ignored).
mixed $data Array of elements containing data to be stored for header navbar. Elements might contain: title -- string Site title. *required url -- string Site url. *required usergroups -- array Array of ints. newWindow -- boolean Flag used to display site in new window. *required subnav -- mixed Array of subnav sites (containing same site data structure). id -- int Id of subnav site. title -- string Title of subnav site. url -- string Url of subnav site. usergroups -- array Array of ints. newWindow -- boolean Flag used to display subnav site in new window. subnav -- mixed Array of subnav sites (containing same site data structure).

Return Value

boolean To indicate if save was succesfully done.

at line 149
boolean saveFooterNavbar(int $siteId, mixed $data)

Stores the footer navbar data.

Parameters

int $siteId The storing data siteid (currently ignored).
mixed $data Array of data to be stored for footer navbar. title -- string Site title. url -- string Site url. usergroups -- array Array of ints. newWindow -- boolean Flag used to display site in new window. subnav -- mixed Array of subnav sites (containing same site data structure). id -- int Id of subnav site. title -- string Title of subnav site. url -- string Url of subnav site. usergroups -- array Array of ints. newWindow -- boolean Flag used to display subnav site in new window. subnav -- mixed Array of subnav sites (containing same site data structure).

Return Value

boolean To indicate if save was succesfully done.

at line 191
mixed loadHeaderNavbar(int $siteId, string $url = false, int $edit = false, int $channelId = 0)

Gets the header navbar data

Parameters

int $siteId Site id requesting header data.
string $url URL
int $edit Edit mode so allow all links if user can admin sitebuilder
int $channelId Channel ID (optional, used to determine current header navbar tab)

Return Value

mixed Array of header navbar data (Described in save method).

at line 205
mixed loadFooterNavbar(int $siteId, string $url = false, int $edit = false)

Gets the footer navbar data

Parameters

int $siteId Site id requesting footer data.
string $url URL
int $edit Edit mode so allow all links if user can admin sitebuilder

Return Value

mixed Array of footer navbar data (Described in save method).

at line 591
protected string|false getChannelType(int $channelId)

Returns the channel type for the given channel ID

Parameters

int $channelId The channel associated with the page. If a non channel node is provided we will use that nodes channel instead.

Return Value

string|false The channel type, or an false if there was a problem, for example the user doesn't have access to the channel.

at line 625
protected cachePhrases($edit = false)

Parameters

$edit

at line 637
protected addPhrasesToData($data)

Parameters

$data

at line 659
protected hasEmptyData(mixed $data)

Check if data array is empty

Parameters

mixed $data Array of site data (described in save methods) to check.

Exceptions

Exception missing_required_field if there's an empty field in site data.

at line 695
protected cleanData($data)

Parameters

$data

at line 734
protected saveNavbarPhrase($element, $phrases)

Parameters

$element
$phrases

at line 816
array getSiteStatistics()

Returns an array of general statistics for the site

Return Value

array Statistics.

at line 851
clearSiteCache()

Clears the internal site cache.

WARNING: Only intended for use by unit tests. Do not use in any other context