X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2FHttpHeader.php;h=497ffb2aa0ff8d2dbc4a7f98804e01383d665c6c;hb=824ae29017126c7420683e485d03fdc15ca4fab7;hp=9c89fb4d600d4361661a4949ed82243bfd27a1c6;hpb=6855525e48fad5de270500a5445c4f4ff85d8bda;p=diogenes.git diff --git a/plugins/HttpHeader.php b/plugins/HttpHeader.php index 9c89fb4..497ffb2 100644 --- a/plugins/HttpHeader.php +++ b/plugins/HttpHeader.php @@ -18,12 +18,12 @@ * 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 HttpHeader plugin allows you to add an HTTP header to a page. */ -class HttpHeader extends Diogenes_Plugin_Filter +class HttpHeader extends Diogenes_Plugin_Skel_Filter { /** Plugin name */ var $name = "HttpHeader"; @@ -31,8 +31,14 @@ class HttpHeader extends Diogenes_Plugin_Filter /** Plugin description */ var $description = "This plugin allows you to add an HTTP header to a page."; - /** Plugin parameters */ - var $params = array('contents' => ''); + + /** Constructor. + */ + function HttpHeader() + { + $this->declareParam('contents', ''); + } + /** Apply filtering to the input and return an output. * @@ -40,13 +46,11 @@ class HttpHeader extends Diogenes_Plugin_Filter */ function filter($input) { - $header = $this->params['contents']; - + $header = $this->getParamValue('contents'); if ($header) { header($header); } - return $input; }