1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-06 22:26:32 +02:00

Version 1.2.9: Some preparations

This commit is contained in:
Sebastian
2018-12-06 18:07:50 +01:00
parent 39d59df52a
commit 423e52271f
20 changed files with 338 additions and 11 deletions

View File

@@ -13,6 +13,7 @@ use Typemill\Models\Markdown;
use Typemill\Events\OnPagetreeLoaded;
use Typemill\Events\OnBreadcrumbLoaded;
use Typemill\Events\OnItemLoaded;
use Typemill\Events\OnOriginalLoaded;
use Typemill\Events\OnMarkdownLoaded;
use Typemill\Events\OnContentArrayLoaded;
use Typemill\Events\OnHtmlLoaded;
@@ -118,6 +119,9 @@ class PageController extends Controller
$contentMD = isset($filePath) ? file_get_contents($filePath) : false;
}
# dispatch the original content without plugin-manipulations for case anyone wants to use it
$this->c->dispatcher->dispatch('onOriginalLoaded', new OnOriginalLoaded($contentMD));
$contentMD = $this->c->dispatcher->dispatch('onMarkdownLoaded', new OnMarkdownLoaded($contentMD))->getData();
/* initialize parsedown */
@@ -136,7 +140,7 @@ class PageController extends Controller
/* parse markdown-content-array to content-string */
$contentHTML = $parsedown->markup($contentArray);
$contentHTML = $this->c->dispatcher->dispatch('onHtmlLoaded', new OnHtmlLoaded($contentHTML))->getData();
/* extract the h1 headline*/
$contentParts = explode("</h1>", $contentHTML);
$title = isset($contentParts[0]) ? strip_tags($contentParts[0]) : $settings['title'];
@@ -155,7 +159,7 @@ class PageController extends Controller
$lastSpace = strrpos($description, ' ');
$description = substr($description, 0, $lastSpace);
}
/* get url and alt-tag for first image, if exists */
if($firstImage)
{

View File

@@ -49,9 +49,14 @@ class SettingsController extends Controller
);
$copyright = $this->getCopyright();
$validate->settings($newSettings, $copyright, 'settings');
}
else
{
$this->c->flash->addMessage('error', 'Wrong Input');
return $response->withRedirect($this->c->router->pathFor('settings.show'));
}
if(isset($_SESSION['errors']))
{