[gnomeweb-wp] replaced baked solution from WPML for listing available languages to use custom html and integrate i



commit a168152ccd1c03587fb245abba56ecce45e5ec1f
Author: Vinicius Depizzol <vdepizzol gmail com>
Date:   Thu Aug 19 19:34:51 2010 -0300

    replaced baked solution from WPML for listing available languages to use custom html and integrate it with the template

 wp-content/themes/gnome-grass/footer.php |   32 +++++++++++++++++++++++++++++-
 wp-content/themes/gnome-grass/style.css  |    2 +-
 2 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/wp-content/themes/gnome-grass/footer.php b/wp-content/themes/gnome-grass/footer.php
index de4295d..145bebd 100644
--- a/wp-content/themes/gnome-grass/footer.php
+++ b/wp-content/themes/gnome-grass/footer.php
@@ -22,7 +22,37 @@
                 </div>
                 */ ?>
                 <?php
-                $sitepress->language_selector();
+                
+                if(function_exists('icl_get_languages')) {
+                
+                    $languages = icl_get_languages('skip_missing=0&orderby=code');
+                    
+                    echo '<div><ul class="menu available_languages">';
+                    
+                    if(count($languages) > 0) {
+                        echo '<li><strong>';
+                        echo _e('Also available in:', 'grass');
+                        echo '</strong><ul class="sub-menu">';
+                    }
+                    
+                    foreach($languages as $key => $value) {
+                        if($value['active'] == true) {
+                            echo '<li class="active"><a href="'.$value['url'].'" title="'.$value['translated_name'].'">'.$value['native_name'].'</a></li>';
+                        } else {
+                            echo '<li><a href="'.$value['url'].'" title="'.$value['translated_name'].'">'.$value['native_name'].'</a></li>';
+                        }
+                    }
+                    
+                    echo '</ul></li></ul></div>';
+                    
+                    /*
+                     * If the number of available languages get bigger,
+                     * we'll have to put a "more..." link here.
+                     *
+                     */
+                    
+                }
+                
                 ?>
             </div>
             
diff --git a/wp-content/themes/gnome-grass/style.css b/wp-content/themes/gnome-grass/style.css
index e662ea1..5180192 100644
--- a/wp-content/themes/gnome-grass/style.css
+++ b/wp-content/themes/gnome-grass/style.css
@@ -601,7 +601,7 @@ dl.icon_list dt img {
     background: #d3d7cf;
     -webkit-transition: background-color 100ms ease-in;
 }
-#footer a.lang_sel_sel {
+#footer .available_languages li.active {
     background: url(images/selected-language.png) no-repeat right center;
     margin-right: -10px;
     padding-right: 10px;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]