/** * Clean values of all variables of the object for storage. * also add slashes and quote string whereever needed * * CleanVars only contains changed and cleaned variables * Reference is used for PHP4 compliance * * @return bool true if successful * @access public */ function cleanVars(&$object) { $ts =& Xmf_Sanitizer::getInstance(); $errors = array(); $vars = $object->getVars(); $object->cleanVars = array(); foreach ($vars as $k => $v) { if (!$v["changed"]) { continue; } $cleanv = $v['value']; $cleanv = Xmf_Object_Dtype::cleanVars($object, $k, $v, $cleanv); $object->cleanVars[$k] = $cleanv; } if (!empty($errors)) { $object->setErrors($errors); } $object->unsetDirty(); //print_r($errors);exit(); return empty($errors) ? true : false; }
function _initControls($key, $title = '', $description = '') { $ret = Xmf_Object_Dtype::getVarControl($this->object->vars[$key]['data_type']); $this->assignVarControl($key, $ret); }
function getVarControl($key) { return Xmf_Object_Dtype::_loadDtype($key)->getVarControl($key); }
/** * clean values of all variables of the object for storage. * also add slashes whereever needed * * @return bool true if successful * @access public */ function cleanVars() { $existing_errors = $this->getErrors(); $this->_errors = array(); foreach ($this->vars as $k => $v) { $cleanv = $v['value']; if (!$v['changed']) { } else { $cleanv = Xmf_Object_Dtype::cleanVars($this, $k, $v, $cleanv); } $this->cleanVars[$k] =& $cleanv; unset($cleanv); } if (count($this->_errors) > 0) { $this->_errors = array_merge($existing_errors, $this->_errors); return false; } $this->_errors = array_merge($existing_errors, $this->_errors); $this->unsetDirty(); return true; }