ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
php4DOMNode Class Reference

php4DOMNode More...

+ Inheritance diagram for php4DOMNode:
+ Collaboration diagram for php4DOMNode:

Public Member Functions

 __construct ($aDomNode)
 
 append_child ($newnode)
 
 replace_node ($newnode)
 
 append_sibling ($newnode)
 
 attributes ()
 
 child_nodes ()
 
 children ()
 
 unlink_node ($aDomNode="")
 
 clone_node ($deep=false)
 
 first_child ()
 
 get_content ()
 
 has_attributes ()
 
 has_child_nodes ()
 
 insert_before ($newnode, $refnode)
 
 last_child ()
 
 next_sibling ()
 
 node_name ($a_local=false)
 
 node_type ()
 
 node_value ()
 
 parent_node ()
 
 previous_sibling ()
 
 remove_child ($oldchild)
 
 replace_child ($oldnode, $newnode)
 
 set_content ($text)
 

Data Fields

 $myDOMNode
 

Detailed Description

php4DOMNode

Definition at line 342 of file inc.xml5compliance.php.

Constructor & Destructor Documentation

◆ __construct()

php4DOMNode::__construct (   $aDomNode)

Definition at line 346 of file inc.xml5compliance.php.

347  {
348  $this->myDOMNode = $aDomNode;
349  }

Member Function Documentation

◆ append_child()

php4DOMNode::append_child (   $newnode)

Definition at line 351 of file inc.xml5compliance.php.

Referenced by ilPCTable\addCell(), ilDOMUtil\addElementToList(), ilPCTable\addRow(), ilPCParagraph\createAtNode(), ilMediaAliasItem\insert(), ilPageObject\insertContentNode(), ilPCDataTable\makeEmptyCell(), and ilDOMUtil\setFirstOptionalElement().

352  {
353  //echo "BH";
354  //if (strtolower(get_class($newnode)) != "php4domcdatasection")
355  //{
356  $doc = $this->myDOMNode->ownerDocument;
357  //echo "<br>BH1:".get_class($newnode).":";
358  $newnode->myDOMNode = $doc->importNode($newnode->myDOMNode, true);
359  //echo "BH2";
360  return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode));
361  //}
362  //else
363  //{
364  //}
365  }
php4DomElement
+ Here is the caller graph for this function:

◆ append_sibling()

php4DOMNode::append_sibling (   $newnode)

Definition at line 372 of file inc.xml5compliance.php.

373  {
374  return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode));
375  }
php4DomElement

◆ attributes()

php4DOMNode::attributes ( )

Definition at line 377 of file inc.xml5compliance.php.

References $i.

Referenced by ilPCTable\importCellAttributes(), and ilPCTable\importTableAttributes().

378  {
379  //echo "<br>node:".$this->myDOMNode->nodeName.":";
380  $myDOMNodeList = $this->myDOMNode->attributes;
381  $nodeSet = array();
382  $i = 0;
383  if (is_object($myDOMNodeList)) {
384  while ($node = $myDOMNodeList->item($i)) {
385  $nodeSet[] = new php4DOMAttr($node);
386  $i++;
387  }
388  }
389 
390  return $nodeSet;
391  }
$i
Definition: metadata.php:41
+ Here is the caller graph for this function:

◆ child_nodes()

php4DOMNode::child_nodes ( )

Definition at line 393 of file inc.xml5compliance.php.

References $i.

Referenced by ilDOMUtil\addElementToList(), children(), ilDOMUtil\deleteAllChildsByName(), ilPCTableData\deleteRowContent(), ilPCTableData\deleteTDContent(), ilPCTable\extractText(), ilPCTable\importHtml(), ilPCTable\importRow(), ilPCDataTable\makeEmptyCell(), ilPCTable\makeEmptyCell(), ilDOMUtil\setFirstOptionalElement(), and ilPCParagraph\setNode().

394  {
395  $myDOMNodeList = $this->myDOMNode->childNodes;
396  $nodeSet = array();
397  $i = 0;
398  while ($node = $myDOMNodeList->item($i)) {
399  $nodeSet[] = new php4DOMElement($node);
400  $i++;
401  }
402  return $nodeSet;
403  }
php4DomElement
$i
Definition: metadata.php:41
+ Here is the caller graph for this function:

◆ children()

php4DOMNode::children ( )

Definition at line 406 of file inc.xml5compliance.php.

References child_nodes().

407  {
408  //echo "<br>php4DomNode::children"; flush();
409  return $this->child_nodes();
410  }
+ Here is the call graph for this function:

◆ clone_node()

php4DOMNode::clone_node (   $deep = false)

Definition at line 427 of file inc.xml5compliance.php.

428  {
429  return new php4DOMElement($this->myDOMNode->cloneNode($deep));
430  }
php4DomElement

◆ first_child()

◆ get_content()

php4DOMNode::get_content ( )

Definition at line 437 of file inc.xml5compliance.php.

438  {
439  return $this->myDOMNode->textContent;
440  }

◆ has_attributes()

php4DOMNode::has_attributes ( )

Definition at line 442 of file inc.xml5compliance.php.

Referenced by ilPCTable\importCellAttributes(), and ilPCTable\importTableAttributes().

443  {
444  return $this->myDOMNode->hasAttributes();
445  }
+ Here is the caller graph for this function:

◆ has_child_nodes()

php4DOMNode::has_child_nodes ( )

Definition at line 447 of file inc.xml5compliance.php.

Referenced by ilPCTable\importHtml(), and ilPCTable\importRow().

