Index: translation404-page.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/translation404/translation404-page.tpl.php,v
retrieving revision 1.1
diff -u -p -r1.1 translation404-page.tpl.php
--- translation404-page.tpl.php	8 Mar 2009 20:36:09 -0000	1.1
+++ translation404-page.tpl.php	8 Apr 2009 13:14:16 -0000
@@ -1,13 +1,25 @@
 <?php
-/* translation_not_found tempalte file*/
+// $Id$
+
+/**
+ * @file
+ * translation404-page.tpl.php
+ *
+ * Theme implementation to display a translation not found page.
+ *
+ * Available variables:
+ * - $languages_info:
+ *
+ * @see translation404_preprocess_translation_not_found_page()
+ */
 ?>
 <div id="translation-not-found-page">
-  <?php foreach($languages_info as $languages_info_item): ?>
+  <?php foreach ($languages_info as $languages_info_item): ?>
     <div id="<?php print $languages_info_item['id']; ?>" class ="<?php print $languages_info_item['direction_class']; ?>">
       <h2 class="lang-native-name"><?php print $languages_info_item['native']; ?><h2>
       <h3 class="lang-page-desc"><?php print $languages_info_item['page_desc']; ?><h3>
-      <h4 class="lang-actions-title"><?php print $languages_info_item['actions_title']; ?><h4>  
-      <?php print $languages_info_item['themed_links']?>  
+      <h4 class="lang-actions-title"><?php print $languages_info_item['actions_title']; ?><h4>
+      <?php print $languages_info_item['themed_links']?>
     </div>
   <?php endforeach; ?>
 </div>
\ No newline at end of file
Index: translation404.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/translation404/translation404.admin.inc,v
retrieving revision 1.1
diff -u -p -r1.1 translation404.admin.inc
--- translation404.admin.inc	8 Mar 2009 20:36:09 -0000	1.1
+++ translation404.admin.inc	8 Apr 2009 13:31:46 -0000
@@ -1,29 +1,28 @@
-<?php 
-// $Id: translation404.admin.inc,v 1.1 2009/03/08 20:36:09 gavri Exp $ 
-/** 
-*@file 
-*Administration page callbacks for the translation404 module. 
-*/ 
-/** 
-*Form builder. Configure translation404 settings
-* 
-*@ingroup forms 
-*@see system_settings_form(). 
-*/
-// 
+<?php
+// $Id: translation404.admin.inc,v 1.1 2009/03/08 20:36:09 gavri Exp $
+/**
+ * @file
+ * Administration page callbacks for the translation404 module.
+ */
+/**
+ * Form builder. Configure translation404 settings
+ *
+ * @ingroup forms
+ * @see system_settings_form()
+ */
+//
 //  translation404.admin.inc
 //  Â«projectÂ»
-//  
+//
 //  Created by gavri on 2009-02-12.
 //  Copyright 2009 Linnovate. All rights reserved.
-// 
- 
-function translation404_admin_settings() { 
+//
+
+function translation404_admin_settings() {
   $form['overview'] = array(
-    '#prefix' => '<h4 class="translation404-overview">', 
-    '#value' => theme('advanced_help_topic', 'translation404', 'about-translation404') . t('Mange page translation not found'),
-    '#suffix' => '</h4>', 
-    
+    '#prefix' => '<h4 class="translation404-overview">',
+    '#value' => theme('advanced_help_topic', 'translation404', 'about-translation404') . t('Manage page translation not found'),
+    '#suffix' => '</h4>',
   );
   $form['translation404_default_path'] = array(
     '#type' => 'textfield',
@@ -34,7 +33,7 @@ function translation404_admin_settings()
     '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=')
   );
   //add checkboxes to disable/enable each module that implements the module
-  $enabling_modules_form = _translation404_enable_implemented_modules(); 
+  $enabling_modules_form = _translation404_enable_implemented_modules();
   $form = array_merge($form, $enabling_modules_form);
-  return system_settings_form($form); 
-} 
+  return system_settings_form($form);
+}
Index: translation404.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/translation404/translation404.css,v
retrieving revision 1.1
diff -u -p -r1.1 translation404.css
--- translation404.css	8 Mar 2009 20:36:09 -0000	1.1
+++ translation404.css	8 Apr 2009 13:33:45 -0000
@@ -1,2 +1,4 @@
+/* $Id$ */
+
 .translation404-direction-rtl {direction:rtl;}
 .translation404-direction-ltr {direction:ltr;}
