BitSystem Class Reference

Inheritance diagram for BitSystem:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 BitSystem ()
 checkBitVersion ()
 checkEnvironment ()
 confirmDialog ($pFormHash, $pMsg)
 diff2 ($page1, $page2)
 display ($pMid, $pBrowserTitle=NULL)
 expungePackageConfig ($pPackageName)
 fatalError ($pMsg, $pTemplate='error.tpl', $pErrorTitle="Seems there's been a problem.")
 fatalPermission ($pPermission, $pMsg=NULL)
 genPass ()
 get_display_offset ($pUser=FALSE)
 get_long_date_format ()
 get_long_datetime ($pTimestamp, $pUser=FALSE)
 get_long_datetime_format ()
 get_long_time_format ()
 get_short_date_format ()
 get_short_datetime_format ()
 get_short_time_format ()
 getBrowserStyleCss ()
 getBrowserTitle ()
 getConfig ($pName, $pDefault=NULL)
 getConfigMatch ($pPattern, $pSelectValue="")
 getCustomStyleCss ($pStyle=null)
 getDefaultPage ()
 getErrorEmail ()
 getIncludeFiles ($pPhpFile=NULL, $pTplFile=NULL)
 getPermissionInfo ($pPermission=NULL, $pPackageName=NULL)
 getPreference ($pName, $pDefault= '')
 getStyle ()
 getStyleCss ($pStyle=NULL, $pUserId=NULL)
 getStylePath ($pStyle=NULL)
 getStyleUrl ($pStyle=NULL)
 getTplIncludeFiles ($pFilename)
 getUTCTime ()
 getUTCTimestamp ()
 getVersion ($pPackage, $pDefault=NULL)
 hasValidSenderEmail ($pSenderEmail=NULL)
 initSmarty ()
 isAjaxRequest ()
 isFeatureActive ($pFeatureName)
 isJavascriptEnabled ()
 isPackageActive ($pPackageName)
 isPackageInstalled ($pPackageName)
 loadAjax ($pAjaxLib, $pLibHash=NULL)
 loadConfig ($pPackage=NULL)
 loadPackage ($pPkgDir, $pScanFile, $pAutoRegister=TRUE, $pOnce=TRUE)
 lookupMimeType ($pExtension)
 makePackageHomeable ($package)
 onlyRenderContent ($pOnlyRender=true)
 postDisplay ($pMid)
 preDisplay ($pMid)
 registerAppMenu ($pMenuHash, $pMenuTitle=NULL, $pTitleUrl=NULL, $pMenuTemplate=NULL, $pAdminPanel=FALSE)
 registerConfig ($packagedir, $preferences)
 registerModules ($pModuleHash)
 registerNotifyEvent ($pEventHash)
 registerPackage ($pRegisterHash)
 registerPackageInfo ($pPackage, $pInfoHash)
 registerPackageVersion ($pPackage, $pVersion)
 registerPreferences ($packagedir, $preferences)
 registerSchemaConstraints ($pPackage, $pTableName, $pConstraints)
 registerSchemaDefault ($pPackage, $pMixedDefaultSql)
 registerSchemaIndexes ($pPackage, $pIndexHash)
 registerSchemaSequences ($pPackage, $pSeqHash)
 registerSchemaTable ($pPackage, $pTableName, $pDataDict, $pRequired=FALSE, $pTableOptions=NULL)
 registerUpgrade ($pPackage, $pUpgradeHash)
 registerUserPermissions ($packagedir, $userpermissions)
 scanPackages ($pScanFile= 'bit_setup_inc.php', $pOnce=TRUE, $pSelect='', $pAutoRegister=TRUE)
 sendEmail ($pMailHash)
 setBrowserTitle ($pTitle)
 setConfig ($pName, $pValue)
 setConfigMatch ($pPattern, $pSelect_value="", $pNew_value=NULL, $pPackage=NULL)
 setHelpInfo ($package, $context, $desc)
 setOnloadScript ($pJavscript)
 setPreference ($pPrefName, $pPrefValue)
 setStyle ($pStyle)
 storeConfig ($pName, $pValue, $pPackage=NULL)
 storeVersion ($pPackage, $pVersion)
 verifyFeature ($pFeatureName)
 verifyFileExtension ($pFile, $pFileName=NULL)
 verifyInstalledPackages ($pSelect='installed')
 verifyMimeType ($pFile)
 verifyPackage ($pPackageName)
 verifyPermission ($pPermission, $pMsg=NULL)

