public static function onCCK_StoragePrepareStore(&$field, $value, &$config = array()) { // Prepare if (is_array($value)) { $store = $value; } else { $store = ' ' . $value; } parent::g_onCCK_StoragePrepareStore($field, $store, $config); }
public static function onCCK_StoragePrepareStore(&$field, $value, &$config = array()) { // Prepare if (strpos($field->storage_field2, '|') !== false) { $levels = explode('|', $field->storage_field2); for ($i = 0, $n = count($levels); $i < $n; $i++) { $field->{'storage_field' . ($i + 2)} = $levels[$i]; } $value = array($field->storage_field3 => $value); $value = json_encode($value); } elseif (is_array($value)) { $value = json_encode($value); } else { if ($value != '') { $value = addcslashes($value, "\"\n\r\\"); } $value = '"' . $value . '"'; } $store = '"' . $field->storage_field2 . '":' . $value . ','; // Add Process if (!isset(self::$list[$field->storage_field])) { parent::g_addProcess('beforeStore', self::$type, $config, array('s_table' => $field->storage_table, 's_field' => $field->storage_field)); self::$list[$field->storage_field] = 1; } // Set parent::g_onCCK_StoragePrepareStore($field, $store, $config); }
public static function onCCK_StoragePrepareImport($field, $value, &$config = array()) { // Prepare $store = '<br />' . '::' . $field->storage_field2 . '::' . $value . '::' . '/' . $field->storage_field2 . '::'; // Set parent::g_onCCK_StoragePrepareStore($field, $store, $config); return $store; }