BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
BsCore Class Reference

Public Member Functions

 parseWikiText ($sText, $oTitle, $nocache=false, $numberheadings=null)
 
 getUserMiniProfile ($oUser, $aParams=array())
 
 registerPermission ($sPermissionName, $aUserGroups=array(), $aConfig=array())
 
 registerBehaviorSwitch ($sMagicWord, $aCallback=null)
 
 behaviorSwitches (&$article, &$content)
 
 hideBehaviorSwitches (&$parser, &$text)
 
 recoverBehaviorSwitches (&$parser, &$text)
 
 lastChanceBehaviorSwitches ($editPage)
 

Static Public Member Functions

static getForbiddenCharsInArticleTitle ()
 
static getInstance ()
 
static sanitize ($handover, $default=false, $options=BsPARAMTYPE::STRING)
 
static sanitizeArrayEntry ($array, $key, $default=null, $options=null)
 
static doInitialise ()
 
static getFileSystemPath ()
 
static getUserDisplayName ($oUser=null)
 
static getRequestURI ($getUrlEncoded=false)
 
static checkAccessAdmission ($sPermission= 'read', $sI18NInstanceKey= 'BlueSpice', $sI18NMessageKey= 'not_allowed', $bSilent=true)
 
static loadCurrentUser ()
 
static addTemplateLinkDependencyByText ($oParser, $sTitle)
 
static addTemplateLinkDependency ($oParser, $oTitle)
 
static getMediaWikiIncludePath ()
 
static getMediaWikiWebrootPath ()
 

Public Attributes

 $aBehaviorSwitches = array()
 

Protected Attributes

 $aEditButtons = array()
 
 $aEditButtonRanking = array()
 

Static Protected Attributes

static $prForbiddenCharsInArticleTitle = array( '#', '<', '>', '[', ']', '|', '{', '}' )
 
static $oInstance = null
 
static $bExtJsLoaded = false
 
static $prRequestUri = null
 
static $prUrlIsEncoded = false
 
static $oLocalParser = false
 
static $oLocalParserOptions = false
 
static $prCurrentUser = null
 
static $aUserMiniProfiles = array()
 
static $bHtmlFormClassLoaded = false
 

Member Function Documentation

static BsCore::addTemplateLinkDependency (   $oParser,
  $oTitle 
)
static

Make the page being parsed have a dependency on $page via the templatelinks table. http://www.mediawiki.org/wiki/Manual:Tag_extensions#Regenerating_the_page_when_another_page_is_edited

Parameters
Parser$oParser
Title$oTitle
static BsCore::addTemplateLinkDependencyByText (   $oParser,
  $sTitle 
)
static

Make the page being parsed have a dependency on $page via the templatelinks table. http://www.mediawiki.org/wiki/Manual:Tag_extensions#Regenerating_the_page_when_another_page_is_edited

Parameters
Parser$oParser
String$sTitle
BsCore::behaviorSwitches ( $article,
$content 
)

Hook-handler for "ArticleAfterFetchContentObject"

Parameters
WikiPage$article
Content$content
Returns
boolean Always true to keep hook running
static BsCore::checkAccessAdmission (   $sPermission = 'read',
  $sI18NInstanceKey = 'BlueSpice',
  $sI18NMessageKey = 'not_allowed',
  $bSilent = true 
)
static
Parameters
string$sPermission
string$sI18NInstanceKey
string$sI18NMessageKey
bool$bSilent
Returns
bool
static BsCore::getInstance ( )
static

Used to access the singleton BlueSpice object.

Returns
BsCore Singleton instance of BlueSpice object.
static BsCore::getMediaWikiIncludePath ( )
static

Returns the MediaWiki include path variable String $IP MediaWiki include path variable

Returns
String MediaWiki include path variable
static BsCore::getMediaWikiWebrootPath ( )
static

Returns the filesystempath to the webroot directory in which MediaWiki is installed. String $wgScriptPath The relative path from the webroot for hyperlinks.

Returns
String Webroot directory in which MediaWiki is installed
static BsCore::getRequestURI (   $getUrlEncoded = false)
static

