more module updates

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-20 18:23:59 +02:00
parent 322dd995bf
commit 6737f9faa1
10 changed files with 112 additions and 31 deletions

View File

@@ -55,7 +55,7 @@ function views_rss_core_field_formatter_settings_summary($field, $instance, $vie
unset($image_styles['']);
// Styles could be lost because of enabled/disabled modules that defines
// their styles in code.
if (isset($image_styles[$settings['image_style']])) {
if (!empty($settings['image_style']) && !empty($image_styles[$settings['image_style']])) {
$summary[] = t('Image style: @style', array('@style' => $image_styles[$settings['image_style']]));
}
else {
@@ -101,9 +101,8 @@ function views_rss_core_field_formatter_view($entity_type, $entity, $field, $ins
// Get file size of image preset file (if it has already been created,
// otherwise just create it first and then get file size).
$path = image_style_path($display['settings']['image_style'], $item['uri']);
$real_path = drupal_realpath($path);
if (file_exists($real_path) || image_style_create_derivative($image_style, $item['uri'], $path)) {
$item['filesize'] = filesize($real_path);
if (file_exists($path) || image_style_create_derivative($image_style, $item['uri'], $path)) {
$item['filesize'] = filesize($path);
}
}
elseif ($field['type'] == 'media') {
@@ -122,7 +121,7 @@ function views_rss_core_field_formatter_view($entity_type, $entity, $field, $ins
else {
$uri = file_create_url($item['uri']);
}
// XML element array in format_xml_elements() format.
$rss_element = array(
'key' => 'enclosure',
@@ -138,7 +137,7 @@ function views_rss_core_field_formatter_view($entity_type, $entity, $field, $ins
'#markup' => format_xml_elements(array($rss_element)),
'#rss_element' => $rss_element,
);
}
return $element;
}

View File

@@ -45,6 +45,16 @@ function views_rss_core_preprocess_channel_atom_link(&$variables) {
);
}
/**
* Preprocess function for channel <language> element.
*/
function views_rss_core_preprocess_channel_language(&$variables) {
global $language;
if (empty($variables['elements'][0]['value'])) {
$variables['elements'][0]['value'] = $language->language;
}
}
/**
* Preprocess function for channel <category> element.
*/
@@ -110,7 +120,7 @@ function views_rss_core_preprocess_channel_date(&$variables) {
if (count($variables['view']->result) > 0) {
$max_date = 0;
foreach ($variables['view']->result as $row) {
$key = strtolower($variables['elements'][0]['key']);
$key = $variables['elements'][0]['key'];
if (isset($row->$key) && $row->$key > $max_date) {
$max_date = $row->$key;
}
@@ -194,4 +204,4 @@ function views_rss_core_preprocess_item_source(&$variables) {
$view_title = $variables['view']->get_title();
$variables['elements'][0]['value'] = (!empty($view_title)) ? $view_title : variable_get('site_name', t('Drupal'));
$variables['elements'][0]['attributes'] = array('url' => $url);
}
}

View File

@@ -4,9 +4,9 @@ package = Views
dependencies[] = views_rss
core = "7.x"
; Information added by drupal.org packaging script on 2013-09-11
version = "7.x-2.0-rc3+4-dev"
; Information added by Drupal.org packaging script on 2014-12-23
version = "7.x-2.0-rc4"
core = "7.x"
project = "views_rss"
datestamp = "1378900636"
datestamp = "1419363788"

View File

@@ -60,7 +60,8 @@ function views_rss_core_views_rss_channel_elements() {
'help' => 'http://www.rssboard.org/rss-profile#namespace-elements-atom-link',
);
$elements['language'] = array(
'description' => t('The language the channel is written in. This allows aggregators to group all Italian language sites, for example, on a single page. See list of <a href="@w3c_url">allowable values</a> for this element defined by the W3C.', array(
'preprocess functions' => array('views_rss_core_preprocess_channel_language'),
'description' => t("The language the channel is written in. This allows aggregators to group all Italian language sites, for example, on a single page. See list of <a href='@w3c_url'>allowable values</a> for this element defined by the W3C. If left empty, it will use current site's language.", array(
'@w3c_url' => url('http://www.w3.org/TR/REC-html40/struct/dirlang.html', array('fragment' => 'langcodes')),
)),
'help' => 'http://www.rssboard.org/rss-profile#element-channel-language',
@@ -281,4 +282,4 @@ function views_rss_core_views_rss_options_form_validate($form, &$form_state) {
form_set_error('style_options][channel][core][views_rss_core][docs', t("Not a valid URL."));
}
}
}
}

View File

@@ -4,9 +4,9 @@ package = Views
dependencies[] = views_rss
core = "7.x"
; Information added by drupal.org packaging script on 2013-09-11
version = "7.x-2.0-rc3+4-dev"
; Information added by Drupal.org packaging script on 2014-12-23
version = "7.x-2.0-rc4"
core = "7.x"
project = "views_rss"
datestamp = "1378900636"
datestamp = "1419363788"