From 935e3259e2726b4b78898e2feff7c70813050e36 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 19 Mar 2006 19:17:18 +0000 Subject: [PATCH] Adding a fetch_modified_link() hook --- printer_css.php | 58 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/printer_css.php b/printer_css.php index 3fb0f1f..a166ea5 100644 --- a/printer_css.php +++ b/printer_css.php @@ -32,6 +32,10 @@ * This framework works in conjunction with ISSO.Printer to create a unique * CSS editor enviornment. * +* Hooks: +* $this->fetch_modified_link_hook - Required hook that is run when +* preparing revert links for properties +* * @author Iris Studios, Inc. * @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc. * @version $Revision$ @@ -82,6 +86,22 @@ class Printer_CSS 'text-decoration' => 'text_decoration' ); + /** + * Hook ran in fetch_modified_link; takes three params: $descriptor, $property, $name + * @var string + * @access private + */ + var $fetch_modified_link_hook = ':=NO METHOD=:'; + + /** + * Module fields + * @var array + * @access private + */ + var $fields = array( + 'fetch_modified_link_hook' => array(REQ_YES, null, false) + ); + // ################################################################### /** * Constructor @@ -100,6 +120,35 @@ class Printer_CSS $this->__construct($registry); } + // ################################################################### + /** + * Sets an ISSO field + * + * @access public + * + * @param string Field name + * @param mixed Value of the field + */ + function set($name, $value) + { + $this->registry->do_set($name, $value, 'printer_css'); + } + + // ################################################################### + /** + * Gets an ISSO field + * + * @access public + * + * @param string Field name + * + * @return mixed Value of the field + */ + function get($fieldname) + { + return $this->registry->do_get($fieldname, 'printer_css'); + } + // ################################################################### /** * Adds a CSS information block to the array for later use @@ -400,7 +449,14 @@ class Printer_CSS if ($status) { - return '' . $name . ''; + if (is_callable($this->fetch_modified_link_hook)) + { + return call_user_func($this->fetch_modified_link_hook, $descriptor, $property, $name); + } + else + { + trigger_error('Printer_CSS::fetch_modified_link() needs to have the fetch_modified_link_hook( $descriptor , $property , $name ) defined', E_USER_ERROR); + } } else { -- 2.22.5