package de.tvo.workplace.layout;

import java.io.Serializable;

import org.eclnt.jsfserver.resources.ResourceManager;

public class DefaultLayout implements LayoutInterface, Serializable {

	private static final long serialVersionUID = 2030247226246332983L;

	@Override
	public String getLogoPathTop() {
		return null;
	}

	@Override
	public String getLogoPathLeft() {
		return "/images/logos/geis.png";
	}

	@Override
	public String getTitelText() {
		return ResourceManager.getRuntimeInstance().readProperty("literalsWorkplace", "titeldefaultportal");
	}
	
	@Override
	public String getTitel2Text() {
		return ResourceManager.getRuntimeInstance().readProperty("literalsWorkplace", "titeldefaultportal2");
	}

	@Override
	public String getTitelTopText() {
		return "Webportal - Geis Gruppe";
	}

	// Update from MainBean showLogin()
	private String m_impressumLink = null; //"https://geis-group.eu/impressum";
	@Override
	public String getImpressumLink() {
		return m_impressumLink;
	}
	
	// Update from MainBean showLogin()
	private String m_kontaktLink = null; //"https://geis-group.eu/kontakt";
	@Override
	public String getKontaktLink() {
		return m_kontaktLink;
	}
	

	private String m_countryLanguage = "de_DE";
	@Override
	public String getCountryLanguage() {
		return m_countryLanguage;
	}
	public void updateCountryLanguageAndLinks(String countryLanguage) {
		this.m_countryLanguage = countryLanguage;
		updateKontaktAndImpressumLink(countryLanguage);
	}

	private void updateKontaktAndImpressumLink(String countryLanguage) {
//		System.out.println("updateKontaktAndImpressumLink: " + countryLanguage);
		switch (countryLanguage) {
		case "de_DE":
			m_kontaktLink = "https://geis-group.eu/kontakt";
			m_impressumLink = "https://geis-group.eu/impressum";
			break;
			
		case "en_US":
			m_kontaktLink = "https://geis-group.eu/en/contact";
			m_impressumLink = "https://geis-group.eu/en/imprint";
			break;
			
		case "cs_CZ":
			m_kontaktLink = "https://geis-group.eu/en/contact";
			m_impressumLink = "https://geis-group.eu/en/imprint";
			break;
			
		case "pl_PL":
			m_kontaktLink = "https://geis-group.eu/en/contact";
			m_impressumLink = "https://geis-group.eu/en/imprint";
			break;

		default:
			m_kontaktLink = "https://geis-group.eu/kontakt";
			m_impressumLink = "https://geis-group.eu/impressum";
			break;
		}
		
	}
	
	@Override
	public boolean getShowLogoRight() {
		return false;
	}

	@Override
	public boolean getShowGTMS() {
		return false;
	}

	@Override
	public boolean getShowLOG() {
		return true;
	}
	
}
