diff --git a/cache/lastCache.txt b/cache/lastCache.txt index 4d74b8e..5654e3b 100644 --- a/cache/lastCache.txt +++ b/cache/lastCache.txt @@ -1 +1 @@ -1571726903 \ No newline at end of file +1572791939 \ No newline at end of file diff --git a/composer.json b/composer.json index de6e23e..c28ee25 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,9 @@ { - "name": "trendschau/typemill", + "name": "typemill/typemill", "type": "project", "description": "A crazy simple tool to create web-documentations and online manuals with markdown files.", "keywords": ["documentations","manuals","flat-file","Markdown","php"], - "homepage": "http://typemill.net", + "homepage": "https://typemill.net", "license": "MIT", "config": { "vendor-dir": "system/vendor" diff --git a/content/00-Welcome/03-Markdown-Test.md b/content/00-Welcome/03-Markdown-Test.md index a4b0883..9fc7200 100644 --- a/content/00-Welcome/03-Markdown-Test.md +++ b/content/00-Welcome/03-Markdown-Test.md @@ -299,8 +299,6 @@ $$ x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a) $$ -Das war es dann aber auch. - [^1]: Thank you for scrolling. [^2]: This is the end of the page. diff --git a/readme.md b/readme.md index 35f5dce..0f37b1b 100644 --- a/readme.md +++ b/readme.md @@ -18,6 +18,7 @@ TYPEMILL is a small flat file cms created for editors and writers. It provides a * Allows super easy backend and frontend forms with simple YAML-files. * Ships with a fully responsive standard theme * Ships with plugins for + * Search * MathJax and KaTeX. * Code highlighting. * Matomo/Piwik and Google Analytics. @@ -60,7 +61,7 @@ You can use your ftp-software for that. ## Setup -Please go to `your-typemill-website.com/setup`, create an initial user and then setup your system in the author panel. +Please go to `your-typemill-website.com/setup`, create an initial user and configure your system in the author panel. ## Login @@ -88,17 +89,20 @@ Typemill is still in an early stage and contributions are highly welcome. Here a Some ideas for devs (please fork this repository make your changes and create a pull request): * Fix a bug. -* Create a nice theme. -* Create a new plugin. -* Improve the CSS-code with BEM or utility-css (e.g. Tailwind) and make it modular. -* Rebuild the theme with the new css-grid feature. +* Create a theme. +* Create a plugin. +* Auto-update functionality for core system plugins and themes. +* Create a plugin and theme download page. * Improve the accessibility of html and css. -* Help to establish autotests with selenium or cypress. -* Write unit-tests. -* Write an auto-update functionality. +* Implement an ACL for user roles and rights. For hints, questions, problems and support, please open up a new issue on GitHub. ## Licence -TYPEMILL is published under MIT licence. Please check the licence of the included libraries, too. \ No newline at end of file +TYPEMILL is published under MIT licence. Please check the licence of the included libraries, too. + +## Community & Supporters + +* [Eziquel Bruni](https://github.com/EzequielBruni) edits the typemill documentation. +* [vodaris](https://www.vodaris.de) sponsored the development of the search plugin. \ No newline at end of file diff --git a/system/Controllers/ContentApiController.php b/system/Controllers/ContentApiController.php index 490bd8b..28a09f2 100644 --- a/system/Controllers/ContentApiController.php +++ b/system/Controllers/ContentApiController.php @@ -87,7 +87,7 @@ class ContentApiController extends ContentController } public function unpublishArticle(Request $request, Response $response, $args) - { + { # get params from call $this->params = $request->getParams(); $this->uri = $request->getUri(); @@ -129,6 +129,19 @@ class ContentApiController extends ContentController } } + # check if it is a folder and if the folder has published pages. + $message = false; + if($this->item->elementType == 'folder') + { + foreach($this->item->folderContent as $folderContent) + { + if($folderContent->status == 'published') + { + $message = 'There are published pages within this folder. The pages are not visible on your website anymore.'; + } + } + } + # update the file $delete = $this->deleteContentFiles(['md']); @@ -143,7 +156,7 @@ class ContentApiController extends ContentController # dispatch event $this->c->dispatcher->dispatch('onPageUnpublished', new OnPageUnpublished($this->item)); - return $response->withJson(['success'], 200); + return $response->withJson(['success' => ['message' => $message]], 200); } else { diff --git a/system/Controllers/SettingsController.php b/system/Controllers/SettingsController.php index 4509fa3..214bc83 100644 --- a/system/Controllers/SettingsController.php +++ b/system/Controllers/SettingsController.php @@ -45,7 +45,7 @@ class SettingsController extends Controller $params = $request->getParams(); $newSettings = isset($params['settings']) ? $params['settings'] : false; $validate = new Validation(); - + if($newSettings) { /* make sure only allowed fields are stored */ @@ -54,6 +54,7 @@ class SettingsController extends Controller 'author' => $newSettings['author'], 'copyright' => $newSettings['copyright'], 'year' => $newSettings['year'], + 'language' => $newSettings['language'], 'startpage' => isset($newSettings['startpage']) ? true : false, 'editor' => $newSettings['editor'], ); @@ -562,6 +563,13 @@ class SettingsController extends Controller if($validate->username($params['username'])) { $user->deleteUser($params['username']); + + # if user deleted his own account + if($_SESSION['user'] == $params['username']) + { + session_destroy(); + return $response->withRedirect($this->c->router->pathFor('auth.show')); + } $this->c->flash->addMessage('info', 'Say goodbye, the user is gone!'); return $response->withRedirect($this->c->router->pathFor('user.list')); diff --git a/system/Controllers/SetupController.php b/system/Controllers/SetupController.php index dfe7ef5..00ebcf0 100644 --- a/system/Controllers/SetupController.php +++ b/system/Controllers/SetupController.php @@ -15,16 +15,36 @@ class SetupController extends Controller $checkFolder = new Write(); $systemcheck = array(); - + + # check folders and create them if possible try{ $checkFolder->checkPath('settings'); }catch(\Exception $e){ $systemcheck['error'][] = $e->getMessage(); } try{ $checkFolder->checkPath('settings/users'); }catch(\Exception $e){ $systemcheck['error'][] = $e->getMessage(); } try{ $checkFolder->checkPath('content'); }catch(\Exception $e){ $systemcheck['error'][] = $e->getMessage(); } try{ $checkFolder->checkPath('cache'); }catch(\Exception $e){ $systemcheck['error'][] = $e->getMessage(); } try{ $checkFolder->checkPath('media'); }catch(\Exception $e){ $systemcheck['error'][] = $e->getMessage(); } + + # check php-version + if (version_compare(phpversion(), '7.0.0', '<')) { + $systemcheck['error'][] = 'The PHP-version of your server is ' . phpversion() . ' and Typemill needs at least 7.0.0'; + } + + # check if mod rewrite is enabled + $modules = apache_get_modules(); + if(!in_array('mod_rewrite', $modules)) + { + $systemcheck['error'][] = 'The apache module "mod_rewrite" is not enabled.'; + } + + # check if GD extension is enabled + if(!extension_loaded('gd')){ + $systemcheck['error'][] = 'The php-extension GD for image manipulation is not enabled.'; + } + + $setuperrors = empty($systemcheck) ? false : 'Some system requirements for Typemill are missing.'; $systemcheck = empty($systemcheck) ? false : $systemcheck; - return $this->render($response, 'auth/setup.twig', array( 'messages' => $systemcheck )); + return $this->render($response, 'auth/setup.twig', array( 'messages' => $setuperror, 'systemcheck' => $systemcheck )); } public function create($request, $response, $args) diff --git a/system/author/auth/setup.twig b/system/author/auth/setup.twig index 405ff67..4aaacf8 100644 --- a/system/author/auth/setup.twig +++ b/system/author/auth/setup.twig @@ -4,9 +4,19 @@ {% block content %}