|
|
@ -401,11 +401,8 @@ class Pico |
|
|
|
$this->triggerEvent('onContentLoaded', array(&$this->rawContent)); |
|
|
|
$this->triggerEvent('onContentLoaded', array(&$this->rawContent)); |
|
|
|
|
|
|
|
|
|
|
|
// parse file meta |
|
|
|
// parse file meta |
|
|
|
$this->metaHeaders = $this->getMetaHeaders(); |
|
|
|
$this->triggerEvent('onMetaParsing', array(&$this->rawContent)); |
|
|
|
$this->triggerEvent('onMetaHeaders', array(&$this->metaHeaders)); |
|
|
|
$this->meta = $this->parseFileMeta($this->rawContent, $this->getMetaHeaders()); |
|
|
|
|
|
|
|
|
|
|
|
$this->triggerEvent('onMetaParsing', array(&$this->rawContent, &$this->metaHeaders)); |
|
|
|
|
|
|
|
$this->meta = $this->parseFileMeta($this->rawContent, $this->metaHeaders); |
|
|
|
|
|
|
|
$this->triggerEvent('onMetaParsed', array(&$this->meta)); |
|
|
|
$this->triggerEvent('onMetaParsed', array(&$this->meta)); |
|
|
|
|
|
|
|
|
|
|
|
// parse file content |
|
|
|
// parse file content |
|
|
@ -1091,24 +1088,29 @@ class Pico |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns known meta headers |
|
|
|
* Returns known meta headers |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* This method triggers the `onMetaHeaders` event when the known meta |
|
|
|
|
|
|
|
* headers weren't assembled yet. |
|
|
|
|
|
|
|
* |
|
|
|
* @return string[] known meta headers; the array value specifies the |
|
|
|
* @return string[] known meta headers; the array value specifies the |
|
|
|
* YAML key to search for, the array key is later used to access the |
|
|
|
* YAML key to search for, the array key is later used to access the |
|
|
|
* found value |
|
|
|
* found value |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function getMetaHeaders() |
|
|
|
public function getMetaHeaders() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ($this->metaHeaders !== null) { |
|
|
|
if ($this->metaHeaders === null) { |
|
|
|
return $this->metaHeaders; |
|
|
|
$this->metaHeaders = array( |
|
|
|
|
|
|
|
'title' => 'Title', |
|
|
|
|
|
|
|
'description' => 'Description', |
|
|
|
|
|
|
|
'author' => 'Author', |
|
|
|
|
|
|
|
'date' => 'Date', |
|
|
|
|
|
|
|
'robots' => 'Robots', |
|
|
|
|
|
|
|
'template' => 'Template' |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->triggerEvent('onMetaHeaders', array(&$this->metaHeaders)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return array( |
|
|
|
return $this->metaHeaders; |
|
|
|
'title' => 'Title', |
|
|
|
|
|
|
|
'description' => 'Description', |
|
|
|
|
|
|
|
'author' => 'Author', |
|
|
|
|
|
|
|
'date' => 'Date', |
|
|
|
|
|
|
|
'robots' => 'Robots', |
|
|
|
|
|
|
|
'template' => 'Template' |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|