Static Public Member Functions

 appendIncludePath ($pPath)
 prependIncludePath ($pPath)

Public Attributes

 $mActivePackage
 $mAppMenu = array()
 $mConfig
 $mDisplayOnlyContent
 $mInstallModules = array()
 $mNotifyEvents = array()
 $mOnload = array()
 $mPackageFileName
 $mPackages = array()
 $mPackagesDirNameXref = array()
 $mRegisterCalled
 $mStyle = array()

Detailed Description

Definition at line 51 of file BitSystem.php.


Member Function Documentation

BitSystem::appendIncludePath ( pPath  )  [static]

* Append $pPath to the include path

Definition at line 1437 of file BitSystem.php.

BitSystem::BitSystem (  ) 

base constructor, auto assigns member db variable

public

Definition at line 98 of file BitSystem.php.

References $gBitTimer, BitBase::BitBase(), checkEnvironment(), FALSE, initSmarty(), and loadConfig().

Referenced by BitInstaller::BitInstaller().

Here is the call graph for this function:

BitSystem::checkBitVersion (  ) 

Definition at line 1744 of file BitSystem.php.

References $data, $error, $h, $lines, $ret, $version, bit_http_request(), information, and tra().

Here is the call graph for this function:

BitSystem::checkEnvironment (  ) 

Definition at line 1460 of file BitSystem.php.

References $_SERVER, $errors, exit, and FALSE.

Referenced by BitSystem().

BitSystem::confirmDialog ( pFormHash,
pMsg 
)

This code was duplicated _EVERYWHERE_ so here is an easy template to cut that down. It will verify if a given user has a given $permission and if not, it will display the error template and die()

Parameters:
$pPermission value of a given permission
Returns:
none public

Definition at line 650 of file BitSystem.php.

References $pParamHash, and die.

BitSystem::diff2 ( page1,
page2 
)

Definition at line 1808 of file BitSystem.php.

BitSystem::display ( pMid,
pBrowserTitle = NULL 
)

Display the main page template

Parameters:
$mid the name of the template for the page content public

Reimplemented from BitBase.

Reimplemented in BitInstaller.

Definition at line 380 of file BitSystem.php.

References $gBitSmarty, setBrowserTitle(), and tra().

Here is the call graph for this function:

BitSystem::expungePackageConfig ( pPackageName  ) 

Delete all prefences for the given package public

Definition at line 298 of file BitSystem.php.

References $query, $result, loadConfig(), mConfig, and mDb.

Here is the call graph for this function:

BitSystem::fatalError ( pMsg,
pTemplate = 'error.tpl',
pErrorTitle = "Seems there's been a problem." 
)

If an unrecoverable error has occurred, this method should be invoked. script exist occurs

Parameters:
string $ pMsg error message to be displayed
Returns:
none this function will DIE DIE DIE!!! public

Definition at line 1006 of file BitSystem.php.

References die, and tra().

Here is the call graph for this function:

BitSystem::fatalPermission ( pPermission,
pMsg = NULL 
)

Definition at line 620 of file BitSystem.php.

References $gBitUser, die, and tra().

Here is the call graph for this function:

BitSystem::genPass (  ) 

Definition at line 1302 of file BitSystem.php.

References $i, and $r.

Referenced by BitUser::createTempPassword(), BitUser::generateChallenge(), LibertyContent::getNumberOfPages(), LibertyContent::getPage(), TikiWikiParser::parseData(), BitUser::renewPassword(), and BitUser::verify().

BitSystem::get_display_offset ( pUser = FALSE  ) 

Retrieves the user's preferred offset for displaying dates.

Definition at line 1653 of file BitSystem.php.

BitSystem::get_long_date_format (  ) 

Retrieves the user's preferred long date format for displaying dates.

Definition at line 1660 of file BitSystem.php.

References FALSE.

BitSystem::get_long_datetime ( pTimestamp,
pUser = FALSE 
)

Definition at line 1738 of file BitSystem.php.

BitSystem::get_long_datetime_format (  ) 

Retrieves the user's preferred long date/time format for displaying dates.

Definition at line 1712 of file BitSystem.php.

References FALSE.

BitSystem::get_long_time_format (  ) 

Retrieves the user's preferred long time format for displaying dates.

Definition at line 1686 of file BitSystem.php.

References FALSE.

BitSystem::get_short_date_format (  ) 

