diff --git a/content/00-welcome/02-manage-access.yaml b/content/00-welcome/02-manage-access.yaml index dd11ee6..5c27f91 100644 --- a/content/00-welcome/02-manage-access.yaml +++ b/content/00-welcome/02-manage-access.yaml @@ -2,13 +2,8 @@ meta: navtitle: 'manage access' title: 'Manage access' description: ' Restrict Access for the Website' - heroimage: null - heroimagealt: null owner: Sebastian author: Sebastian - allowedrole: null - alloweduser: null - manualdate: null modified: '2023-05-06' created: '2023-06-12' time: 22-36-36 diff --git a/data/navigation/navi-draft.txt b/data/navigation/navi-draft.txt index 84fcabc..472c5d4 100644 --- a/data/navigation/navi-draft.txt +++ b/data/navigation/navi-draft.txt @@ -1 +1 @@ -a:2:{i:0;O:8:"stdClass":22:{s:12:"originalName";s:10:"00-welcome";s:11:"elementType";s:6:"folder";s:8:"contains";s:5:"pages";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"00";s:4:"name";s:7:"welcome";s:4:"slug";s:7:"welcome";s:4:"path";s:11:"/00-welcome";s:15:"pathWithoutType";s:17:"/00-welcome/index";s:9:"urlRelWoF";s:8:"/welcome";s:6:"urlRel";s:17:"/typemill/welcome";s:6:"urlAbs";s:33:"http://localhost/typemill/welcome";s:3:"key";i:0;s:7:"keyPath";i:0;s:12:"keyPathArray";a:1:{i:0;s:1:"0";}s:7:"chapter";i:1;s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:13:"folderContent";a:5:{i:0;O:8:"stdClass":20:{s:12:"originalName";s:24:"00-setup-your-website.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"00";s:4:"name";s:18:"setup your website";s:4:"slug";s:18:"setup-your-website";s:4:"path";s:36:"/00-welcome/00-setup-your-website.md";s:15:"pathWithoutType";s:33:"/00-welcome/00-setup-your-website";s:3:"key";i:0;s:7:"keyPath";s:3:"0.0";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"0";}s:7:"chapter";s:3:"1.1";s:9:"urlRelWoF";s:27:"/welcome/setup-your-website";s:6:"urlRel";s:36:"/typemill/welcome/setup-your-website";s:6:"urlAbs";s:52:"http://localhost/typemill/welcome/setup-your-website";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:1;O:8:"stdClass":20:{s:12:"originalName";s:19:"01-write-content.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"01";s:4:"name";s:13:"write content";s:4:"slug";s:13:"write-content";s:4:"path";s:31:"/00-welcome/01-write-content.md";s:15:"pathWithoutType";s:28:"/00-welcome/01-write-content";s:3:"key";i:1;s:7:"keyPath";s:3:"0.1";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"1";}s:7:"chapter";s:3:"1.2";s:9:"urlRelWoF";s:22:"/welcome/write-content";s:6:"urlRel";s:31:"/typemill/welcome/write-content";s:6:"urlAbs";s:47:"http://localhost/typemill/welcome/write-content";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:2;O:8:"stdClass":20:{s:12:"originalName";s:19:"02-manage-access.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"02";s:4:"name";s:13:"manage access";s:4:"slug";s:13:"manage-access";s:4:"path";s:31:"/00-welcome/02-manage-access.md";s:15:"pathWithoutType";s:28:"/00-welcome/02-manage-access";s:3:"key";i:2;s:7:"keyPath";s:3:"0.2";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"2";}s:7:"chapter";s:3:"1.3";s:9:"urlRelWoF";s:22:"/welcome/manage-access";s:6:"urlRel";s:31:"/typemill/welcome/manage-access";s:6:"urlAbs";s:47:"http://localhost/typemill/welcome/manage-access";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:3;O:8:"stdClass":20:{s:12:"originalName";s:14:"03-get-help.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"03";s:4:"name";s:8:"get help";s:4:"slug";s:8:"get-help";s:4:"path";s:26:"/00-welcome/03-get-help.md";s:15:"pathWithoutType";s:23:"/00-welcome/03-get-help";s:3:"key";i:3;s:7:"keyPath";s:3:"0.3";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"3";}s:7:"chapter";s:3:"1.4";s:9:"urlRelWoF";s:17:"/welcome/get-help";s:6:"urlRel";s:26:"/typemill/welcome/get-help";s:6:"urlAbs";s:42:"http://localhost/typemill/welcome/get-help";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:4;O:8:"stdClass":20:{s:12:"originalName";s:19:"04-markdown-test.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"04";s:4:"name";s:13:"markdown test";s:4:"slug";s:13:"markdown-test";s:4:"path";s:31:"/00-welcome/04-markdown-test.md";s:15:"pathWithoutType";s:28:"/00-welcome/04-markdown-test";s:3:"key";i:4;s:7:"keyPath";s:3:"0.4";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"4";}s:7:"chapter";s:3:"1.5";s:9:"urlRelWoF";s:22:"/welcome/markdown-test";s:6:"urlRel";s:31:"/typemill/welcome/markdown-test";s:6:"urlAbs";s:47:"http://localhost/typemill/welcome/markdown-test";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}}s:7:"noindex";b:0;}i:1;O:8:"stdClass":22:{s:12:"originalName";s:16:"01-cyanine-theme";s:11:"elementType";s:6:"folder";s:8:"contains";s:5:"pages";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"01";s:4:"name";s:13:"cyanine theme";s:4:"slug";s:13:"cyanine-theme";s:4:"path";s:17:"/01-cyanine-theme";s:15:"pathWithoutType";s:23:"/01-cyanine-theme/index";s:9:"urlRelWoF";s:14:"/cyanine-theme";s:6:"urlRel";s:23:"/typemill/cyanine-theme";s:6:"urlAbs";s:39:"http://localhost/typemill/cyanine-theme";s:3:"key";i:1;s:7:"keyPath";i:1;s:12:"keyPathArray";a:1:{i:0;s:1:"1";}s:7:"chapter";i:2;s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:13:"folderContent";a:4:{i:0;O:8:"stdClass":20:{s:12:"originalName";s:17:"00-landingpage.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"00";s:4:"name";s:11:"landingpage";s:4:"slug";s:11:"landingpage";s:4:"path";s:35:"/01-cyanine-theme/00-landingpage.md";s:15:"pathWithoutType";s:32:"/01-cyanine-theme/00-landingpage";s:3:"key";i:0;s:7:"keyPath";s:3:"1.0";s:12:"keyPathArray";a:2:{i:0;s:1:"1";i:1;s:1:"0";}s:7:"chapter";s:3:"2.1";s:9:"urlRelWoF";s:26:"/cyanine-theme/landingpage";s:6:"urlRel";s:35:"/typemill/cyanine-theme/landingpage";s:6:"urlAbs";s:51:"http://localhost/typemill/cyanine-theme/landingpage";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:1;}i:1;O:8:"stdClass":20:{s:12:"originalName";s:22:"01-colors-and-fonts.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"01";s:4:"name";s:16:"colors and fonts";s:4:"slug";s:16:"colors-and-fonts";s:4:"path";s:40:"/01-cyanine-theme/01-colors-and-fonts.md";s:15:"pathWithoutType";s:37:"/01-cyanine-theme/01-colors-and-fonts";s:3:"key";i:1;s:7:"keyPath";s:3:"1.1";s:12:"keyPathArray";a:2:{i:0;s:1:"1";i:1;s:1:"1";}s:7:"chapter";s:3:"2.2";s:9:"urlRelWoF";s:31:"/cyanine-theme/colors-and-fonts";s:6:"urlRel";s:40:"/typemill/cyanine-theme/colors-and-fonts";s:6:"urlAbs";s:56:"http://localhost/typemill/cyanine-theme/colors-and-fonts";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:2;O:8:"stdClass":20:{s:12:"originalName";s:12:"02-footer.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"02";s:4:"name";s:6:"footer";s:4:"slug";s:6:"footer";s:4:"path";s:30:"/01-cyanine-theme/02-footer.md";s:15:"pathWithoutType";s:27:"/01-cyanine-theme/02-footer";s:3:"key";i:2;s:7:"keyPath";s:3:"1.2";s:12:"keyPathArray";a:2:{i:0;s:1:"1";i:1;s:1:"2";}s:7:"chapter";s:3:"2.3";s:9:"urlRelWoF";s:21:"/cyanine-theme/footer";s:6:"urlRel";s:30:"/typemill/cyanine-theme/footer";s:6:"urlAbs";s:46:"http://localhost/typemill/cyanine-theme/footer";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:3;O:8:"stdClass":20:{s:12:"originalName";s:22:"03-content-elements.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"03";s:4:"name";s:16:"content elements";s:4:"slug";s:16:"content-elements";s:4:"path";s:40:"/01-cyanine-theme/03-content-elements.md";s:15:"pathWithoutType";s:37:"/01-cyanine-theme/03-content-elements";s:3:"key";i:3;s:7:"keyPath";s:3:"1.3";s:12:"keyPathArray";a:2:{i:0;s:1:"1";i:1;s:1:"3";}s:7:"chapter";s:3:"2.4";s:9:"urlRelWoF";s:31:"/cyanine-theme/content-elements";s:6:"urlRel";s:40:"/typemill/cyanine-theme/content-elements";s:6:"urlAbs";s:56:"http://localhost/typemill/cyanine-theme/content-elements";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}}s:7:"noindex";b:0;}} \ No newline at end of file +a:2:{i:0;O:8:"stdClass":22:{s:12:"originalName";s:10:"00-welcome";s:11:"elementType";s:6:"folder";s:8:"contains";s:5:"pages";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"00";s:4:"name";s:7:"welcome";s:4:"slug";s:7:"welcome";s:4:"path";s:11:"/00-welcome";s:15:"pathWithoutType";s:17:"/00-welcome/index";s:9:"urlRelWoF";s:8:"/welcome";s:6:"urlRel";s:17:"/typemill/welcome";s:6:"urlAbs";s:33:"http://localhost/typemill/welcome";s:3:"key";s:1:"0";s:7:"keyPath";s:1:"0";s:12:"keyPathArray";a:1:{i:0;s:1:"0";}s:7:"chapter";i:1;s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:13:"folderContent";a:5:{i:0;O:8:"stdClass":20:{s:12:"originalName";s:24:"00-setup-your-website.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"00";s:4:"name";s:18:"setup your website";s:4:"slug";s:18:"setup-your-website";s:4:"path";s:36:"/00-welcome/00-setup-your-website.md";s:15:"pathWithoutType";s:33:"/00-welcome/00-setup-your-website";s:3:"key";i:0;s:7:"keyPath";s:3:"0.0";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"0";}s:7:"chapter";s:3:"1.1";s:9:"urlRelWoF";s:27:"/welcome/setup-your-website";s:6:"urlRel";s:36:"/typemill/welcome/setup-your-website";s:6:"urlAbs";s:52:"http://localhost/typemill/welcome/setup-your-website";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:1;O:8:"stdClass":20:{s:12:"originalName";s:19:"01-write-content.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"01";s:4:"name";s:13:"write content";s:4:"slug";s:13:"write-content";s:4:"path";s:31:"/00-welcome/01-write-content.md";s:15:"pathWithoutType";s:28:"/00-welcome/01-write-content";s:3:"key";i:1;s:7:"keyPath";s:3:"0.1";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"1";}s:7:"chapter";s:3:"1.2";s:9:"urlRelWoF";s:22:"/welcome/write-content";s:6:"urlRel";s:31:"/typemill/welcome/write-content";s:6:"urlAbs";s:47:"http://localhost/typemill/welcome/write-content";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:2;O:8:"stdClass":20:{s:12:"originalName";s:19:"02-manage-access.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"02";s:4:"name";s:13:"manage access";s:4:"slug";s:13:"manage-access";s:4:"path";s:31:"/00-welcome/02-manage-access.md";s:15:"pathWithoutType";s:28:"/00-welcome/02-manage-access";s:3:"key";i:2;s:7:"keyPath";s:3:"0.2";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"2";}s:7:"chapter";s:3:"1.3";s:9:"urlRelWoF";s:22:"/welcome/manage-access";s:6:"urlRel";s:31:"/typemill/welcome/manage-access";s:6:"urlAbs";s:47:"http://localhost/typemill/welcome/manage-access";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:3;O:8:"stdClass":20:{s:12:"originalName";s:14:"03-get-help.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"03";s:4:"name";s:8:"get help";s:4:"slug";s:8:"get-help";s:4:"path";s:26:"/00-welcome/03-get-help.md";s:15:"pathWithoutType";s:23:"/00-welcome/03-get-help";s:3:"key";i:3;s:7:"keyPath";s:3:"0.3";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"3";}s:7:"chapter";s:3:"1.4";s:9:"urlRelWoF";s:17:"/welcome/get-help";s:6:"urlRel";s:26:"/typemill/welcome/get-help";s:6:"urlAbs";s:42:"http://localhost/typemill/welcome/get-help";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:4;O:8:"stdClass":20:{s:12:"originalName";s:19:"04-markdown-test.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"04";s:4:"name";s:13:"markdown test";s:4:"slug";s:13:"markdown-test";s:4:"path";s:31:"/00-welcome/04-markdown-test.md";s:15:"pathWithoutType";s:28:"/00-welcome/04-markdown-test";s:3:"key";i:4;s:7:"keyPath";s:3:"0.4";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"4";}s:7:"chapter";s:3:"1.5";s:9:"urlRelWoF";s:22:"/welcome/markdown-test";s:6:"urlRel";s:31:"/typemill/welcome/markdown-test";s:6:"urlAbs";s:47:"http://localhost/typemill/welcome/markdown-test";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}}s:7:"noindex";b:0;}i:1;O:8:"stdClass":22:{s:12:"originalName";s:16:"01-cyanine-theme";s:11:"elementType";s:6:"folder";s:8:"contains";s:5:"pages";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"01";s:4:"name";s:13:"cyanine theme";s:4:"slug";s:13:"cyanine-theme";s:4:"path";s:17:"/01-cyanine-theme";s:15:"pathWithoutType";s:23:"/01-cyanine-theme/index";s:9:"urlRelWoF";s:14:"/cyanine-theme";s:6:"urlRel";s:23:"/typemill/cyanine-theme";s:6:"urlAbs";s:39:"http://localhost/typemill/cyanine-theme";s:3:"key";s:1:"1";s:7:"keyPath";s:1:"1";s:12:"keyPathArray";a:1:{i:0;s:1:"1";}s:7:"chapter";i:2;s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:13:"folderContent";a:4:{i:0;O:8:"stdClass":20:{s:12:"originalName";s:17:"00-landingpage.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"00";s:4:"name";s:11:"landingpage";s:4:"slug";s:11:"landingpage";s:4:"path";s:35:"/01-cyanine-theme/00-landingpage.md";s:15:"pathWithoutType";s:32:"/01-cyanine-theme/00-landingpage";s:3:"key";i:0;s:7:"keyPath";s:3:"1.0";s:12:"keyPathArray";a:2:{i:0;s:1:"1";i:1;s:1:"0";}s:7:"chapter";s:3:"2.1";s:9:"urlRelWoF";s:26:"/cyanine-theme/landingpage";s:6:"urlRel";s:35:"/typemill/cyanine-theme/landingpage";s:6:"urlAbs";s:51:"http://localhost/typemill/cyanine-theme/landingpage";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:1;}i:1;O:8:"stdClass":20:{s:12:"originalName";s:22:"01-colors-and-fonts.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"01";s:4:"name";s:16:"colors and fonts";s:4:"slug";s:16:"colors-and-fonts";s:4:"path";s:40:"/01-cyanine-theme/01-colors-and-fonts.md";s:15:"pathWithoutType";s:37:"/01-cyanine-theme/01-colors-and-fonts";s:3:"key";i:1;s:7:"keyPath";s:3:"1.1";s:12:"keyPathArray";a:2:{i:0;s:1:"1";i:1;s:1:"1";}s:7:"chapter";s:3:"2.2";s:9:"urlRelWoF";s:31:"/cyanine-theme/colors-and-fonts";s:6:"urlRel";s:40:"/typemill/cyanine-theme/colors-and-fonts";s:6:"urlAbs";s:56:"http://localhost/typemill/cyanine-theme/colors-and-fonts";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:2;O:8:"stdClass":20:{s:12:"originalName";s:12:"02-footer.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"02";s:4:"name";s:6:"footer";s:4:"slug";s:6:"footer";s:4:"path";s:30:"/01-cyanine-theme/02-footer.md";s:15:"pathWithoutType";s:27:"/01-cyanine-theme/02-footer";s:3:"key";i:2;s:7:"keyPath";s:3:"1.2";s:12:"keyPathArray";a:2:{i:0;s:1:"1";i:1;s:1:"2";}s:7:"chapter";s:3:"2.3";s:9:"urlRelWoF";s:21:"/cyanine-theme/footer";s:6:"urlRel";s:30:"/typemill/cyanine-theme/footer";s:6:"urlAbs";s:46:"http://localhost/typemill/cyanine-theme/footer";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:3;O:8:"stdClass":20:{s:12:"originalName";s:22:"03-content-elements.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"03";s:4:"name";s:16:"content elements";s:4:"slug";s:16:"content-elements";s:4:"path";s:40:"/01-cyanine-theme/03-content-elements.md";s:15:"pathWithoutType";s:37:"/01-cyanine-theme/03-content-elements";s:3:"key";i:3;s:7:"keyPath";s:3:"1.3";s:12:"keyPathArray";a:2:{i:0;s:1:"1";i:1;s:1:"3";}s:7:"chapter";s:3:"2.4";s:9:"urlRelWoF";s:31:"/cyanine-theme/content-elements";s:6:"urlRel";s:40:"/typemill/cyanine-theme/content-elements";s:6:"urlAbs";s:56:"http://localhost/typemill/cyanine-theme/content-elements";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}}s:7:"noindex";b:0;}} \ No newline at end of file diff --git a/data/navigation/navi-extended.txt b/data/navigation/navi-extended.txt index 69087af..4d4caba 100644 --- a/data/navigation/navi-extended.txt +++ b/data/navigation/navi-extended.txt @@ -3,7 +3,7 @@ hide: false noindex: false path: /00-welcome - keyPath: 0 + keyPath: '0' /welcome/setup-your-website: navtitle: 'setup your website' hide: false @@ -39,7 +39,7 @@ hide: false noindex: false path: /01-cyanine-theme - keyPath: 1 + keyPath: '1' /cyanine-theme/landingpage: navtitle: landingpage hide: false diff --git a/system/typemill/Controllers/ControllerWebFrontend.php b/system/typemill/Controllers/ControllerWebFrontend.php index d59953f..9164e3e 100644 --- a/system/typemill/Controllers/ControllerWebFrontend.php +++ b/system/typemill/Controllers/ControllerWebFrontend.php @@ -103,7 +103,8 @@ class ControllerWebFrontend extends Controller $liveNavigation = $navigation->removeHiddenPages($liveNavigation); # SET PAGEs ACTIVE - $liveNavigation = $navigation->setActiveNaviItems($liveNavigation, $breadcrumb); +# $liveNavigation = $navigation->setActiveNaviItems($liveNavigation, $breadcrumb); + $liveNavigation = $navigation->setActiveNaviItemsWithKeyPath($liveNavigation, $item->keyPathArray); # DISPATCH LIVE NAVIGATION $liveNavigation = $this->c->get('dispatcher')->dispatch(new OnPagetreeLoaded($liveNavigation), 'onPagetreeLoaded')->getData(); @@ -111,7 +112,8 @@ class ControllerWebFrontend extends Controller # For FOLDERS use item without drafts and hidden pages if(!$home && $item->elementType == 'folder') { - $item = $navigation->getItemWithUrl($liveNavigation, $item->urlRelWoF); + # $item = $navigation->getItemWithUrl($liveNavigation, $item->urlRelWoF); + $item = $navigation->getItemWithKeyPath($liveNavigation, $item->keyPathArray); } # ADD BACKWARD-/FORWARD PAGINATION @@ -173,7 +175,7 @@ class ControllerWebFrontend extends Controller { $metadata = $meta->getMetaData($refitem); $metadata = $meta->addMetaDefaults($metadata, $refitem, $this->settings['author']); - $metadata = $meta->addMetaTitleDescription($metadata, $refItem, $markdownArray); + $metadata = $meta->addMetaTitleDescription($metadata, $refitem, $markdownArray); } break; diff --git a/system/typemill/Models/Folder.php b/system/typemill/Models/Folder.php index 7697565..9641b91 100644 --- a/system/typemill/Models/Folder.php +++ b/system/typemill/Models/Folder.php @@ -33,12 +33,82 @@ class Folder return $folderContent; } + + /* + * scans content of a folder recursively and keeps the index order + * vars: folder path as string + * returns: multi-dimensional array with names of folders and files + */ + public function scanFolder($folderPath, $draft = false) + { + $folderItems = scandir($folderPath); + $folderContent = array(); + + # if it is the live version and if it is a folder that is not published, then do not show the folder and its content. + if(!$draft && !in_array('index.md', $folderItems)){ return false; } + + # Remove '.' and '..' from the array + $folderItems = array_diff($folderItems, array('.', '..')); + + # Reindex the array + $folderItems = array_values($folderItems); + + foreach ($folderItems as $key => $item) + { + if (is_dir($folderPath . DIRECTORY_SEPARATOR . $item)) + { + + $subFolder = $item; + $folderPublished = file_exists($folderPath . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . 'index.md'); + + # scan that folder only if it is a draft or if the folder is published (contains index.md) + if($draft OR $folderPublished) + { + # we need s countable index here + $folderContent[$key . ':' . $subFolder] = $this->scanFolder($folderPath . DIRECTORY_SEPARATOR . $subFolder, $draft); + } + } + else + { + $nameParts = $this->getStringParts($item); + $fileType = array_pop($nameParts); + + if($fileType == 'md') + { + $folderContent[] = $item; + } + + if($fileType == 'txt') + { + if(isset($last) && ($last == implode($nameParts)) ) + { + array_pop($folderContent); + $item = $item . 'md'; + } + $folderContent[] = $item; + + if(!$draft) + { + $index = count($folderContent)-1; + unset($folderContent[$index]); + } + } + + # store the name of the last file + $last = implode($nameParts); + + } + } + return $folderContent; + } + + /* * scans content of a folder recursively * vars: folder path as string * returns: multi-dimensional array with names of folders and files */ - public function scanFolder($folderPath, $draft = false) + public function scanFolderOLD($folderPath, $draft = false) { $folderItems = scandir($folderPath); $folderContent = array(); @@ -90,69 +160,131 @@ class Folder return $folderContent; } + /* - * scans content of a folder recursively and keeps the index order - * vars: folder path as string - * returns: multi-dimensional array with names of folders and files + * Transforms array of folder item into an array of item-objects with additional information for each item + * vars: multidimensional array with folder- and file-names + * returns: array of objects. Each object contains information about an item (file or folder). */ - public function scanFolderCheckIndex($folderPath, $draft = false) + + public function getFolderContentDetails(array $folderContent, $language, $baseUrl, $fullSlugWithFolder = NULL, $fullSlugWithoutFolder = NULL, $fullPath = NULL, $keyPath = NULL, $chapter = NULL) { - $folderItems = scandir($folderPath); - $folderContent = array(); + $contentDetails = []; + $iteration = 0; + $chapternr = 1; - # if it is the live version and if it is a folder that is not published, then do not show the folder and its content. - if(!$draft && !in_array('index.md', $folderItems)){ return false; } - - foreach ($folderItems as $key => $item) + foreach($folderContent as $key => $name) { - if (!in_array($item, array(".","..")) && substr($item, 0, 1) != '.') + $item = new \stdClass(); + + if(is_array($name)) { - if (is_dir($folderPath . DIRECTORY_SEPARATOR . $item)) + # get the index of the folder. Limit to 2 parts to ensure only the first ":" is used + $findIndex = explode(':', $key, 2); + $key = $findIndex[0]; + $folderName = $findIndex[1]; + + $nameParts = $this->getStringParts($folderName); + + $fileType = ''; + if(in_array('index.md', $name)) { + $fileType = 'md'; + $status = 'published'; + } + if(in_array('index.txt', $name)) + { + $fileType = 'txt'; + $status = 'unpublished'; + } + if(in_array('index.txtmd', $name)) + { + $fileType = 'txt'; + $status = 'modified'; + } - $subFolder = $item; - $folderPublished = file_exists($folderPath . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . 'index.md'); + $item->originalName = $folderName; + $item->elementType = 'folder'; + $item->contains = $this->getFolderContentType($name, $fullPath . DIRECTORY_SEPARATOR . $key . DIRECTORY_SEPARATOR . 'index.yaml'); + $item->status = $status; + $item->fileType = $fileType; + $item->order = count($nameParts) > 1 ? array_shift($nameParts) : NULL; + $item->name = implode(" ",$nameParts); + $item->name = iconv(mb_detect_encoding($item->name, mb_detect_order(), true), "UTF-8", $item->name); + $item->slug = implode("-",$nameParts); + $item->slug = $this->createSlug($item->slug, $language); + $item->path = $fullPath . DIRECTORY_SEPARATOR . $folderName; + $item->pathWithoutType = $fullPath . DIRECTORY_SEPARATOR . $folderName . DIRECTORY_SEPARATOR . 'index'; + $item->urlRelWoF = $fullSlugWithoutFolder . '/' . $item->slug; + $item->urlRel = $fullSlugWithFolder . '/' . $item->slug; + $item->urlAbs = $baseUrl . $fullSlugWithoutFolder . '/' . $item->slug; + $item->key = $key; + $item->keyPath = isset($keyPath) ? $keyPath . '.' . $key : $key; + $item->keyPathArray = explode('.', $item->keyPath); + $item->chapter = $chapter ? $chapter . '.' . $chapternr : $chapternr; + $item->active = false; + $item->activeParent = false; + $item->hide = false; - # scan that folder only if it is a draft or if the folder is published (contains index.md) - if($draft OR $folderPublished) - { - # we need s countable index here - $folderContent[$subFolder] = $this->scanFolder($folderPath . DIRECTORY_SEPARATOR . $subFolder, $draft); - } + # sort posts in descending order + if($item->contains == "posts") + { + rsort($name); + } + + $item->folderContent = $this->getFolderContentDetails($name, $language, $baseUrl, $item->urlRel, $item->urlRelWoF, $item->path, $item->keyPath, $item->chapter); + } + elseif($name) + { + # do not use index files + if($name == 'index.md' || $name == 'index.txt' || $name == 'index.txtmd' ) continue; + + $nameParts = $this->getStringParts($name); + $fileType = array_pop($nameParts); + $nameWithoutType = $this->getNameWithoutType($name); + + if($fileType == 'md') + { + $status = 'published'; + } + elseif($fileType == 'txt') + { + $status = 'unpublished'; } else { - $nameParts = $this->getStringParts($item); - $fileType = array_pop($nameParts); - - if($fileType == 'md') - { - $folderContent[] = $item; - } - - if($fileType == 'txt') - { - if(isset($last) && ($last == implode($nameParts)) ) - { - array_pop($folderContent); - $item = $item . 'md'; - } - $folderContent[] = $item; - - if(!$draft) - { - $index = count($folderContent)-1; - unset($folderContent[$index]); - } - } - - # store the name of the last file - $last = implode($nameParts); - + $fileType = 'txt'; + $status = 'modified'; } + + $item->originalName = $name; + $item->elementType = 'file'; + $item->status = $status; + $item->fileType = $fileType; + $item->order = count($nameParts) > 1 ? array_shift($nameParts) : NULL; + $item->name = implode(" ",$nameParts); + $item->name = iconv(mb_detect_encoding($item->name, mb_detect_order(), true), "UTF-8", $item->name); + $item->slug = implode("-",$nameParts); + $item->slug = $this->createSlug($item->slug, $language); + $item->path = $fullPath . DIRECTORY_SEPARATOR . $name; + $item->pathWithoutType = $fullPath . DIRECTORY_SEPARATOR . $nameWithoutType; + $item->key = $key; + $item->keyPath = isset($keyPath) ? $keyPath . '.' . $key : $key; + $item->keyPathArray = explode('.',$item->keyPath); + $item->chapter = $chapter . '.' . $chapternr; + $item->urlRelWoF = $fullSlugWithoutFolder . '/' . $item->slug; + $item->urlRel = $fullSlugWithFolder . '/' . $item->slug; + $item->urlAbs = $baseUrl . $fullSlugWithoutFolder . '/' . $item->slug; + $item->active = false; + $item->activeParent = false; + $item->hide = false; } + + $iteration++; + $chapternr++; + $contentDetails[$key] = $item; } - return $folderContent; + return $contentDetails; } @@ -162,7 +294,7 @@ class Folder * returns: array of objects. Each object contains information about an item (file or folder). */ - public function getFolderContentDetails(array $folderContent, $language, $baseUrl, $fullSlugWithFolder = NULL, $fullSlugWithoutFolder = NULL, $fullPath = NULL, $keyPath = NULL, $chapter = NULL) + public function getFolderContentDetailsOLD(array $folderContent, $language, $baseUrl, $fullSlugWithFolder = NULL, $fullSlugWithoutFolder = NULL, $fullPath = NULL, $keyPath = NULL, $chapter = NULL) { $contentDetails = []; $iteration = 0; @@ -277,6 +409,7 @@ class Folder return $contentDetails; } + public function getFolderContentType($folder, $yamlpath) { # check if folder is empty or has only index.yaml-file. This is a rare case so make it quick and dirty @@ -299,7 +432,8 @@ class Folder } else { - $file = $folder[0]; + $firstKey = array_key_first($folder); + $file = $folder[$firstKey]; $nameParts = $this->getStringParts($file); $order = count($nameParts) > 1 ? array_shift($nameParts) : NULL; $order = substr($order, 0, 7); diff --git a/system/typemill/Models/Navigation.php b/system/typemill/Models/Navigation.php index dcf5af5..416ee22 100644 --- a/system/typemill/Models/Navigation.php +++ b/system/typemill/Models/Navigation.php @@ -206,6 +206,8 @@ class Navigation extends Folder { # todo: filter for userrole or username + $basicLiveNavigation = $this->getBasicLiveNavigation($urlinfo, $language); + $this->liveNavigation = $this->storage->getFile('dataFolder', $this->naviFolder, $this->liveNaviName, 'unserialize'); if($this->liveNavigation) @@ -246,7 +248,7 @@ class Navigation extends Folder if(count($liveContentTree) > 0) { $liveNavigation = $this->getFolderContentDetails($liveContentTree, $language, $urlinfo['baseurl'], $urlinfo['basepath']); - + return $liveNavigation; } @@ -334,7 +336,7 @@ class Navigation extends Folder $item->folderContent = $this->mergeNavigationWithExtended($item->folderContent, $extended); } - $mergedNavigation[] = $item; + $mergedNavigation[$key] = $item; } return $mergedNavigation; @@ -364,7 +366,7 @@ class Navigation extends Folder return $item; } - # only used for folders to get items from live-navigation without hidden and unpublished pages + # NOT IN USE ANYMORE BUT KEEP IT public function getItemWithUrl($navigation, $url, $result = NULL) { foreach($navigation as $key => $item) @@ -390,7 +392,7 @@ class Navigation extends Folder } - # used with scan folder that generates own indexes for live version + # NOT IN USE ANYMORE BUT KEEP IT public function setActiveNaviItems($navigation, $breadcrumb) { if($breadcrumb) @@ -550,7 +552,6 @@ class Navigation extends Folder return $liveNavigation; } - public function getBreadcrumb($navigation, $searchArray, $i = NULL, $breadcrumb = NULL) { # if it is the first round, create an empty array