Hi to all,
i think it will be very interesting to use a custom theme function to render entity_translation_overview function result.

In this manner, i can override the theme function in my custom theme to highlight translation not yet saved.

Something very simple like this:


function theme_entity_translation_overview($variables){
  return theme('table', $variables);
}

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Sounds reasonable, care to provide a patch?

eliosh’s picture

Ok, i'll try to post a patch tonight.

eliosh’s picture

Status: Active » Needs review
FileSize
1.13 KB
2.1 KB

Here are the patches.
I'm sorry for not providing one file patch, but i'm using 'diff' command CLI :-)

Status: Needs review » Needs work

The last submitted patch, entity_translation.module.1937242.patch, failed testing.

plach’s picture

Thanks, there are a few coding standard issues I noted below. Can you move the theme function bodies in entity_translation.admin.inc please? Also I'd really need a single patch to commit :)

+++ entity_translation.admin.inc	2013-03-19 11:05:06.000000000 +0100
@@ -296,10 +298,14 @@
+          $classes[] = $translatable ? "" : "non_traslatable";

Separators in class names usually are dashes.

Also, for consistency with the rest of ET code, please use single quotes wherever possible.

eliosh’s picture

Here is the patch updatated.

eliosh’s picture

Status: Needs work » Needs review
plach’s picture

Definitely better :)
However...

+++ b/modules/contrib/entity_translation/entity_translation.admin.inc
@@ -266,8 +267,9 @@ function entity_translation_overview($entity_type, $entity, $callback = NULL) {
+        $classes[] = $translation['status'] ? 'published' : 'not_published';

there is still a lingering underscore here ;)

+++ b/modules/contrib/entity_translation/entity_translation.admin.inc
@@ -266,8 +267,9 @@ function entity_translation_overview($entity_type, $entity, $callback = NULL) {
+        $status .= isset($translation['translate']) && $translation['translate'] ? theme('entity_translation_overview_outdated', array('message' => t('outdated'))) : "";

@@ -296,10 +298,14 @@ function entity_translation_overview($entity_type, $entity, $callback = NULL) {
+          $classes[] = $translatable ? "" : 'non-traslatable';

and double quotes here.

Status: Needs review » Needs work

The last submitted patch, use-custom-theme.1937242.patch, failed testing.

eliosh’s picture

Status: Needs work » Needs review
FileSize
4.09 KB

Here we are with updated patch :-)

Status: Needs review » Needs work

The last submitted patch, use-custom-theme.1937242.patch, failed testing.

plach’s picture

Status: Needs work » Fixed
FileSize
1.31 KB

Committed and pushed with the attached small changes. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit c7f3556 on 7.x-1.x, factory, et-fc, revisions authored by eliosh, committed by plach:
    Issue #1937242 by eliosh: Added Use custom theme function for node...

  • Commit c7f3556 on 7.x-1.x, factory, et-fc, revisions, workbench authored by eliosh, committed by plach:
    Issue #1937242 by eliosh: Added Use custom theme function for node...