| <?php |
| function innerHTML($el) { |
| $doc= new DOMDocument(); |
| $doc->appendChild($doc->importNode($el, TRUE)); |
| $html= trim($doc->saveHTML()); |
| $tag= $el->nodeName; |
| $html= preg_replace('@^<' . $tag . '[^>]*>|</' . $tag . '>$@', '', $html); |
| return $html; |
| } |
| function enhanceDoc($doc) { |
| $docXPath= new DomXPath($doc); |
| $titles= $docXPath->query("//*[contains(@class, 'title')]"); |
| foreach ($titles as $title) { |
| $id= $title->parentNode->getAttribute('id'); |
| if ($id != '') { |
| $link= $title->firstChild; |
| $link->setAttribute('href', '#' . $id); |
| } |
| } |
| } |
| |
| if (!isset($theme)) { |
| $theme= "solstice"; |
| } |
| $Theme= $App->getThemeClass($theme); |
| $themeVariables= array(); |
| $App->AddExtraHtmlHeader('<link rel="stylesheet" href="/statet/solstice-statet.css" type="text/css"/>'); |