Model for style properties and style property definitions.
Note that throughout, style ID -1 is the ACP master.
| package | XenForo_StyleProperty |
|---|
__construct()
Use create() statically unless you know what you're doing.
| inherited_from | \XenForo_Model::__construct() |
|---|
addFetchOptionJoin(array $fetchOptions, integer $join)
Join should be one of the constants.
| inherited_from | \XenForo_Model::addFetchOptionJoin() |
|---|
array
integer
addPositionLimit(string $table, integer $limit, integer $offset, string $column) : string
It no limit value is specified, nothing will be returned.
This must be added within a WHERE clause. If a clause is required, it will begin with "AND", so ensure there is a condition before it.
| inherited_from | \XenForo_Model::addPositionLimit() |
|---|
stringName of the table alias to prefix. May be blank for no table reference.
integerNumber of records to limit to; ignored if <= 0
integerOffset from the start of the records. 0+
stringName of the column that is storing the position
stringPosition limit clause if neededappendStylePropertyXml(\DOMElement $rootNode, integer $styleId, string | null $addOnId)
integerStyle to read values/definitions from
stringnullIf not null, limits to values/definitions in the specified add-on
assertValidCutOffOperator(string $operator)
| inherited_from | \XenForo_Model::assertValidCutOffOperator() |
|---|
string
canEditStyleProperty(integer $styleId) : boolean
integer
booleancanEditStylePropertyDefinition(integer $styleId) : boolean
integer
booleancompileCssPropertyForCache(array $original, array $properties) : array
arrayOriginal, input-based CSS rule
arrayA list of all properties, for resolving variable style references
arrayCSS rule for cachecompileCssProperty_cleanUp(array $output, array $original) : array
arrayOutput CSS property
arrayOriginal format of CSS property
arrayUpdated output CSS propertycompileCssProperty_compileRules(array $output, array $original) : array
arrayOutput CSS property
arrayOriginal format of CSS property
arrayUpdated output CSS propertycompileCssProperty_sanitize(array $output, array $original) : array
arrayOutput CSS property
arrayOriginal format of CSS property
arrayUpdated output CSS propertycompileScalarPropertyForCache(string $original, array $properties) : string
stringOriginal property value
arrayA list of all properties, for resolving variable style references
stringconvertAtPropertiesToTemplateSyntax(string $text, array $properties) : string
string
array
stringcreate(string $class) : \XenForo_Model
The class must exist or be autoloadable or an exception will be thrown.
| inherited_from | \XenForo_Model::create() |
|---|
stringClass to load
createOrUpdateStylePropertyDefinition(integer $definitionId, array $input) : array
Input data is named after fields in the style property definition, as well as property_value_scalar and property_value_css.
integerDefinition to update; if 0, creates a new one
arrayList of data from input to change in definition
arrayDefinition info after savingdeleteStylePropertiesAndDefinitionsInStyle(integer $styleId, string | null $addOnId, boolean $leaveChildCustomizations)
integerStyle to delete from. 0 for master, -1 for admin
stringnullIf not null, limits deletions to an ad-on
booleanIf true, child customizations of a deleted definition will be left
deleteStylePropertyDevelopmentFile(string $name, integer $styleId)
string
integerDefinition style ID.
deleteStylePropertyDevelopmentFileIfNeeded(array $definition, array $property)
This is used when reverting a customized property; the file is only deleted if we're deleting the property from a style other than the one it was created in.
array
array
deleteStylePropertyGroupsInStyle(integer $styleId, string | null $addOnId)
integerStyle to delete from. 0 for master, -1 for admin
stringnullIf not null, limits deletions to an ad-on
fetchAllKeyed(string $sql, string $key, mixed $bind, string $nullPrefix) : array
The 'key' parameter provides the column name with which to key the result. For example, calling fetchAllKeyed('SELECT item_id, title, date FROM table', 'item_id') would result in an array keyed by item_id: [$itemId] => array('item_id' => $itemId, 'title' => $title, 'date' => $date)
Note that the specified key must exist in the query result, or it will be ignored.
| inherited_from | \XenForo_Model::fetchAllKeyed() |
|---|
stringSQL to execute
stringColumn with which to key the results array
mixedParameters for the SQL
stringIf the key is null, prefix the counter with this
arrayfilterPropertiesByType(array $properties)
array[scalar props, css props]
getColorPalettePropertiesInStyle(integer $styleId, array $path, array $properties) : array
integer
arraynullPath from style to root (earlier positions closer to style); if null, determined automatically
arraynullList of properties in this style and all parent styles; if null, determined automatically
arraygetConditionsForClause(array $sqlConditions) : string
This always returns a value that can be used in a clause such as WHERE.
| inherited_from | \XenForo_Model::getConditionsForClause() |
|---|
array
stringgetContentTypeField(string $contentType, string $fieldName) : string | false
| inherited_from | \XenForo_Model::getContentTypeField() |
|---|
string
string
stringfalse
getContentTypesWithField(string $fieldName) : array
| inherited_from | \XenForo_Model::getContentTypesWithField() |
|---|
string
arrayFormat: [content type] => field valuegetDefaultStylePropertyDefinition(integer $styleId, string $groupName) : array
integer
string
arraygetDefaultStylePropertyGroup(integer $styleId) : array
integer
arraygetEffectiveStylePropertiesByGroup(integer $styleId, array $path, array $properties) : array
Properties are organized within the groups (in properties key).
integer
arraynullPath from style to root (earlier positions closer to style); if null, determined automatically
arraynullList of properties in this style and all parent styles; if null, determined automatically
arrayFormat: [group name] => group info, with [properties][definition id] => property infogetEffectiveStylePropertiesInStyle(integer $styleId, array $path, array $properties) : array
This includes properties that have been customized/created in a parent style.
Includes effectiveState key in each property (customized, inherited, default).
integer
arraynullPath from style to root (earlier positions closer to style); if null, determined automatically
arraynullList of properties in this style and all parent styles; if null, determined automatically
arrayFormat: [definition id] => infogetEffectiveStylePropertyGroupsInStyle(integer $styleId, array $path) : array
integer
arraynullPath from style to root (earlier positions closer to style); if null, determined automatically
arrayFormat: [group name] => infogetModelFromCache(string $class) : \XenForo_Model
If it does not exist, it will be instantiated.
| inherited_from | \XenForo_Model::getModelFromCache() |
|---|
stringName of the class to load
getOrderByClause(array $choices, array $fetchOptions, string $defaultOrderSql) : string
| inherited_from | \XenForo_Model::getOrderByClause() |
|---|
array
array
string
stringOrder by clause or empty stringgetParentPathFromStyle($styleId) : array
For real styles, this is the parent list. However, this function can handle styles 0 (master) and -1 (ACP).
arrayParent list; earlier positions are more specificgetStyle(integer $styleId) : array | false
integer
arrayfalse
getStylePropertiesInStyleByDefinitions(integer $styleId, array $definitionIds) : array
integer
array
arrayFormat: [definition id] => infogetStylePropertiesInStyles(array $styleIds) : array
This only includes properties that have been customized or initially defined in the specified styles. Includes definition info.
array
arrayFormat: [property id] => infogetStylePropertyByDefinitionAndStyle(integer $definitionId, integer $styleId) : array | false
Includes definition info.
integer
integer
arrayfalse
getStylePropertyById(integer $id) : array | false
Includes definition info.
integer
arrayfalse
getStylePropertyDefinitionById(integer $propertyDefinitionId) : array | false
Includes default property value.
integer
arrayfalse
getStylePropertyDefinitionByNameAndStyle(string $name, integer $styleId) : array | false
Includes default property value.
string
integer
arrayfalse
getStylePropertyDefinitionsByGroup($groupName, integer | null $styleId) : array
integernullIf specified, limits to definitions in a specified style
arraygetStylePropertyDefinitionsByIds(array $propertyDefinitionIds) : array
Includes default property value.
array
arrayFormat: [property definition id] => infogetStylePropertyDefinitionsForAdminQuickSearch(string $searchText, array $propertyNames) : array
Does not include default property value.
string
array
arraygetStylePropertyDescriptionPhraseName(array $property) : string
array
stringgetStylePropertyDevelopmentDirectory(integer $styleId) : string
Returns an empty string for non-master properties.
integer
stringgetStylePropertyDevelopmentFileName(string $propertyName, integer $styleId) : string
Ensures directory is writable.
string
integer
stringgetStylePropertyDevelopmentXml(integer $styleId) : \DOMDocument
getStylePropertyGroupById(integer $groupId) : array | false
integer
arrayfalse
getStylePropertyGroupDescriptionPhraseName(array $group) : string
array
stringgetStylePropertyGroupOptions(integer $styleId) : array
integer
arrayFormat: [name] => titlegetStylePropertyGroupTitlePhraseName(array $group) : string
array
stringgetStylePropertyGroupsInStyles(array $styleIds) : array
array
arrayFormat: [property group id] => infogetStylePropertyTitlePhraseName(array $property) : string
array
stringgroupStylePropertiesByStyle(array $properties) : array
This uses the customization style (not definition style) for grouping.
array
arrayFormat: [style id][definition id] => infoimportStylePropertiesFromArray(array $newProperties, array $newGroups, integer $styleId, string | null $addOnId)
arrayList of properties and definitions to import
arrayList of groups to import
integerTarget style ID
stringnullIf not null, only replaces properties with this add-on; otherwise, all in style
importStylePropertiesFromDevelopment(integer $styleId)
This only imports one style's worth of properties at a time.
integerStyle to import for
importStylePropertyDevelopmentXml(string $fileName, $styleId)
stringFile to read the XML from
importStylePropertyXml(\SimpleXMLElement $xml, integer $styleId, string | null $addOnId)
integerTarget style ID
stringnullIf not null, target add-on for definitions; if null, add-on is ''
keyPropertiesByName(array $properties) : array
This is only safe to do when getting properties (effective or not) for a single style.
array
arraylimitQueryResults(string $query, integer $limit, integer $offset) : string
If the limit value is 0 or less, no clause is applied.
| inherited_from | \XenForo_Model::limitQueryResults() |
|---|
stringSQL query to run
integerNumber of records to limit to; ignored if <= 0
integerOffset from the start of the records. 0+
stringQuery with limit applied if necessarymoveStylePropertiesBetweenGroups(string $sourceGroup, string $destinationGroup)
string
string
moveStylePropertyDevelopmentFile(array $oldDefinition, array $newDefinition)
array
array
parseBackgroundCss(string $value) : array | false
string
arrayfalseList of property rules to apply or false if shortcut could not be parsedparseBorderCss(string $value, string $name) : array | false
string
stringThe name of the shortcut (border, border-top, etc)
arrayfalseList of property rules to apply or false if shortcut could not be parsedparseFontCss(string $value) : array | false
string
arrayfalseList of property rules to apply or false if shortcut could not be parsedparsePaddingMarginCss(string $value, array $values) : boolean
string
arrayBy reference. Pushes out the effective padding/margin values to later be pulled together.
booleanprepareLimitFetchOptions(array $fetchOptions) : array
Includes: limit, offset, page, and perPage.
| inherited_from | \XenForo_Model::prepareLimitFetchOptions() |
|---|
arrayUnprepared options
arrayLimit options; keys: limit, offsetprepareStateLimitFromConditions(array $fetchOptions, string $table, string $stateField, string $userField) : string
Looks for keys "deleted" and "moderated".
| inherited_from | \XenForo_Model::prepareStateLimitFromConditions() |
|---|
array
stringName of the table to prefix the state and user fields with
stringName of the field that holds the state
stringName of the field that holds the user ID
stringSQL condition to limit stateprepareStyleProperties(array $properties, integer | null $displayStyleId) : array
array
integernullThe ID of the style the properties are being edited in
arrayprepareStyleProperty(array $property, integer | null $displayStyleId) : array
array
integernullThe ID of the style the properties are being edited in
arrayPrepared versionprepareStylePropertyGroup(array $group, integer | null $displayStyleId) : array
If properties are found within, they will be automatically prepared.
integernullThe ID of the style the groups/properties are being edited in
arrayPrepared versionprepareStylePropertyGroups(array $groups, integer | null $displayStyleId) : array
If properties are found within, they will be automatically prepared.
array
integernullThe ID of the style the groups/properties are being edited in
arrayprepareStylePropertyPhrases(array $property) : array
array
arrayrebuildPropertyCacheForAllStyles()
rebuildPropertyCacheInStyleAndChildren(integer $styleId) : array
integer
arrayThe property cache for the requested stylereplacePropertiesInTemplateForEditor(string $templateText, integer $editStyleId, array $properties) : string
This allows for easier editing and viewing of properties.
stringTemplate with {xen:property} references
integerThe style the template is being edited in
arraynullA list of valid style properties; if null, grabbed automatically ([name] => property)
stringReplaced template textreplaceVariablesInStylePropertyValue(string $value, array $properties, array $seenProperties) : string
stringProperty value. This is an individual string value.
arrayList of properites to read from.
stringresetLocalCacheData($name)
This can be used if you know when some cached data has expired.
| inherited_from | \XenForo_Model::resetLocalCacheData() |
|---|
saveStylePropertiesInStyleFromInput(integer $styleId, array $properties, array $reset)
integerStyle to change properties in
arrayProperties from input; keyed by definition ID
arrayList of properties to reset if customized; keyed by definition ID
saveStylePropertiesInStyleFromTemplate(integer $styleId, array $updates, array $properties)
integerStyle to save properties into
arrayList of property data to update (return from translateEditorPropertiesToArray)
arrayList of style properties available in this style. Keyed by name!
setAllowCachedRead(boolean $allowCachedRead)
This may be controllable on an individual level basis, if the implementation allows it.
| inherited_from | \XenForo_Model::setAllowCachedRead() |
|---|
boolean
setLocalCacheData(string $name, $value)
This should only be used if you know what you're doing or for testing purposes!
Note that you cannot get the existing data via the public interface. If you think you need the set data, use a new object. It defaults to empty. :)
| inherited_from | \XenForo_Model::setLocalCacheData() |
|---|
string
standardizeNodePermissionsAndUserId(integer $nodeId, array | null $permissions, integer | null $userId)
If an invalid permission set or user ID is provided, the current visitor's will be used.
| inherited_from | \XenForo_Model::standardizeNodePermissionsAndUserId() |
|---|
integerNode permissions are for
arraynullPermissions for node or null to use current visitor's permissions
integernullUser permissions belong to or null to use current visitor
standardizePermissionCombinationIdAndUserId(integer | null $permissionCombinationId, integer | null $userId)
If null, users current visitor's values.
| inherited_from | \XenForo_Model::standardizePermissionCombinationIdAndUserId() |
|---|
integernullPermission combination ID or null to use current visitor
integernullUser permissions belong to or null to use current visitor
standardizePermissionsAndUserId(array | null $permissions, integer | null $userId)
If an invalid permission set or user ID is provided, the current visitor's will be used.
| inherited_from | \XenForo_Model::standardizePermissionsAndUserId() |
|---|
arraynullGlobal pPermissions or null to use current visitor's permissions
integernullUser permissions belong to or null to use current visitor
standardizeViewingUserReference(array $viewingUser)
This array must contain all basic user info (preferably all user info) and include global permissions in a "permissions" key. If not an array or missing a user_id, the visitor's values will be used.
| inherited_from | \XenForo_Model::standardizeViewingUserReference() |
|---|
arraynull
standardizeViewingUserReferenceForNode(integer $nodeId, array $viewingUser, array $nodePermissions)
| inherited_from | \XenForo_Model::standardizeViewingUserReferenceForNode() |
|---|
integer
arraynullViewing user; if null, use visitor
arraynullPermissions for this node; if null, use visitor's
translateEditorPropertiesToArray(string $templateText, string $outputText, array $properties) : array
stringTemplate with @ property references
stringBy reference, the template with {xen:property} values instead
arrayA list of valid style properties in the correct style; keyed by named
arrayProperty values from the template text. Change detection still needs to be run.unserializePermissionsInList(array $items, string $serializedKey, string $targetKey) : array
| inherited_from | \XenForo_Model::unserializePermissionsInList() |
|---|
arrayList of items
stringKey where serialized permissions are
stringKey where unserialized permissions will go
arrayList of items with permissions unserializedupdatePropertyCacheInStyle(integer $styleId, array $effectiveProperties, array $style) : array | false
integer
arrayList of effective properties in style.
arraynullStyle information; queried if needed
arrayfalseCompiled property cacheupdateStylePropertyDevelopmentFile(array $definition)
array
updateStylePropertyValue(array $definition, integer $styleId, mixed $newValue, array $extraOptions, mixed $existingProperty, string $existingValue)
arrayStyle property definition
integerStyle property is being changed in
mixedNew value (string for scalar; array for css)
booleanExtra options to pass to the data writer
mixedIf array/false, considered to be the property to be updated; otherwise, determined automatically
stringThe existing value in the place of this property. This may come from the parent style (unlike $existingProperty). This prevents customization from occurring when a value isn't changed.
writeStylePropertyDevelopmentFile(array $definition, array $property)
arrayProperty definition
arrayProperty value
_atToPropertyCallback($property)
_getCache(boolean $forceCachedRead) : \Zend_Cache_Core | \Zend_Cache_Frontend | false
If cache reads are disabled, this will return false.
| inherited_from | \XenForo_Model::_getCache() |
|---|
booleanIf true, the global "allow cached read" value is ignored
\Zend_Cache_Core\Zend_Cache_Frontendfalse
_getCssValue(array $search, string | array $key) : string
Gets the value(s) for one or more CSS rule keys. Multiple keys will be separated by a space.
arrayArray to search for keys in
stringarrayOne or more keys to search for
stringValues for matching keys; space separated_getCssValueRule(array $search, string | array $key) : string
Gets the full rule(s) for one or more CSS rule keys.
arrayArray to search for keys in
stringarrayOne or more keys to search for
stringFull CSS rules_getDb() : \Zend_Db_Adapter_Abstract
| inherited_from | \XenForo_Model::_getDb() |
|---|
\Zend_Db_Adapter_Abstract_getLocalCacheData(string $name) : mixed
| inherited_from | \XenForo_Model::_getLocalCacheData() |
|---|
string
mixed_getPaddingMarginShortCuts($type, array $output)
$_allowCachedRead : boolean
If not, it should be retrieved from the source.
| inherited_from | \XenForo_Model::$$_allowCachedRead |
|---|
$_cache : \Zend_Cache_Core | \Zend_Cache_Frontend
| inherited_from | \XenForo_Model::$$_cache |
|---|
$_db : \Zend_Db_Adapter_Abstract
| inherited_from | \XenForo_Model::$$_db |
|---|
$_localCacheData : array
This data is generally treated as canonical, even if {$_allowCachedRead} is false.
| inherited_from | \XenForo_Model::$$_localCacheData |
|---|
$_modelCache : array
| inherited_from | \XenForo_Model::$$_modelCache |
|---|
$_tempProperties