Fix cloning of page
This commit is contained in:
parent
2e627e55cb
commit
e6448ea675
1 changed files with 7 additions and 7 deletions
|
|
@ -3614,7 +3614,7 @@ if (!GETPOST('hide_websitemenu')) {
|
|||
array('type' => 'text', 'name' => 'siteref', 'label' => $langs->trans("WebSite"), 'value' => 'copy_of_'.$object->ref)
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneSite'), '', 'confirm_createfromclone', $formquestion, 0, 1, 200);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneSite'), '', 'confirm_createfromclone', $formquestion, 0, 1, 0);
|
||||
|
||||
print $formconfirm;
|
||||
}
|
||||
|
|
@ -3623,7 +3623,7 @@ if (!GETPOST('hide_websitemenu')) {
|
|||
// Confirmation to clone
|
||||
if ($action == 'createpagefromclone') {
|
||||
// Create an array for form
|
||||
$preselectedlanguage = GETPOST('newlang', 'aZ09') ? GETPOST('newlang', 'aZ09') : ''; // Dy default, we do not force any language on pages
|
||||
$preselectedlanguage = GETPOST('newlang', 'aZ09') ? GETPOST('newlang', 'aZ09') : ($objectpage->lang ?: ''); // Dy default, we do not force any language on pages
|
||||
$onlylang = array();
|
||||
if ($website->otherlang) {
|
||||
if (!empty($website->lang)) {
|
||||
|
|
@ -3641,8 +3641,6 @@ if (!GETPOST('hide_websitemenu')) {
|
|||
$textifempty = $langs->trans("Default");
|
||||
}
|
||||
|
||||
$formheight = 300;
|
||||
|
||||
$formquestion = array(
|
||||
array('type' => 'hidden', 'name' => 'sourcepageurl', 'value' => $objectpage->pageurl),
|
||||
array('type' => 'other', 'tdclass' => 'fieldrequired', 'name' => 'newwebsite', 'label' => $langs->trans("WebSite"), 'value' => $formwebsite->selectWebsite((string) $object->id, 'newwebsite', 0)),
|
||||
|
|
@ -3650,14 +3648,16 @@ if (!GETPOST('hide_websitemenu')) {
|
|||
array('type' => 'text', 'tdclass' => 'maxwidth200', 'name' => 'newpageurl', 'label' => $langs->trans("WEBSITE_PAGENAME"), 'value' => '')
|
||||
);
|
||||
if (count($onlylang) > 1) {
|
||||
$formquestion[] = array('type' => 'checkbox', 'tdclass' => 'maxwidth200', 'name' => 'is_a_translation', 'label' => $langs->trans("PageIsANewTranslation"), 'value' => 0, 'morecss' => 'margintoponly');
|
||||
$formheight += 50;
|
||||
$formquestion[] = array('type' => 'checkbox', 'tdclass' => 'maxwidth200', 'name' => 'is_a_translation', 'label' => $langs->trans("PageIsANewTranslation"), 'value' => 0,
|
||||
'morecss' => 'margintoponly',
|
||||
'moreattr' => 'onclick="console.log(\'Click on is_a_translation\'); jQuery(\'#newlang\').val(-1).trigger(\'change\');"'
|
||||
);
|
||||
}
|
||||
|
||||
$value = $formadmin->select_language($preselectedlanguage, 'newlang', 0, array(), $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1);
|
||||
$formquestion[] = array('type' => 'other', 'name' => 'newlang', 'label' => $form->textwithpicto($langs->trans("Language"), $langs->trans("DefineListOfAltLanguagesInWebsiteProperties")), 'value' => $value);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, $formheight, 550);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 0, 550);
|
||||
|
||||
print $formconfirm;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue