SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Subsites

Provides functions for getting information about subsites

Variables

NameVisibilityDescription
$configs (static) 
$subsites (static) 

Functions

NameVisibilityDescription
determineBestDomainprivate (static)For a given list of domains, determine the best match based on the current HTTP_HOST
getAbsRootpublic (static)Returns the abs root (including protocol and server name) of the specified subsite
getAbsRootAdminpublic (static)Returns the abs root (including protocol and server name) of the current admin subsite
getCodepublic (static)Returns the name of the specified subsite
getCodespublic (static)Gets the list of subsite codes which are available, by reading the appropriate directory
getConfigpublic (static)Get a config value for a given subsite
getConfigAdminpublic (static)Admin version of the getConfig function, uses the currently active subsite
getFirstAccessablepublic (static)Returns the id of the first subsite in the list (alphabetical) that the user is able to access.
getNamepublic (static)Returns the name of the specified subsite
hasMultiplepublic (static)Determines if multiple subsites can be accessed by the currently logged in administrator
listSelectorpublic (static)Outputs a select UL for choosing a subsite from within the admin area
loadConfigpublic (static)Load the configuration for a subsite code.
loadSubsitesprivate (static)Loads all the subsites into memory, ready for further processing

private determineBestDomain

unknown Subsites::determineBestDomain ( mixed $domains );

For a given list of domains, determine the best match based on the current HTTP_HOST

If there is an exact match, it is used
If there is an ends-with match, it is used
Failing all that, the first domain in the list is used

public getAbsRoot

string Subsites::getAbsRoot ( int $id [, string $protocol ] );

Returns the abs root (including protocol and server name) of the specified subsite
Falls back to the current root if no abs root can be found in the database

public getAbsRootAdmin

unknown Subsites::getAbsRootAdmin ( );

Returns the abs root (including protocol and server name) of the current admin subsite

public getCode

unknown Subsites::getCode ( mixed $id );

Returns the name of the specified subsite

public getCodes

array Subsites::getCodes ( );

Gets the list of subsite codes which are available, by reading the appropriate directory

public getConfig

mixed Subsites::getConfig ( string $key , int $subsite_id );

Get a config value for a given subsite

Use this instead of Kohana::config, if you need to target a specific subsite.
It always looks in the "sprout" config file, doesn't support other files.

public getConfigAdmin

unknown Subsites::getConfigAdmin ( mixed $key );

Admin version of the getConfig function, uses the currently active subsite

public getFirstAccessable

unknown Subsites::getFirstAccessable ( );

Returns the id of the first subsite in the list (alphabetical) that the user is able to access.
Returns null if there are no subsites the user can access.

public getName

unknown Subsites::getName ( mixed $id );

Returns the name of the specified subsite

public hasMultiple

bool Subsites::hasMultiple ( );

Determines if multiple subsites can be accessed by the currently logged in administrator

public listSelector

void Subsites::listSelector ( [ int $selected_id ] );

Outputs a select UL for choosing a subsite from within the admin area

public loadConfig

unknown Subsites::loadConfig ( string $subsite_code );

Load the configuration for a subsite code.
It will only be loaded once per request - it gets cached in a static var

private loadSubsites

void Subsites::loadSubsites ( );

Loads all the subsites into memory, ready for further processing