diff --git a/core/content/about/info.html b/core/content/about/info.html index d41a7c7..e2c910f 100644 --- a/core/content/about/info.html +++ b/core/content/about/info.html @@ -1,6 +1,39 @@
WebCoreMJR is a somewhat simple website framework that uses php and xml, and doesn't use a database. I mainly created this for use in my own websites, but decided to create a dedicated website for it.
diff --git a/core/css/navigation.css b/core/css/navigation.css
index 13596b9..b8bf01f 100644
--- a/core/css/navigation.css
+++ b/core/css/navigation.css
@@ -24,7 +24,11 @@
padding: 12px 16px;
color: #333;
}
-.navigationMain li a:hover, .navigationMain li .dropdown:hover .dropbtn {
+.navigationMain li a:hover, .navigationMain li a.active {
+ background-color: #444;
+ color: #CCC;
+}
+.navigationMain li .dropdown:hover .dropbtn {
background-color: #444;
color: #CCC;
}
@@ -123,6 +127,10 @@
display: none;
}
+.noLink {
+ cursor: default;
+}
+
@media only screen and (max-width: 640px) {
.navigationSpan {
display: block;
diff --git a/core/css/navigation.css.map b/core/css/navigation.css.map
index bb9abce..9b5d3dc 100644
--- a/core/css/navigation.css.map
+++ b/core/css/navigation.css.map
@@ -1 +1 @@
-{"version":3,"sourceRoot":"","sources":["../sass/navigation.scss","../sass/vars.scss"],"names":[],"mappings":"AAEA;EACC;;;AAGD;EACC;;;AAGD;EAEC;;AAEA;EACC;EACA;EACA;EACA;;AAGD;EACC;EACA;;AAEA;EACC;EACA;EACA,OCxBY;;AD2Bb;EACC,kBC3BmB;ED4BnB,OChCa;;ADmCd;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA,kBCxCkB;;AD0ClB;EACC;EACA;EACA;;AAEA;EACC,kBClDiB;;ADoDjB;EACC,OCzDU;;AD8Db;EACC;EACA;EACA;EACA;;AAIF;EACC;;;AAKH;EAEC;EACA;EACA;EACA;EACA,kBCjFc;EDkFd;EACA;AAA+B;EAC5B;AAAmC;EACnC;EACA;;;AAEJ;EAEC;EACA;EACA;EACA;EACA,kBC9Fc;ED+Fd;;;AAED;EAEC;EACA;EACA;EACA;EACA,kBCvGc;EDwGd;EACA;AAA8B;EAC3B;AAAkC;EAClC;EACA;;;AAEJ;EACC;EACA;EACA;EACA;EACA,kBCnHc;EDoHd;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EAEC;IACC;;;EAKA;IACU;IACA;IACA;IACA;;EAEA;IACC;;EAID;IACC;IACA;;EAEA;IACC;IACA;IACA;IACA;;;EAOb;IACC;IACA;;;EAGD;IACC;;;EAGD;IACC;;;EAUE;IACC;;EAGD;IACC;;EAIF;IACU","file":"navigation.css"}
\ No newline at end of file
+{"version":3,"sourceRoot":"","sources":["../sass/navigation.scss","../sass/vars.scss"],"names":[],"mappings":"AAEA;EACC;;;AAGD;EACC;;;AAGD;EAEC;;AAEA;EACC;EACA;EACA;EACA;;AAGD;EACC;EACA;;AAEA;EACC;EACA;EACA,OCxBY;;AD0BZ;EACC,kBC1BkB;ED2BlB,OC/BY;;ADmCd;EACC,kBChCmB;EDiCnB,OCrCa;;ADwCd;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA,kBC7CkB;;AD+ClB;EACC;EACA;EACA;;AAEA;EACC,kBCvDiB;;ADyDjB;EACC,OC9DU;;ADmEb;EACC;EACA;EACA;EACA;;AAIF;EACC;;;AAKH;EAEC;EACA;EACA;EACA;EACA,kBCtFc;EDuFd;EACA;AAA+B;EAC5B;AAAmC;EACnC;EACA;;;AAEJ;EAEC;EACA;EACA;EACA;EACA,kBCnGc;EDoGd;;;AAED;EAEC;EACA;EACA;EACA;EACA,kBC5Gc;ED6Gd;EACA;AAA8B;EAC3B;AAAkC;EAClC;EACA;;;AAEJ;EACC;EACA;EACA;EACA;EACA,kBCxHc;EDyHd;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EAEC;IACC;;;EAKA;IACU;IACA;IACA;IACA;;EAEA;IACC;;EAID;IACC;IACA;;EAEA;IACC;IACA;IACA;IACA;;;EAOb;IACC;IACA;;;EAGD;IACC;;;EAGD;IACC;;;EAUE;IACC;;EAGD;IACC;;EAIF;IACU","file":"navigation.css"}
\ No newline at end of file
diff --git a/core/php/functions/coreFunctions/core.php b/core/php/functions/coreFunctions/core.php
index 9df17ac..aa67c07 100644
--- a/core/php/functions/coreFunctions/core.php
+++ b/core/php/functions/coreFunctions/core.php
@@ -74,7 +74,8 @@ public function loadDirFilesRec($directory, $arrayOfFiles = array(), $addedDir =
{
$arrayOfFiles[$entireFileOrDir] = array(
"fileName" => $fileOrDir,
- "fileNamePlusPath" => $addedDir."/".$fileOrDir
+ "fileNamePlusPath" => $addedDir."/".$fileOrDir,
+ "path" => $addedDir
);
}
}
diff --git a/core/php/functions/pageFunctions/gallery.php b/core/php/functions/pageFunctions/gallery.php
index 30a7171..0606998 100644
--- a/core/php/functions/pageFunctions/gallery.php
+++ b/core/php/functions/pageFunctions/gallery.php
@@ -2,6 +2,11 @@
class gallery
{
+ private function getDefaultId($data)
+ {
+ return preg_replace('/[^a-z0-9]+/', '_', strtolower($data["src"]));
+ }
+
public function generateGallery($arrayOfImages, $config = array())
{
$htmlToReturn = "";
@@ -68,8 +73,13 @@ public function generateGallery($arrayOfImages, $config = array())
$htmlToReturn .= "
";
}
+ $id = $this->getDefaultId($value);
+ if(isset($value["id"]))
+ {
+ $id = $value["id"];
+ }
$htmlToReturn .= "<".$tag.">";
- $link = "#".$value["id"];
+ $link = "#".$id;
$image = $value["src"];
$thumb = $value["src"];
if(isset($value["link"]))
@@ -80,14 +90,19 @@ public function generateGallery($arrayOfImages, $config = array())
{
$thumb = $value["thumb"];
}
+ $target = "";
+ if(isset($value["target"]))
+ {
+ $target = " target=\"".$value["target"]."\"";
+ }
$htmlToReturn .= "
-
+
";
- if($link === "#".$value["id"])
+ if($link === "#".$id)
{
$htmlToReturn .= "
-
+
@@ -96,14 +111,14 @@ public function generateGallery($arrayOfImages, $config = array())
if($arrows && $arrayOfImagesCounter !== 0)
{
$htmlToReturn .= "
- ";
+ getDefaultId($arrayOfImagesGen[$arrayOfImagesCounter-1])."\" class=\"arrow left lightboxLeft\" >";
}
$htmlToReturn .= "
";
if($arrows && ($arrayOfImagesCounter + 1) < $arrayOfImagesCount)
{
$htmlToReturn .= "
- ";
+ getDefaultId($arrayOfImagesGen[$arrayOfImagesCounter+1])."\" class=\"arrow right lightboxRight\" >";
}
if($galleryThumbs)
{
@@ -117,8 +132,13 @@ public function generateGallery($arrayOfImages, $config = array())
{
break;
}
+ $id = $this->getDefaultId($value2);
+ if(isset($value2["id"]))
+ {
+ $id = $value2["id"];
+ }
$thumb2 = $value2["src"];
- $link2 = "#".$value2["id"];
+ $link2 = "#".$id;
if(isset($value2["thumb"]))
{
$thumb2 = $value2["thumb"];
@@ -149,8 +169,13 @@ public function generateGallery($arrayOfImages, $config = array())
{
continue;
}
+ $id = $this->getDefaultId($value2);
+ if(isset($value2["id"]))
+ {
+ $id = $value2["id"];
+ }
$thumb2 = $value2["src"];
- $link2 = "#".$value2["id"];
+ $link2 = "#".$id;
if(isset($value2["thumb"]))
{
$thumb2 = $value2["thumb"];
diff --git a/core/php/functions/pageFunctions/header.php b/core/php/functions/pageFunctions/header.php
index da46bb2..cf64fac 100644
--- a/core/php/functions/pageFunctions/header.php
+++ b/core/php/functions/pageFunctions/header.php
@@ -52,6 +52,16 @@ private function modifyArrayAgain($newNavArray)
}
public function generateNavigationArray()
+ {
+ return $this->generateNavigationArrayWithParams(0);
+ }
+
+ public function generateSitemap()
+ {
+ return $this->generateNavigationArrayWithParams(-1);
+ }
+
+ private function generateNavigationArrayWithParams($minCurrent)
{
$currentDir = realpath(__DIR__ . '/../../../..')."/";
$xmlDir = $currentDir."core/xml/content/";
@@ -66,11 +76,22 @@ public function generateNavigationArray()
$arrayOfFiles[$currentFileKey]["position"] = intval($xmlLayout->menu->position);
$arrayOfFiles[$currentFileKey]["name"] = (string)$xmlLayout->menu->name;
$arrayOfFiles[$currentFileKey]["key"] = (string)$xmlLayout->menu->key;
+ $current = 0;
+ $currentURI = "$_SERVER[REQUEST_URI]";
+ if("$_SERVER[REQUEST_URI]" === "/")
+ {
+ $currentURI = "/home";
+ }
+ if($currentURI === explode(".xml", $arrayOfFiles[$currentFileKey]["fileNamePlusPath"])[0])
+ {
+ $current = 1;
+ }
+ $arrayOfFiles[$currentFileKey]["current"] = $current;
}
$newNavArray = array();
foreach ($arrayOfFiles as $AOFvalue)
{
- if($AOFvalue["position"] === 0)
+ if($AOFvalue["position"] <= $minCurrent)
{
continue; //skip if position is 0
}
@@ -89,21 +110,94 @@ public function generateNavigationArray()
return $newNavArray;
}
+ private function findIfSubCurrent($files)
+ {
+ foreach ($files as $name => $file)
+ {
+ if(isset($file["files"]))
+ {
+ if(!empty($file["files"]) && $this->findIfSubCurrent($file["files"]))
+ {
+ return true;
+ }
+ }
+ if($file["current"] === 1)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
public function generateNavUL($navArray, $htmlToReturn = "")
{
$htmlToReturn .= "";
foreach ($navArray as $key => $value)
{
+ $classText = "";
+ $addClassText = false;
if(isset($value["files"]))
{
if(!empty($value["files"]))
{
- $htmlToReturn .= "
";
diff --git a/core/sass/navigation.scss b/core/sass/navigation.scss
index 089706f..ae386c4 100644
--- a/core/sass/navigation.scss
+++ b/core/sass/navigation.scss
@@ -27,9 +27,14 @@
text-decoration: none;
padding: 12px 16px;
color: $linkColorAlt;
+
+ &:hover, &.active {
+ background-color: $backgroundColorMain;
+ color: $fontColorMain;
+ }
}
- a:hover, .dropdown:hover .dropbtn {
+ .dropdown:hover .dropbtn {
background-color: $backgroundColorMain;
color: $fontColorMain;
}
@@ -133,6 +138,10 @@
display: none;
}
+.noLink{
+ cursor: default;
+}
+
@media only screen and (max-width : 640px) {
.navigationSpan{
diff --git a/core/xml/content/sitemap.xml b/core/xml/content/sitemap.xml
new file mode 100644
index 0000000..e5b2fb3
--- /dev/null
+++ b/core/xml/content/sitemap.xml
@@ -0,0 +1,15 @@
+
+