Add ID of page

This commit is contained in:
Laurent Destailleur
2017-10-01 21:29:49 +02:00
parent 8180967652
commit e13f29b4c8
2 changed files with 16 additions and 3 deletions

View File

@@ -49,3 +49,4 @@ CreateByFetchingExternalPage=Create page/container by fetching page from externa
OrEnterPageInfoManually=Or create empty page from scratch...
FetchAndCreate=Fetch and Create
ExportSite=Export site
IDOfPage=Id of page

View File

@@ -275,9 +275,14 @@ if ($action == 'add')
$objectpage->content = preg_replace('/^.*<body[^>]*>/ims', '', $objectpage->content);
$objectpage->content = preg_replace('/<\/body[^>]*>.*$/ims', '', $objectpage->content);
// Now loop to fetch all css files. Include them inline into header of page
// TODO...
$tmp = $objectpage->content;
// Now loop o to fetch all images
// Now loop to fetch all images
preg_match_all('/<img([^\.\/]+)src="([^>"]+)"([^>]*)>/i', $objectpage->content, $regs);
foreach ($regs[0] as $key => $val)
{
@@ -399,12 +404,13 @@ if ($action == 'add')
if (! $error)
{
$pageid = $objectpage->id;
$pageid = $objectpage->id;
// To generate the CSS, robot and htmlheader file.
// To generate the CSS, robot and htmlheader file.
if (! dol_is_file($filehtmlheader))
{
// TODO use header of page for common header ?
$htmlheadercontent = "<!-- HTML header content (common for all pages) -->";
$result=dolSaveHtmlHeader($filehtmlheader, $htmlheadercontent);
}
@@ -1536,6 +1542,12 @@ if ($action == 'editmeta' || $action == 'create')
if ($action != 'create')
{
print '<tr><td class="titlefield">';
print $langs->trans('IDOfPage');
print '</td><td>';
print $pageid;
print '</td></tr>';
print '<tr><td class="titlefield">';
print $langs->trans('WEBSITE_PAGEURL');
print '</td><td>';