448  {
449  return $this->myDOMNode->hasChildNodes();
450  }
+ Here is the caller graph for this function:

◆ insert_before()

php4DOMNode::insert_before (   $newnode,
  $refnode 
)

Definition at line 453 of file inc.xml5compliance.php.

References $myDOMNode.

Referenced by ilPCParagraph\createBeforeNode(), and ilPageObject\insertContentNode().

454  {
455  //echo "BH";
456  $doc = $this->myDOMNode->ownerDocument;
457  $newnode->myDOMNode = $doc->importNode($newnode->myDOMNode, true);
458 
459  $mydomnode = $this->myDOMNode;
460  $mynewnode = $newnode->myDOMNode;
461  $myrefnode = $refnode->myDOMNode;
462  try {
463  $domel = $mydomnode->insertBefore($mynewnode, $myrefnode);
464  } catch (DOMException $exception) {
465  // php 4 accepted $this == $refnode -> switch to parent of $this
466  $mydomnode = $this->myDOMNode->parentNode;
467  $domel = $mydomnode->insertBefore($mynewnode, $myrefnode);
468  }
469  $el = new php4DOMElement($domel);
470  return $el;
471  }
php4DomElement
+ Here is the caller graph for this function:

◆ last_child()

php4DOMNode::last_child ( )

Definition at line 474 of file inc.xml5compliance.php.

475  {
476  $last = $this->myDOMNode->lastChild;
477 
478  if (is_object($last)) {
479  return new php4DOMElement($last);
480  } else {
481  return false;
482  }
483  }
php4DomElement

◆ next_sibling()

php4DOMNode::next_sibling ( )

Definition at line 486 of file inc.xml5compliance.php.

Referenced by ilPCParagraph\createAfter().

487  {
488  $next = $this->myDOMNode->nextSibling;
489 
490  if (is_object($next)) {
491  return new php4DOMElement($next);
492  } else {
493  return false;
494  }
495  }
php4DomElement
+ Here is the caller graph for this function:

◆ node_name()

php4DOMNode::node_name (   $a_local = false)

Definition at line 497 of file inc.xml5compliance.php.

Referenced by ilPageObject\getParentContentObjectForPcId().

498  {
499  if ($a_local) {
500  return $this->myDOMNode->localName ?? "";
501  } else {
502  return $this->myDOMNode->nodeName ?? "";
503  }
504  }
+ Here is the caller graph for this function:

◆ node_type()

php4DOMNode::node_type ( )

Definition at line 506 of file inc.xml5compliance.php.

507  {
508  return $this->myDOMNode->nodeType;
509  }

◆ node_value()

php4DOMNode::node_value ( )

Definition at line 511 of file inc.xml5compliance.php.

512  {
513  return $this->myDOMNode->nodeValue;
514  }

◆ parent_node()

php4DOMNode::parent_node ( )

Definition at line 517 of file inc.xml5compliance.php.

Referenced by ilPCParagraph\createAfter(), and ilPageObject\getParentContentObjectForPcId().

518  {
519  $parent = $this->myDOMNode->parentNode;
520 
521  if (is_object($parent)) {
522  return new php4DOMElement($parent);
523  } else {
524  return false;
525  }
526  }
php4DomElement
+ Here is the caller graph for this function:

◆ previous_sibling()

php4DOMNode::previous_sibling ( )

Definition at line 529 of file inc.xml5compliance.php.

530  {
531  $prev = $this->myDOMNode->previousSibling;
532 
533  if (is_object($prev)) {
534  return new php4DOMElement($prev);
535  } else {
536  return false;
537  }
538  }
php4DomElement

◆ remove_child()

php4DOMNode::remove_child (   $oldchild)

Definition at line 540 of file inc.xml5compliance.php.

Referenced by ilPCTableData\deleteTDContent(), ilPCDataTable\makeEmptyCell(), and ilPCTable\makeEmptyCell().

541  {
542  return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode));
543  }
php4DomElement
+ Here is the caller graph for this function:

◆ replace_child()

php4DOMNode::replace_child (   $oldnode,
  $newnode 
)

Definition at line 545 of file inc.xml5compliance.php.

546  {
547  return new php4DOMElement($this->myDOMNode->replaceChild($oldchild->myDOMNode, $newnode->myDOMNode));
548  }
php4DomElement

◆ replace_node()

php4DOMNode::replace_node (   $newnode)

Definition at line 367 of file inc.xml5compliance.php.

References set_content().

368  {
369  return $this->set_content($newnode->myDOMNode->textContent);
370  }
+ Here is the call graph for this function:

◆ set_content()

php4DOMNode::set_content (   $text)

Definition at line 550 of file inc.xml5compliance.php.

Referenced by replace_node().

551  {
552  $this->myDOMNode->textContent = $text;
553  return $this->myDOMNode->textContent;
554  }
+ Here is the caller graph for this function:

◆ unlink_node()

php4DOMNode::unlink_node (   $aDomNode = "")

Definition at line 413 of file inc.xml5compliance.php.

414  {
415  // sometimes the node to unlink is passed
416  if (!is_object($aDomNode)) {
417  $aDomNode = $this;
418  //$aDomNode = $this;
419  }
420 
421  $parent = $aDomNode->myDOMNode->parentNode;
422  if (is_object($parent)) {
423  $parent->removeChild($aDomNode->myDOMNode);
424  }
425  }

Field Documentation

◆ $myDOMNode

php4DOMNode::$myDOMNode

Definition at line 344 of file inc.xml5compliance.php.

Referenced by insert_before().


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