\ No newline at end of file
Index: translation404.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/translation404/translation404.info,v
retrieving revision 1.1
diff -u -p -r1.1 translation404.info
--- translation404.info	8 Mar 2009 20:36:09 -0000	1.1
+++ translation404.info	8 Apr 2009 12:24:27 -0000
@@ -1,4 +1,4 @@
-; $Id:
+; $Id$
 name = Translation404
 description = Handle non existing links in the locale language switcher block.
 dependencies[] = translation
Index: translation404.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/translation404/translation404.module,v
retrieving revision 1.1
diff -u -p -r1.1 translation404.module
--- translation404.module	8 Mar 2009 20:36:09 -0000	1.1
+++ translation404.module	8 Apr 2009 13:40:07 -0000
@@ -1,35 +1,35 @@
 <?php
-// $Id: translation404.module,v 1.1 2009/03/08 20:36:09 gavri Exp $ 
-/** 
-*@file 
-*translation404 module. 
-*/
+// $Id: translation404.module,v 1.1 2009/03/08 20:36:09 gavri Exp $
+/**
+ * @file
+ * translation404 module.
+ */
 /*
   TODO provide settings page for:
-  1. enable/disable _translation404_default_node_handeling.
-  1a. if 1 is enabled show choose if to enable this module for only node types taht are translatable or for all node types (maybe a checkbox would be nice for all content types).
-  2. chosing a differnt path for custom translation page not found (like 404 and 403 in drupal core).
-  3. add a coustom class to lang switcher when linking to tarnsaltion page not found
-  4. make the option to remove all togetger the lang switcher links that direct to tarnsaltion page not found
+  1. enable/disable _translation404_default_node_handling.
+  1a. if 1 is enabled show choose if to enable this module for only node types that are translatable or for all node types (maybe a checkbox would be nice for all content types).
+  2. chosing a different path for custom translation page not found (like 404 and 403 in drupal core).
+  3. add a coustom class to lang switcher when linking to translation page not found
+  4. make the option to remove all together the lang switcher links that direct to translation page not found
   5. write permission handler for adminstrating the settings page
   6. hook to advanced help
   7. create a screencast
-*/
+ */
 /*
-  TODO disable hook_menu $items['translation_not_found']  if a differnt path was chosen
-*/
+  TODO disable hook_menu $items['translation_not_found']  if a different path was chosen
+ */
 /*
   TODO write documenatation
-*/
+ */
 
 
 
