예제 #1
0
 /**
  * Get user agent information as XML
  * @param \DOMElement $node
  */
 public static function getUserAgentXML($node)
 {
     if ($ua = self::getUserAgent()) {
         DOM::array2domAttr($node, $ua);
     }
     if ($uac = self::getUserAgentClass()) {
         $node->setAttribute('uaClass', $uac);
     }
 }
예제 #2
0
파일: Plugger.php 프로젝트: difra-org/difra
 /**
  * Get plugins information as XML
  * @param \DOMElement|\DOMNode $node
  */
 public static function getPluginsXML($node)
 {
     self::smartPluginsEnable();
     self::fillMissingReq();
     $pluginsNode = $node->appendChild($node->ownerDocument->createElement('plugins'));
     DOM::array2domAttr($pluginsNode, self::$pluginsData);
     $provisionsNode = $node->appendChild($node->ownerDocument->createElement('provisions'));
     DOM::array2domAttr($provisionsNode, self::$provisions);
 }
예제 #3
0
 /**
  * Add console data to output XML
  * @param \DOMNode|\DOMElement $node
  * @param bool $standalone
  * @return string
  */
 public static function debugXML($node, $standalone = false)
 {
     self::init();
     $node->setAttribute('debug', self::$enabled ? '1' : '0');
     $node->setAttribute('debugConsole', self::$console);
     $node->setAttribute('caches', self::$caches ? '1' : '0');
     if (!self::$console) {
         return;
     }
     /** @var $debugNode \DOMElement */
     $debugNode = $node->appendChild($node->ownerDocument->createElement('debug'));
     Libs\XML\DOM::array2domAttr($debugNode, self::$output, true);
     if ($standalone) {
         $node->setAttribute('standalone', 1);
     }
 }
예제 #4
0
파일: HTML.php 프로젝트: difra-org/difra
 /**
  * If some disallowed element is not empty, replace it with span
  * @param \DOMElement $node
  */
 private function replace(&$node)
 {
     if (!$node->hasChildNodes()) {
         $node->parentNode->removeChild($node);
         return;
     }
     DOM::renameNode($node, 'span');
 }