Add htmlheader field for each page

This commit is contained in:
Laurent Destailleur 2017-10-02 00:08:00 +02:00
parent e13f29b4c8
commit 94ae6c62e6
4 changed files with 12 additions and 3 deletions

View File

@ -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;

View File

@ -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),

View File

@ -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 <strong>&lt;?php ?&gt;</strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax: <strong>&lt;?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?&gt;</strong><br><br>To include a link to download a file stored into the <strong>documents</strong> directory, use the <strong>document.php</strong> wrapper:<br>Example, for a file into documents/ecm (need to be logged), syntax is:<br><strong>&lt;a href="/document.php?modulepart=ecm&file=reldir/filename.ext"&gt;</strong>.<br>for a file into documents/media (open public access), syntax is:<br><strong>&lt;a href="/document.php?modulepart=medias[&hashp=publicsharekey if modulepart != medias]"&gt;</strong>.<br><br>To include an image stored into the <strong>documents</strong> directory, use the <strong>viewimage.php</strong> wrapper:<br>Example, for an image into documents/media (open access), syntax is:<br><strong>&lt;a href="/viewimage.php?modulepart=medias&amp;file=filename.ext"&gt;</strong>.
YouCanEditHtmlSource=You can include PHP code into this source using tags <strong>&lt;?php ?&gt;</strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax:<br><strong>&lt;?php dolIncludeHtmlContent($websitekey.'/alias_of_content_to_include.php'); ?&gt;</strong><br><br>To include a <strong>link to download</strong> a file stored into the <strong>documents</strong> directory, use the <strong>document.php</strong> wrapper:<br>Example, for a file into documents/ecm (need to be logged), syntax is:<br><strong>&lt;a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext"&gt;</strong><br>For same file into documents/ecm (open access using the sharing hash key), syntax is:<br><strong>&lt;a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext&hashp=publicsharekeyoffile"&gt;</strong><br>For a file into documents/media (open directory for public access), syntax is:<br><strong>&lt;a href="/document.php?modulepart=medias&file=relative_dir/filename.ext"&gt;</strong><br><br>To include an <strong>image</strong> stored into the <strong>documents</strong> directory, use the <strong>viewimage.php</strong> wrapper:<br>Example, for an image into documents/media (open access), syntax is:<br><strong>&lt;a href="/viewimage.php?modulepart=medias&amp;file=relative_dir/filename.ext"&gt;</strong>
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.

View File

@ -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 = '<html><body>This is a html content</body></html>';
$this->status = '';
$this->grabbed_from = '';