Determines the request URI for Apache and IIS

Parameters
bool$getUrlEncodedset to true to get URI url encoded
Returns
string the requested URI
static BsCore::getUserDisplayName (   $oUser = null)
static
Deprecated:
since version 2.23.2
Parameters
User$oUser
Returns
String
BsCore::getUserMiniProfile (   $oUser,
  $aParams = array() 
)

Creates a miniprofile for a user. It consists if the useres profile image and links to his userpage. In future versions it should also have a little menu with his mail adress, and other profile information.

Parameters
User$oUserThe requested MediaWiki User object
array$aParamsThe settings array for the mini profile view object
Returns
ViewUserMiniProfile A view with the users mini profile
BsCore::hideBehaviorSwitches ( $parser,
$text 
)

Hook-handler for "ParserBeforeStrip"

Parameters
Parser$parser
string$text
Returns
boolean Always true to keep hook running
Deprecated:
since version 2.22
BsCore::lastChanceBehaviorSwitches (   $editPage)

Hook-handler for "EditPage::showEditForm:initial" Needed for edit and sumbit (preview) mode

Parameters
EditPage$editPage
Returns
boolean Always true to keep hook running
BsCore::parseWikiText (   $sText,
  $oTitle,
  $nocache = false,
  $numberheadings = null 
)

Parses WikiText into HTML

Parameters
string$sTextWikiText
Title$oTitle
bool$nocacheDISFUNCTIONAL and therefore DEPRECATED. There is no chaching anyway.
bool$numberheadings
Returns
string The HTML result
BsCore::recoverBehaviorSwitches ( $parser,
$text 
)

Hook-handler for "ParserBeforeTidy"

Parameters
Parser$parser
string$text
Returns
boolean Always true to keep hook running
Deprecated:
since version 2.22
BsCore::registerBehaviorSwitch (   $sMagicWord,
  $aCallback = null 
)

Register a callback for a MagicWord

Parameters
string$sMagicWordThe MagicWord in upper case and without surrounding double underscores. OR: if $callback == null this may be a lower case identifier that gets written to the page_props table by the parser.
callable$aCallbackor null to use MediaWiki page_props mechanism
BsCore::registerPermission (   $sPermissionName,
  $aUserGroups = array(),
  $aConfig = array() 
)

Registers a permission with the MediaWiki Framework. object for proper internationalisation of your permission. Every permission is granted automatically to the user group 'sysop'. You can specify additional groups through the third parameter.

Parameters
String$sPermissionNameI.e. 'myextension-dosomething'
Array$aUserGroupsUser groups that get preinitialized with the new pemission. I.e. array( 'user', 'bureaucrats' )
Array$aConfigset configs for permissions i.e. array('type'=>'global'). The default here is ('type' = 'namespace')
Returns
void
static BsCore::sanitize (   $handover,
  $default = false,
  $options = BsPARAMTYPE::STRING 
)
static

When retrieving data from sources different from the BsCore::getParam() method, use this interface to sanitize the value. For security reasons it is strongly recommended to use this method!

Parameters
mixed$handoverThe value that has to be sanitized.
mixed$defaultA default value that gets returned, if the submitted value is not valid or does not match the requested BsPARAMTYPE.
BsPARAMTYPE$optionsSets the type of the expected return value. This information is used for proper sanitizing.
Returns
mixed Depending on the BsPARAMTYPE sumbitted in $options the sanitized $handover or in case of invalidity of $handover, the $default value.
static BsCore::sanitizeArrayEntry (   $array,
  $key,
  $default = null,
  $options = null 
)
static

When retrieving data from sources different from the BsCore::getParam() method, use this interface to sanitize an array. For security reasons it is strongly recommended to use this method!

Parameters
array$arrayThe array that has to be sanitized.
array$defaultA default array that gets returned, if the submitted array is not valid or does not match the requested BsPARAMTYPE.
BsPARAMTYPE$optionsSets the type of the expected return value. This information is used for proper sanitizing.
Returns
array Depending on the BsPARAMTYPE sumbitted in $options the sanitized $array or in case of invalidity of $array, the $default array.

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