-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPicoParsePagesContent.php
55 lines (53 loc) · 1.78 KB
/
PicoParsePagesContent.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* This file is part of Pico. It's copyrighted by the contributors recorded
* in the version control history of the file, available from the following
* original location:
*
* <https://github.com/PhrozenByte/pico-parse-pages-content/blob/master/PicoParsePagesContent.php>
*
* The file was previously part of the project's main repository; the version
* control history of the original file applies accordingly, available from
* the following original location:
*
* <https://github.com/picocms/Pico/blob/5cf47e65de66ffc963263a059eb5fe5defadd3e2/plugins/01-PicoParsePagesContent.php>
*
* SPDX-License-Identifier: MIT
* License-Filename: LICENSE
*/
/**
* Parses the contents of all pages
*
* This plugin exists for historic reasons only and should not be used! It is
* disabled by default and needs to be enabled manually.
*
* This plugin heavily impacts Pico's performance, you should avoid to enable
* 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
* @license http://opensource.org/licenses/MIT The MIT License
* @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()
*/
public function onSinglePageLoaded(array &$pageData)
{
if (!isset($pageData['content'])) {
$pageData['content'] = $this->prepareFileContent($pageData['raw_content'], $pageData['meta']);
$pageData['content'] = $this->parseFileContent($pageData['content']);
}
}
}