Code comment
This commit is contained in:
parent
332db70fca
commit
15b818da30
@ -52,8 +52,8 @@ function dolSaveMasterFile($filemaster)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save content of a page on disk.
|
* Save an alias page on disk (A page that include the reference page).
|
||||||
* It can save file into root directory or into language subdirectory.
|
* It saves file into the root directory but also into language subdirectory.
|
||||||
*
|
*
|
||||||
* @param string $filealias Full path of filename to generate
|
* @param string $filealias Full path of filename to generate
|
||||||
* @param Website $object Object website
|
* @param Website $object Object website
|
||||||
@ -82,7 +82,7 @@ function dolSavePageAlias($filealias, $object, $objectpage)
|
|||||||
@chmod($filealias, octdec($conf->global->MAIN_UMASK));
|
@chmod($filealias, octdec($conf->global->MAIN_UMASK));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save also alias into language subdirectory if we have to
|
// Save also alias into language subdirectory if it is not a main language
|
||||||
if ($objectpage->lang && in_array($objectpage->lang, explode(',', $object->otherlang))) {
|
if ($objectpage->lang && in_array($objectpage->lang, explode(',', $object->otherlang))) {
|
||||||
$dirname = dirname($filealias);
|
$dirname = dirname($filealias);
|
||||||
$filename = basename($filealias);
|
$filename = basename($filealias);
|
||||||
@ -103,13 +103,16 @@ function dolSavePageAlias($filealias, $object, $objectpage)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save also alias into all language subdirectories if it is a main language
|
||||||
|
// TODO
|
||||||
|
|
||||||
return ($result ?true:false);
|
return ($result ?true:false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save content of a page on disk.
|
* Save content of a page on disk (page name is generally ID_of_page.php).
|
||||||
* Page contents are always saved into root directory.
|
* Page contents are always saved into "root" directory. Only aliases pages saved with dolSavePageAlias() can be in root or language subdir.
|
||||||
*
|
*
|
||||||
* @param string $filetpl Full path of filename to generate
|
* @param string $filetpl Full path of filename to generate
|
||||||
* @param Website $object Object website
|
* @param Website $object Object website
|
||||||
@ -230,10 +233,11 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage)
|
|||||||
|
|
||||||
//var_dump($filetpl);exit;
|
//var_dump($filetpl);exit;
|
||||||
$result = file_put_contents($filetpl, $tplcontent);
|
$result = file_put_contents($filetpl, $tplcontent);
|
||||||
if (!empty($conf->global->MAIN_UMASK))
|
if (!empty($conf->global->MAIN_UMASK)) {
|
||||||
@chmod($filetpl, octdec($conf->global->MAIN_UMASK));
|
@chmod($filetpl, octdec($conf->global->MAIN_UMASK));
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1316,6 +1316,7 @@ class Website extends CommonObject
|
|||||||
|
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
|
|
||||||
|
// Loop on each container/page
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
@ -1333,7 +1334,7 @@ class Website extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regenerate alternative aliases pages
|
// Regenerate aliases pages (pages with a natural name)
|
||||||
if (is_array($aliasesarray))
|
if (is_array($aliasesarray))
|
||||||
{
|
{
|
||||||
foreach ($aliasesarray as $aliasshortcuttocreate)
|
foreach ($aliasesarray as $aliasshortcuttocreate)
|
||||||
|
|||||||
@ -2429,15 +2429,17 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
|
|
||||||
//print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">';
|
//print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">';
|
||||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
|
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
|
||||||
|
|
||||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
|
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
|
||||||
|
|
||||||
print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'"'.($atleastonepage ? ' disabled="disabled"' : '').'>';
|
print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'"'.($atleastonepage ? ' disabled="disabled"' : '').'>';
|
||||||
|
|
||||||
|
// Regenerate all pages
|
||||||
|
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=regeneratesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'"><span class="fa fa-cogs"><span></a>';
|
||||||
|
|
||||||
print ' ';
|
print ' ';
|
||||||
|
|
||||||
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=replacesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'"><span class="fa fa-search"><span></a>';
|
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=replacesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'"><span class="fa fa-search"><span></a>';
|
||||||
|
|
||||||
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=regeneratesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'"><span class="fa fa-cogs"><span></a>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</span>';
|
print '</span>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user