From d5a2b2d14610511be21dc4fbf625ef069f670dbf Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 8 May 2006 03:04:25 +0000 Subject: [PATCH] r807: Adding a new logging class that will eventually replace class_history.php --- includes/class_logging.php | 86 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 includes/class_logging.php diff --git a/includes/class_logging.php b/includes/class_logging.php new file mode 100644 index 0000000..3d7aaa3 --- /dev/null +++ b/includes/class_logging.php @@ -0,0 +1,86 @@ +original or $this->modified array based + * on the passed arrays of information and the fields to add (and what + * name to add them under), the element they go into, and any prefix + * + * @access public + * + * @param bool TRUE for original, FALSE for modified + * @param array Data array + * @param array List of fields in the data array to add; in format of array('field name' => 'display name', 'display name 2', 'display name 3') + * @param string Element to add to + * @param string Field prefix + */ + function add_data($orig, $data, $fields, $element = '', $prefix = '') + { + $array = ($orig ? 'original' : 'modified'); + $prefix .= ($prefix != '' ? '.' : ''); + + foreach ($fields AS $fname => $fdisplay) + { + if (is_numeric($fname)) + { + $fname = $fdisplay; + } + + $this->$array["$element"]["$prefix$fdisplay"] = $data["$fname"]; + } + } +} + +/*=====================================================================*\ +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ \ No newline at end of file -- 2.22.5