function _register_fields_dynamic() { $this->_register_event_setup(); $this->fields = $this->enable_all($this->_event_form->getFields()); $udm_fields = AMP_get_column_names('userdata'); $udm_overlap = $this->udm->admin ? array('id', 'publish', 'dia_key') : array('id', 'dia_key'); $udm_fields = array_diff($udm_fields, $udm_overlap); $allowed_fields = array_diff(array_keys($this->fields), $udm_fields); $this->fields = array_combine_key($allowed_fields, $this->fields); if (isset($this->fields['humanity_test'])) { $captcha_def = $this->fields['humanity_test']; } unset($this->fields['submit']); unset($this->fields['submitAction']); unset($this->fields['humanity_test']); $this->insertBeforeFieldOrder(array_keys($this->fields)); $this->insertAfterFieldOrder(array('humanity_test')); if (isset($captcha_def)) { $this->fields['humanity_test'] = $captcha_def; } }
function __construct() { $type_fields = array(); $field_names = AMP_get_column_names('userdata_fields'); foreach ($field_names as $field_name) { if (strpos($field_name, 'type_') === 0) { $type_fields[] = $field_name; } } $image_pickers = array(); foreach ($type_fields as $type_field) { $matches = AMP_lookup('userdata_images_by_field', $type_field); if (!$matches) { continue; } foreach ($matches as $match_id => $match_type) { $image_pickers[] = array('fieldname' => substr($type_field, 5), 'modin' => $match_id); } } $this->dataset = $image_pickers; }
function _getColumnNames($sourceDef) { if (function_exists('AMP_get_column_names')) { return AMP_get_column_names($sourceDef); } trigger_error('BAD version of utility.functions.inc.php'); return array(); /* $reg = &_Registry::instance(); $definedSources = &$reg->getEntry( AMP_REGISTRY_SYSTEM_DATASOURCE_DEFS ); if ( !$definedSources ) { $definedSources = AMP_cache_get( AMP_REGISTRY_SYSTEM_DATASOURCE_DEFS ); } if ($definedSources && isset($definedSources[ $sourceDef ])) return $definedSources[ $sourceDef ]; if ( !isset( $this->dbcon )) trigger_error( sprintf( AMP_TEXT_ERROR_NOT_DEFINED, get_class( $this ), 'dbcon' )); $colNames = $this->dbcon->MetaColumnNames( $sourceDef ); $definedSources[ $sourceDef ] = $colNames; $reg->setEntry( AMP_REGISTRY_SYSTEM_DATASOURCE_DEFS, $definedSources ); AMP_cache_set( AMP_REGISTRY_SYSTEM_DATASOURCE_DEFS, $definedSources ); return $colNames; */ }