You are here

protected function QueryPathCssEventHandler::lang in QueryPath 6

Same name and namespace in other branches
  1. 7.3 QueryPath/CssEventHandler.php \QueryPathCssEventHandler::lang()
  2. 7.2 QueryPath/CssEventHandler.php \QueryPathCssEventHandler::lang()
1 call to QueryPathCssEventHandler::lang()
QueryPathCssEventHandler::pseudoClass in QueryPath/CssEventHandler.php

File

QueryPath/CssEventHandler.php, line 744

Class

QueryPathCssEventHandler

Code

protected function lang($value) {
  $operator = strpos($value, '-') !== FALSE ? self::isExactly : self::containsWithHyphen;
  $orig = $this->matches;
  $origDepth = $this->findAnyElement;
  $this
    ->attribute('lang', $value, $operator);
  $lang = $this->matches;
  $this->matches = $orig;
  $this->findAnyElement = $origDepth;
  $this
    ->attributeNS('lang', 'xml', $value, $operator);
  foreach ($this->matches as $added) {
    $lang
      ->attach($added);
  }
  $this->matches = $lang;
}