vB_Library_Phrase
extends vB_Library
in package
vB_Library_Phrase
Tags
Table of Contents
- VALID_CLASS = 'A-Za-z0-9_\.\[\]'
- Characters that are valid for use in a phrase varname. Alphanumeric and underscore (_) are commonly used everywhere. CKEditor phrase varnames use periods (.), and help phrase varnames use square brackets ([]).
- $instance : mixed
- __serialize() : mixed
- __sleep() : mixed
- __unserialize() : mixed
- __wakeup() : mixed
- cleanGuidForPhrase() : string
- Cleans a guid to match phrase valid class (self::VALID_CLASS).
- clearCache() : mixed
- getContentInstance() : mixed
- instance() : vB_PageCache
- Returns singleton instance of self.
- monitorWords() : mixed
- Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
- replaceOptionsAndConfigValuesInPhrase() : string
- Replaces instances of vBulletin options and config variables in a phrase with the value held in the variable.
- save() : void
- Add a new phrase or update an existing phrase
- setPhraseDate() : mixed
- Resets the phrase cachebuster date.
- __construct() : mixed
- getLibraryClassNameInternal() : mixed
Constants
VALID_CLASS
Characters that are valid for use in a phrase varname. Alphanumeric and underscore (_) are commonly used everywhere. CKEditor phrase varnames use periods (.), and help phrase varnames use square brackets ([]).
public
string
VALID_CLASS
= 'A-Za-z0-9_\.\[\]'
Properties
$instance
protected
static mixed
$instance
= array()
Methods
__serialize()
public
__serialize() : mixed
Return values
mixed —__sleep()
public
__sleep() : mixed
Return values
mixed —__unserialize()
public
__unserialize(mixed $serialized) : mixed
Parameters
- $serialized : mixed
Return values
mixed —__wakeup()
public
__wakeup() : mixed
Return values
mixed —cleanGuidForPhrase()
Cleans a guid to match phrase valid class (self::VALID_CLASS).
public
cleanGuidForPhrase(mixed $guid) : string
This is used to build phrases for import items. Example: title and description for pages - 'page_' . $guidforphrase . 'title' - 'page' . $guidforphrase . '_description'
Parameters
- $guid : mixed
Return values
string —GUID for phrase.
clearCache()
public
static clearCache() : mixed
Return values
mixed —getContentInstance()
public
static getContentInstance(mixed $contenttypeid) : mixed
Parameters
- $contenttypeid : mixed
Return values
mixed —instance()
Returns singleton instance of self.
public
static instance(mixed $class) : vB_PageCache
Parameters
- $class : mixed
Return values
vB_PageCache —- Reference to singleton instance of the cache handler
monitorWords()
Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
public
monitorWords(mixed $text, mixed $type, mixed $nodeid[, mixed $userid = null ][, mixed $insertNotifications = true ], mixed $currentuserid) : mixed
Parameters
- $text : mixed
- $type : mixed
- $nodeid : mixed
- $userid : mixed = null
- $insertNotifications : mixed = true
- $currentuserid : mixed
Return values
mixed —replaceOptionsAndConfigValuesInPhrase()
Replaces instances of vBulletin options and config variables in a phrase with the value held in the variable.
public
replaceOptionsAndConfigValuesInPhrase(mixed $text) : string
This function currently supports variables such as $vbulletin->config[xxx][yyy] and $vbulletin->options[xxx], and is intended to be used in Admin CP phrases, primarily help phrases.
This function is placed here in the spirit of DRY, since it's needed in various places, and for namespacing. It's not dependent on anything else in the phrase library.
Parameters
- $text : mixed
Return values
string —The phrase textafter replacements are done.
save()
Add a new phrase or update an existing phrase
public
save(string $fieldname, string $varname, array<string|int, mixed> $data[, bool $skipBuildLanguage = false ]) : void
Parameters
- $fieldname : string
-
New Phrase Type for adding, old Phrase Type for editing
- $varname : string
-
New Varname for adding, old Varname for editing
- $data : array<string|int, mixed>
-
Phrase data to be added or updated 'text' => Phrase text array. 'oldvarname' => Old varname for editing only 'oldfieldname' => Old fieldname for editing only 't' => 'ismaster' => 'product' => Product ID of the phrase
- $skipBuildLanguage : bool = false
-
(Optional) Set to true to skip build_language() call. Used by the page importer to delay build_language until the old page title & desc restore queries are finished.
Return values
void —setPhraseDate()
Resets the phrase cachebuster date.
public
setPhraseDate() : mixed
Return values
mixed —__construct()
protected
__construct() : mixed
Return values
mixed —getLibraryClassNameInternal()
protected
static getLibraryClassNameInternal(mixed $controller) : mixed
Parameters
- $controller : mixed