Index: includes/i18nviews.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/i18nviews/includes/i18nviews.views.inc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 i18nviews.views.inc
--- includes/i18nviews.views.inc 14 Jun 2010 03:15:07 -0000 1.1.2.1
+++ includes/i18nviews.views.inc 14 Nov 2010 13:33:14 -0000
@@ -43,6 +43,9 @@
'i18nviews_handler_filter_term_node_tid' => array(
'parent' => 'views_handler_filter_term_node_tid',
),
+ 'i18nviews_handler_argument_string' => array(
+ 'parent' => 'views_handler_argument_string',
+ ),
),
);
}
@@ -53,6 +56,7 @@
*/
function i18nviews_views_data_alter(&$data) {
$data['term_data']['name']['field']['handler'] = 'i18nviews_handler_field_taxonomy';
+ $data['term_data']['name']['argument']['handler'] = 'i18nviews_handler_argument_string';
$data['term_data']['description']['field']['handler'] = 'i18nviews_handler_field_term_description';
$data['term_node']['tid']['field']['handler'] = 'i18nviews_handler_field_term_node_tid';
$data['term_node']['tid']['argument']['handler'] = 'i18nviews_handler_argument_term_node_tid';
@@ -72,7 +76,14 @@
'help' => t("Use the locale system as implemented by the Views translation module."),
'handler' => 'views_plugin_localization_i18nstrings',
'path' => $path,
- ),
+ ),
+ 'argument validator' => array(
+ 'i18_taxonomy_term' => array(
+ 'title' => t('Localised Taxonomy term validator'),
+ 'handler' => 'views_plugin_argument_validate_i18ntaxonomy_term',
+ 'path' => $path,
+ ),
+ ),
),
);
}
Index: includes/i18nviews_handler_argument_string.inc
===================================================================
RCS file: includes/i18nviews_handler_argument_string.inc
diff -N includes/i18nviews_handler_argument_string.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ includes/i18nviews_handler_argument_string.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,49 @@
+view->name=="theviewiwanttochangefornow"){
+ //dpm($this);
+ $argument = $this->argument;
+ global $language;
+ $currentlang = $language->language;
+ $thequery = 'SELECT source FROM {locales_source} ls INNER JOIN {locales_target} lt ON ( ls.lid = lt.lid AND lt.translation = "%s" AND lt.language= "%s" AND ls.textgroup="taxonomy" )';
+ $result = db_query ($thequery, $argument, $currentlang);
+ $ids = db_fetch_array($result);
+ $argument = $ids['source'];
+ }
+ else {$argument = $this->argument;}
+
+ if (!empty($this->options['transform_dash'])) {
+ $argument = strtr($argument, '-', ' ');
+ }
+
+ if (!empty($this->definition['many to one'])) {
+ if (!empty($this->options['glossary'])) {
+ $this->helper->formula = TRUE;
+ }
+ $this->value = array($argument);
+ $this->helper->ensure_my_table();
+ $this->helper->add_filter();
+ return;
+ }
+
+ $this->ensure_my_table();
+ if (empty($this->options['glossary'])) {
+ $field = "$this->table_alias.$this->real_field";
+ }
+ else {
+ $field = $this->get_formula();
+ }
+
+ $this->query->add_where(0, "$field = '%s'", $argument);
+ }
+
+}
+
Index: includes/views_plugin_localization_i18nstrings.inc
===================================================================
RCS file: includes/views_plugin_localization_i18nstrings.inc
diff -N includes/views_plugin_localization_i18nstrings.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ includes/views_plugin_localization_i18nstrings.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,60 @@
+stringid($keys), $string);
+ }
+
+ /**
+ * Save a string for translation.
+ *
+ * @param $source
+ * Full data for the string to be translated.
+ */
+ function save($source) {
+ i18nstrings_update($this->stringid($source['keys']), $source['value'], $source['format']);
+ return TRUE;
+ }
+
+ /**
+ * Delete a string.
+ *
+ * @param $source
+ * Full data for the string to be translated.
+ */
+ function delete($source) {
+ i18nstrings_remove($this->stringid($source['keys']), $source['value']);
+ return TRUE;
+ }
+
+ /**
+ * Get string id for i18n
+ *
+ * @param $keys
+ * Array of keys for the string to be translated.
+ */
+ function stringid($keys) {
+ return 'views:' . implode(':', $keys);
+ }
+}
+
Index: .buildpath
===================================================================
RCS file: .buildpath
diff -N .buildpath
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ .buildpath 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,5 @@
+
+
+
+
+
Index: .project
===================================================================
RCS file: .project
diff -N .project
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ .project 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,22 @@
+
+
+ il18views
+
+
+
+
+
+ org.eclipse.wst.validation.validationbuilder
+
+
+
+
+ org.eclipse.dltk.core.scriptbuilder
+
+
+
+
+
+ org.eclipse.php.core.PHPNature
+
+