... unsure
Some checks reported warnings
/ phplint (push) Has been cancelled

This commit is contained in:
David Bailey 2024-08-24 13:09:28 +02:00
parent 76ca7b9c32
commit 0dcf36052e
18 changed files with 152 additions and 112 deletions

View file

@ -9,10 +9,14 @@ class PostHandler {
public $markdown_engine;
public $site_defaults;
function __construct($db_adapter) {
$this->db = $db_adapter;
$this->posts = [];
$this->site_defaults = null;
$this->markdown_engine = null;
}
@ -26,7 +30,7 @@ class PostHandler {
$post_data = $this->db->get_postdata($key);
$post = null;
if(isset($post_data)) {
$post = new Post($this, $post_data);
$post = new Post($this, $post_data, $this->site_defaults);
}
$this->posts[$key] = $post;
@ -39,7 +43,7 @@ class PostHandler {
}
public function render_post($post) {
return $this->markdown_engine($post);
return ($this->markdown_engine)($post);
}
public function get_children_for($post, ...$search_opts) {
@ -47,7 +51,7 @@ class PostHandler {
$out_list = [];
foreach($child_list as $child_data) {
array_push($out_list, new Post($this, $child_data));
array_push($out_list, new Post($this, $child_data, $this->site_defaults));
}
return $out_list;