public function onCCK_StoragePrepareContent(&$field, &$value, &$storage) { if (self::$type != $field->storage) { return; } parent::g_onCCK_StoragePrepareContent($field, $config); // Init $P = $field->storage_field; // Prepare if (!isset($storage->values[$P])) { $storage->values[$P] = isset($storage->{$P}) ? self::_initValues($storage->{$P}) : array(0 => array(), 1 => array(), 2 => array(), 3 => array()); } // Set if (($k = array_search($field->storage_field2, $storage->values[$P][1])) !== false) { $value = $storage->values[$P][2][$k]; } }
public function onCCK_StoragePrepareContent(&$field, &$value, &$storage) { if (self::$type != $field->storage) { return; } parent::g_onCCK_StoragePrepareContent($field, $config); // Init $P = $field->storage_field; // Prepare if (!isset($storage->values[$P])) { $storage->values[$P] = isset($storage->{$P}) ? self::_initValues($storage->{$P}) : array(); } // Set if (isset($storage->values[$P][$field->storage_field2])) { $value = $storage->values[$P][$field->storage_field2]; if (is_array($value) && isset($field->storage_field3)) { $value = $value[$field->storage_field3]; } } }