1 | <?php |
||
21 | class PicoExcerpt extends AbstractPicoPlugin |
||
22 | { |
||
23 | /** |
||
24 | * This plugin is disabled by default |
||
25 | * |
||
26 | * @see AbstractPicoPlugin::$enabled |
||
27 | */ |
||
28 | protected $enabled = false; |
||
29 | |||
30 | /** |
||
31 | * This plugin depends on PicoParsePagesContent |
||
32 | * |
||
33 | * @see PicoParsePagesContent |
||
34 | * @see AbstractPicoPlugin::$dependsOn |
||
35 | */ |
||
36 | protected $dependsOn = array('PicoParsePagesContent'); |
||
37 | |||
38 | /** |
||
39 | * Adds the default excerpt length of 50 words to the config |
||
40 | * |
||
41 | * @see DummyPlugin::onConfigLoaded() |
||
42 | */ |
||
43 | public function onConfigLoaded(array &$config) |
||
49 | |||
50 | /** |
||
51 | * Creates a excerpt for the contents of each page |
||
52 | * |
||
53 | * @see PicoExcerpt::createExcerpt() |
||
54 | * @see DummyPlugin::onSinglePageLoaded() |
||
55 | */ |
||
56 | public function onSinglePageLoaded(array &$pageData) |
||
65 | |||
66 | /** |
||
67 | * Helper function to create a excerpt of a string |
||
68 | * |
||
69 | * @param string $string the string to create a excerpt from |
||
70 | * @param int $wordLimit the maximum number of words the excerpt should be long |
||
71 | * @return string excerpt of $string |
||
72 | */ |
||
73 | protected function createExcerpt($string, $wordLimit) |
||
81 | } |
||
82 |