Added before_parse_content & after_parse_content hooks. content_parsed

hook is depreciated. Updated get_protocol() method.
pico-3.0-alpha
Gilbert Pellegrom 12 years ago
parent 9616d902e0
commit 022334ff13
  1. 12
      lib/pico.php
  2. 15
      plugins/pico_plugin.php

@ -58,8 +58,11 @@ class Pico {
$meta = $this->read_file_meta($content);
$this->run_hooks('file_meta', array(&$meta));
$this->run_hooks('before_parse_content', array(&$content));
$content = $this->parse_content($content);
$this->run_hooks('content_parsed', array(&$content));
$this->run_hooks('after_parse_content', array(&$content));
$this->run_hooks('content_parsed', array(&$content)); // Depreciated @ v0.8
// Get all the pages
$pages = $this->get_pages($settings['base_url'], $settings['pages_order_by'], $settings['pages_order'], $settings['excerpt_length']);
@ -302,8 +305,11 @@ class Pico {
*/
private function get_protocol()
{
preg_match("|^HTTP[S]?|is",$_SERVER['SERVER_PROTOCOL'],$m);
return strtolower($m[0]);
$protocol = 'http';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){
$protocol = 'https';
}
return $protocol;
}
/**

@ -12,6 +12,11 @@ class Pico_Plugin {
public function plugins_loaded()
{
}
public function config_loaded(&$settings)
{
}
public function request_url(&$url)
@ -39,22 +44,22 @@ class Pico_Plugin {
}
public function config_loaded(&$settings)
public function before_read_file_meta(&$headers)
{
}
public function before_read_file_meta(&$headers)
public function file_meta(&$meta)
{
}
public function file_meta(&$meta)
public function before_parse_content(&$content)
{
}
public function content_parsed(&$content)
public function after_parse_content(&$content)
{
}

Loading…
Cancel
Save