From 0db61af84176a39cf1dfd90f62985d0728822b03 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 2 Apr 2013 23:02:52 +0400 Subject: api: add article api hook to getArticle, change parameters passed --- classes/api.php | 8 +++++++- include/functions.php | 5 ----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/classes/api.php b/classes/api.php index 902cb0853..4427834eb 100644 --- a/classes/api.php +++ b/classes/api.php @@ -340,6 +340,12 @@ class API extends Handler { "attachments" => $attachments ); + global $pluginhost; + foreach ($pluginhost->get_hooks($pluginhost::HOOK_RENDER_ARTICLE_API) as $p) { + $article = $p->hook_render_article_api(array("article" => $article)); + } + + array_push($articles, $article); } @@ -680,7 +686,7 @@ class API extends Handler { global $pluginhost; foreach ($pluginhost->get_hooks($pluginhost::HOOK_RENDER_ARTICLE_API) as $p) { - $headline_row = $p->hook_render_article_api($headline_row); + $headline_row = $p->hook_render_article_api(array("headline" => $headline_row)); } array_push($headlines, $headline_row); diff --git a/include/functions.php b/include/functions.php index 6399ad5bb..d77cb199e 100644 --- a/include/functions.php +++ b/include/functions.php @@ -39,11 +39,6 @@ * @return boolean True if defined successfully or not. */ function define_default($name, $value) { - // Note: performence freaks should define everything in - // config.php becasue if will make defined() run much faster, - // see comment by 'tris+php at tfconsulting dot com dot au' - // here: - // http://www.php.net/manual/en/function.defined.php#89886 defined($name) or define($name, $value); } -- cgit v1.2.3