BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
BsDOMHelper Class Reference

Static Public Member Functions

static getPreviousDOMElementSibling ($oNode, $aElementNames=array())
 
static getNextDOMElementSibling ($oNode, $aElementNames=array())
 
static getParentDOMElement ($oNode, $aElementNames=array())
 
static getFirstDOMElementChild ($oNode, $aElementNames=array())
 
static addClassesRecursive ($oNode, $aClasses, $bOverrideExisting=false)
 
static insertAfter ($oNode, $oRefNode)
 
static getElementsByClassNames ($oDOMDoc, $aClassNames)
 
static getElementsByTagNames ($oDOMDoc, $aTagnames)
 
static removeElement ($oEl)
 

Member Function Documentation

static BsDOMHelper::addClassesRecursive (   $oNode,
  $aClasses,
  $bOverrideExisting = false 
)
static

Adds one or more entries to the "class" attribute of all childNodes in a recursive manner

Parameters
DOMElement$oNode
array$aClasses
bool$bOverrideExistingWether or not to override existing classes
static BsDOMHelper::getElementsByClassNames (   $oDOMDoc,
  $aClassNames 
)
static

HINT: http://stackoverflow.com/questions/1604471/how-can-i-find-an-element-by-css-class-with-xpath

Parameters
DOMDocument$oDOMDoc
array$aClassNames
Returns
array of DOMElement
static BsDOMHelper::getElementsByTagNames (   $oDOMDoc,
  $aTagnames 
)
static

Returns an array of DOMElements of given tag names. The returned array is ordered according to the provided tag name array

Parameters
DOMDocument$oDOMDoc
array$aTagnames
Returns
array of DOMElements Empty array if no tags of the specified names were found of provided list was no array
static BsDOMHelper::getFirstDOMElementChild (   $oNode,
  $aElementNames = array() 
)
static

Finds the previous DOMElement starting from $oNode in the DOM tree

Parameters
DOMNode$oNode
array$aElementNames
Returns
DOMElement | null
static BsDOMHelper::getNextDOMElementSibling (   $oNode,
  $aElementNames = array() 
)
static

Finds the next DOMElement starting from $oNode in the DOM tree

Parameters
DOMNode$oNode
array$aElementNames
Returns
DOMElement | null
static BsDOMHelper::getParentDOMElement (   $oNode,
  $aElementNames = array() 
)
static

Finds the previous DOMElement starting from $oNode in the DOM tree

Parameters
DOMNode$oNode
array$aElementNames
Returns
DOMElement | null
static BsDOMHelper::getPreviousDOMElementSibling (   $oNode,
  $aElementNames = array() 
)
static

Finds the previous DOMElement starting from $oNode in the DOM tree

Parameters
DOMNode$oNode
array$aElementNames
Returns
DOMElement | null
static BsDOMHelper::insertAfter (   $oNode,
  $oRefNode 
)
static

Inserts a DOMNode after another DOMNode in the DOM tree

Parameters
DOMNode$oNode
DOMNode$oRefNode
static BsDOMHelper::removeElement (   $oEl)
static

Tries to remove a DOMElement from the DOM tree.

Parameters
DOMElement$oEl
Returns
boolean true on success, false if the operation could not be performed

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