From 49d539ee724d397a8be578653dc4a81ae51cee02 Mon Sep 17 00:00:00 2001
From: Aviortheking <2bazert@gmail.com>
Date: Mon, 26 Nov 2018 14:01:19 +0100
Subject: [PATCH] remove files from .gitignore added .html files edited handler
and tagHandler
---
project/.htaccess | 4 +-
project/.idea/misc.xml | 6 -
project/.idea/modules.xml | 8 -
project/.idea/project.iml | 8 -
project/.idea/vcs.xml | 6 -
project/.idea/workspace.xml | 227 -----------------------
project/assets/html/includes/footer.html | 1 +
project/assets/html/includes/head.html | 8 +
project/assets/html/includes/header.html | 1 +
project/assets/html/index.html | 13 ++
project/assets/php/handler.php | 16 +-
project/assets/php/tagHandler.php | 25 ++-
12 files changed, 61 insertions(+), 262 deletions(-)
delete mode 100644 project/.idea/misc.xml
delete mode 100644 project/.idea/modules.xml
delete mode 100644 project/.idea/project.iml
delete mode 100644 project/.idea/vcs.xml
delete mode 100644 project/.idea/workspace.xml
create mode 100644 project/assets/html/includes/footer.html
create mode 100644 project/assets/html/includes/head.html
create mode 100644 project/assets/html/includes/header.html
create mode 100644 project/assets/html/index.html
diff --git a/project/.htaccess b/project/.htaccess
index 59412ac..ca51626 100644
--- a/project/.htaccess
+++ b/project/.htaccess
@@ -8,14 +8,14 @@ RewriteEngine on
# Condition de redirection
# si https est off ou si le protocol n'est pas en HTTPS
-RewriteCond %{HTTPS} off
+#RewriteCond %{HTTPS} off
# lieux de redirection
# on redirige vers https
# entre [] se sont des Flags
# R=302 indique une redirection visible en indiquant le code 302
# L finit le processus et n'aplique plus rien de se qui se trouve en dessous
-RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]
+#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]
# condition si il n'y a pas de fichier a l'endroit ciblé
# (ou si le fichier n'est pas accésible par l'utilisateur)
diff --git a/project/.idea/misc.xml b/project/.idea/misc.xml
deleted file mode 100644
index 28a804d..0000000
--- a/project/.idea/misc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project/.idea/modules.xml b/project/.idea/modules.xml
deleted file mode 100644
index a0733a5..0000000
--- a/project/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project/.idea/project.iml b/project/.idea/project.iml
deleted file mode 100644
index c956989..0000000
--- a/project/.idea/project.iml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project/.idea/vcs.xml b/project/.idea/vcs.xml
deleted file mode 100644
index 6c0b863..0000000
--- a/project/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project/.idea/workspace.xml b/project/.idea/workspace.xml
deleted file mode 100644
index 0635106..0000000
--- a/project/.idea/workspace.xml
+++ /dev/null
@@ -1,227 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- DEFINITION_ORDER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1543220472616
-
-
- 1543220472616
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project/assets/html/includes/footer.html b/project/assets/html/includes/footer.html
new file mode 100644
index 0000000..a0eb7cb
--- /dev/null
+++ b/project/assets/html/includes/footer.html
@@ -0,0 +1 @@
+
@Copyright 2018 HIFIVE
\ No newline at end of file
diff --git a/project/assets/html/includes/head.html b/project/assets/html/includes/head.html
new file mode 100644
index 0000000..47b3613
--- /dev/null
+++ b/project/assets/html/includes/head.html
@@ -0,0 +1,8 @@
+
+
+
+ Page Title
+
+
+
+
\ No newline at end of file
diff --git a/project/assets/html/includes/header.html b/project/assets/html/includes/header.html
new file mode 100644
index 0000000..c619916
--- /dev/null
+++ b/project/assets/html/includes/header.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/project/assets/html/index.html b/project/assets/html/index.html
new file mode 100644
index 0000000..7a32c53
--- /dev/null
+++ b/project/assets/html/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/project/assets/php/handler.php b/project/assets/php/handler.php
index e386aaf..823d8b5 100644
--- a/project/assets/php/handler.php
+++ b/project/assets/php/handler.php
@@ -1 +1,15 @@
-/* Fichier qui va gerer la creation de la page et la redirection au cas ou */
\ No newline at end of file
+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
@@ -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);