2015-08-28 16:30:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parses the contents of all pages
|
|
|
|
*
|
|
|
|
* This plugin exists for backward compatibility and is disabled by default.
|
|
|
|
* It gets automatically enabled when {@link PicoDeprecated} is enabled. You
|
|
|
|
* can avoid this by calling {@link PicoParsePagesContent::setEnabled()}.
|
|
|
|
*
|
2015-11-04 18:50:44 +00:00
|
|
|
* This plugin heavily impacts Pico's performance, you should avoid to enable
|
2015-08-28 16:30:19 +00:00
|
|
|
* it whenever possible! If you must parse the contents of a page, do this
|
|
|
|
* selectively and only for pages you really need to.
|
|
|
|
*
|
|
|
|
* @author Daniel Rudolf
|
|
|
|
* @link http://picocms.org
|
2016-05-23 13:13:56 +00:00
|
|
|
* @license http://opensource.org/licenses/MIT The MIT License
|
2015-08-28 16:30:19 +00:00
|
|
|
* @version 1.0
|
|
|
|
*/
|
|
|
|
class PicoParsePagesContent extends AbstractPicoPlugin
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* This plugin is disabled by default
|
|
|
|
*
|
|
|
|
* @see AbstractPicoPlugin::$enabled
|
|
|
|
*/
|
|
|
|
protected $enabled = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parses the contents of all pages
|
|
|
|
*
|
|
|
|
* @see DummyPlugin::onSinglePageLoaded()
|
|
|
|
*/
|
2015-11-25 03:07:46 +00:00
|
|
|
public function onSinglePageLoaded(array &$pageData)
|
2015-08-28 16:30:19 +00:00
|
|
|
{
|
|
|
|
if (!isset($pageData['content'])) {
|
2015-11-06 00:08:31 +00:00
|
|
|
$pageData['content'] = $this->prepareFileContent($pageData['raw_content'], $pageData['meta']);
|
2015-08-28 16:30:19 +00:00
|
|
|
$pageData['content'] = $this->parseFileContent($pageData['content']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|