-/** 
- * Implementation of hook_perm(). 
- */ 
-function translation404_perm() { 
-  return array('Administer Translation404'); 
-} 
+/**
+ * Implementation of hook_perm().
+ */
+function translation404_perm() {
+  return array('Administer Translation404');
+}
 
 define('TRANSLATION_NOT_FOUND', "translation_not_found");
 /**
@@ -40,31 +40,32 @@ function translation404_init() {
 }
 
 /**
- * implementation of hook_menu()
+ * Implementation of hook_menu().
  */
 function translation404_menu() {
   $items = array();
   $items['translation_not_found'] = array(
-    'title' => 'Tarnslation Not Found', 
-    'page callback' =>  '_translation_not_found_page',
-    'access callback' => TRUE, 
-    'type' => MENU_CALLBACK, 
+    'title' => 'Translation Not Found',
+    'page callback' => '_translation_not_found_page',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+  $items['admin/settings/translation-page-not-found'] = array(
+    'title' => 'Translation page not found settings',
+    'description' => t('Set when and how Transnlation page not found appears.'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('translation404_admin_settings'),
+    'access callback' => 'user_access',
+    'access arguments' => array('Administer Translation404'),
+    'type' => MENU_NORMAL_ITEM,
+    'file' => 'translation404.admin.inc',
   );
-  $items['admin/settings/translation-page-not-found'] = array( 
-  'title' => 'Translation page not found settings', 
-  'description' => t('Set when and how Transnslation page not found appers.'), 
-  'page callback' => 'drupal_get_form', 
-  'page arguments' => array('translation404_admin_settings'),
-  'access callback' => 'user_access', 
-  'access arguments' => array('Administer Translation404'), 
-  'type' => MENU_NORMAL_ITEM, 
-  'file' => 'translation404.admin.inc', 
-  ); 
-  
+
   return $items;
 }
+
 /**
- * implementation of hook_theme()
+ * Implementation of hook_theme().
  */
 function translation404_theme($existing) {
   return array(
@@ -74,10 +75,15 @@ function translation404_theme($existing)
     ),
   );
 }
+
 /**
+ * Process variables for translation404-page.tpl.php
+ *
  * implementation of theme_preprocess_translation_not_found_page()
+ *
+ * @see translation404-page.tpl.php
  */
-function  translation404_preprocess_translation_not_found_page(&$vars) {
+function translation404_preprocess_translation_not_found_page(&$vars) {
   $languages = language_list();
   $vars['languages'] = $languages;
   foreach ($languages as $language) {
@@ -89,19 +95,19 @@ function  translation404_preprocess_tran
     $more_links = translation404_invoke_translation_404('added_page_links', $links, $_SESSION['translation404_stored']);
     $more_links_lang = array();
     foreach ($more_links as $key => $more_link) {
-       $more_links_lang[$key] = $more_link;
-       //translate link title to the native language
-       $more_links_lang[$key]['title'] = t($more_link['title'], array(), $language->language);
+      $more_links_lang[$key] = $more_link;
+      //translate link title to the native language
+      $more_links_lang[$key]['title'] = t($more_link['title'], array(), $language->language);
       if (!isset($more_link['language'])) {
-         $more_links_lang[$key]['language'] = $language;
+        $more_links_lang[$key]['language'] = $language;
       }
-     
+
     }
     $links = array_merge($links, $more_links_lang);
     //direction class for css
     $direction = ($language->direction) ? 'rtl' : 'ltr';
     $languages_info[$language->language]['direction_class'] = 'translation404-direction-'. $direction;
-    //The id for the wrapping div 
+    //The id for the wrapping div
     $languages_info[$language->language]['id'] = 'desc-'. $language->language;
     //The language name in it's native language
     $languages_info[$language->language]['native'] = $language->native;
@@ -112,15 +118,18 @@ function  translation404_preprocess_tran
     //This var pass the array of links so other preprocess function could theme the links differently
     $languages_info[$language->language]['links'] = $links;
     //The themed links
-    $languages_info[$language->language]['themed_links'] = theme('links', $links); 
+    $languages_info[$language->language]['themed_links'] = theme('links', $links);
   }
   $vars['languages_info'] = $languages_info;
 }
+
 /**
- * implementation of hook_translation_link_alter()
+ * Implementation of hook_translation_link_alter().
+ *
  * This is the main logic of this module
  * to see how to implement the hook_translation404_translation
  * see node_translation404 at translation404/modules/node.translation404.inc
+ *
  * @see node_translation404()
  */
 function translation404_translation_link_alter(&$links, $path) {
@@ -149,6 +158,7 @@ function translation404_translation_link
     }
   }
 }
