/** * Decodes mixed params. * * @param mixed The encoded object/array/string/etc * @return mixed The decoded version */ static function decode(&$data) { if (is_object($data) || is_array($data)) { foreach ($data as $index => &$datum) { //skip any fields with prefix binary_ if (substr($index, 0, 7) != 'binary_') { $datum = ilp_db::decode($datum); } } return $data; } else { return html_entity_decode($data, ENT_QUOTES, 'utf-8'); } }
/** * Initializes default form values. * * Edited to decode the html in htmleditor elements. * * @param array $defaultValues values used to fill the form * @param mixed $filter (optional) filter(s) to apply to all default values * @since 1.0 * @access public * @return void */ function setDefaults($defaultValues = null, $filter = null) { parent::setDefaults($defaultValues, $filter); // decode the values for htmleditor elements foreach ($this->_defaultValues as $name => &$value) { if ($this->getElementType($name) == 'htmleditor') { /********NEEDS ATTENTION*******/ //need to replace assmgr_db::decode with a function for ilp $this->_defaultValues[$name] = ilp_db::decode($value); } } // reinitialise each of the elements foreach (array_keys($this->_elements) as $key) { $this->_elements[$key]->onQuickFormEvent('updateValue', null, $this); } }