Changeset 17069


Ignore:
Timestamp:
Jul 25, 2012, 10:26:52 PM (12 years ago)
Author:
mistic100
Message:

Merged revision(s) r17064 from trunk:
works with Additional Pages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/plugins/language_switch/language_switch.inc.php

    r15923 r17069  
    8888function language_controler_flags()
    8989{
    90   global $user, $template, $conf;
     90  global $user, $template, $conf, $page;
    9191 
    9292  $available_lang = get_languages();
     
    9898 
    9999  $url_starting = get_query_string_diff(array('lang'));
    100 
     100 
     101  if ($page['section'] == 'additional_page' and isset($page['additional_page']))
     102  {
     103    $base_url = make_index_url(array('section'=>'page')).'/'.(isset($page['additional_page']['permalink']) ? $page['additional_page']['permalink'] : $page['additional_page']['id']);
     104  }
     105  else
     106  {
     107    $base_url = duplicate_index_url();
     108  }
     109 
    101110  foreach ($available_lang as $code => $displayname)
    102111  {
     112   
    103113    $qlc = array (
    104       'url' => add_url_params(duplicate_index_url(), array('lang'=> $code)),
     114      'url' => add_url_params($base_url, array('lang'=> $code)),
    105115      'alt' => ucwords($displayname),
    106116      'title' => substr($displayname, 0, -4), // remove [FR] or [RU]
Note: See TracChangeset for help on using the changeset viewer.