Retrieves the user's preferred short date format for displaying dates.

Definition at line 1673 of file BitSystem.php.

References FALSE.

BitSystem::get_short_datetime_format (  ) 

Retrieves the user's preferred short date/time format for displaying dates.

Definition at line 1725 of file BitSystem.php.

References FALSE.

BitSystem::get_short_time_format (  ) 

Retrieves the user's preferred short time format for displaying dates.

Definition at line 1699 of file BitSystem.php.

References FALSE.

BitSystem::getBrowserStyleCss (  ) 

Definition at line 1910 of file BitSystem.php.

References $gBitThemes.

BitSystem::getBrowserTitle (  ) 

set the title of the browser

Parameters:
string $ pScanFile file to be looked for
Returns:
none public

Definition at line 1282 of file BitSystem.php.

BitSystem::getConfig ( pName,
pDefault = NULL 
)

Add getConfig / setConfig for more uniform handling of config variables instead of spreading global vars. easily get the value of any given preference stored in kernel_config

public

Definition at line 188 of file BitSystem.php.

References loadConfig(), and mConfig.

Referenced by getErrorEmail(), getPreference(), hasValidSenderEmail(), and sendEmail().

Here is the call graph for this function:

BitSystem::getConfigMatch ( pPattern,
pSelectValue = "" 
)

retreive a group of config variables

public

Definition at line 201 of file BitSystem.php.

References loadConfig(), and mConfig.

Here is the call graph for this function:

BitSystem::getCustomStyleCss ( pStyle = null  ) 

Definition at line 1905 of file BitSystem.php.

References $gBitThemes.

BitSystem::getDefaultPage (  ) 

Definition at line 1195 of file BitSystem.php.

References $gBitSystem, $gBitUser, $url, $userlib, FALSE, BitPage::getDisplayUrl(), mInfo, and mPackages.

Here is the call graph for this function:

BitSystem::getErrorEmail (  ) 

Smartly determines where error emails should go

public

Definition at line 328 of file BitSystem.php.

References $_SERVER, $ret, and getConfig().

Here is the call graph for this function:

BitSystem::getIncludeFiles ( pPhpFile = NULL,
pTplFile = NULL 
)

getIncludeFiles will get a set of available files with a given filename

Parameters:
array $pPhpFile name of php file
array $pTplFile name of tpl file public
Returns:
array of includable files

Definition at line 1844 of file BitSystem.php.

References $gBitSystem, $ret, and mPackages.

BitSystem::getPermissionInfo ( pPermission = NULL,
pPackageName = NULL 
)

It will get information about a permissions

Parameters:
$pPermission value of a given permission
Returns:
none public

Definition at line 588 of file BitSystem.php.

References $ret, $sql, and mDb.

BitSystem::getPreference ( pName,
pDefault = '' 
)

Definition at line 1873 of file BitSystem.php.

References getConfig().

Here is the call graph for this function:

BitSystem::getStyle (  ) 

Definition at line 1890 of file BitSystem.php.

References $gBitThemes.

BitSystem::getStyleCss ( pStyle = NULL,
pUserId = NULL 
)

Definition at line 1900 of file BitSystem.php.

References $gBitThemes.

BitSystem::getStylePath ( pStyle = NULL  ) 

Definition at line 1920 of file BitSystem.php.

References $gBitThemes.

BitSystem::getStyleUrl ( pStyle = NULL  ) 

Definition at line 1915 of file BitSystem.php.

References $gBitThemes.

BitSystem::getTplIncludeFiles ( pFilename  ) 

Definition at line 1885 of file BitSystem.php.

References $gBitThemes.

BitSystem::getUTCTime (  ) 

Retrieve a current UTC timestamp Simple map to BitDate object allowing tidy display elsewhere

Definition at line 1638 of file BitSystem.php.

BitSystem::getUTCTimestamp (  ) 

Retrieve a current UTC ISO timestamp Simple map to BitDate object allowing tidy display elsewhere

Definition at line 1646 of file BitSystem.php.

BitSystem::getVersion ( pPackage,
pDefault = NULL 
)

Definition at line 1831 of file BitSystem.php.

References $gBitSystem.

BitSystem::hasValidSenderEmail ( pSenderEmail = NULL  ) 

Determines if this site has a legitimate sender address set.

Parameters:
$mid the name of the template for the page content public

Definition at line 315 of file BitSystem.php.

References getConfig().

Here is the call graph for this function:

