Jump to content
poterasal

Nevoie de ajutor

Recommended Posts

Nu am nici o valoare , mai jos am pus fisierul language.php cu tot ce se afla in el , da-i un ochi aici :

<?php 	class Language {


/*
Check if the language exists in the file directory and return booleans true if exists if not false
*/

public function checkLanguage($lang)
{
global $LANGUAGE_DIR;
$language = $LANGUAGE_DIR . "/" . $lang . ".lang";
if (file_exists($language))
{
return true;
} else {
return false;
}
}

/*
Set Language
*/

public function setLanguage($language)
{
global $DEFAULT_LANGUAGE;
global $LANGUAGE_DIR;
if ($language)
{
$session->LANGUAGE = $language;
}

if (!isset($session->LANGUAGE))
{
$session->LANGUAGE = $DEFAULT_LANGUAGE;
}

if ($this->checkLanguage($session->LANGUAGE))
{
$lang = $session->LANGUAGE;
return $lang;
} else {
return $DEFAULT_LANGUAGE;
}
}

/*
Get Languages
*/

public function getLanguage($language)
{
global $LANGUAGE_DIR;
$lang = $this->setLanguage($language);
include_once($LANGUAGE_DIR . "/" . $lang . ".lang");
return $lang;
}
}

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...