diff --git a/cache/cyanine-custom.css b/cache/cyanine-custom.css index c4ab8ec..e370893 100644 --- a/cache/cyanine-custom.css +++ b/cache/cyanine-custom.css @@ -1,30 +1,30 @@ -.landingpageintro h1{ -display: inline-block; -background: white; -padding: 4px 10px; -margin: 5px; -} - -.landingpageintro p{ -display: inline; -background: white; -line-height: 2.1rem; -padding: 6px 4px 4px; -} -article a[href^="http"]::after, -article a[href^="https://"]::after -{ - content: ""; - width: 11px; - height: 11px; - margin-left: 4px; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z'/%3E%3Cpath fill-rule='evenodd' d='M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z'/%3E%3C/svg%3E"); - background-position: center; - background-repeat: no-repeat; - background-size: contain; - display: inline-block; -} -a[href^="https://www.electrictoolbox.com"] { - background: none; - padding-right: 0; +.landingpageintro h1{ +display: inline-block; +background: white; +padding: 4px 10px; +margin: 5px; +} + +.landingpageintro p{ +display: inline; +background: white; +line-height: 2.1rem; +padding: 6px 4px 4px; +} +article a[href^="http"]::after, +article a[href^="https://"]::after +{ + content: ""; + width: 11px; + height: 11px; + margin-left: 4px; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z'/%3E%3Cpath fill-rule='evenodd' d='M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z'/%3E%3C/svg%3E"); + background-position: center; + background-repeat: no-repeat; + background-size: contain; + display: inline-block; +} +a[href^="https://www.electrictoolbox.com"] { + background: none; + padding-right: 0; } \ No newline at end of file diff --git a/content/00-welcome/00-setup-your-website.yaml b/content/00-welcome/00-setup-your-website.yaml index 7d9343d..52c647d 100644 --- a/content/00-welcome/00-setup-your-website.yaml +++ b/content/00-welcome/00-setup-your-website.yaml @@ -3,6 +3,8 @@ meta: owner: Sebastian created: '2023-06-12' time: 22-36-14 - modified: '2023-03-26' - title: 'Typemill provides detailed settings, and you have access to nearly all settings in the author panel. Learn the basics in this short video:' + modified: '2023-10-23' + title: 'Setup your website' description: ' You will find all configurations and settings under the main navigation point settings with the following sub-navigation:' + hide: false + noindex: false diff --git a/content/00-welcome/01-manage-access.yaml b/content/00-welcome/01-manage-access.yaml index 6101b43..d11743e 100644 --- a/content/00-welcome/01-manage-access.yaml +++ b/content/00-welcome/01-manage-access.yaml @@ -1,8 +1,16 @@ meta: navtitle: 'manage access' + title: 'Manage access' + description: ' Restrict Access for the Website' + heroimage: null + heroimagealt: null owner: Sebastian + author: null + allowedrole: null + alloweduser: null + manualdate: null + modified: '2023-05-06' created: '2023-06-12' time: 22-36-36 - modified: '2023-05-06' - title: 'Typemill has a build-in system to restrict access to pages or to the whole websites. You can activate both features in the system settings under the section "access rights". If you activate one of the features, then Typemill will use session cookies on all frontend pages. Learn all the details in the following video tutorial:' - description: ' Restrict Access for the Website' + hide: false + noindex: false diff --git a/content/00-welcome/03-get-help.yaml b/content/00-welcome/03-get-help.yaml index 9858468..285fc15 100644 --- a/content/00-welcome/03-get-help.yaml +++ b/content/00-welcome/03-get-help.yaml @@ -1,8 +1,16 @@ meta: navtitle: 'get help' + title: 'get help' + description: 'If you found a bug or if you have a question, then please open a new issue on GitHub. Do you need professional help, an individual theme or a special plugin?' + heroimage: null + heroimagealt: null owner: Sebastian + author: null + allowedrole: null + alloweduser: null + manualdate: null + modified: '2023-05-13' created: '2023-06-12' time: 22-36-34 - modified: '2023-05-13' - title: 'If you need any help, then please read the [documentation on typemill.net](https://typemill.net/typemill) first. You can also check these [video-tutorials](https://www.youtube.com/channel/UCyghKiX2kK9QIqTf1WT1Xxw) about the basics to create a typemill website.' - description: 'If you found a bug or if you have a question, then please open a new issue on GitHub. Do you need professional help, an individual theme or a special plugin?' + hide: false + noindex: false diff --git a/content/00-welcome/05-markdown-test.md b/content/00-welcome/04-markdown-test.md similarity index 97% rename from content/00-welcome/05-markdown-test.md rename to content/00-welcome/04-markdown-test.md index 62ad7f0..359ca52 100644 --- a/content/00-welcome/05-markdown-test.md +++ b/content/00-welcome/04-markdown-test.md @@ -28,6 +28,7 @@ Headlines are simply done with hash chars like this: + ### Third Level Headline A third headline is more decent and lower prioritized than a second level headline. @@ -55,6 +56,7 @@ A paragraph is a simple text-block separated with a new line above and below. + A paragraph is a simple text-block separated with a new line above and below. ## Soft Linebreak @@ -70,6 +72,7 @@ He said: "again" + For a soft linebreak (eg. for dialoges in literature), add two spaces at the end of a line and use a simple return. She said: "Hello" @@ -87,6 +90,7 @@ For bold text use two **asterix** or two __underscores__. + For italic text use one *asterix* or one _underscore_. For bold text use two **asterix** or two __underscores__. @@ -110,6 +114,7 @@ For an ordered list use whatever number you want and add a dot: + For an unordered list use a dash * like @@ -137,6 +142,7 @@ Easily created for example with three dashes like this: + Easily created for example with three dashes like this: --- @@ -156,6 +162,7 @@ You can even use a download-link like []() + This is an ordinary [Link](http://typemill.net). Links can also be [relative](/info). @@ -186,6 +193,7 @@ The same rules as with links, but with a ! + The same rules as with links, but with a ! ![](media/tmp/kai-dahms-v0nbnxlwjzk-3unsp-1.webp) @@ -207,6 +215,7 @@ You can link an image with a nested syntax like this: + You can link an image with a nested syntax like this: [![alt-text](media/files/markdown.png){.imgClass}](https://typemill.net) @@ -228,6 +237,7 @@ You can controll the image position with the classes .left, .right and .middle l + ![](media/tmp/kai-dahms-v0nbnxlwjzk-3unsp-1.webp) The first image should float on the left side of this paragraph. This might not work with all themes. If you are a theme developer, please ensure that you support the image classes "left", "right" and "center". You can add these classes manually in the raw mode or you can assign them in the visual mode when you edit a picture (double click on it to open the dialog). Images in a separate line are rendered with the html5 elements `figure` and `figcapture`. @@ -254,6 +264,7 @@ There are always some women and men with wise words + There always some women and men with wise words > But I usually don't read them, to be honest. @@ -273,6 +284,7 @@ Add the footnote text at the bottom of the page like this: + You can write footnotes[^1] with markdown. Scroll down to the end of the page[^2] and look for the footnotes. @@ -291,6 +303,7 @@ Footnotes won't work with the visual editor right now, so please use the raw mod + You won't see the abbreviation directly, but if you write HTML or W3C somewhere, then you can see the tooltip with the explanation. *[HTML]: Hyper Text Markup Language @@ -311,6 +324,7 @@ Orange + Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae. @@ -322,18 +336,18 @@ Orange You can create different notices if you add a '!', '!!', '!!!', '!!!!' before a line. This will wrap the content into a div-class with the classes `notice1`, `notice2`, `notice3` and `notice4`. You can also span notices over several lines. This logic follows some other CMS like Grav, Lektor or Yellow and it is not compatible with other markdown processors or editors. -> ! Notice 1 -> ! -> ! Please note that you can use **markdown** inside of the notice so you can *format* your text here. - -Notice 2 - -Please note that you can use **markdown** inside of the notice so you can *format* your text here. - -! **Notice 3** +! Notice 1 ! ! Please note that you can use **markdown** inside of the notice so you can *format* your text here. +!! **Notice 2** +!! +!! Please note that you can use **markdown** inside of the notice so you can *format* your text here. + +!!! **Notice 3** +!!! +!!! Please note that you can use **markdown** inside of the notice so you can *format* your text here. + ## Tables ```` @@ -348,6 +362,7 @@ Please note that you can use **markdown** inside of the notice so you can *forma + | Name | Usage | |---|---| | My Name | For Me | @@ -364,6 +379,7 @@ Let us create some `` like this + Let us create some `` and now let us check, if a codeblock works: ```` @@ -381,6 +397,7 @@ Use four apostroph like this: + ## Math Please activate the math-plugin to use mathematical expressions with LaTeX syntax. You can choose between MathJax or the newer KaTeX library. MathJax is included from a CDN, KaTeX is included in the plugin. So if you don't want to fetch code from a CDN, use KaTeX instead. The markdown syntax in TYPEMILL is the same for both libraries. @@ -396,6 +413,7 @@ inline \(x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a)\) math + inline $x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a)$ math inline \(x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a)\) math @@ -415,6 +433,7 @@ x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a) + $$ x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a) $$ diff --git a/content/00-welcome/05-markdown-test.yaml b/content/00-welcome/04-markdown-test.yaml similarity index 100% rename from content/00-welcome/05-markdown-test.yaml rename to content/00-welcome/04-markdown-test.yaml diff --git a/content/00-welcome/06-todos.md b/content/00-welcome/05-todoss.md similarity index 83% rename from content/00-welcome/06-todos.md rename to content/00-welcome/05-todoss.md index 9f51ce5..b8d2e46 100644 --- a/content/00-welcome/06-todos.md +++ b/content/00-welcome/05-todoss.md @@ -105,18 +105,45 @@ * DONE: Captcha integration * DONE: Solution for logo and favicon * FIXED: Raw editor jumps if you edit long text at the end -* Reference feature -* Typemill Utilities +* DONE: Typemill Utilities +* DONE: Update CSS for themes +* DONE: test with different user rights * Markdown secure rendering * finish youtube component -* Handle formdata centrally ??? * BUG: Error fields in account form not styled correctly -* DONE: Update CSS for themes * BUG: Codefield jumps on editing * False for owner on live? +## Dark Mode + +* DONE: system +* DONE: content-navigation +* DONE: visual editor preview +* DONE: visual editor edit modes +* DONE: raw editor +* DONE: meta +* DONE: other tabs +* DONE: modals +* DONE: medialib +* DONE: publish-bar. + +## Feedback GitHub + +* FIXED: Website restriction +* NO ERROR: Change slug of blog +* FIXED: undefined array key "title" in TwigMetaExtension on line 25 +* FIXED: CSS for navigation +* DONE: Test with 8.2.7 (deprecation reports) +* NOT REPRODUCED: Meta from home folder? +* automatic generated password in firefox +* FIXED: upload hero image in landinpage +* FIXED: Restriction for custom css to 10000 characters +* NOT REPRODUCED: Custom css löschen => false + ## later +* Handle formdata centrally ??? +* Reference Feature * Clear cache * Show security Log * User search only for +10 users @@ -161,7 +188,8 @@ ## Upgrade -* Delete content of system folder +* Switch server to php 8.0 at least +* Delete content of system folders * Upload new content of system folder with folders typemill and vendor * Backup and delete settings file * upload new index.php file diff --git a/content/00-welcome/06-todos.yaml b/content/00-welcome/05-todoss.yaml similarity index 58% rename from content/00-welcome/06-todos.yaml rename to content/00-welcome/05-todoss.yaml index 77a04a6..2cd3140 100644 --- a/content/00-welcome/06-todos.yaml +++ b/content/00-welcome/05-todoss.yaml @@ -2,17 +2,13 @@ meta: navtitle: 'To Dos' title: 'A list of open tasks' description: ' Visual Editor with more stuff' - heroimage: null - heroimagealt: null - owner: Sebastian - author: null + heroimage: media/live/screenshot-2023-08-03-at-15-23-44-setup-3.png + heroimagealt: '' + owner: 'Sebastian, testauthor' + author: '' allowedrole: '' - alloweduser: null - manualdate: null modified: '2023-06-19' created: '2023-06-19' time: 15-15-01 - reference: null - referencetype: null hide: false noindex: false diff --git a/data/navigation/navi-draft.txt b/data/navigation/navi-draft.txt index 85331c9..545a364 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:6:{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-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:"01";s:4:"name";s:13:"manage access";s:4:"slug";s:13:"manage-access";s:4:"path";s:31:"/00-welcome/01-manage-access.md";s:15:"pathWithoutType";s:28:"/00-welcome/01-manage-access";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/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:2;O:8:"stdClass":20:{s:12:"originalName";s:19:"02-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:"02";s:4:"name";s:13:"write content";s:4:"slug";s:13:"write-content";s:4:"path";s:31:"/00-welcome/02-write-content.md";s:15:"pathWithoutType";s:28:"/00-welcome/02-write-content";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/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:1;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:"05-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:"05";s:4:"name";s:13:"markdown test";s:4:"slug";s:13:"markdown-test";s:4:"path";s:31:"/00-welcome/05-markdown-test.md";s:15:"pathWithoutType";s:28:"/00-welcome/05-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;}i:5;O:8:"stdClass":20:{s:12:"originalName";s:11:"06-todos.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"06";s:4:"name";s:6:"To Dos";s:4:"slug";s:5:"todos";s:4:"path";s:23:"/00-welcome/06-todos.md";s:15:"pathWithoutType";s:20:"/00-welcome/06-todos";s:3:"key";i:5;s:7:"keyPath";s:3:"0.5";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"5";}s:7:"chapter";s:3:"1.6";s:9:"urlRelWoF";s:14:"/welcome/todos";s:6:"urlRel";s:23:"/typemill/welcome/todos";s:6:"urlAbs";s:39:"http://localhost/typemill/welcome/todos";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";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:6:{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-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:"01";s:4:"name";s:13:"manage access";s:4:"slug";s:13:"manage-access";s:4:"path";s:31:"/00-welcome/01-manage-access.md";s:15:"pathWithoutType";s:28:"/00-welcome/01-manage-access";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/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:2;O:8:"stdClass":20:{s:12:"originalName";s:19:"02-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:"02";s:4:"name";s:13:"write content";s:4:"slug";s:13:"write-content";s:4:"path";s:31:"/00-welcome/02-write-content.md";s:15:"pathWithoutType";s:28:"/00-welcome/02-write-content";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/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:1;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;}i:5;O:8:"stdClass":20:{s:12:"originalName";s:12:"05-todoss.md";s:11:"elementType";s:4:"file";s:6:"status";s:9:"published";s:8:"fileType";s:2:"md";s:5:"order";s:2:"05";s:4:"name";s:6:"To Dos";s:4:"slug";s:6:"todoss";s:4:"path";s:24:"/00-welcome/05-todoss.md";s:15:"pathWithoutType";s:21:"/00-welcome/05-todoss";s:3:"key";i:5;s:7:"keyPath";s:3:"0.5";s:12:"keyPathArray";a:2:{i:0;s:1:"0";i:1;s:1:"5";}s:7:"chapter";s:3:"1.6";s:9:"urlRelWoF";s:15:"/welcome/todoss";s:6:"urlRel";s:24:"/typemill/welcome/todoss";s:6:"urlAbs";s:40:"http://localhost/typemill/welcome/todoss";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 diff --git a/data/navigation/navi-extended.txt b/data/navigation/navi-extended.txt index e4467fe..60aef1f 100644 --- a/data/navigation/navi-extended.txt +++ b/data/navigation/navi-extended.txt @@ -32,13 +32,13 @@ navtitle: 'markdown test' hide: false noindex: false - path: /00-welcome/05-markdown-test.md + path: /00-welcome/04-markdown-test.md keyPath: '0.4' -/welcome/todos: +/welcome/todoss: navtitle: 'To Dos' hide: false noindex: false - path: /00-welcome/06-todos.md + path: /00-welcome/05-todoss.md keyPath: '0.5' /cyanine-theme: navtitle: 'cyanine theme' diff --git a/data/security/securitylog.txt b/data/security/securitylog.txt index dfaea29..5ce3ebc 100644 --- a/data/security/securitylog.txt +++ b/data/security/securitylog.txt @@ -11,3 +11,8 @@ 127.0.0.1;2023-09-15 06:06:46;wrong login 127.0.0.1;2023-09-15 22:03:38;wrong login 127.0.0.1;2023-09-16 08:49:53;wrong login +127.0.0.1;2023-10-23 20:42:13;wrong login +127.0.0.1;2023-10-23 21:26:26;wrong login +127.0.0.1;2023-10-24 21:52:19;wrong login +127.0.0.1;2023-10-26 20:57:09;wrong login +127.0.0.1;2023-10-28 12:18:34;wrong login diff --git a/media/live/android-chrome-512x512-1.png b/media/live/android-chrome-512x512-1.png deleted file mode 100644 index 4c5543d..0000000 Binary files a/media/live/android-chrome-512x512-1.png and /dev/null differ diff --git a/media/live/android-chrome-512x512-2.png b/media/live/android-chrome-512x512-2.png deleted file mode 100644 index 4c5543d..0000000 Binary files a/media/live/android-chrome-512x512-2.png and /dev/null differ diff --git a/media/live/android-chrome-512x512.png b/media/live/android-chrome-512x512.png deleted file mode 100644 index 4c5543d..0000000 Binary files a/media/live/android-chrome-512x512.png and /dev/null differ diff --git a/media/live/screenshot-2023-08-03-at-15-23-44-setup.png b/media/live/screenshot-2023-08-03-at-15-23-44-setup.png deleted file mode 100644 index b92e64b..0000000 Binary files a/media/live/screenshot-2023-08-03-at-15-23-44-setup.png and /dev/null differ diff --git a/media/live/screenshot-typemill-startpage.png b/media/live/screenshot-typemill-startpage.png deleted file mode 100644 index c23c1ae..0000000 Binary files a/media/live/screenshot-typemill-startpage.png and /dev/null differ diff --git a/media/live/youtube-7yvlwxjl9dc-1.jpg b/media/live/youtube-7yvlwxjl9dc-1.jpg new file mode 100644 index 0000000..b6a0ac8 Binary files /dev/null and b/media/live/youtube-7yvlwxjl9dc-1.jpg differ diff --git a/media/live/youtube-7yvlwxjl9dc-2.jpg b/media/live/youtube-7yvlwxjl9dc-2.jpg new file mode 100644 index 0000000..b6a0ac8 Binary files /dev/null and b/media/live/youtube-7yvlwxjl9dc-2.jpg differ diff --git a/media/live/youtube-7yvlwxjl9dc.jpg b/media/live/youtube-7yvlwxjl9dc.jpg new file mode 100644 index 0000000..b6a0ac8 Binary files /dev/null and b/media/live/youtube-7yvlwxjl9dc.jpg differ diff --git a/media/original/android-chrome-512x512-1.png b/media/original/android-chrome-512x512-1.png deleted file mode 100644 index 28a60ef..0000000 Binary files a/media/original/android-chrome-512x512-1.png and /dev/null differ diff --git a/media/original/android-chrome-512x512-2.png b/media/original/android-chrome-512x512-2.png deleted file mode 100644 index 28a60ef..0000000 Binary files a/media/original/android-chrome-512x512-2.png and /dev/null differ diff --git a/media/original/android-chrome-512x512.png b/media/original/android-chrome-512x512.png deleted file mode 100644 index 28a60ef..0000000 Binary files a/media/original/android-chrome-512x512.png and /dev/null differ diff --git a/media/original/screenshot-2023-08-03-at-15-23-44-setup.png b/media/original/screenshot-2023-08-03-at-15-23-44-setup.png deleted file mode 100644 index e5cfb8b..0000000 Binary files a/media/original/screenshot-2023-08-03-at-15-23-44-setup.png and /dev/null differ diff --git a/media/original/screenshot-typemill-startpage.png b/media/original/screenshot-typemill-startpage.png deleted file mode 100644 index 3aef5e2..0000000 Binary files a/media/original/screenshot-typemill-startpage.png and /dev/null differ diff --git a/media/original/youtube-7yvlwxjl9dc-1.jpg b/media/original/youtube-7yvlwxjl9dc-1.jpg new file mode 100644 index 0000000..49e9006 Binary files /dev/null and b/media/original/youtube-7yvlwxjl9dc-1.jpg differ diff --git a/media/original/youtube-7yvlwxjl9dc-2.jpg b/media/original/youtube-7yvlwxjl9dc-2.jpg new file mode 100644 index 0000000..49e9006 Binary files /dev/null and b/media/original/youtube-7yvlwxjl9dc-2.jpg differ diff --git a/media/original/youtube-7yvlwxjl9dc.jpg b/media/original/youtube-7yvlwxjl9dc.jpg new file mode 100644 index 0000000..49e9006 Binary files /dev/null and b/media/original/youtube-7yvlwxjl9dc.jpg differ diff --git a/media/thumbs/android-chrome-512x512-1.png b/media/thumbs/android-chrome-512x512-1.png deleted file mode 100644 index 25095db..0000000 Binary files a/media/thumbs/android-chrome-512x512-1.png and /dev/null differ diff --git a/media/thumbs/android-chrome-512x512-2.png b/media/thumbs/android-chrome-512x512-2.png deleted file mode 100644 index 25095db..0000000 Binary files a/media/thumbs/android-chrome-512x512-2.png and /dev/null differ diff --git a/media/thumbs/android-chrome-512x512.png b/media/thumbs/android-chrome-512x512.png deleted file mode 100644 index 25095db..0000000 Binary files a/media/thumbs/android-chrome-512x512.png and /dev/null differ diff --git a/media/thumbs/screenshot-2023-08-03-at-15-23-44-setup.png b/media/thumbs/screenshot-2023-08-03-at-15-23-44-setup.png deleted file mode 100644 index ffb91aa..0000000 Binary files a/media/thumbs/screenshot-2023-08-03-at-15-23-44-setup.png and /dev/null differ diff --git a/media/thumbs/screenshot-typemill-startpage.png b/media/thumbs/screenshot-typemill-startpage.png deleted file mode 100644 index 4e2d288..0000000 Binary files a/media/thumbs/screenshot-typemill-startpage.png and /dev/null differ diff --git a/media/thumbs/youtube-7yvlwxjl9dc-1.jpg b/media/thumbs/youtube-7yvlwxjl9dc-1.jpg new file mode 100644 index 0000000..990454f Binary files /dev/null and b/media/thumbs/youtube-7yvlwxjl9dc-1.jpg differ diff --git a/media/thumbs/youtube-7yvlwxjl9dc-2.jpg b/media/thumbs/youtube-7yvlwxjl9dc-2.jpg new file mode 100644 index 0000000..990454f Binary files /dev/null and b/media/thumbs/youtube-7yvlwxjl9dc-2.jpg differ diff --git a/media/thumbs/youtube-7yvlwxjl9dc.jpg b/media/thumbs/youtube-7yvlwxjl9dc.jpg new file mode 100644 index 0000000..990454f Binary files /dev/null and b/media/thumbs/youtube-7yvlwxjl9dc.jpg differ diff --git a/system/typemill/Controllers/Controller.php b/system/typemill/Controllers/Controller.php index 4dfd530..d32f92a 100644 --- a/system/typemill/Controllers/Controller.php +++ b/system/typemill/Controllers/Controller.php @@ -141,8 +141,7 @@ abstract class Controller return $formDefinitions; } - # used to protect api access, can we do it with middleware? - protected function validateRights($userrole, $resource, $action) + protected function userroleIsAllowed($userrole, $resource, $action) { $acl = $this->c->get('acl'); @@ -151,10 +150,45 @@ abstract class Controller return true; } - die("PLEASE UPDATE THE METHOD validateRights in controller.php"); + return false; + } + + protected function userIsAllowed($username, $pagemeta) + { + if( + isset($pagemeta['meta']['owner']) && + $pagemeta['meta']['owner'] && + $pagemeta['meta']['owner'] !== '' + ) + { + $allowedusers = array_map('trim', explode(",", $pagemeta['meta']['owner'])); + if( + in_array($username, $allowedusers) + ) + { + return true; + } + } + + return false; + } + + + # used to protect api access, can we do it with middleware? + protected function validateRights($userrole, $resource, $action) + { # check ownership. THIS WILL FAIL ANYWAY!!! # MAYBE WE SHOUD ADD THIS CHECK INTO MIDDLEWARE, TOO ? + $acl = $this->c->get('acl'); + + if($acl->isAllowed($userrole, $resource, $action)) + { + return true; + } + + die("PLEASE UPDATE THE METHOD validateRights in controller.php"); + $writeMeta = new writeMeta(); $pagemeta = $writeMeta->getPageMeta($this->settings, $this->item); diff --git a/system/typemill/Controllers/ControllerApiAuthorArticle.php b/system/typemill/Controllers/ControllerApiAuthorArticle.php index b87a718..b35d51b 100644 --- a/system/typemill/Controllers/ControllerApiAuthorArticle.php +++ b/system/typemill/Controllers/ControllerApiAuthorArticle.php @@ -23,16 +23,6 @@ class ControllerApiAuthorArticle extends Controller { public function publishArticle(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'content', 'update'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->articlePublish($params); @@ -59,6 +49,22 @@ class ControllerApiAuthorArticle extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'publish')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + # publish content $content = new Content($urlinfo['baseurl'], $this->settings, $this->c->get('dispatcher')); $draftMarkdown = $content->getDraftMarkdown($item); @@ -106,16 +112,6 @@ class ControllerApiAuthorArticle extends Controller public function unpublishArticle(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'content', 'update'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->articlePublish($params); @@ -142,6 +138,22 @@ class ControllerApiAuthorArticle extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'publish')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + # publish content $content = new Content($urlinfo['baseurl'], $this->settings, $this->c->get('dispatcher')); $draftMarkdown = $content->getDraftMarkdown($item); @@ -183,16 +195,6 @@ class ControllerApiAuthorArticle extends Controller public function updateDraft(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'mycontent', 'edit'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(401); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->articleUpdate($params); @@ -219,6 +221,22 @@ class ControllerApiAuthorArticle extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'update')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + # save draft content $content = new Content($urlinfo['baseurl'], $this->settings, $this->c->get('dispatcher')); $markdown = $params['title'] . PHP_EOL . PHP_EOL . $params['body']; @@ -246,16 +264,6 @@ class ControllerApiAuthorArticle extends Controller public function publishDraft(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'mycontent', 'edit'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(401); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->articleUpdate($params); @@ -282,6 +290,22 @@ class ControllerApiAuthorArticle extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'update')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + # save draft content $content = new Content($urlinfo['baseurl'], $this->settings, $this->c->get('dispatcher')); $markdown = $params['title'] . PHP_EOL . PHP_EOL . $params['body']; @@ -326,16 +350,6 @@ class ControllerApiAuthorArticle extends Controller public function discardArticleChanges(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'mycontent', 'edit'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->articlePublish($params); @@ -362,6 +376,22 @@ class ControllerApiAuthorArticle extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'update')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + # publish content $content = new Content($urlinfo['baseurl'], $this->settings, $this->c->get('dispatcher')); $content->deleteDraft($item); @@ -387,16 +417,6 @@ class ControllerApiAuthorArticle extends Controller public function createArticle(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'mycontent', 'create'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->navigationItem($params); @@ -495,7 +515,13 @@ class ControllerApiAuthorArticle extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(500); } - $storage->updateYaml('contentFolder', $folderPath, $namePath . '.yaml', ['meta' => ['navtitle' => $params['item_name']]]); + $storage->updateYaml('contentFolder', $folderPath, $namePath . '.yaml', + ['meta' => [ + 'navtitle' => $params['item_name'], + 'owner' => $request->getAttribute('c_username'), + 'created' => date("Y-m-d"), + 'time' => date("H-i-s") + ]]); } elseif($params['type'] == 'folder') { @@ -508,7 +534,13 @@ class ControllerApiAuthorArticle extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(500); } $storage->writeFile('contentFolder', $folderPath . DIRECTORY_SEPARATOR . $namePath, 'index.txt', $content); - $storage->updateYaml('contentFolder', $folderPath . DIRECTORY_SEPARATOR . $namePath, 'index.yaml', ['meta' => ['navtitle' => $params['item_name']]]); + $storage->updateYaml('contentFolder', $folderPath . DIRECTORY_SEPARATOR . $namePath, 'index.yaml', + ['meta' => [ + 'navtitle' => $params['item_name'], + 'owner' => $request->getAttribute('c_username'), + 'created' => date("Y-m-d"), + 'time' => date("H-i-s") + ]]); # always redirect to a folder # $url = $urlinfo['baseurl'] . '/tm/content/' . $this->settings['editor'] . $folder->urlRelWoF . '/' . $slug; @@ -527,16 +559,6 @@ class ControllerApiAuthorArticle extends Controller public function createPost(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'mycontent', 'create'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->navigationItem($params); @@ -619,7 +641,13 @@ class ControllerApiAuthorArticle extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(500); } - $storage->updateYaml('contentFolder', $folderPath, $namePath . '.yaml', ['meta' => ['navtitle' => $params['item_name']]]); + $storage->updateYaml('contentFolder', $folderPath, $namePath . '.yaml', + ['meta' => [ + 'navtitle' => $params['item_name'], + 'owner' => $request->getAttribute('c_username'), + 'created' => date("Y-m-d"), + 'time' => date("H-i-s") + ]]); } elseif($params['type'] == 'folder') { @@ -644,16 +672,6 @@ class ControllerApiAuthorArticle extends Controller public function renameArticle(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'mycontent', 'edit'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->articleRename($params); @@ -680,6 +698,22 @@ class ControllerApiAuthorArticle extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'update')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + # check if name exists $parentUrl = str_replace($item->slug, '', $item->urlRelWoF); if($parentUrl == '/') @@ -732,16 +766,6 @@ class ControllerApiAuthorArticle extends Controller public function sortArticle(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'content', 'update'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->navigationSort($params); @@ -768,6 +792,31 @@ class ControllerApiAuthorArticle extends Controller $navigation = new Navigation(); $draftNavigation = $navigation->getDraftNavigation($urlinfo, $langattr); $item = $navigation->getItemWithKeyPath($draftNavigation, $itemKeyPath); + if(!$item) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('page not found'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(404); + } + + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'update')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + $extendedNavigation = $navigation->getExtendedNavigation($urlinfo, $langattr); $pageinfo = $extendedNavigation[$params['url']] ?? false; if(!$pageinfo) @@ -861,16 +910,6 @@ class ControllerApiAuthorArticle extends Controller public function deleteArticle(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'content', 'delete'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->articlePublish($params); @@ -897,6 +936,22 @@ class ControllerApiAuthorArticle extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'delete')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + $content = new Content($urlinfo['baseurl'], $this->settings, $this->c->get('dispatcher')); # check if it is a folder and if the folder has published pages. diff --git a/system/typemill/Controllers/ControllerApiAuthorBlock.php b/system/typemill/Controllers/ControllerApiAuthorBlock.php index d5a8014..cd17051 100644 --- a/system/typemill/Controllers/ControllerApiAuthorBlock.php +++ b/system/typemill/Controllers/ControllerApiAuthorBlock.php @@ -8,22 +8,13 @@ use Slim\Routing\RouteContext; use Typemill\Models\Navigation; use Typemill\Models\Validation; use Typemill\Models\Content; +use Typemill\Models\Meta; use Typemill\Static\Translations; class ControllerApiAuthorBlock extends Controller { public function addBlock(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'content', 'update'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); @@ -51,6 +42,22 @@ class ControllerApiAuthorBlock extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'update')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + $content = new Content($urlinfo['baseurl'], $this->settings, $this->c->get('dispatcher')); $draftMarkdown = $content->getDraftMarkdown($item); @@ -119,16 +126,6 @@ class ControllerApiAuthorBlock extends Controller public function moveBlock(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'content', 'update'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->blockMove($params); @@ -155,6 +152,22 @@ class ControllerApiAuthorBlock extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'update')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + $content = new Content($urlinfo['baseurl'], $this->settings, $this->c->get('dispatcher')); $draftMarkdown = $content->getDraftMarkdown($item); @@ -212,16 +225,6 @@ class ControllerApiAuthorBlock extends Controller public function updateBlock(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'content', 'update'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->blockInput($params); @@ -248,6 +251,22 @@ class ControllerApiAuthorBlock extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'update')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + $content = new Content($urlinfo['baseurl'], $this->settings, $this->c->get('dispatcher')); $draftMarkdown = $content->getDraftMarkdown($item); @@ -318,16 +337,6 @@ class ControllerApiAuthorBlock extends Controller public function deleteBlock(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'content', 'update'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->blockDelete($params); @@ -354,6 +363,22 @@ class ControllerApiAuthorBlock extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(404); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'update')) + { + # then check if user is the owner of this content + $meta = new Meta(); + $metadata = $meta->getMetaData($item); + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + $content = new Content($urlinfo['baseurl'], $this->settings, $this->c->get('dispatcher')); $draftMarkdown = $content->getDraftMarkdown($item); diff --git a/system/typemill/Controllers/ControllerApiAuthorMeta.php b/system/typemill/Controllers/ControllerApiAuthorMeta.php index 46dbd75..7bd7bb5 100644 --- a/system/typemill/Controllers/ControllerApiAuthorMeta.php +++ b/system/typemill/Controllers/ControllerApiAuthorMeta.php @@ -15,18 +15,6 @@ class ControllerApiAuthorMeta extends Controller { public function getMeta(Request $request, Response $response, $args) { - - # is it really needed? Check middleware if rights are validated there already - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'content', 'update'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $url = $request->getQueryParams()['url'] ?? false; $navigation = new Navigation(); @@ -50,6 +38,20 @@ class ControllerApiAuthorMeta extends Controller $metadata = $meta->addMetaDefaults($metadata, $item, $this->settings['author']); } + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'view')) + { + # then check if user is the owner of this content + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } + # if item is a folder if($item->elementType == "folder" && isset($item->contains)) { @@ -103,16 +105,6 @@ class ControllerApiAuthorMeta extends Controller public function updateMeta(Request $request, Response $response, $args) { - $validRights = $this->validateRights($request->getAttribute('c_userrole'), 'content', 'update'); - if(!$validRights) - { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You do not have enough rights.'), - ])); - - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); - } - $params = $request->getParsedBody(); $validate = new Validation(); $validInput = $validate->metaInput($params); @@ -140,11 +132,26 @@ class ControllerApiAuthorMeta extends Controller } $meta = new Meta(); + $metadata = $meta->getMetaData($item); + + # if user is not allowed to perform this action (e.g. not admin) + if(!$this->userroleIsAllowed($request->getAttribute('c_userrole'), 'content', 'update')) + { + # then check if user is the owner of this content + if(!$this->userIsAllowed($request->getAttribute('c_username'), $metadata)) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You do not have enough rights.'), + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } + } # if item is a folder if($item->elementType == "folder" && isset($item->contains)) { - $metadata['meta']['contains'] = isset($pagemeta['meta']['contains']) ? $pagemeta['meta']['contains'] : $item->contains; + $metadata['meta']['contains'] = isset($metadata['meta']['contains']) ? $metadata['meta']['contains'] : $item->contains; # get global metadefinitions $metadefinitions = $meta->getMetaDefinitions($this->settings, $folder = true); @@ -167,7 +174,20 @@ class ControllerApiAuthorMeta extends Controller $tabdefinitions['fields'] = $this->addDatasets($tabdefinitions['fields']); $tabdefinitions = $this->flattenTabFields($tabdefinitions['fields'], []); - # create validation object + $validated['data'] = $validate->recursiveValidation($tabdefinitions, $params['data']); + + if(!empty($validate->errors)) + { + $errors[$params['tab']] = $validate->errors; + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('Please correct the errors in the form.'), + 'errors' => $errors + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(400); + } + +/* $errors = []; # take the user input data and iterate over all fields and values @@ -202,8 +222,7 @@ class ControllerApiAuthorMeta extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(400); } - - $pageMeta = $meta->getMetaData($item); +*/ # extended $navigation = new Navigation(); @@ -213,10 +232,10 @@ class ControllerApiAuthorMeta extends Controller if($params['tab'] == 'meta') { # if manual date has been modified - if( $this->hasChanged($params['data'], $pageMeta['meta'], 'manualdate')) + if( $this->hasChanged($params['data'], $metadata['meta'], 'manualdate')) { # update the time - $params['data']['time'] = date('H-i-s', time()); + $validated['data']['time'] = date('H-i-s', time()); # if it is a post, then rename the post if($item->elementType == "file" && strlen($item->order) == 12) @@ -225,7 +244,7 @@ class ControllerApiAuthorMeta extends Controller $metadate = $params['data']['manualdate']; if($metadate == '') { - $metadate = $pageMeta['meta']['created']; + $metadate = $metadata['meta']['created']; } $datetime = $metadate . '-' . $params['data']['time']; $datetime = implode(explode('-', $datetime)); @@ -242,8 +261,8 @@ class ControllerApiAuthorMeta extends Controller } # if folder has changed and contains pages instead of posts or posts instead of pages - if($item->elementType == "folder" && isset($params['data']['contains']) && isset($pageMeta['meta']['contains']) && $this->hasChanged($params['data'], $pageMeta['meta'], 'contains')) - { + if($item->elementType == "folder" && isset($params['data']['contains']) && isset($metadata['meta']['contains']) && $this->hasChanged($params['data'], $metadata['meta'], 'contains')) + { if($meta->folderContainsFolders($item)) { $response->getBody()->write(json_encode([ @@ -275,9 +294,9 @@ class ControllerApiAuthorMeta extends Controller } # normalize the meta-input - $params['data']['navtitle'] = (isset($params['data']['navtitle']) && $params['data']['navtitle'] !== null )? $params['data']['navtitle'] : ''; - $params['data']['hide'] = (isset($params['data']['hide']) && $params['data']['hide'] !== null) ? $params['data']['hide'] : false; - $params['data']['noindex'] = (isset($params['data']['noindex']) && $params['data']['noindex'] !== null) ? $params['data']['noindex'] : false; + $validated['data']['navtitle'] = (isset($params['data']['navtitle']) && $params['data']['navtitle'] !== null )? $params['data']['navtitle'] : ''; + $validated['data']['hide'] = (isset($params['data']['hide']) && $params['data']['hide'] !== null) ? $params['data']['hide'] : false; + $validated['data']['noindex'] = (isset($params['data']['noindex']) && $params['data']['noindex'] !== null) ? $params['data']['noindex'] : false; # input values are empty but entry in structure exists if( @@ -290,11 +309,11 @@ class ControllerApiAuthorMeta extends Controller } elseif( # check if navtitle or hide-value has been changed - ($this->hasChanged($params['data'], $pageMeta['meta'], 'navtitle')) + ($this->hasChanged($params['data'], $metadata['meta'], 'navtitle')) OR - ($this->hasChanged($params['data'], $pageMeta['meta'], 'hide')) + ($this->hasChanged($params['data'], $metadata['meta'], 'hide')) OR - ($this->hasChanged($params['data'], $pageMeta['meta'], 'noindex')) + ($this->hasChanged($params['data'], $metadata['meta'], 'noindex')) ) { $navigation->clearNavigation(); @@ -302,10 +321,10 @@ class ControllerApiAuthorMeta extends Controller } # add the new/edited metadata - $pageMeta[$params['tab']] = $params['data']; + $metadata[$params['tab']] = $validated['data']; # store the metadata - $store = $meta->updateMeta($pageMeta, $item); + $store = $meta->updateMeta($metadata, $item); if($store === true) { diff --git a/system/typemill/Controllers/ControllerApiSystemUsers.php b/system/typemill/Controllers/ControllerApiSystemUsers.php index e983feb..5ee4f5e 100644 --- a/system/typemill/Controllers/ControllerApiSystemUsers.php +++ b/system/typemill/Controllers/ControllerApiSystemUsers.php @@ -126,14 +126,21 @@ class ControllerApiSystemUsers extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(400); } - # if a non-admin-user tries to update another account - if(!$isAdmin AND ($username !== $request->getAttribute('username')) ) + # if it is a non-admin-user + if(!$isAdmin) { - $response->getBody()->write(json_encode([ - 'message' => Translations::translate('You are not allowed to update another user.') - ])); + # do not change userrole + unset($userdata['userrole']); + + # if a non-admin-user tries to update another account + if(($username !== $request->getAttribute('c_username'))) + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You are not allowed to update another user.') + ])); - return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + return $response->withHeader('Content-Type', 'application/json')->withStatus(403); + } } # cleanup password entry diff --git a/system/typemill/Controllers/ControllerWebAuthor.php b/system/typemill/Controllers/ControllerWebAuthor.php index 05b40e4..1fc1e32 100644 --- a/system/typemill/Controllers/ControllerWebAuthor.php +++ b/system/typemill/Controllers/ControllerWebAuthor.php @@ -71,6 +71,7 @@ class ControllerWebAuthor extends Controller return $this->c->get('view')->render($response, 'content/blox-editor.twig', [ 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'content' => $draftMarkdownHtml, 'jsdata' => [ @@ -139,6 +140,7 @@ class ControllerWebAuthor extends Controller return $this->c->get('view')->render($response, 'content/raw-editor.twig', [ 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'content' => $draftMarkdownHtml, 'jsdata' => [ diff --git a/system/typemill/Controllers/ControllerWebFrontend.php b/system/typemill/Controllers/ControllerWebFrontend.php index 9130eb0..bb7db11 100644 --- a/system/typemill/Controllers/ControllerWebFrontend.php +++ b/system/typemill/Controllers/ControllerWebFrontend.php @@ -48,6 +48,7 @@ class ControllerWebFrontend extends Controller { $item = $navigation->getHomepageItem($urlinfo['baseurl']); $item->active = true; + $home = true; } else { @@ -65,10 +66,8 @@ class ControllerWebFrontend extends Controller $keyPathArray = explode(".", $pageinfo['keyPath']); -# $item = $navigation->getItemWithKeyPath($draftNavigation, $keyPathArray); - # but what if parent is unpublished ?? if(!$item) { return $this->c->get('view')->render($response->withStatus(404), '404.twig', [ @@ -257,7 +256,7 @@ class ControllerWebFrontend extends Controller } $pagedata = [ - 'home' => false, + 'home' => $home, 'navigation' => $liveNavigation, 'title' => $title, 'content' => $contentHtml, diff --git a/system/typemill/Controllers/ControllerWebSystem.php b/system/typemill/Controllers/ControllerWebSystem.php index d7ce8bc..d9d42e0 100644 --- a/system/typemill/Controllers/ControllerWebSystem.php +++ b/system/typemill/Controllers/ControllerWebSystem.php @@ -41,6 +41,7 @@ class ControllerWebSystem extends Controller # 'captcha' => $this->checkIfAddCaptcha(), # 'basicauth' => $user->getBasicAuth(), 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'jsdata' => [ 'settings' => $this->settings, @@ -92,6 +93,7 @@ class ControllerWebSystem extends Controller return $this->c->get('view')->render($response, 'system/themes.twig', [ 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'jsdata' => [ 'systemnavi' => $systemNavigation, @@ -145,6 +147,7 @@ class ControllerWebSystem extends Controller return $this->c->get('view')->render($response, 'system/plugins.twig', [ 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'jsdata' => [ 'systemnavi' => $systemNavigation, @@ -188,6 +191,7 @@ class ControllerWebSystem extends Controller return $this->c->get('view')->render($response, 'system/license.twig', [ 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'jsdata' => [ 'systemnavi' => $systemNavigation, @@ -225,6 +229,7 @@ class ControllerWebSystem extends Controller return $this->c->get('view')->render($response, 'system/account.twig', [ 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'jsdata' => [ 'systemnavi' => $systemNavigation, @@ -269,6 +274,7 @@ class ControllerWebSystem extends Controller return $this->c->get('view')->render($response, 'system/users.twig', [ 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'jsdata' => [ 'systemnavi' => $systemNavigation, @@ -313,6 +319,7 @@ class ControllerWebSystem extends Controller return $this->c->get('view')->render($response, 'system/user.twig', [ 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'jsdata' => [ 'systemnavi' => $systemNavigation, @@ -345,6 +352,7 @@ class ControllerWebSystem extends Controller return $this->c->get('view')->render($response, 'system/usernew.twig', [ 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'jsdata' => [ 'systemnavi' => $systemNavigation, @@ -387,6 +395,7 @@ class ControllerWebSystem extends Controller return $this->c->get('view')->render($response, 'layouts/layoutSystemBlank.twig', [ 'settings' => $this->settings, + 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'jsdata' => [ 'systemnavi' => $systemNavigation, diff --git a/system/typemill/Extensions/TwigMetaExtension.php b/system/typemill/Extensions/TwigMetaExtension.php index 0af943b..b3716dd 100644 --- a/system/typemill/Extensions/TwigMetaExtension.php +++ b/system/typemill/Extensions/TwigMetaExtension.php @@ -22,7 +22,13 @@ class TwigMetaExtension extends AbstractExtension $metadata = $meta->getMetaData($item); - if(!$metadata OR $metadata['meta']['title'] == '' OR $metadata['meta']['description'] == '') + if( + !$metadata + OR !isset($metadata['meta']['title']) + OR $metadata['meta']['title'] == '' + OR !isset($metadata['meta']['description']) + OR $metadata['meta']['description'] == '' + ) { $metadata = $meta->addMetaDefaults($metadata, $item, $settings['author']); } diff --git a/system/typemill/Middleware/ApiAuthorization.php b/system/typemill/Middleware/ApiAuthorization.php index a3df700..f24209a 100644 --- a/system/typemill/Middleware/ApiAuthorization.php +++ b/system/typemill/Middleware/ApiAuthorization.php @@ -21,7 +21,7 @@ class ApiAuthorization implements MiddlewareInterface { if(!$this->acl->isAllowed($request->getAttribute('c_userrole'), $this->resource, $this->action)) { - $message = 'userrole: ' . $request->getAttribute('c_userrole') . ' resource: ' . $this->resource . ' action: ' . $this->action; + $message = 'Permission denied. Your are an ' . $request->getAttribute('c_userrole') . ' and you cannot ' . $this->action . ' this ' . $this->resource; $response = new Response(); $response->getBody()->write(json_encode([ diff --git a/system/typemill/Middleware/SessionMiddleware.php b/system/typemill/Middleware/SessionMiddleware.php index 32e45f1..1914e6a 100644 --- a/system/typemill/Middleware/SessionMiddleware.php +++ b/system/typemill/Middleware/SessionMiddleware.php @@ -44,6 +44,10 @@ class SessionMiddleware implements MiddlewareInterface $request = $request->withAttribute('c_username', $userdata['username']); $request = $request->withAttribute('c_userrole', $userdata['userrole']); + if(isset($userdata['darkmode'])) + { + $request = $request->withAttribute('c_darkmode', $userdata['darkmode']); + } } } diff --git a/system/typemill/Middleware/WebAuthorization.php b/system/typemill/Middleware/WebAuthorization.php index b30b7be..573e40c 100644 --- a/system/typemill/Middleware/WebAuthorization.php +++ b/system/typemill/Middleware/WebAuthorization.php @@ -26,7 +26,7 @@ class WebAuthorization implements MiddlewareInterface return $response->withHeader('Location', $this->router->urlFor('user.account'))->withStatus(302); } - + $response = $handler->handle($request); return $response; diff --git a/system/typemill/Middleware/WebRedirectIfUnauthenticated.php b/system/typemill/Middleware/WebRedirectIfUnauthenticated.php index 74c099b..ee2fdcd 100644 --- a/system/typemill/Middleware/WebRedirectIfUnauthenticated.php +++ b/system/typemill/Middleware/WebRedirectIfUnauthenticated.php @@ -34,6 +34,10 @@ class WebRedirectIfUnauthenticated implements MiddlewareInterface $request = $request->withAttribute('c_username', $userdata['username']); $request = $request->withAttribute('c_userrole', $userdata['userrole']); + if(isset($userdata['darkmode'])) + { + $request = $request->withAttribute('c_darkmode', $userdata['darkmode']); + } # this executes code from routes first and then executes middleware $response = $handler->handle($request); diff --git a/system/typemill/Models/Validation.php b/system/typemill/Models/Validation.php index b8b67c5..27953c0 100644 --- a/system/typemill/Models/Validation.php +++ b/system/typemill/Models/Validation.php @@ -44,6 +44,7 @@ class Validation # checks if email is available if user is created Validator::addRule('emailAvailable', function($field, $value, array $params, array $fields) use ($user) { + if(!$value){ return false; } $email = trim($value); if($email == '' OR $user->findUsersByEmail($email)){ return false; } return true; @@ -255,10 +256,8 @@ class Validation { return true; } - else - { - return false; - } + + return false; } /** @@ -322,10 +321,12 @@ class Validation $v->rule('required', ['username'])->message("required"); $v->rule('alphaNum', 'username')->message("invalid"); $v->rule('lengthBetween', 'username', 3, 20)->message("Length between 3 - 20"); + if($v->validate()) { return true; } + return false; } @@ -336,10 +337,12 @@ class Validation $v->rule('required', ['email'])->message("required"); $v->rule('noHTML', 'email')->message(" contains HTML"); $v->rule('lengthBetween', 'email', 3, 50)->message("Length between 3 - 50"); + if($v->validate()) { return true; } + return false; } @@ -431,14 +434,12 @@ class Validation $v->rule('lengthBetween', 'item_name', 1, 60); $v->rule('in', 'type', ['file', 'folder']); - if($v->validate()) + if($v->validate()) { return true; - } - else - { - return $v->errors(); } + + return $v->errors(); } public function blockInput(array $params) @@ -452,11 +453,9 @@ class Validation if($v->validate()) { return true; - } - else - { - return $v->errors(); } + + return $v->errors(); } public function blockMove(array $params) @@ -471,10 +470,8 @@ class Validation { return true; } - else - { - return $v->errors(); - } + + return $v->errors(); } public function blockDelete(array $params) @@ -488,10 +485,8 @@ class Validation { return true; } - else - { - return $v->errors(); - } + + return $v->errors(); } public function articlePublish(array $params) @@ -515,10 +510,8 @@ class Validation { return true; } - else - { - return $v->errors(); - } + + return $v->errors(); } public function articleUpdate(array $params) @@ -544,10 +537,8 @@ class Validation { return true; } - else - { - return $v->errors(); - } + + return $v->errors(); } public function articleRename(array $params) @@ -562,11 +553,9 @@ class Validation if($v->validate()) { return true; - } - else - { - return $v->errors(); } + + return $v->errors(); } public function metaInput(array $params) @@ -578,11 +567,9 @@ class Validation if($v->validate()) { return true; - } - else - { - return $v->errors(); } + + return $v->errors(); } /** @@ -599,7 +586,27 @@ class Validation $v->rule('lengthBetween', 'password', 5, 50); $v->rule('equals', 'passwordrepeat', 'password'); - return $this->validationResult($v); + if($v->validate()) + { + return true; + } + + return $v->errors(); + } + + public function newPassword(array $params) + { + $v = new Validator($params); + $v->rule('required', ['password', 'newpassword']); + $v->rule('lengthBetween', 'newpassword', 5, 50); + $v->rule('equals', 'passwordrepeat', 'password'); + + if($v->validate()) + { + return true; + } + + return $v->errors(); } @@ -619,14 +626,12 @@ class Validation $v->rule('noHTML', 'title'); $v->rule('markdownSecure', 'content'); - if($v->validate()) + if($v->validate()) { return true; - } - else - { - return $v->errors(); - } + } + + return $v->errors(); } /** @@ -687,7 +692,8 @@ class Validation } break; case "codearea": - $v->rule('lengthMax', $fieldName, 10000); + $v->rule('lengthMax', $fieldName, 50000); +# how prevent bad code here? break; case "color": $v->rule('regex', $fieldName, '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/'); @@ -830,65 +836,4 @@ class Validation return $output; } - - - /** - * result for validation - * - * @param obj $v the validation object. - * @return bool - */ - - public function checkArray($arrayvalues, $v) - { - die('I think checkArray not in use anymore'); - - foreach($arrayvalues as $key => $value) - { - if(is_array($value)) - { - $this->checkArray($value, $v); - } - $v->rule('noHTML', $value); - $v->rule('lengthMax', $value, 1000); - } - return $v; - } - - public function validationResult($v, $name = false) - { - die("do not use validationResults in validation model anymore"); - - if($v->validate()) - { - return true; - } - else - { - if($name == 'meta') - { - return $v->errors(); - } - elseif($name) - { - if(isset($_SESSION['errors'][$name])) - { - foreach ($v->errors() as $key => $val) - { - $_SESSION['errors'][$name][$key] = $val; - break; - } - } - else - { - $_SESSION['errors'][$name] = $v->errors(); - } - } - else - { - $_SESSION['errors'] = $v->errors(); - } - return false; - } - } } \ No newline at end of file diff --git a/system/typemill/author/content/blox-editor.twig b/system/typemill/author/content/blox-editor.twig index 2316981..a2c7b25 100644 --- a/system/typemill/author/content/blox-editor.twig +++ b/system/typemill/author/content/blox-editor.twig @@ -10,7 +10,7 @@ meta -
+
{% for block in content %}
{{ block.html|raw }}
{% endfor %} diff --git a/system/typemill/author/css/custom.css b/system/typemill/author/css/custom.css index 5e96bd6..109384b 100644 --- a/system/typemill/author/css/custom.css +++ b/system/typemill/author/css/custom.css @@ -177,6 +177,9 @@ .sideaction:hover ~ .blox-preview{ background: rgb(245 245 244); } +.dark .sideaction:hover ~ .blox-preview{ + background: rgb(28 25 23); +} @@ -225,6 +228,14 @@ .blox-preview tr:nth-child(even){ background-color:rgb(245 245 244); } .blox-preview td{ padding: 5px;} +.dark .blox-preview thead{ + background: rgb(28 25 23); +} +.dark .blox-preview tr:nth-child(even){ background-color:transparent; } +.dark table, .dark th, .dark td { + border: 1px solid rgb(87 83 78); +} + .blox-preview dl{ border-top: 1px solid rgb(20 184 166); border-bottom: 1px solid rgb(20 184 166); @@ -249,12 +260,16 @@ .blox-preview dd{ padding-left: 40px; } - .blox-preview pre,.blox-preview code{ white-space: pre; color: #333; background: rgb(245 245 244); } +.dark .blox-preview pre,.dark .blox-preview code{ + white-space: pre; + color: #fff; + background: rgb(87 83 78); +} .blox-preview code{ display: inline-block; padding: 0 0.5em; @@ -286,6 +301,11 @@ padding-top:12px; padding-bottom:12px; } +.dark .blox-preview blockquote{ + color: #fff; + background: rgb(87 83 78); +} + .blox-preview blockquote:before { position: absolute; left: 0px; @@ -323,6 +343,13 @@ background: rgb(245 245 244); padding: 10px; } +.dark .blox-preview .notice1, +.dark .blox-preview .notice2, +.dark .blox-preview .notice3, +.dark .blox-preview .notice4{ + color: #fff; + background: rgb(87 83 78); +} .blox-preview .notice1:before, .blox-preview .notice2:before, .blox-preview .notice3:before, @@ -353,11 +380,13 @@ position: relative; text-align: center; } -.blox-preview img.youtube{ +.blox-preview figure.youtube{ position: relative; } -.blox-preview button.play-video { + +.blox-preview .youtube::before { position: absolute; + left:50%; top: 50%; margin-top: -50px; margin-left: -50px; @@ -369,22 +398,22 @@ border: 0px; padding: 0; text-align: center; + content: ''; } -.blox-preview button.play-video:hover { - background: #cc4146; -} -.blox-preview button.play-video::after { +.blox-preview .youtube::after { position: absolute; top: 50%; + left:50%; margin: -20px 0 0 -15px; height: 0; width: 0; border-style: solid; border-width: 20px 0 20px 40px; border-color: transparent transparent transparent rgba(255, 255, 255, 0.75); - content: ' '; + content: ''; } + .blox-preview ul.TOC, .blox-preview .TOC ul{ list-style: none; @@ -402,6 +431,7 @@ } .blox-preview ul.TOC{ background: rgb(245 245 244); + background: transparent; width: 100%; padding: 20px; box-sizing:border-box; @@ -528,4 +558,18 @@ .blox-editor input.urlinput:focus{ outline: 0px; border: 0px; +} + +/**************** +** NAVIGATION ** +****************/ + +.pl-15{ + padding-left: 3.6rem; +} +.pl-18{ + padding-left: 4rem; +} +.pl-21{ + padding-left: 5rem; } \ No newline at end of file diff --git a/system/typemill/author/css/output.css b/system/typemill/author/css/output.css index cd39e49..9bf7403 100644 --- a/system/typemill/author/css/output.css +++ b/system/typemill/author/css/output.css @@ -838,6 +838,10 @@ video { margin-bottom: 2rem; } +.mt-1 { + margin-top: 0.25rem; +} + .mt-5 { margin-top: 1.25rem; } @@ -1266,10 +1270,6 @@ video { border-left-width: 4px; } -.border-l-2 { - border-left-width: 2px; -} - .border-b-8 { border-bottom-width: 8px; } @@ -1282,6 +1282,10 @@ video { border-bottom-width: 4px; } +.border-l-2 { + border-left-width: 2px; +} + .border-solid { border-style: solid; } @@ -1330,11 +1334,6 @@ video { border-color: rgb(250 204 21 / var(--tw-border-opacity)); } -.border-stone-100 { - --tw-border-opacity: 1; - border-color: rgb(245 245 244 / var(--tw-border-opacity)); -} - .border-rose-500 { --tw-border-opacity: 1; border-color: rgb(244 63 94 / var(--tw-border-opacity)); @@ -1365,6 +1364,11 @@ video { border-color: rgb(255 228 230 / var(--tw-border-opacity)); } +.border-stone-100 { + --tw-border-opacity: 1; + border-color: rgb(245 245 244 / var(--tw-border-opacity)); +} + .border-x-transparent { border-left-color: transparent; border-right-color: transparent; @@ -1424,16 +1428,16 @@ video { background-color: rgb(254 226 226 / var(--tw-bg-opacity)); } -.bg-stone-900 { - --tw-bg-opacity: 1; - background-color: rgb(28 25 23 / var(--tw-bg-opacity)); -} - .bg-stone-600 { --tw-bg-opacity: 1; background-color: rgb(87 83 78 / var(--tw-bg-opacity)); } +.bg-stone-900 { + --tw-bg-opacity: 1; + background-color: rgb(28 25 23 / var(--tw-bg-opacity)); +} + .bg-rose-500 { --tw-bg-opacity: 1; background-color: rgb(244 63 94 / var(--tw-bg-opacity)); @@ -1654,6 +1658,10 @@ video { padding-top: 0.75rem; } +.pl-24 { + padding-left: 6rem; +} + .text-left { text-align: left; } @@ -1766,9 +1774,9 @@ video { color: rgb(168 162 158 / var(--tw-text-opacity)); } -.text-stone-700 { +.text-stone-900 { --tw-text-opacity: 1; - color: rgb(68 64 60 / var(--tw-text-opacity)); + color: rgb(28 25 23 / var(--tw-text-opacity)); } .text-stone-500 { @@ -1776,16 +1784,16 @@ video { color: rgb(120 113 108 / var(--tw-text-opacity)); } -.text-stone-900 { - --tw-text-opacity: 1; - color: rgb(28 25 23 / var(--tw-text-opacity)); -} - .text-stone-300 { --tw-text-opacity: 1; color: rgb(214 211 209 / var(--tw-text-opacity)); } +.text-stone-700 { + --tw-text-opacity: 1; + color: rgb(68 64 60 / var(--tw-text-opacity)); +} + .text-red-500 { --tw-text-opacity: 1; color: rgb(239 68 68 / var(--tw-text-opacity)); @@ -1926,11 +1934,6 @@ video { border-color: rgb(68 64 60 / var(--tw-border-opacity)); } -.hover\:border-stone-200:hover { - --tw-border-opacity: 1; - border-color: rgb(231 229 228 / var(--tw-border-opacity)); -} - .hover\:border-teal-500:hover { --tw-border-opacity: 1; border-color: rgb(20 184 166 / var(--tw-border-opacity)); @@ -2040,11 +2043,6 @@ video { border-color: rgb(37 99 235 / var(--tw-border-opacity)); } -.focus\:border-stone-200:focus { - --tw-border-opacity: 1; - border-color: rgb(231 229 228 / var(--tw-border-opacity)); -} - .focus\:bg-white:focus { --tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity)); @@ -2090,11 +2088,6 @@ video { background-color: rgb(231 229 228 / var(--tw-bg-opacity)); } -.disabled\:bg-stone-50:disabled { - --tw-bg-opacity: 1; - background-color: rgb(250 250 249 / var(--tw-bg-opacity)); -} - .disabled\:text-stone-800:disabled { --tw-text-opacity: 1; color: rgb(41 37 36 / var(--tw-text-opacity)); @@ -2109,14 +2102,12 @@ video { visibility: visible; } -.dark .dark\:border-stone-900 { - --tw-border-opacity: 1; - border-color: rgb(28 25 23 / var(--tw-border-opacity)); +.dark .dark\:border { + border-width: 1px; } -.dark .dark\:border-stone-200 { - --tw-border-opacity: 1; - border-color: rgb(231 229 228 / var(--tw-border-opacity)); +.dark .dark\:border-0 { + border-width: 0px; } .dark .dark\:border-stone-600 { @@ -2129,9 +2120,14 @@ video { border-color: rgb(68 64 60 / var(--tw-border-opacity)); } -.dark .dark\:bg-stone-600 { - --tw-bg-opacity: 1; - background-color: rgb(87 83 78 / var(--tw-bg-opacity)); +.dark .dark\:border-stone-900 { + --tw-border-opacity: 1; + border-color: rgb(28 25 23 / var(--tw-border-opacity)); +} + +.dark .dark\:border-stone-200 { + --tw-border-opacity: 1; + border-color: rgb(231 229 228 / var(--tw-border-opacity)); } .dark .dark\:bg-stone-700 { @@ -2139,9 +2135,9 @@ video { background-color: rgb(68 64 60 / var(--tw-bg-opacity)); } -.dark .dark\:bg-stone-200 { +.dark .dark\:bg-stone-600 { --tw-bg-opacity: 1; - background-color: rgb(231 229 228 / var(--tw-bg-opacity)); + background-color: rgb(87 83 78 / var(--tw-bg-opacity)); } .dark .dark\:bg-stone-900 { @@ -2149,9 +2145,9 @@ video { background-color: rgb(28 25 23 / var(--tw-bg-opacity)); } -.dark .dark\:text-gray-400 { - --tw-text-opacity: 1; - color: rgb(156 163 175 / var(--tw-text-opacity)); +.dark .dark\:bg-stone-200 { + --tw-bg-opacity: 1; + background-color: rgb(231 229 228 / var(--tw-bg-opacity)); } .dark .dark\:text-stone-200 { @@ -2159,31 +2155,71 @@ video { color: rgb(231 229 228 / var(--tw-text-opacity)); } -.dark .dark\:text-stone-50 { - --tw-text-opacity: 1; - color: rgb(250 250 249 / var(--tw-text-opacity)); -} - .dark .dark\:text-stone-900 { --tw-text-opacity: 1; color: rgb(28 25 23 / var(--tw-text-opacity)); } +.dark .dark\:text-stone-600 { + --tw-text-opacity: 1; + color: rgb(87 83 78 / var(--tw-text-opacity)); +} + +.dark .dark\:text-gray-400 { + --tw-text-opacity: 1; + color: rgb(156 163 175 / var(--tw-text-opacity)); +} + +.dark .dark\:text-stone-300 { + --tw-text-opacity: 1; + color: rgb(214 211 209 / var(--tw-text-opacity)); +} + +.dark .dark\:text-stone-50 { + --tw-text-opacity: 1; + color: rgb(250 250 249 / var(--tw-text-opacity)); +} + .dark .hover\:dark\:border-stone-200:hover { --tw-border-opacity: 1; border-color: rgb(231 229 228 / var(--tw-border-opacity)); } +.dark .hover\:dark\:border-rose-500:hover { + --tw-border-opacity: 1; + border-color: rgb(244 63 94 / var(--tw-border-opacity)); +} + .dark .hover\:dark\:border-stone-600:hover { --tw-border-opacity: 1; border-color: rgb(87 83 78 / var(--tw-border-opacity)); } +.dark .hover\:dark\:bg-teal-500:hover { + --tw-bg-opacity: 1; + background-color: rgb(20 184 166 / var(--tw-bg-opacity)); +} + +.dark .hover\:dark\:bg-rose-500:hover { + --tw-bg-opacity: 1; + background-color: rgb(244 63 94 / var(--tw-bg-opacity)); +} + +.dark .hover\:dark\:bg-stone-600:hover { + --tw-bg-opacity: 1; + background-color: rgb(87 83 78 / var(--tw-bg-opacity)); +} + .dark .hover\:dark\:bg-stone-900:hover { --tw-bg-opacity: 1; background-color: rgb(28 25 23 / var(--tw-bg-opacity)); } +.dark .dark\:hover\:bg-stone-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(231 229 228 / var(--tw-bg-opacity)); +} + .dark .hover\:dark\:bg-stone-200:hover { --tw-bg-opacity: 1; background-color: rgb(231 229 228 / var(--tw-bg-opacity)); @@ -2194,11 +2230,6 @@ video { background-color: rgb(20 184 166 / var(--tw-bg-opacity)); } -.dark .dark\:hover\:bg-stone-200:hover { - --tw-bg-opacity: 1; - background-color: rgb(231 229 228 / var(--tw-bg-opacity)); -} - .dark .hover\:dark\:text-stone-900:hover { --tw-text-opacity: 1; color: rgb(28 25 23 / var(--tw-text-opacity)); @@ -2224,6 +2255,16 @@ video { color: rgb(28 25 23 / var(--tw-text-opacity)); } +.dark .disabled\:dark\:bg-stone-600:disabled { + --tw-bg-opacity: 1; + background-color: rgb(87 83 78 / var(--tw-bg-opacity)); +} + +.dark .disabled\:dark\:text-stone-200:disabled { + --tw-text-opacity: 1; + color: rgb(231 229 228 / var(--tw-text-opacity)); +} + @media (min-width: 768px) { .md\:max-w-md { max-width: 28rem; diff --git a/system/typemill/author/js/typemillutils.js b/system/typemill/author/js/typemillutils.js index 631294a..6c7db6a 100644 --- a/system/typemill/author/js/typemillutils.js +++ b/system/typemill/author/js/typemillutils.js @@ -14,7 +14,9 @@ let typemillUtilities = { var youtubeItem = this.youtubeItems[i]; this.addYoutubePlayButton(youtubeItem); } - } + } + + console.info(this.youtubeItems); }, addYoutubePlayButton: function(element) diff --git a/system/typemill/author/js/vue-blox-components.js b/system/typemill/author/js/vue-blox-components.js index 1365d2c..830b225 100644 --- a/system/typemill/author/js/vue-blox-components.js +++ b/system/typemill/author/js/vue-blox-components.js @@ -71,7 +71,7 @@ bloxeditor.component('headline-component', {
- @@ -334,9 +334,9 @@ bloxeditor.component('code-component', {
-
+
- +
`, @@ -562,7 +562,7 @@ bloxeditor.component('notice-component', { - @@ -884,7 +884,7 @@ bloxeditor.component('definition-component', { definitionList: [], } }, - template: `
+ template: `
@@ -895,15 +895,15 @@ bloxeditor.component('definition-component', { item-key="id" @end="moveDefinition">
+
- +
- +
-
- +
+
@@ -1326,23 +1326,23 @@ bloxeditor.component('image-component', {
- +
- +
- +
- +
- @@ -1350,8 +1350,8 @@ bloxeditor.component('image-component', {
- - + +
`, data: function(){ @@ -2268,14 +2268,14 @@ bloxeditor.component('shortcode-component', {
-
+
- +
- + diff --git a/system/typemill/author/js/vue-blox.js b/system/typemill/author/js/vue-blox.js index 863873f..80bfdb1 100644 --- a/system/typemill/author/js/vue-blox.js +++ b/system/typemill/author/js/vue-blox.js @@ -1,5 +1,5 @@ const bloxeditor = Vue.createApp({ - template: `
+ template: `
-
+
-
+
- - + +
@@ -232,8 +232,8 @@ bloxeditor.component('content-block', { props: ['element', 'index'], template: `
-
-
+
+

Choose a content type

@@ -241,11 +241,11 @@ bloxeditor.component('content-block', {
-
-
+
+
@@ -254,8 +254,8 @@ bloxeditor.component('content-block', {
- - + +
diff --git a/system/typemill/author/js/vue-contentnavi.js b/system/typemill/author/js/vue-contentnavi.js index a6b9fa5..968b68e 100644 --- a/system/typemill/author/js/vue-contentnavi.js +++ b/system/typemill/author/js/vue-contentnavi.js @@ -7,11 +7,11 @@ const navigation = Vue.createApp({
-
+
`, data: function () { @@ -183,10 +183,10 @@ navigation.component('navilevel',{