+
 function _translation_not_found_page() {
   //inspired from drupal_not_found
   drupal_set_header('HTTP/1.1 404 Not Found');
@@ -159,17 +169,15 @@ function _translation_not_found_page() {
     menu_set_active_item($path);
     $return = menu_execute_active_handler($path);
   }
- else {
+  else {
     //drupal_set_title(t('Page not found'));
     $return = theme('translation_not_found_page');
-    
   }
   return $return;
 }
 
-
 /**
- * taken from  node_invoke_nodeapi
+ * taken from node_invoke_nodeapi
  *
  */
 function translation404_invoke_translation_404($op, $a3 = NULL, $a4 = NULL) {
@@ -181,7 +189,7 @@ function translation404_invoke_translati
   $implement_modules = variable_get('translation404_enable', _translation404_enable_default());
   foreach (module_implements('translation404api') as $name) {
     //only apply modules that are enabled threw settings
-    if ($implement_modules[$name] == $name) {  
+    if ($implement_modules[$name] == $name) {
       $function = $name .'_translation404api';
       $result = $function($op, $a3, $a4);
       if (isset($result) && is_array($result)) {
@@ -194,6 +202,7 @@ function translation404_invoke_translati
   }
   return $return;
 }
+
 //
 function _translation404_enable_implemented_modules() {
   include_once(drupal_get_path('module', 'translation404') .'/modules/node.translation404.inc');
@@ -203,18 +212,19 @@ function _translation404_enable_implemen
   foreach (module_implements('translation404api') as $name) {
     $options[$name] = t('Enable @module_name for translation_404', array('@module_name' => $name));
   }
-  $form['translation404_enable'] = array( 
-    '#title' => t('Enalble translation page not found for this modules'), 
-    '#type' => 'checkboxes', 
-    '#description' => (t('desc here.')), 
+  $form['translation404_enable'] = array(
+    '#title' => t('Enable translation page not found for this modules'),
+    '#type' => 'checkboxes',
+    '#description' => (t('desc here.')),
     '#options' => $options,
-    '#default_value' =>  variable_get('translation404_enable', _translation404_enable_default()),
+    '#default_value' => variable_get('translation404_enable', _translation404_enable_default()),
   );
-  //add spesific setting by implemented modules
+  //add specific setting by implemented modules
   $settings_forms = translation404_invoke_translation_404('settings_form');
   $form = array_merge($form, $settings_forms);
   return $form;
 }
+
 function _translation404_enable_default() {
   foreach (module_implements('translation404api') as $name) {
     //by default enable all modules
Index: modules/i18ntaxonomy.translation404.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/translation404/modules/i18ntaxonomy.translation404.inc,v
retrieving revision 1.1
diff -u -p -r1.1 i18ntaxonomy.translation404.inc
--- modules/i18ntaxonomy.translation404.inc	8 Mar 2009 20:36:09 -0000	1.1
+++ modules/i18ntaxonomy.translation404.inc	8 Apr 2009 13:27:24 -0000
@@ -1,22 +1,22 @@
 <?php
-// $Id: i18ntaxonomy.translation404.inc,v 1.1 2009/03/08 20:36:09 gavri Exp $ 
-/** 
-* @file 
-* translation404 module. 
-* 
-* Enable only if i18ntaxonomy.module is enabled.
-*	mange taxonomy specific menu items - $items['taxonomy/term/%'] 
-*
-* Set different action according to vocabulary type
-* 1. Type: None. No multilingual options for this vocabulary.
-*  	 Action: Don't do anything.
-* 2. Type: Localize terms. Terms are common for all languages, but their name and description may be localized.
-*    Action: Don't do anything.	
-* 3. Type: Per language terms. Different terms will be allowed for each language and they can be translated.
-*    Action:	Don't do anything.
-* 4. Type: Set language to vocabulary. The vocabulary will have a global language and it will only show up for pages in that language.
-*    Action Taken: Always shot t404 page for other languages
-*/
+// $Id: i18ntaxonomy.translation404.inc,v 1.1 2009/03/08 20:36:09 gavri Exp $
+/**
+ * @file
+ * translation404 module.
+ *
+ * Enable only if i18ntaxonomy.module is enabled.
+ * mange taxonomy specific menu items - $items['taxonomy/term/%']
+ *
+ * Set different action according to vocabulary type
+ * 1. Type: None. No multilingual options for this vocabulary.
+ *    Action: Don't do anything.
+ * 2. Type: Localize terms. Terms are common for all languages, but their name and description may be localized.
+ *    Action: Don't do anything.
+ * 3. Type: Per language terms. Different terms will be allowed for each language and they can be translated.
+ *    Action:	Don't do anything.
+ * 4. Type: Set language to vocabulary. The vocabulary will have a global language and it will only show up for pages in that language.
+ *    Action Taken: Always shot t404 page for other languages
+ */
 
 /**
  * Implementation of hook_translation404api().
@@ -29,7 +29,7 @@ function i18ntaxonomy_translation404api(
       //check if the current page path is taxonomy/term/%
       if ((preg_match("!^taxonomy/term/([0-9]+)(/.+|)$!", $a4, $matches)) && ($term = taxonomy_get_term((int)$matches[1]))) {
         switch (i18ntaxonomy_vocabulary($term->vid)) {
-          // Predefined language for all terms 
+          // Predefined language for all terms
           case I18N_TAXONOMY_LANGUAGE:
             foreach (language_list() as $language) {
               $a3[$language->language]['href'] = TRANSLATION_NOT_FOUND;
@@ -46,7 +46,7 @@ function i18ntaxonomy_translation404api(
                   $stored = array(
                     'type' => 'term',
                     'vid' => $term->vid,
-                    );
+                  );
                 }
               }
             // Run through the localization system
@@ -59,21 +59,23 @@ function i18ntaxonomy_translation404api(
             // palce holder - for noe take no action
             case I18N_TAXONOMY_NONE:
               break;
-            }
-            $return = array('links' => $a3, 'stored' => $stored);
-          }
-          break;
-        case 'added_page_links':
-        //if directed from node page and node is translatable and user have permmisions (stored in the session) add a translation link
-          if ($a4['type'] == 'term' && user_access('translate content')) {
-            $links = array(
-            'translate_node' => array(
-              'title' => t('Go to terms Translations to Translate This term'),
-              'href' => 'admin/content/taxonomy/'. $a4['vid'] .'/translation',
-              ));
-            $return = $links;
-          }
-        break;
         }
-  return  $return;
-}
\ No newline at end of file
+        $return = array('links' => $a3, 'stored' => $stored);
+      }
+      break;
+
+    case 'added_page_links':
+      //if directed from node page and node is translatable and user have permmisions (stored in the session) add a translation link
+      if ($a4['type'] == 'term' && user_access('translate content')) {
+        $links = array(
+          'translate_node' => array(
+            'title' => t('Go to terms Translations to Translate This term'),
+            'href' => 'admin/content/taxonomy/'. $a4['vid'] .'/translation',
+           )
+         );
+         $return = $links;
+      }
+      break;
+  }
+  return $return;
+}
Index: modules/node.translation404.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/translation404/modules/node.translation404.inc,v
retrieving revision 1.1
diff -u -p -r1.1 node.translation404.inc
--- modules/node.translation404.inc	8 Mar 2009 20:36:09 -0000	1.1
+++ modules/node.translation404.inc	8 Apr 2009 13:31:05 -0000
@@ -1,28 +1,28 @@
 <?php
-// $Id: node.translation404.inc,v 1.1 2009/03/08 20:36:09 gavri Exp $ 
-/** 
-*@file 
-*translation404 module. 
-*/
+// $Id: node.translation404.inc,v 1.1 2009/03/08 20:36:09 gavri Exp $
+/**
+ * @file
+ * translation404 module.
+ */
 
 /**
  * Implementation of hook_translation404api().
  */
 function node_translation404api($op, $a3 = NULL, $a4 = NULL) {
-  $stored = NULL; //optional array to pass static var for the t404 page usfull for tarnslate this node link
+  $stored = NULL; //optional array to pass static var for the t404 page useful for translate this node link
   $return = array();
   switch ($op) {
     case 'populate_links':
       //$a3 is $links and $a4 is $path
       //check if the current page is a node
       if ((preg_match("!^node/([0-9]+)(/.+|)$!", $a4, $matches)) && ($node = node_load((int)$matches[1]))) {
-        //by default apply only on translatable node types - or on all node types in case of setteing change
+        //by default apply only on translatable node types - or on all node types in case of setting change
         foreach (node_get_types() as $node_type) {
           if (translation_supported_type($node_type->type)) {
             $options[$node_type->type] = $node_type->name;
           }
         }
-        //gets the data from teh settings form to see of to operate on the data r not
+        //gets the data from the settings form to see of to operate on the data or not
         $stored_settings = variable_get('translation404_node_types', $options);
         if ($stored_settings[$node->type]) {
           $languages = language_list();
@@ -33,26 +33,26 @@ function node_translation404api($op, $a3
               'nid' => $node->nid,
             );
           }
-          //first check that this node have any transltions if not retrun tarnslation page not found for all the other langauges
+          //first check that this node have any translations if not return translation page not found for all the other languages
           //and if this node isnot set to language neutral.
           if (empty($node->tnid) && !empty($node->language)) {
             //The node doen't have translation
             foreach (language_list() as $language) {
-              //we set all links including the current lang as translation page not dound
-              // the calling fuction (translation404_translation_link_alter())
+              //we set all links including the current lang as translation page not found
+              // the calling function (translation404_translation_link_alter())
               //is taking care of that at this line - $links[$langcode]['href'] = $current_page;
               $a3[$language->language]['href'] = TRANSLATION_NOT_FOUND;
             }
           }
           elseif (!empty($node->language)) {
-            //The node has at least one tarnslation
-            //check to see if all nodes have translation - and for the ones that don't - retrun tarnslation page not found
+            //The node has at least one translation
+            //check to see if all nodes have translation - and for the ones that don't - return translation page not found
             $translations = translation_node_get_translations($node->tnid);
             foreach (language_list() as $language) {
-                $language_name = $language->name;
-                if (empty($translations[$language->language]->nid)) {
-                 $a3[$language->language]['href'] = TRANSLATION_NOT_FOUND;
-                }
+              $language_name = $language->name;
+              if (empty($translations[$language->language]->nid)) {
+                $a3[$language->language]['href'] = TRANSLATION_NOT_FOUND;
+              }
             }
           }
         }
@@ -66,25 +66,27 @@ function node_translation404api($op, $a3
         }
       }
       $form['translation404_node_types'] = array(
-        '#type' => 'checkboxes', 
+        '#type' => 'checkboxes',
         '#title' => t('Node Specific settings - Choose on which node types to act'),
         '#options' => $options,
         '#default_value' => variable_get('translation404_node_types', $options),
         '#description' => t('Only matters if node for translation_404 upper checkbox is enabled.'),
       );
-       $return = $form;
+      $return = $form;
       break;
+
     case 'added_page_links':
-      //if directed from node page and node is translatable and user have permmisions (stored in the session) add a translation link
+      //if directed from node page and node is translatable and user have permissions (stored in the session) add a translation link
       if ($a4['type'] == 'node' && user_access('translate content')) {
         $links = array(
-           'translate_node' => array(
-             'title' => t('Translate this node'),
-             'href' => 'node/'. $a4['nid'] .'/translate',
-          ));
-         $return = $links;
+          'translate_node' => array(
+            'title' => t('Translate this node'),
+            'href' => 'node/'. $a4['nid'] .'/translate',
+          )
+        );
+        $return = $links;
       }
       break;
   }
-  return  $return;
-}
\ No newline at end of file
+  return $return;
+}
