Changeset 9906 for trunk/plugins


Ignore:
Timestamp:
Mar 28, 2011, 3:51:43 PM (13 years ago)
Author:
plg
Message:

Language Switch:

  • display language name next to flag (and enlarge the flag box to ~400px)
  • force the links color inside the language box because the background color is

forced : on a theme like "grum dark II", the result is really awful, impossible
to read.

  • the current language is not removed from the list, this ways the list is not

reorganized depending on the current language

Location:
trunk/plugins/language_switch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/language_switch/flags.tpl

    r9905 r9906  
    55    <ul>
    66      <li>
    7         <a rel="nofollow" href="#">
     7        <a rel="nofollow" href="#" class="activeFlag">
    88          <img class="flags" src="{$lang_switch.Active.img}" alt="{$lang_switch.Active.alt}" title="{$lang_switch.Active.alt}"/>
    99        </a>
     
    1616<![endif]-->
    1717        <ul class="flag-pan">
     18         <li class="languageSwitchBoxTitle">{'Language'|@translate}</li>
    1819
    1920{foreach from=$lang_switch.flags key=code item=flag name=f}
    2021          <li>
    2122            <a rel="nofollow" href="{$SCRIPT_NAME}{$flag.url}">
    22               <img class="flags" src="{$flag.img}" alt="{$flag.alt}" title="{$flag.alt}"/>
     23              <img class="flags" src="{$flag.img}" alt="{$flag.alt}" title="{$flag.alt}"/> {$flag.title}
    2324            </a>
    2425          </li>
  • trunk/plugins/language_switch/language_switch-Sylvia.css

    r9905 r9906  
    11.flag-pan { border:1px solid; background-color: #111; }
     2.content ul.categoryActions .flag-pan a:hover {color:#ddd}
    23.menuf .flags {border-color: #000 !important; }
    34
  • trunk/plugins/language_switch/language_switch-default.css

    r9904 r9906  
    1 .flag-pan { width:132px; z-index:100; border-width:1px; border-style: solid; background-color: #999; padding: 2px 5px 10px 5px; }
    2 .content ul.categoryActions .flag-pan a img.flags { margin: 5px 2px 10px; }
    3 .content ul.categoryActions .flag-pan a { margin: 0; border:none; }
     1.flag-pan { width:380px; z-index:100; border:2px solid #CDCDCD; background-color: #f0f0f0; padding: 2px 5px 10px 5px; }
     2.languageSwitchBoxTitle {display:block;width:370px;text-align:center;margin:5px auto;font-weight:bold;color:#464646;}
     3.content ul.categoryActions .flag-pan a img.flags { margin-bottom: -2px; }
     4.content ul.categoryActions .flag-pan a { margin: 0; border:none; color:#464646;}
     5.content ul.categoryActions .flag-pan a:hover {color:black}
    46.menuf { width:30px; height:24px; display: inline; }
    5 .menuf ul li a, .menuf ul li a:visited {display:block; text-decoration:none; width:44px; height:27px; text-align:center; line-height:27px; overflow:hidden; border:none}
     7.menuf ul li a, .menuf ul li a:visited {display:block; text-decoration:none; width:120px; height:27px; text-align:left; line-height:27px; overflow:hidden; border:none}
    68.menuf ul {padding:0; margin:0; list-style: none;}
    7 .menuf ul li {float:left; position:relative; right: 0; top: 0;}
     9.menuf ul li {float:left; position:relative; right:0; top:0; margin-left:5px}
    810.menuf ul li ul {display: none;}/* specific to non IE browsers */
    9 .menuf li a:hover { border:0 !important;}
    10 .menuf .flags {border-width:1px !important; ; border-style: solid !important; margin-top:5px; }
    11 .menuf ul li:hover ul {display:block; position:absolute; top:0px; left:-96px; }
     11.menuf li a:hover { border:1px dotted #464646}
     12.menuf .flags {border:1px solid #ddd !important; margin-top:5px; }
     13.menuf ul li:hover ul {display:block; position:absolute; top:0px; right:0px; }
    1214.menuf ul li:hover ul li ul {display: none;}
    1315.menuf ul li:hover ul li {display: block;}
    1416.menuf ul li:hover ul li a {display:block;}
    1517.menuf ul li:hover ul li:hover ul {display:block; position:absolute; left:0px; top:0;}
     18
     19.menuf ul li a.activeFlag, .menuf ul li a.activeFlag:visited {width:30px;}
  • trunk/plugins/language_switch/language_switch.inc.php

    r8728 r9906  
    7171                 add_url_params( $url_starting, array('lang'=> $code) )),
    7272        'alt' => ucwords( $displayname ),
     73        'title' => substr($displayname, 0, -4), // remove [FR] or [RU]
    7374        'img' => get_root_url().'language/' . $code . '/' . $code . '.jpg',
    7475        );
    75       if ( $code !== $user['language'] )
    76         $lsw['flags'][$code] = $qlc ;
    77       else $lsw['Active'] = $qlc;
     76     
     77      $lsw['flags'][$code] = $qlc ;
     78     
     79      if ($code == $user['language'])
     80      {
     81        $lsw['Active'] = $qlc;
     82      }
    7883    }
    7984    $template->set_filename('language_flags', dirname(__FILE__) . '/flags.tpl');
Note: See TracChangeset for help on using the changeset viewer.