diff --git a/content/00-welcome/05-todos.md b/content/00-welcome/05-todos.md index a72a3db..318210d 100644 --- a/content/00-welcome/05-todos.md +++ b/content/00-welcome/05-todos.md @@ -34,10 +34,11 @@ Biig blocks: * DONE: Media Library * DONE: Posts * DONE: Setup -* Recover Password +* DONE: Recover Password Small features: +* DONE: Merge processAssets modell * Sitemap and ping * Captcha * Clear Cache @@ -49,6 +50,8 @@ Small features: * Image generation on the fly * Assets * Bug: Table of content duplicated for published pages +* Bug: Navigation frontend if unpublished pages +* Image and files for meta Cleanups: diff --git a/content/00-welcome/05-todos.txt b/content/00-welcome/05-todos.txt deleted file mode 100644 index c30cc9d..0000000 --- a/content/00-welcome/05-todos.txt +++ /dev/null @@ -1 +0,0 @@ -["# ToDos Version 2","[TOC]","## Visual Editor","* FIXED: File is not published from tmp to media\/files if you save the block.","## Raw Editor","* DONE ready","## Medialib","* DONE","## Posts","* Setup","## Plugins","* Asset Class","## Frontend","* DONE\n* DONE: Test restrictions","## ToDos","Biig blocks:","* DONE: Media Library\n* DONE: Posts\n* DONE: Setup\n* DONE: Recover Password","Small features:","* Sitemap and ping\n* Captcha\n* Clear Cache\n* Security Log\n* Backend fields\n* Proxy\n* DONE: Session handling: csrf fail and session start error if restrictions are active\n* Editor: Warn if open another block\n* Image generation on the fly\n* Assets\n* Bug: Table of content duplicated for published pages\n* Bug: Navigation frontend if unpublished pages","Cleanups:","* Events\n* Error messages\n* Translations","## Select userroles","* Userroles for file restriction: in vue-blox-components loaded via api\n* Userroles for userfields: in php model user getUserFields()\n* Userroles for meta: in php controller apiAuthorMeta getMeta()\n* Plugins and themes: in php model extension getThemeDefinitions()","## License Check","* On activation in apiControllerExtension. It checks the license in yaml.\n* In plugin php code with setPremiumLicense\n* In static plugins, it checks manual premium list and method setPremiumLicense and more "] \ No newline at end of file diff --git a/data/navigation/navi-draft.txt b/data/navigation/navi-draft.txt index 75c26a8..834136d 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:19:"00-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:"00";s:4:"name";s:13:"markdown test";s:4:"slug";s:13:"markdown-test";s:4:"path";s:31:"/00-welcome/00-markdown-test.md";s:15:"pathWithoutType";s:28:"/00-welcome/00-markdown-test";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: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: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:14:"02-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:"02";s:4:"name";s:8:"get help";s:4:"slug";s:8:"get-help";s:4:"path";s:26:"/00-welcome/02-get-help.md";s:15:"pathWithoutType";s:23:"/00-welcome/02-get-help";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: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:3;O:8:"stdClass":20:{s:12:"originalName";s:24:"03-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:"03";s:4:"name";s:18:"setup your website";s:4:"slug";s:18:"setup-your-website";s:4:"path";s:36:"/00-welcome/03-setup-your-website.md";s:15:"pathWithoutType";s:33:"/00-welcome/03-setup-your-website";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: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:4;O:8:"stdClass":20:{s:12:"originalName";s:19:"04-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:"04";s:4:"name";s:13:"write content";s:4:"slug";s:13:"write-content";s:4:"path";s:31:"/00-welcome/04-write-content.md";s:15:"pathWithoutType";s:28:"/00-welcome/04-write-content";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/write-content";s:6:"urlRel";s:31:"/typemill/welcome/write-content";s:6:"urlAbs";s:47:"http://localhost/typemill/welcome/write-content";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:5;O:8:"stdClass":20:{s:12:"originalName";s:14:"05-todos.txtmd";s:11:"elementType";s:4:"file";s:6:"status";s:8:"modified";s:8:"fileType";s:3:"txt";s:5:"order";s:2:"05";s:4:"name";s:6:"To Dos";s:4:"slug";s:5:"todos";s:4:"path";s:26:"/00-welcome/05-todos.txtmd";s:15:"pathWithoutType";s:20:"/00-welcome/05-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:5:{i:0;O:8:"stdClass":20:{s:12:"originalName";s:9:"00-new.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:3:"new";s:4:"slug";s:3:"new";s:4:"path";s:27:"/01-cyanine-theme/00-new.md";s:15:"pathWithoutType";s:24:"/01-cyanine-theme/00-new";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:18:"/cyanine-theme/new";s:6:"urlRel";s:27:"/typemill/cyanine-theme/new";s:6:"urlAbs";s:43:"http://localhost/typemill/cyanine-theme/new";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:17:"01-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:"01";s:4:"name";s:11:"landingpage";s:4:"slug";s:11:"landingpage";s:4:"path";s:35:"/01-cyanine-theme/01-landingpage.md";s:15:"pathWithoutType";s:32:"/01-cyanine-theme/01-landingpage";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: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:2;O:8:"stdClass":20:{s:12:"originalName";s:22:"02-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:"02";s:4:"name";s:16:"content elements";s:4:"slug";s:16:"content-elements";s:4:"path";s:40:"/01-cyanine-theme/02-content-elements.md";s:15:"pathWithoutType";s:37:"/01-cyanine-theme/02-content-elements";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: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;}i:3;O:8:"stdClass":20:{s:12:"originalName";s:22:"03-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:"03";s:4:"name";s:16:"colors and fonts";s:4:"slug";s:16:"colors-and-fonts";s:4:"path";s:40:"/01-cyanine-theme/03-colors-and-fonts.md";s:15:"pathWithoutType";s:37:"/01-cyanine-theme/03-colors-and-fonts";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/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:4;O:8:"stdClass":20:{s:12:"originalName";s:12:"04-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:"04";s:4:"name";s:6:"footer";s:4:"slug";s:6:"footer";s:4:"path";s:30:"/01-cyanine-theme/04-footer.md";s:15:"pathWithoutType";s:27:"/01-cyanine-theme/04-footer";s:3:"key";i:4;s:7:"keyPath";s:3:"1.4";s:12:"keyPathArray";a:2:{i:0;s:1:"1";i:1;s:1:"4";}s:7:"chapter";s:3:"2.5";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;}}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:19:"00-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:"00";s:4:"name";s:13:"markdown test";s:4:"slug";s:13:"markdown-test";s:4:"path";s:31:"/00-welcome/00-markdown-test.md";s:15:"pathWithoutType";s:28:"/00-welcome/00-markdown-test";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: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: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:14:"02-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:"02";s:4:"name";s:8:"get help";s:4:"slug";s:8:"get-help";s:4:"path";s:26:"/00-welcome/02-get-help.md";s:15:"pathWithoutType";s:23:"/00-welcome/02-get-help";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: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:3;O:8:"stdClass":20:{s:12:"originalName";s:24:"03-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:"03";s:4:"name";s:18:"setup your website";s:4:"slug";s:18:"setup-your-website";s:4:"path";s:36:"/00-welcome/03-setup-your-website.md";s:15:"pathWithoutType";s:33:"/00-welcome/03-setup-your-website";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: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:4;O:8:"stdClass":20:{s:12:"originalName";s:19:"04-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:"04";s:4:"name";s:13:"write content";s:4:"slug";s:13:"write-content";s:4:"path";s:31:"/00-welcome/04-write-content.md";s:15:"pathWithoutType";s:28:"/00-welcome/04-write-content";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/write-content";s:6:"urlRel";s:31:"/typemill/welcome/write-content";s:6:"urlAbs";s:47:"http://localhost/typemill/welcome/write-content";s:6:"active";b:0;s:12:"activeParent";b:0;s:4:"hide";b:0;s:7:"noindex";b:0;}i:5;O:8:"stdClass":20:{s:12:"originalName";s:11:"05-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:"05";s:4:"name";s:6:"To Dos";s:4:"slug";s:5:"todos";s:4:"path";s:23:"/00-welcome/05-todos.md";s:15:"pathWithoutType";s:20:"/00-welcome/05-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:5:{i:0;O:8:"stdClass":20:{s:12:"originalName";s:9:"00-new.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:3:"new";s:4:"slug";s:3:"new";s:4:"path";s:27:"/01-cyanine-theme/00-new.md";s:15:"pathWithoutType";s:24:"/01-cyanine-theme/00-new";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:18:"/cyanine-theme/new";s:6:"urlRel";s:27:"/typemill/cyanine-theme/new";s:6:"urlAbs";s:43:"http://localhost/typemill/cyanine-theme/new";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:17:"01-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:"01";s:4:"name";s:11:"landingpage";s:4:"slug";s:11:"landingpage";s:4:"path";s:35:"/01-cyanine-theme/01-landingpage.md";s:15:"pathWithoutType";s:32:"/01-cyanine-theme/01-landingpage";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: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:2;O:8:"stdClass":20:{s:12:"originalName";s:22:"02-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:"02";s:4:"name";s:16:"content elements";s:4:"slug";s:16:"content-elements";s:4:"path";s:40:"/01-cyanine-theme/02-content-elements.md";s:15:"pathWithoutType";s:37:"/01-cyanine-theme/02-content-elements";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: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;}i:3;O:8:"stdClass":20:{s:12:"originalName";s:22:"03-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:"03";s:4:"name";s:16:"colors and fonts";s:4:"slug";s:16:"colors-and-fonts";s:4:"path";s:40:"/01-cyanine-theme/03-colors-and-fonts.md";s:15:"pathWithoutType";s:37:"/01-cyanine-theme/03-colors-and-fonts";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/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:4;O:8:"stdClass":20:{s:12:"originalName";s:12:"04-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:"04";s:4:"name";s:6:"footer";s:4:"slug";s:6:"footer";s:4:"path";s:30:"/01-cyanine-theme/04-footer.md";s:15:"pathWithoutType";s:27:"/01-cyanine-theme/04-footer";s:3:"key";i:4;s:7:"keyPath";s:3:"1.4";s:12:"keyPathArray";a:2:{i:0;s:1:"1";i:1;s:1:"4";}s:7:"chapter";s:3:"2.5";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;}}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 85722fa..359ca64 100644 --- a/data/navigation/navi-extended.txt +++ b/data/navigation/navi-extended.txt @@ -38,7 +38,7 @@ navtitle: 'To Dos' hide: false noindex: false - path: /00-welcome/05-todos.txtmd + path: /00-welcome/05-todos.md keyPath: '0.5' /cyanine-theme: navtitle: 'cyanine theme' diff --git a/media/files/screenshot-2023-06-09-at-16-53-35-typemill.png b/media/files/screenshot-2023-06-09-at-16-53-35-typemill.png new file mode 100644 index 0000000..c8a20da Binary files /dev/null and b/media/files/screenshot-2023-06-09-at-16-53-35-typemill.png differ diff --git a/media/live/screenshot-typemill-startpage.png b/media/live/screenshot-typemill-startpage.png new file mode 100644 index 0000000..c23c1ae Binary files /dev/null and b/media/live/screenshot-typemill-startpage.png differ diff --git a/media/tmp/screenshot-typemill-startpage.png b/media/original/screenshot-typemill-startpage.png similarity index 100% rename from media/tmp/screenshot-typemill-startpage.png rename to media/original/screenshot-typemill-startpage.png diff --git a/media/thumbs/screenshot-typemill-startpage.png b/media/thumbs/screenshot-typemill-startpage.png new file mode 100644 index 0000000..4e2d288 Binary files /dev/null and b/media/thumbs/screenshot-typemill-startpage.png differ diff --git a/system/typemill/Controllers/ControllerApiFile.php b/system/typemill/Controllers/ControllerApiFile.php index 7aa7294..63f43ea 100644 --- a/system/typemill/Controllers/ControllerApiFile.php +++ b/system/typemill/Controllers/ControllerApiFile.php @@ -4,7 +4,7 @@ namespace Typemill\Controllers; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ResponseInterface as Response; -use Typemill\Models\ProcessFile; +use Typemill\Models\ProcessAssets; use Typemill\Models\StorageWrapper; class ControllerApiFile extends Controller @@ -204,7 +204,7 @@ class ControllerApiFile extends Controller } } - $fileProcessor = new ProcessFile(); + $fileProcessor = new ProcessAssets(); $fileinfo = $fileProcessor->storeFile($params['file'], $params['name']); $filePath = str_replace('media/files', 'media/tmp', $fileinfo['url']); diff --git a/system/typemill/Controllers/ControllerApiImage.php b/system/typemill/Controllers/ControllerApiImage.php index 315d2ca..695a79d 100644 --- a/system/typemill/Controllers/ControllerApiImage.php +++ b/system/typemill/Controllers/ControllerApiImage.php @@ -4,15 +4,11 @@ namespace Typemill\Controllers; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ResponseInterface as Response; -use Typemill\Models\ProcessImage; +use Typemill\Models\ProcessAssets; use Typemill\Models\StorageWrapper; use Typemill\Extensions\ParsedownExtension; -# use Typemill\Models\ProcessFile; -# use Typemill\Models\Yaml; -# use Typemill\Controllers\ControllerAuthorBlockApi; - class ControllerApiImage extends Controller { @@ -139,7 +135,7 @@ class ControllerApiImage extends Controller return $response->withHeader('Content-Type', 'application/json')->withStatus(400); } - $img = new ProcessImage(); + $img = new ProcessAssets(); if($this->settingActive('allowsvg')) { @@ -321,7 +317,7 @@ class ControllerApiImage extends Controller $imageData64 = 'data:image/jpeg;base64,' . base64_encode($imageData); - $img = new ProcessImage(); + $img = new ProcessAssets(); # prepare the image if(!$img->prepareImage($imageData64, $class . '-' . $videoID . '.jpg')) diff --git a/system/typemill/Models/ProcessAssets.php b/system/typemill/Models/ProcessAssets.php index e7c647a..093ffed 100644 --- a/system/typemill/Models/ProcessAssets.php +++ b/system/typemill/Models/ProcessAssets.php @@ -5,22 +5,29 @@ namespace Typemill\Models; use Typemill\Models\Folder; use Typemill\Static\Slug; - class ProcessAssets { - public $errors = []; + public $errors = []; - public $basepath = false; + protected $basepath = false; - public $tmpFolder = false; + protected $tmpFolder = false; - public $extension = false; + protected $extension = false; - public $filename = false; + protected $filename = false; - public $filetype = false; + protected $filetype = false; - public $filedata = false; + protected $filedata = false; + + protected $allowedExtensions = ['png' => true, 'jpg' => true, 'jpeg' => true, 'webp' => true]; + + protected $animated = false; + + protected $resizable = true; + + protected $sizes = []; public function __construct() { @@ -170,129 +177,272 @@ class ProcessAssets return $bytes; } - - -/* - public function checkFolders($forassets = null) - { - - $folders = [$this->mediaFolder, $this->tmpFolder, $this->fileFolder]; - - if($forassets == 'images') - { - $folders = [$this->mediaFolder, $this->tmpFolder, $this->originalFolder, $this->liveFolder, $this->thumbFolder, $this->customFolder]; - } - - foreach($folders as $folder) - { - if(!file_exists($folder) && !is_dir( $folder )) - { - if(!mkdir($folder, 0755, true)) - { - return false; - } - if($folder == $this->thumbFolder) - { - # cleanup old systems - $this->cleanupLiveFolder(); - - # generate thumbnails from live folder - $this->generateThumbs(); - } - } - elseif(!is_writeable($folder) OR !is_readable($folder)) - { - return false; - } - - # check if thumb-folder is empty, then generate thumbs from live folder - if($folder == $this->thumbFolder && $this->is_dir_empty($folder)) - { - # cleanup old systems - $this->cleanupLiveFolder(); - - # generate thumbnails from live folder - $this->generateThumbs(); - } - } - return true; - } -*/ - public function is_dir_empty($dir) { return (count(scandir($dir)) == 2); } -/* - public function setFileName($originalname, $type, $overwrite = NULL) + + ############################# + # FILE HANDLING # + ############################# + + public function storeFile($file, $name) { - $pathinfo = pathinfo($originalname); - $this->extension = isset($pathinfo['extension']) ? strtolower($pathinfo['extension']) : null; - $this->filename = Folder::createSlug($pathinfo['filename']); + $this->clearTempFolder(); - $filename = $this->filename; + $this->setPathInfo($name); - # check if file name is - if(!$overwrite) + $this->decode($file); + + $fullpath = $this->getFullPath(); + + if($this->filedata !== false && file_put_contents($fullpath, $this->filedata)) { - $suffix = 1; + $size = filesize($this->getFullPath()); + $size = $this->formatSizeUnits($size); - $destination = $this->liveFolder; - if($type == 'file') - { - $destination = $this->fileFolder; - } + $title = str_replace('-', ' ', $this->filename); + $title = $title . ' (' . strtoupper($this->extension) . ', ' . $size .')'; - while(file_exists($destination . $filename . '.' . $this->extension)) - { - $filename = $this->filename . '-' . $suffix; - $suffix++; - } + return [ + 'title' => $title, + 'name' => $this->filename, + 'extension' => $this->extension, + 'size' => $size, + 'url' => 'media/files/' . $this->getFullName() + ]; } - $this->filename = $filename; - - return true; + return false; } -*/ -/* - public function getName() + + ############################# + # IMAGE HANDLING # + ############################# + + public function prepareImage($image, $name) { - return $this->filename; + # change clear tmp folder and delete only old ones + $this->clearTempFolder(); + #$this->checkFolders('image'); + $this->decode($image); + $this->setPathInfo($name); + $this->checkAllowedExtension(); + + if(empty($this->errors)) + { + return true; + } + + return false; } - public function setExtension($extension) + public function storeOriginalToTmp() + { + # $this->saveName(); + $this->saveOriginal(); + + if(empty($this->errors)) + { + return true; + } + + return false; + } + + public function storeRenditionsToTmp($sizes) + { + # transform image-stream into image + $image = $this->createImage(); + + $originalsize = $this->getImageSize($image); + + foreach($sizes as $destinationfolder => $desiredsize) + { + $desiredsize = $this->calculateSize($originalsize, $desiredsize); + + $resizedImage = $this->resizeImage($image, $desiredsize, $originalsize); + + $this->saveResizedImage($resizedImage, $destinationfolder, $this->extension); + + imagedestroy($resizedImage); + } + + imagedestroy($image); + + if(empty($this->errors)) + { + return true; + } + + return false; + } + + # add an allowed image extension like svg + public function addAllowedExtension(string $extension) + { + $this->allowedExtensions[$extension] = true; + } + + # force an image type like webp + public function setExtension(string $extension) { $this->extension = $extension; } - public function getExtension() + public function checkAllowedExtension() { - return $this->extension; - } - - public function getFullName() - { - return $this->filename . '.' . $this->extension; - } - -*/ - -/* - public function cleanupLiveFolder() - { - # delete all old thumbs mlibrary in live folder - foreach(glob($this->liveFolder . '*mlibrary*') as $filename) + if(!isset($this->allowedExtensions[$this->extension])) { - unlink($filename); + $this->errors[] = 'Images with this extension are not allowed.'; + + return false; } return true; - } -*/ - + } + + # check if image should not be resized (animated gif and svg) + public function isResizable() + { + if($this->filetype == 'gif' && $this->detectAnimatedGif()) + { + $this->resizable = false; + } + + if($this->filetype == 'svg+xml') + { + $this->resizable = false; + } + + return $this->resizable; + } + + public function detectAnimatedGif() + { + $is_animated = preg_match('#(\x00\x21\xF9\x04.{4}\x00\x2C.*){2,}#s', $this->filedata); + if ($is_animated == 1) + { + $this->animated = true; + } + + return $this->animated; + } + + # save the original image to temp folder + public function saveOriginal($destinationfolder = 'ORIGINAL') + { + $path = $this->tmpFolder . $destinationfolder . '+' . $this->filename . '.' . $this->extension; + + if(!file_put_contents($path, $this->filedata)) + { + $this->errors[] = 'could not store the image in the temporary folder'; + } + } + + # save the original image for all sizes/folders + public function saveOriginalForAll() + { + $this->saveOriginal('LIVE'); + $this->saveOriginal('THUMBS'); + } + + public function createImage() + { + return imagecreatefromstring($this->filedata); + } + + public function getImageSize($image) + { + return ['width' => imagesx($image), 'height' => imagesy($image)]; + } + + public function calculateSize(array $originalsize, array $desiredsize) + { + # if desired size is bigger than the actual image, then drop the desired sizes and use the actual image size instead + if($desiredsize['width'] > $originalsize['width']) + { + return $originalsize; + } + + if(!isset($desiredsize['height'])) + { + $resizeFactor = $originalsize['width'] / $desiredsize['width']; + $desiredsize['height'] = round( ($originalsize['height'] / $resizeFactor), 0); + } + + return $desiredsize; + } + + public function resizeImage($image, array $desired, array $original) + { + # resize + $ratio = max($desired['width']/$original['width'], $desired['height']/$original['height']); + $h = $desired['height'] / $ratio; + $x = ($original['width'] - $desired['width'] / $ratio) / 2; + $y = ($original['height'] - $desired['height'] / $ratio) / 2; + $w = $desired['width'] / $ratio; + + $resizedImage = imagecreatetruecolor($desired['width'], $desired['height']); + + # preserve transparency + if($this->extension == "gif" or $this->extension == "png" or $this->extension == "webp") + { + imagecolortransparent($resizedImage, imagecolorallocatealpha($resizedImage, 0, 0, 0, 127)); + imagealphablending($resizedImage, false); + imagesavealpha($resizedImage, true); + } + + imagecopyresampled($resizedImage, $image, 0, 0, $x, $y, $desired['width'], $desired['height'], $w, $h); + + return $resizedImage; + } + + public function saveResizedImage($resizedImage, string $destinationfolder, string $extension) + { + $destinationfolder = strtoupper($destinationfolder); + + switch($extension) + { + case "png": + $storedImage = imagepng( $resizedImage, $this->tmpFolder . $destinationfolder . '+' . $this->filename . '.png', 9 ); + break; + case "gif": + $storedImage = imagegif( $resizedImage, $this->tmpFolder . $destinationfolder . '+' . $this->filename . '.gif' ); + break; + case "webp": + $storedImage = imagewebp( $resizedImage, $this->tmpFolder . $destinationfolder . '+' . $this->filename . '.webp', 80); + break; + case "jpg": + case "jpeg": + $storedImage = imagejpeg( $resizedImage, $this->tmpFolder . $destinationfolder . '+' . $this->filename . '.' . $extension, 80); + break; + default: + $storedImage = false; + } + + if(!$storedImage) + { + $failedImage = $this->tmpFolder . $destinationfolder . '+' . $this->filename . '.' . $extension; + + $this->errors[] = "Could not store the resized version $failedImage"; + + return false; + } + + return true; + } + + + + + + + + # REFACTOR IF NEEDED + public function findPagesWithUrl($structure, $url, $result) { foreach ($structure as $key => $item) diff --git a/system/typemill/Models/ProcessFile.php b/system/typemill/Models/_OLDProcessFile.php similarity index 93% rename from system/typemill/Models/ProcessFile.php rename to system/typemill/Models/_OLDProcessFile.php index cb9f0eb..3e3aa6d 100644 --- a/system/typemill/Models/ProcessFile.php +++ b/system/typemill/Models/_OLDProcessFile.php @@ -7,6 +7,8 @@ class ProcessFile extends ProcessAssets public function storeFile($file, $name) { + die('use processAssets instead of processFile'); + $this->clearTempFolder(); $this->setPathInfo($name); @@ -51,7 +53,9 @@ class ProcessFile extends ProcessAssets */ public function moveUploadedFile(UploadedFile $uploadedFile, $overwrite = false, $name = false, $folder = NULL) { + die('use processAssets instead of processFile'); $this->setFileName($uploadedFile->getClientFilename(), 'file'); + if($name) { diff --git a/system/typemill/Models/ProcessImage.php b/system/typemill/Models/_OLDProcessImage.php similarity index 89% rename from system/typemill/Models/ProcessImage.php rename to system/typemill/Models/_OLDProcessImage.php index d57eac0..b0d8fe6 100644 --- a/system/typemill/Models/ProcessImage.php +++ b/system/typemill/Models/_OLDProcessImage.php @@ -17,6 +17,8 @@ class ProcessImage extends ProcessAssets public function prepareImage($image, $name) { + die('use processAssets instead of processImages'); + # change clear tmp folder and delete only old ones $this->clearTempFolder(); #$this->checkFolders('image'); @@ -34,6 +36,9 @@ class ProcessImage extends ProcessAssets public function storeOriginalToTmp() { + + die('use processAssets instead of processImages'); + # $this->saveName(); $this->saveOriginal(); @@ -47,6 +52,9 @@ class ProcessImage extends ProcessAssets public function storeRenditionsToTmp($sizes) { + die('use processAssets instead of processImages'); + + # transform image-stream into image $image = $this->createImage(); @@ -76,17 +84,20 @@ class ProcessImage extends ProcessAssets # add an allowed image extension like svg public function addAllowedExtension(string $extension) { + die('use processAssets instead of processImages'); $this->allowedExtensions[$extension] = true; } # force an image type like webp public function setExtension(string $extension) { + die('use processAssets instead of processImages'); $this->extension = $extension; } public function checkAllowedExtension() { + die('use processAssets instead of processImages'); if(!isset($this->allowedExtensions[$this->extension])) { $this->errors[] = 'Images with this extension are not allowed.'; @@ -100,6 +111,7 @@ class ProcessImage extends ProcessAssets # check if image should not be resized (animated gif and svg) public function isResizable() { + die('use processAssets instead of processImages'); if($this->filetype == 'gif' && $this->detectAnimatedGif()) { $this->resizable = false; @@ -115,6 +127,7 @@ class ProcessImage extends ProcessAssets public function detectAnimatedGif() { + die('use processAssets instead of processImages'); $is_animated = preg_match('#(\x00\x21\xF9\x04.{4}\x00\x2C.*){2,}#s', $this->filedata); if ($is_animated == 1) { @@ -127,6 +140,7 @@ class ProcessImage extends ProcessAssets # save the original image to temp folder public function saveOriginal($destinationfolder = 'ORIGINAL') { + die('use processAssets instead of processImages'); $path = $this->tmpFolder . $destinationfolder . '+' . $this->filename . '.' . $this->extension; if(!file_put_contents($path, $this->filedata)) @@ -138,22 +152,26 @@ class ProcessImage extends ProcessAssets # save the original image for all sizes/folders public function saveOriginalForAll() { + die('use processAssets instead of processImages'); $this->saveOriginal('LIVE'); $this->saveOriginal('THUMBS'); } public function createImage() { + die('use processAssets instead of processImages'); return imagecreatefromstring($this->filedata); } public function getImageSize($image) { + die('use processAssets instead of processImages'); return ['width' => imagesx($image), 'height' => imagesy($image)]; } public function calculateSize(array $originalsize, array $desiredsize) { + die('use processAssets instead of processImages'); # if desired size is bigger than the actual image, then drop the desired sizes and use the actual image size instead if($desiredsize['width'] > $originalsize['width']) { @@ -171,6 +189,7 @@ class ProcessImage extends ProcessAssets public function resizeImage($image, array $desired, array $original) { + die('use processAssets instead of processImages'); # resize $ratio = max($desired['width']/$original['width'], $desired['height']/$original['height']); $h = $desired['height'] / $ratio; @@ -195,6 +214,7 @@ class ProcessImage extends ProcessAssets public function saveResizedImage($resizedImage, string $destinationfolder, string $extension) { + die('use processAssets instead of processImages'); $destinationfolder = strtoupper($destinationfolder); switch($extension) @@ -296,6 +316,7 @@ class ProcessImage extends ProcessAssets */ public function moveUploadedImage(UploadedFile $uploadedFile, $overwrite = false, $name = false, $folder = NULL) { + die('use processAssets instead of processImages'); $this->setFileName($uploadedFile->getClientFilename(), 'file'); if($name) @@ -341,6 +362,7 @@ class ProcessImage extends ProcessAssets public function generateThumbs() { + die('use processAssets instead of processImages'); # generate images from live folder to 'tmthumbs' $liveImages = scandir($this->liveFolder); @@ -358,6 +380,7 @@ class ProcessImage extends ProcessAssets public function generateThumbFromImageFile($filename) { + die('use processAssets instead of processImages'); $this->setFileName($filename, 'image', $overwrite = true); $image = $this->createImageFromPath($this->liveFolder . $filename, $this->extension); @@ -379,6 +402,7 @@ class ProcessImage extends ProcessAssets # filename and imagepath can be a tmp-version after upload. public function generateSizesFromImageFile($filename, $imagePath) { + die('use processAssets instead of processImages'); $this->setFileName($filename, 'image'); $image = $this->createImageFromPath($imagePath, $this->extension); @@ -392,6 +416,7 @@ class ProcessImage extends ProcessAssets public function grayscale($imagePath, $extension) { + die('use processAssets instead of processImages'); $image = $this->createImageFromPath($imagePath, $extension); imagefilter($image, IMG_FILTER_GRAYSCALE); @@ -401,6 +426,7 @@ class ProcessImage extends ProcessAssets public function createImageFromPath($imagePath, $extension) { + die('use processAssets instead of processImages'); switch($extension) { case 'gif': $image = imagecreatefromgif($imagePath); break; diff --git a/system/typemill/author/js/vue-forms-local.js b/system/typemill/author/js/vue-forms-local.js deleted file mode 100644 index cb46e8e..0000000 --- a/system/typemill/author/js/vue-forms-local.js +++ /dev/null @@ -1,66 +0,0 @@ -const textcomponent = { - props: ['id', 'description', 'maxlength', 'hidden', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'css', 'errors'], - template: `
- - -

{{ errors[name] }}

-

{{ $filters.translate(description) }}

-
`, - methods: { - update: function($event, name) - { - eventBus.$emit('forminput', {'name': name, 'value': $event.target.value}); - }, - }, -}; - -const textareacomponent = { - props: ['id', 'description', 'maxlength', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'css', 'value', 'errors'], - template: `
- - -

{{ errors[name] }}

-

{{ $filters.translate(description) }}

-
`, - methods: { - update: function($event, name) - { - eventBus.$emit('forminput', {'name': name, 'value': $event.target.value}); - }, - formatValue: function(value) - { - /* - if(value !== null && typeof value === 'object') - { - this.textareaclass = 'codearea'; - return JSON.stringify(value, undefined, 4); - } - return value; - */ - }, - }, -}; - -const formcomponents = { - 'component-text' : textcomponent, - 'component-textarea' : textareacomponent -}; diff --git a/system/typemill/author/js/vue-forms.js b/system/typemill/author/js/vue-forms.js index b3c4780..84612ab 100644 --- a/system/typemill/author/js/vue-forms.js +++ b/system/typemill/author/js/vue-forms.js @@ -692,12 +692,14 @@ app.component('component-customfields', { app.component('component-image', { props: ['id', 'description', 'maxlength', 'hidden', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'css', 'errors'], + components: { + medialib: medialib + }, data: function(){ return { maxsize: 10, // megabyte imagepreview: '', showmedialib: false, -// load: false, quality: false, qualitylabel: false, } @@ -716,7 +718,7 @@ app.component('component-image', {
- +
@@ -742,11 +744,14 @@ app.component('component-image', {

{{ $filters.translate(description) }}

- - `, mounted: function() { if(this.hasValue(this.value)) @@ -767,6 +772,14 @@ app.component('component-image', { } }, methods: { + addFromMedialibFunction(value) + { + // this.imgfile = value; + this.imagepreview = data.urlinfo.baseurl + '/' + value; + this.showmedialib = false; + + this.update(value); + }, hasValue: function(value) { if(typeof this.value !== "undefined" && this.value !== false && this.value !== null && this.value !== '') @@ -799,25 +812,23 @@ app.component('component-image', { { eventBus.$emit('forminput', {'name': this.name, 'value': filepath}); }, + /* updatemarkdown: function(markdown, url) { - /* is called from child component medialib */ + /* is called from child component medialib this.update(url); }, createmarkdown: function(url) { - /* is called from child component medialib */ + /* is called from child component medialib this.update(url); }, + */ deleteImage: function() { this.imagepreview = ''; this.update(''); }, - openmedialib: function() - { - this.showmedialib = true; - }, onFileChange: function( e ) { if(e.target.files.length > 0) @@ -872,11 +883,6 @@ app.component('component-image', { app.component('component-file', { props: ['id', 'description', 'maxlength', 'hidden', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], template: `
- - -
@@ -902,7 +908,7 @@ app.component('component-file', {

{{ $filters.translate('upload') }}

- +
@@ -915,6 +921,14 @@ app.component('component-file', { + + +
+ + +
+
+ `, data: function(){ return { @@ -930,6 +944,15 @@ app.component('component-file', { this.getrestriction(); }, methods: { + addFromMedialibFunction(value) + { + this.imgfile = value; + this.imgpreview = data.urlinfo.baseurl + '/' + value; + this.showmedialib = false; + this.saveimage = false; + + this.createmarkdown(); + }, update: function(value) { FormBus.$emit('forminput', {'name': this.name, 'value': value}); @@ -945,10 +968,6 @@ app.component('component-file', { /* is called from child component medialib */ this.update(url); }, - openmedialib: function() - { - this.showmedialib = true; - }, deleteFile: function() { this.update('');