remove replicated code...

This commit is contained in:
Andy Miller
2015-06-20 11:54:46 -06:00
parent 5a2411a0e6
commit 34e50aab21

View File

@@ -492,11 +492,6 @@ class Pages
if (!$this->instances) {
$this->grav['debugger']->addMessage('Page cache missed, rebuilding pages..');
// Fire event for memory and time consuming plugins...
if ($config->get('system.pages.events.page')) {
$this->grav->fireEvent('onBuildPagesInitialized');
}
$this->recurse($pagesDir);
$this->buildRoutes();
@@ -511,11 +506,6 @@ class Pages
$taxonomy->taxonomy($taxonomy_map);
}
} else {
// Fire event for memory and time consuming plugins...
if ($config->get('system.pages.events.page')) {
$this->grav->fireEvent('onBuildPagesInitialized');
}
$this->recurse($pagesDir);
$this->buildRoutes();
}
@@ -539,6 +529,11 @@ class Pages
/** @var Config $config */
$config = $this->grav['config'];
// Fire event for memory and time consuming plugins...
if ($parent === null && $config->get('system.pages.events.page')) {
$this->grav->fireEvent('onBuildPagesInitialized');
}
$page->path($directory);
if ($parent) {
$page->parent($parent);