init.php 557 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. class Example_Article extends Plugin {
  3. private $link;
  4. private $host;
  5. function about() {
  6. return array(1.0,
  7. "Example plugin for HOOK_RENDER_ARTICLE",
  8. "fox",
  9. true);
  10. }
  11. function init($host) {
  12. $this->link = $host->get_link();
  13. $this->host = $host;
  14. $host->add_hook($host::HOOK_RENDER_ARTICLE, $this);
  15. }
  16. function get_prefs_js() {
  17. return file_get_contents(dirname(__FILE__) . "/init.js");
  18. }
  19. function hook_render_article($article) {
  20. $article["content"] = "Content changed: " . $article["content"];
  21. return $article;
  22. }
  23. }
  24. ?>