diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index a34b5e8cab6..f3f0f143ec8 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -103,6 +103,7 @@ ALTER TABLE llx_website_page MODIFY COLUMN pageurl varchar(255); ALTER TABLE llx_website_page ADD COLUMN lang varchar(6); ALTER TABLE llx_website_page ADD COLUMN fk_page integer; ALTER TABLE llx_website_page ADD COLUMN grabbed_from varchar(255); +ALTER TABLE llx_website_page ADD COLUMN htmlheader text; ALTER TABLE llx_website_page MODIFY COLUMN status INTEGER DEFAULT 1; UPDATE llx_website_page set status = 1 WHERE status IS NULL; diff --git a/htdocs/install/mysql/tables/llx_website_page.sql b/htdocs/install/mysql/tables/llx_website_page.sql index f3d1cca4786..5393177a3bb 100644 --- a/htdocs/install/mysql/tables/llx_website_page.sql +++ b/htdocs/install/mysql/tables/llx_website_page.sql @@ -27,6 +27,7 @@ CREATE TABLE llx_website_page keywords varchar(255), lang varchar(6), fk_page integer, + htmlheader text, content mediumtext, -- text is not enough in size status integer DEFAULT 1, grabbed_from varchar(255), diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index b1ac20d2e7f..514b76af16c 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -37,7 +37,7 @@ VirtualHostUrlNotDefined=URL of the virtual host served by external web server n NoPageYet=No pages yet SyntaxHelp=Help on specific syntax tips YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor. -YouCanEditHtmlSource=You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.

You can also include content of another Page/Container with the following syntax: <?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=reldir/filename.ext">.
for a file into documents/media (open public access), syntax is:
<a href="/document.php?modulepart=medias[&hashp=publicsharekey if modulepart != medias]">.

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/media (open access), syntax is:
<a href="/viewimage.php?modulepart=medias&file=filename.ext">. +YouCanEditHtmlSource=You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.

You can also include content of another Page/Container with the following syntax:
<?php dolIncludeHtmlContent($websitekey.'/alias_of_content_to_include.php'); ?>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext">
For same file into documents/ecm (open access using the sharing hash key), syntax is:
<a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext&hashp=publicsharekeyoffile">
For a file into documents/media (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=relative_dir/filename.ext">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/media (open access), syntax is:
<a href="/viewimage.php?modulepart=medias&file=relative_dir/filename.ext"> ClonePage=Clone page/container CloneSite=Clone site ConfirmClonePage=Please enter code/alias of new page and if it is a translation of the cloned page. diff --git a/htdocs/websites/class/websitepage.class.php b/htdocs/websites/class/websitepage.class.php index 756d927aed9..ae10398795c 100644 --- a/htdocs/websites/class/websitepage.class.php +++ b/htdocs/websites/class/websitepage.class.php @@ -52,6 +52,7 @@ class WebsitePage extends CommonObject public $title; public $description; public $keywords; + public $htmlheader; public $content; public $status; public $date_creation; @@ -67,11 +68,12 @@ class WebsitePage extends CommonObject 'title' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1), 'description' =>array('type'=>'varchar(255)', 'label'=>'Description', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1), 'keywords' =>array('type'=>'varchar(255)', 'label'=>'Keywords', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), - 'content' =>array('type'=>'mediumtext', 'label'=>'Content', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), - 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), + 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), //'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'position'=>1000), 'fk_website' =>array('type'=>'integer', 'label'=>'WebsiteId', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>40, 'searchall'=>0, 'foreignkey'=>'websitepage.rowid'), 'fk_page' =>array('type'=>'integer', 'label'=>'ParentPageId', 'enabled'=>1, 'visible'=>1, 'notnull'=>-1, 'position'=>45, 'searchall'=>0, 'foreignkey'=>'website.rowid'), + 'htmlheader' =>array('type'=>'text', 'label'=>'HtmlHeader', 'enabled'=>1, 'visible'=>0, 'position'=>50, 'searchall'=>0), + 'content' =>array('type'=>'mediumtext', 'label'=>'Content', 'enabled'=>1, 'visible'=>0, 'position'=>51, 'searchall'=>0), 'grabbed_from' =>array('type'=>'varchar(255)', 'label'=>'GrabbedFrom', 'enabled'=>1, 'visible'=>1, 'index'=>1, 'position'=>400, 'comment'=>'URL page content was grabbed from'), 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), @@ -126,6 +128,7 @@ class WebsitePage extends CommonObject $sql .= " t.title,"; $sql .= " t.description,"; $sql .= " t.keywords,"; + $sql .= " t.htmlheader,"; $sql .= " t.content,"; $sql .= " t.lang,"; $sql .= " t.fk_page,"; @@ -162,6 +165,7 @@ class WebsitePage extends CommonObject $this->title = $obj->title; $this->description = $obj->description; $this->keywords = $obj->keywords; + $this->htmlheader = $obj->htmlheader; $this->content = $obj->content; $this->lang = $obj->lang; $this->fk_page = $obj->fk_page; @@ -210,6 +214,7 @@ class WebsitePage extends CommonObject $sql .= " t.title,"; $sql .= " t.description,"; $sql .= " t.keywords,"; + $sql .= " t.htmlheader,"; $sql .= " t.content,"; $sql .= " t.lang,"; $sql .= " t.fk_page,"; @@ -255,6 +260,7 @@ class WebsitePage extends CommonObject $record->title = $obj->title; $record->description = $obj->description; $record->keywords = $obj->keywords; + $record->htmlheader = $obj->htmlheader; $record->content = $obj->content; $record->lang = $obj->lang; $record->fk_page = $obj->fk_page; @@ -469,6 +475,7 @@ class WebsitePage extends CommonObject $this->title = 'My Page'; $this->description = 'This is my page'; $this->keywords = 'keyword1, keyword2'; + $this->htmlheader = ''; $this->content = 'This is a html content'; $this->status = ''; $this->grabbed_from = '';