BitSystem::initSmarty (  ) 

Define and load Smarty components

Parameters:
none $
Returns:
none private

Definition at line 124 of file BitSystem.php.

References $_REQUEST, $_SERVER, and $gBitSmarty.

Referenced by BitSystem().

BitSystem::isAjaxRequest (  ) 

Definition at line 1929 of file BitSystem.php.

References BitThemes::isAjaxRequest().

Here is the call graph for this function:

BitSystem::isFeatureActive ( pFeatureName  ) 

check's if the specfied feature is active

Parameters:
$pKey hash key
Returns:
none public

Definition at line 676 of file BitSystem.php.

References $ret, and FALSE.

Referenced by BitInstaller::upgradePackage().

BitSystem::isJavascriptEnabled (  ) 

Definition at line 1925 of file BitSystem.php.

References BitThemes::isJavascriptEnabled().

Here is the call graph for this function:

BitSystem::isPackageActive ( pPackageName  ) 

check's if a package is active.

Parameters:
$pPackageName the name of the package to test where the package name is in the form used to index $mPackages See comments in scanPackages for more information
Returns:
none public
Parameters:
$pKey hash key

Definition at line 491 of file BitSystem.php.

References $ret, and FALSE.

Referenced by storeConfig().

BitSystem::isPackageInstalled ( pPackageName  ) 

check's if a package is Installed

Parameters:
$pPackageName the name of the package to test where the package name is in the form used to index $mPackages See comments in scanPackages for more information
Returns:
none public
Parameters:
$pKey hash key

Definition at line 530 of file BitSystem.php.

References $ret, and FALSE.

BitSystem::loadAjax ( pAjaxLib,
pLibHash = NULL 
)

Definition at line 1933 of file BitSystem.php.

References $gBitThemes.

BitSystem::loadConfig ( pPackage = NULL  ) 

Load all preferences and store them in $this->mConfig

Parameters:
$pPackage optionally get preferences only for selected package

Definition at line 160 of file BitSystem.php.

References $query, $row, $rs, mConfig, and mDb.

Referenced by BitSystem(), expungePackageConfig(), getConfig(), getConfigMatch(), setConfigMatch(), and storeConfig().

BitSystem::loadPackage ( pPkgDir,
pScanFile,
pAutoRegister = TRUE,
pOnce = TRUE 
)

Loads a package

Parameters:
string $ pkgDir = Directory Name of package to load
string $ pScanFile file to be looked for
string $ autoRegister - TRUE = autoregister any packages that don't register on their own, FALSE = don't
string $ pOnce - TRUE = do include_once to load file FALSE = do include to load the file
Returns:
none public

Definition at line 1025 of file BitSystem.php.

References $gBitLanguage, $gBitSystem, $gBitUser, $gLibertySystem, $registerHash, and FALSE.

BitSystem::lookupMimeType ( pExtension  ) 

given an extension, return the mime type

Parameters:
string $pExtension is the extension of the file or the complete file name
Returns:
mime type of entry and populates $this->mMimeTypes with existing mime types public

Definition at line 1324 of file BitSystem.php.

References $fp, $tmp, and $type.

BitSystem::makePackageHomeable ( package  ) 

Definition at line 1881 of file BitSystem.php.

References mPackages, and registerPackage().

Here is the call graph for this function:

BitSystem::onlyRenderContent ( pOnlyRender = true  ) 

Tell bitsystem to only render the 'mid' when doing a display.

Parameters:
$pOnlyRender flag defaulting to true public

Definition at line 370 of file BitSystem.php.

BitSystem::postDisplay ( pMid  ) 

Take care of any processing that needs to happen just after the template is displayed

Parameters:
none $ private

Definition at line 463 of file BitSystem.php.

BitSystem::preDisplay ( pMid  ) 

Take care of any processing that needs to happen just before the template is displayed

Parameters:
none $ private

Definition at line 415 of file BitSystem.php.

References $gBitSmarty, and $gBitThemes.

BitSystem::prependIncludePath ( pPath  )  [static]

* Prepend $pPath to the include path

Definition at line 1413 of file BitSystem.php.

BitSystem::registerAppMenu ( pMenuHash,
pMenuTitle = NULL,
pTitleUrl = NULL,
pMenuTemplate = NULL,
pAdminPanel = FALSE 
)

Define and load Smarty components

Parameters:
$pKey hash key
Returns:
none public

Definition at line 817 of file BitSystem.php.

