summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--views/views_plugin_style_rss_fields.inc11
-rw-r--r--views/views_rss_views_fields.theme.inc10
2 files changed, 19 insertions, 2 deletions
diff --git a/views/views_plugin_style_rss_fields.inc b/views/views_plugin_style_rss_fields.inc
index 31e4e9b..288f0ad 100644
--- a/views/views_plugin_style_rss_fields.inc
+++ b/views/views_plugin_style_rss_fields.inc
@@ -113,10 +113,19 @@ class views_plugin_style_rss_fields extends views_plugin_style {
'#collapsed' => TRUE,
);
}
+ if (isset($this->options['channel'][$namespace][$element_name])) {
+ $default_value = $this->options['channel'][$namespace][$element_name];
+ }
+ elseif (isset($definition['default_value'])) {
+ $default_value = $definition['default_value'];
+ }
+ else {
+ $default_value = NULL;
+ }
$form['channel'][$namespace][$element_name] = array(
'#title' => isset($definition['title']) ? $definition['title'] : $element,
'#type' => isset($definition['type']) ? $definition['type'] : 'textfield',
- '#default_value' => isset($this->options['channel'][$namespace][$element_name]) ? $this->options['channel'][$namespace][$element_name] : NULL,
+ '#default_value' => $default_value,
'#description' => isset($definition['description']) ? $definition['description'] : NULL,
'#required' => isset($definition['required']) ? $definition['required'] : FALSE,
);
diff --git a/views/views_rss_views_fields.theme.inc b/views/views_rss_views_fields.theme.inc
index ed4cc89..462d646 100644
--- a/views/views_rss_views_fields.theme.inc
+++ b/views/views_rss_views_fields.theme.inc
@@ -10,7 +10,15 @@ function template_preprocess_views_view_views_rss_fields(&$vars) {
$vars['channel'] = '';
foreach ($view->style_plugin->xml_channel_elements() as $element => $definition) {
list($namespace, $element_name) = $view->style_plugin->extract_element_names($element, 'core');
- $value = isset($view->style_plugin->options['channel'][$namespace][$element_name]) ? $view->style_plugin->options['channel'][$namespace][$element_name] : NULL;
+ if (isset($view->style_plugin->options['channel'][$namespace][$element_name])) {
+ $value = $view->style_plugin->options['channel'][$namespace][$element_name];
+ }
+ elseif (isset($definition['default_value'])) {
+ $value = $definition['default_value'];
+ }
+ else {
+ $value = NULL;
+ }
// Preprocess element value.
if (isset($definition['preprocess functions']) && is_array($definition['preprocess functions'])) {
foreach ($definition['preprocess functions'] as $preprocess_function) {