Commit 716124b8 authored by Francesco Iannuzzelli's avatar Francesco Iannuzzelli

#28 Fix translation ID

parent 557cadf7
......@@ -35,6 +35,8 @@ $tinymce_article = (int)$_GET['id'];
include_once(SERVER_ROOT."/include/header.php");
include_once(SERVER_ROOT."/../classes/article.php");
include_once(SERVER_ROOT."/../classes/irl.php");
include_once(SERVER_ROOT."/../classes/translations.php");
$tra = new Translations();
// INIT
$id = (int)$_GET['id'];
......@@ -51,12 +53,6 @@ $art_at_work = 0;
$irl = new IRL();
if($w=="tra" || $id_translation>0)
{
include_once(SERVER_ROOT."/../classes/translations.php");
$tra = new Translations();
}
if ($id>0)
{
$action2 = "update";
......@@ -81,6 +77,12 @@ if ($id>0)
$id_licence = $article['id_licence'];
$id_template = $article['id_template'];
$template_values = $a->TemplateValues($id_template);
if(!$id_translation>0) {
$translation = $tra->TranslationGetByArticle($id);
if(isset($translation['id_translation']) && $translation['id_translation']>0) {
$id_translation = $translation['id_translation'];
}
}
}
else
{
......@@ -168,15 +170,6 @@ if ($ah->ModuleAdmin(4))
if ($id_translation>0)
{
$translation = $tra->TranslationGet($id_translation);
}
elseif($w=="tra" && $id>0)
{
$translation = $tra->TranslationGetByArticle($id);
$id_translation = $translation['id_translation'];
}
if($id_translation>0)
{
if($translation['id_article']>0)
{
$atra = new Article($translation['id_article']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment