/** * Validates all modified columns of given Dynaform object. * If parameter $columns is either a single column name or an array of column names * than only those columns are validated. * * NOTICE: This does not apply to primary or foreign keys for now. * * @param Dynaform $obj The object to validate. * @param mixed $cols Column name or array of column names. * * @return mixed TRUE if all columns are valid or the error message of the first invalid column. */ public static function doValidate(Dynaform $obj, $cols = null) { $columns = array(); if ($cols) { $dbMap = Propel::getDatabaseMap(DynaformPeer::DATABASE_NAME); $tableMap = $dbMap->getTable(DynaformPeer::TABLE_NAME); if (! is_array($cols)) { $cols = array($cols); } foreach ($cols as $colName) { if ($tableMap->containsColumn($colName)) { $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); $columns[$colName] = $obj->$get(); } } } else { if ($obj->isNew() || $obj->isColumnModified(DynaformPeer::DYN_TYPE)) $columns[DynaformPeer::DYN_TYPE] = $obj->getDynType(); } return BasePeer::doValidate(DynaformPeer::DATABASE_NAME, DynaformPeer::TABLE_NAME, $columns); }
$arrayParameterAux["DYNAFORM_NAME"] = base64_decode($arrayParameterAux["DYNAFORM_NAME"]); $_SESSION["Current_Dynafom"]["Parameters"] = $arrayParameterAux; if (isset($_REQUEST['DYN_UID'])) { if (class_exists('Dynaform')) { require_once 'classes/model/Dynaform.php'; } $dynaform = new Dynaform(); $dynaform->load($_REQUEST['DYN_UID']); G::LoadClass('dynaformEditor'); $editor = new dynaformEditor(array()); $editor->file = $dynaform->getDynFilename(); $editor->home = PATH_DYNAFORM; $editor->title = $dynaform->getDynTitle(); $editor->dyn_uid = $dynaform->getDynUid(); $editor->pro_uid = $dynaform->getProUid(); $editor->dyn_type = $dynaform->getDynType(); $editor->dyn_title = $dynaform->getDynTitle(); $editor->dyn_description = $dynaform->getDynDescription(); $editor->dyn_editor = 'processmap'; $editor->_setUseTemporalCopy(true); $A = isset($_SESSION['Current_Dynafom']['Parameters']['URL']) ? $_SESSION['Current_Dynafom']['Parameters']['URL'] : ''; $form = new Form($dynaform->getProUid() . '/' . $dynaform->getDynUid(), PATH_DYNAFORM, SYS_LANG, true); $properties = array('A' => $A, 'DYN_UID' => $dynaform->getDynUid(), 'PRO_UID' => $dynaform->getProUid(), 'DYN_TITLE' => $dynaform->getDynTitle(), 'DYN_TYPE' => $dynaform->getDynType(), 'DYN_DESCRIPTION' => $dynaform->getDynDescription(), 'WIDTH' => $form->width, 'MODE' => $form->mode, 'PRINTDYNAFORM' => $form->printdynaform, 'ADJUSTGRIDSWIDTH' => $form->adjustgridswidth, 'NEXTSTEPSAVE' => $form->nextstepsave); $tmp = $editor->_getTmpData(); $tmp['Properties'] = $properties; $editor->_setTmpData($tmp); } } } if (isset($_REQUEST['dynaformRestoreValues'])) { $aRetValues = unserialize(stripslashes(base64_decode($_REQUEST['dynaformRestoreValues'])));