<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
/* SVN FILE: $Id$ */
/**
 * view element to display a language selection.
 *
 * unselected state, i.e. 'en.gif' and 'en_sel.gif'
 */

?>

<?php
	// prepare session flashdata to find back to the current page
	$this->session->set_flashdata('uri', $this->uri->uri_string());
    // get array of available languages
    $_lang_avail = $this->config->item('lang_avail');
    // get user's current language code
    $_sel_lang = $this->config->item('lang_selected');
    // load the respective language file
    $this->lang->load('lang');
    $_Output = Array();
    $v = 0;
    foreach ($_lang_avail as $_lang => $_language) 
    {
        // get language name in currently selected language
        $_lng = $this->lang->line('lng_'.$_lang);
        if ($_sel_lang == $_lang) 
        {
		$fstr="";
            // show selected language button
            $fstr = $this->lang->line($_lang.'_text');
        } 
        else
        {
            // show unselected language button
            $fstr = $fstr = $this->lang->line($_lang.'_text');
            $fstr = anchor(site_url("/languages/change/$_lang"), $fstr, 
                           array('title'=>'',
                                 'tabindex'=>($v+20)));
            $v++;
      }
      //$this->log("language: $_lang: $fstr", LOG_DEBUG);
      $_Output[] = $fstr;
    }
    echo "    <td>" . implode("</td>\n    <td>", $_Output) . "</td>\n";
?>




<?php //echo alt_site_url(); ?>