Commit 3f301ee7 authored by merlinofchaos's avatar merlinofchaos

Re-order views_handler_field_node so that it comes before items that try to extend it

parent 06f6fd84
......@@ -202,9 +202,11 @@ class views_join {
}
$extras[] = $extra;
}
$output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';
if ($extras) {
$output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';
}
}
else if (is_string($this->extra)) {
else if ($this->extra && is_string($this->extra)) {
$output .= " AND ($this->extra)";
}
}
......
......@@ -195,12 +195,16 @@ Drupal.Views.updatePreviewForm = function() {
dataType: 'json'
});
return false;
return false;
}
Drupal.Views.updatePreviewLink = function() {
var url = $(this).attr('href');
url = url.replace('nojs', 'ajax');
if (url.substring(0, 18) != '/admin/build/views') {
// console.log(url.substring(0, 18));
return true;
}
$(this).ajaxSubmit({
url: url,
......
......@@ -486,71 +486,6 @@ function node_views_data() {
return $data;
}
/**
* Filter by language
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_node_language extends views_handler_filter_in_operator {
function construct() {
parent::construct();
$this->value_title = t('Node language');
$this->value_options = locale_language_list();
}
function options(&$options) {
parent::options($options);
// Set the default value to the default language
$options['value'] = language_default('language');
}
}
/**
* Field handler to translate a language into its readable form.
*
* @ingroup views_field_handlers
*/
class views_handler_field_node_language extends views_handler_field_node {
function render($values) {
$languages = locale_language_list();
$value = $languages[$values->{$this->field_alias}];
return $this->render_link($value, $values);
}
}
/**
* Argument handler to accept a language.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_node_language extends views_handler_argument {
function construct() {
parent::construct('language');
}
/**
* Override the behavior of summary_name(). Get the user friendly version
* of the language.
*/
function summary_name($data) {
return $this->node_language($data->{$this->name_alias});
}
/**
* Override the behavior of title(). Get the user friendly version of the
* node type.
*/
function title() {
return $this->node_language($this->argument);
}
function node_language($langcode) {
$languages = locale_language_list();
return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language');
}
}
/**
* Field handler to provide simple renderer that allows linking to a node.
*
......@@ -596,6 +531,19 @@ class views_handler_field_node extends views_handler_field {
}
}
/**
* Field handler to translate a language into its readable form.
*
* @ingroup views_field_handlers
*/
class views_handler_field_node_language extends views_handler_field_node {
function render($values) {
$languages = locale_language_list();
$value = $languages[$values->{$this->field_alias}];
return $this->render_link($value, $values);
}
}
/**
* Field handler to translate a node type into its readable form.
*
......@@ -1124,6 +1072,59 @@ class views_handler_filter_history_user_timestamp extends views_handler_filter {
}
}
/**
* Filter by language
*
* @ingroup views_filter_handlers
*/
class views_handler_filter_node_language extends views_handler_filter_in_operator {
function construct() {
parent::construct();
$this->value_title = t('Node language');
$this->value_options = locale_language_list();
}
function options(&$options) {
parent::options($options);
// Set the default value to the default language
$options['value'] = language_default('language');
}
}
/**
* Argument handler to accept a language.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_node_language extends views_handler_argument {
function construct() {
parent::construct('language');
}
/**
* Override the behavior of summary_name(). Get the user friendly version
* of the language.
*/
function summary_name($data) {
return $this->node_language($data->{$this->name_alias});
}
/**
* Override the behavior of title(). Get the user friendly version of the
* node type.
*/
function title() {
return $this->node_language($this->argument);
}
function node_language($langcode) {
$languages = locale_language_list();
return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language');
}
}
/**
* Implementation of hook_views_plugins
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment