mirror of
https://github.com/Aviortheking/DeltaCMS.git
synced 2025-08-12 19:12:00 +00:00
too manu changes (will list by files)
.gitignore ignores some launch files changelog.md, readme.md added end file line public.php moved started the work on it router.php added require to functions & moved the function in the file set an ini value to show errors defied some constants moved the public page management to public/public.php exampleModule -> headGenerator.php started working on module management *.json reworked files function.php added this file to manages cores functions website.php the Website Object for theme & modules page.php created a test theme
This commit is contained in:
52
test.php
52
test.php
@@ -1,31 +1,37 @@
|
||||
<?php
|
||||
ini_set('display_errors', 'On');
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$test = "<html><body><p>pouet</p></body></html>";
|
||||
$doc->loadHTML($test);
|
||||
// $doc = new DOMDocument();
|
||||
// $test = "<html><body><p>pouet</p></body></html>";
|
||||
// $doc->loadHTML($test);
|
||||
|
||||
appendHTML($doc->getElementsByTagName("body")->item(0), "<img src=\"./\">");
|
||||
// appendHTML($doc->getElementsByTagName("body")->item(0), "<img src=\"./\">");
|
||||
|
||||
echo $doc->saveHTML();
|
||||
// echo $doc->saveHTML();
|
||||
|
||||
// echo gettype(true);
|
||||
|
||||
function appendHTML(DOMNode $parent, $source) {
|
||||
$tmpDoc = new DOMDocument();
|
||||
$html = "<html><body>";
|
||||
$html .= $source;
|
||||
$html .= "</body></html>";
|
||||
$tmpDoc->loadHTML('<?xml encoding="UTF-8">'.$html);
|
||||
// include_once "admin/system/website.php";
|
||||
// $website = new Website(__DIR__);
|
||||
// $website->addTemplate("Blog Page", "templates/blog.php", "page", true);
|
||||
|
||||
foreach ($tmpDoc->childNodes as $item)
|
||||
if ($item->nodeType == XML_PI_NODE)
|
||||
$tmpDoc->removeChild($item);
|
||||
$tmpDoc->encoding = 'UTF-8';
|
||||
|
||||
foreach ($tmpDoc->getElementsByTagName('body')->item(0)->childNodes as $node) {
|
||||
$importedNode = $parent->ownerDocument->importNode($node, true);
|
||||
$parent->appendChild($importedNode);
|
||||
}
|
||||
}
|
||||
// phpinfo();
|
||||
|
||||
?>
|
||||
// function appendHTML(DOMNode $parent, $source) {
|
||||
// $tmpDoc = new DOMDocument();
|
||||
// $html = "<html><body>";
|
||||
// $html .= $source;
|
||||
// $html .= "</body></html>";
|
||||
// $tmpDoc->loadHTML('<?xml encoding="UTF-8">'.$html);
|
||||
|
||||
// foreach ($tmpDoc->childNodes as $item)
|
||||
// if ($item->nodeType == XML_PI_NODE)
|
||||
// $tmpDoc->removeChild($item);
|
||||
// $tmpDoc->encoding = 'UTF-8';
|
||||
|
||||
// foreach ($tmpDoc->getElementsByTagName('body')->item(0)->childNodes as $node) {
|
||||
// $importedNode = $parent->ownerDocument->importNode($node, true);
|
||||
// $parent->appendChild($importedNode);
|
||||
// }
|
||||
// }
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user