References $_COOKIE, $gBitSystem, and $menuHash.

BitSystem::registerConfig ( packagedir,
preferences 
)

Definition at line 980 of file BitSystem.php.

BitSystem::registerModules ( pModuleHash  ) 

Definition at line 990 of file BitSystem.php.

BitSystem::registerNotifyEvent ( pEventHash  ) 

Definition at line 994 of file BitSystem.php.

BitSystem::registerPackage ( pRegisterHash  ) 

Define name, location and url DEFINE's

Parameters:
$pKey hash key
Returns:
none public

Definition at line 713 of file BitSystem.php.

References $_REQUEST, $_SERVER, FALSE, mPackages, tra(), and url.

Referenced by makePackageHomeable().

Here is the call graph for this function:

BitSystem::registerPackageInfo ( pPackage,
pInfoHash 
)

"Virtual" function stub - fully defined in BitInstaller

Returns:
none public

Definition at line 895 of file BitSystem.php.

References mPackages.

BitSystem::registerPackageVersion ( pPackage,
pVersion 
)

Holds the package version - required by packager - the bitweaver package manager

Returns:
none public

Definition at line 883 of file BitSystem.php.

References mPackages.

BitSystem::registerPreferences ( packagedir,
preferences 
)

Definition at line 986 of file BitSystem.php.

BitSystem::registerSchemaConstraints ( pPackage,
pTableName,
pConstraints 
)

Definition at line 870 of file BitSystem.php.

References mPackages.

BitSystem::registerSchemaDefault ( pPackage,
pMixedDefaultSql 
)

"Virtual" function stub - fully defined in BitInstaller

Returns:
none public

Definition at line 931 of file BitSystem.php.

References mPackages.

BitSystem::registerSchemaIndexes ( pPackage,
pIndexHash 
)

"Virtual" function stub - fully defined in BitInstaller

Returns:
none public

Definition at line 919 of file BitSystem.php.

References mPackages.

BitSystem::registerSchemaSequences ( pPackage,
pSeqHash 
)

accepts a sequence to be added to the install list

Returns:
none public

Definition at line 907 of file BitSystem.php.

References mPackages.

BitSystem::registerSchemaTable ( pPackage,
pTableName,
pDataDict,
pRequired = FALSE,
pTableOptions = NULL 
)

"Virtual" function stub - fully defined in BitInstaller

Returns:
none public

Definition at line 857 of file BitSystem.php.

References mPackages.

BitSystem::registerUpgrade ( pPackage,
pUpgradeHash 
)

registerSchemaTable - Handles big array of update info

Returns:
none public

Definition at line 951 of file BitSystem.php.

BitSystem::registerUserPermissions ( packagedir,
userpermissions 
)

Wrap registerSchemaDefault to handle an array of defaults

Returns:
none public

Definition at line 971 of file BitSystem.php.

BitSystem::scanPackages ( pScanFile = 'bit_setup_inc.php',
pOnce = TRUE,
pSelect = '',
pAutoRegister = TRUE 
)

scan all available packages. This is an *expensive* function. DO NOT call this functionally regularly , or arbitrarily. Failure to comply is punishable by death by jello suffication!

Parameters:
string $ pScanFile file to be looked for
string $ pOnce - TRUE = do include_once to load file FALSE = do include to load the file
string $ pSelect - empty or 'all' = load all packages, 'installed' = load installed, 'active' = load active, 'x' = load packages with status x
string $ autoRegister - TRUE = autoregister any packages that don't register on their own, FALSE = don't
string $ fileSystemScan - TRUE = scan file system for packages to load, False = don't
Returns:
none
Packages have three different names: The directory name where they reside on disk The Name they register themselves as when they call registerPackage The Key for the array $this->mPackages

Example: A package in directory 'stars' that registers itself with a name of 'Star Ratings' would have these three names:

Directory Name: 'stars' Registered Name: Star Ratings' $this->mPackages key: 'star_ratings'

Of course, its possible for all three names to be the same if the registered name is all lower case without spaces and is the same as the diretory name.

Functions that expect a package name as a parameter should make clear which form of the name they expect.

public

Definition at line 1093 of file BitSystem.php.

References $gPreScan, and FALSE.

BitSystem::sendEmail ( pMailHash  ) 

centralized function for send emails

Parameters:
$mid the name of the template for the page content public

Definition at line 347 of file BitSystem.php.

References $_SERVER, and getConfig().

Here is the call graph for this function: