mirror of
https://github.com/Aviortheking/Blog_IMIE.git
synced 2025-06-22 22:39:19 +00:00
remove files from .gitignore
added .html files edited handler and tagHandler
This commit is contained in:
@ -1 +1,15 @@
|
||||
/* Fichier qui va gerer la creation de la page et la redirection au cas ou */
|
||||
<?php
|
||||
/* Fichier qui va gerer la creation de la page et la redirection au cas ou */
|
||||
|
||||
|
||||
|
||||
$_GET['page'] = trim($_GET['page'], '/');
|
||||
$_GET['page'] = explode('/', $_GET['page'])[0];
|
||||
if($_GET['page'] == '') $_GET['page'] = 'index';
|
||||
|
||||
// var_dump($_POST);
|
||||
// var_dump($_GET);
|
||||
|
||||
include_once "tagHandler.php";
|
||||
$file = file_get_contents("../html/".$_GET["page"].".html");
|
||||
echo loadTags($file, false);
|
@ -137,6 +137,18 @@ class author extends tag {
|
||||
}
|
||||
}
|
||||
|
||||
class includes extends tag {
|
||||
public function render() {
|
||||
$el = $this->getDOM();
|
||||
$doc = $this->getDoc();
|
||||
$attr = $el->getAttribute("file");
|
||||
$t = $doc->createDocumentFragment();
|
||||
$p = file_get_contents("../html/includes/".$attr.".html");
|
||||
$t->appendXML($p);
|
||||
$el->parentNode->appendChild($t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* input <tag type="loop" for="(table)" limit="(nombre-max généré)">
|
||||
@ -243,7 +255,7 @@ function renameTag( DOMElement $oldTag, $newTagName ) {
|
||||
|
||||
|
||||
//testing purpose
|
||||
$content = file_get_contents("./test.html");
|
||||
//$content = file_get_contents("./test.html");
|
||||
|
||||
|
||||
function loadTags($ctnt, $debug) {
|
||||
@ -252,7 +264,14 @@ function loadTags($ctnt, $debug) {
|
||||
$dom->loadHTML($ctnt);
|
||||
libxml_clear_errors();
|
||||
$list = $dom->getElementsByTagName("tag");
|
||||
|
||||
|
||||
|
||||
$head = $dom->getElementsByTagName("head");
|
||||
$t = $dom->createDocumentFragment();
|
||||
$p = file_get_contents("../html/includes/head.html");
|
||||
$t->appendXML($p);
|
||||
$head->item(0)->appendChild($t);
|
||||
|
||||
for ($i=0; $i < $list->count(); $i++) {
|
||||
$lst = $list->item($i);
|
||||
$tgs = $lst->getAttribute("type");
|
||||
@ -270,5 +289,3 @@ function loadTags($ctnt, $debug) {
|
||||
$res = $dom->saveHTML();
|
||||
echo $res;
|
||||
}
|
||||
|
||||
loadTags($content, $debug);
|
||||
|
Reference in New Issue
Block a user