X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2FHtmlHead.php;h=50a4665fc11689891d98d46da15cad1de5f83d30;hb=0f9303fde9161de7ea1240ecd7e47200822b40fb;hp=a1be65c6137133d1eea7d518548c3659f2b0457f;hpb=6855525e48fad5de270500a5445c4f4ff85d8bda;p=diogenes.git diff --git a/plugins/HtmlHead.php b/plugins/HtmlHead.php index a1be65c..50a4665 100644 --- a/plugins/HtmlHead.php +++ b/plugins/HtmlHead.php @@ -18,21 +18,27 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -require_once 'Plugin/Filter.php'; +require_once 'Plugin/Skel/Filter.php'; require_once 'diogenes/diogenes.hermes.inc.php'; /** The HtmlHead plugin allows you to add entries to a page's block. */ -class HtmlHead extends Diogenes_Plugin_Filter +class HtmlHead extends Diogenes_Plugin_Skel_Filter { /** Plugin name */ var $name = "HtmlHead"; /** Plugin description */ var $description = "This plugin allows you to add entries to a page's <head> block."; - - /** Plugin parameters */ - var $params = array('contents' => ''); + + + /** Constructor. + */ + function HtmlHead() + { + $this->declareParam('contents', ''); + } + /** Apply filtering to the input and return an output. * @@ -41,10 +47,10 @@ class HtmlHead extends Diogenes_Plugin_Filter function filter($input) { global $page; - - if ($this->params['contents']) + $contents = $this->getParamValue('content'); + if (!empty($contents)) { - array_push($page->head, $this->params['contents']); + array_push($page->head, $contents); } return $input;