Work on translation

This commit is contained in:
Laurent Destailleur 2018-10-14 23:26:57 +02:00
parent ac143b28ae
commit ab807ada07
2 changed files with 13 additions and 5 deletions

View File

@ -50,11 +50,19 @@ if ($_SERVER['PHP_SELF'] != DOL_URL_ROOT.'/website/index.php') // If we browsing
}
if ($pageid > 0)
{
// Load tmppage if we have $websitepagefile defined
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
$tmppage=new WebsitePage($db);
$tmppage->fetch($pageid);
$sql ="SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page";
$sql.=" FROM ".MAIN_DB_PREFIX."website_page as wp, ".MAIN_DB_PREFIX."website as w";
$sql.=" WHERE w.rowid = wp.fk_website AND w.ref = '".$db->escape($websitekey)."' AND wp.lang = '".$db->escape(GETPOST('l','aZ09'))."'";
$sql.=" AND wp.fk_page = ".$db->escape($pageid);
//var_dump($sql);exit;
$sql.=" FROM ".MAIN_DB_PREFIX."website_page as wp";
$sql.=" WHERE wp.fk_website = ".$website->id;
$sql.=" AND (wp.fk_page = ".$pageid." OR wp.rowid = ".$pageid;
if ($tmppage->fk_page > 0) $sql.=" OR wp.fk_page = ".$tmppage->fk_page." OR wp.rowid = ".$tmppage->fk_page;
$sql.=")";
$sql.= " AND wp.lang = '".$db->escape(GETPOST('l','aZ09'))."'";
$resql = $db->query($sql);
if ($resql)
{

View File

@ -1081,7 +1081,7 @@ class Website extends CommonObject
/**
* Component to select language inside a container (Full CSS Only)
*
* @param array|string $languagecodes 'auto' to show all languages available for page or language codes array like array('en_US','fr_FR','de_DE','es_ES')
* @param array|string $languagecodes 'auto' to show all languages available for page, or language codes array like array('en_US','fr_FR','de_DE','es_ES')
* @param Translate $weblangs Language Object
* @param string $morecss More CSS class on component
* @param string $htmlname Suffix for HTML name