コード例 #1
0
ファイル: footnote.php プロジェクト: jackalope/jr_cr_demo
 /**
  * Handle a node
  *
  * Handle / transform a given node, and return the result of the
  * conversion.
  * 
  * @param ezcDocumentElementVisitorConverter $converter 
  * @param DOMElement $node 
  * @param mixed $root 
  * @return mixed
  */
 public function handle(ezcDocumentElementVisitorConverter $converter, DOMElement $node, $root)
 {
     $footnoteContent = trim($converter->visitChildren($node, ''));
     $number = $converter->appendFootnote($footnoteContent);
     // Add autonumbered footnote reference
     $root .= '[#]_ ';
     return $root;
 }
コード例 #2
0
ファイル: footnote.php プロジェクト: bmdevel/ezc
 /**
  * Handle a node
  *
  * Handle / transform a given node, and return the result of the
  * conversion.
  *
  * @param ezcDocumentElementVisitorConverter $converter
  * @param DOMElement $node
  * @param mixed $root
  * @return mixed
  */
 public function handle(ezcDocumentElementVisitorConverter $converter, DOMElement $node, $root)
 {
     $number = $converter->appendFootnote($node->cloneNode(true));
     $footnoteReference = $root->ownerDocument->createElement('a', $number);
     $footnoteReference->setAttribute('class', 'footnote');
     $footnoteReference->setAttribute('href', '#__footnote_' . $number);
     $root->appendChild($footnoteReference);
     return $root;
 }