diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php new file mode 100644 index 00000000000..5788c8059ec --- /dev/null +++ b/htdocs/admin/website.php @@ -0,0 +1,161 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/admin/website.php + * \ingroup website + * \brief Page to setup the module Website + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + +$langs->load("admin"); +$langs->load("other"); + +if (! $user->admin) accessforbidden(); + + +$type=array('yesno','texte','chaine'); + +$action = GETPOST('action','alpha'); + +$website='website1'; + + + +/* + * Actions + */ + +// Action mise a jour ou ajout d'une constante +if ($action == 'update') +{ + + + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + + + + +/* + * View + */ + +$form = new Form($db); + +$help_url=''; + +llxHeader('',$langs->trans("WebsiteSetup"),$help_url); + + +$linkback=''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("WebsiteSetup"),$linkback,'title_setup'); + + +$head = array(); + + +/* + * Edition info modele document + */ + + +print "\n".'
'; +print ''; +print ''; + +dol_fiche_head($head, 'general', $langs->trans("Page").': '.$langs->trans("Home"), 0, 'globe'); + +print load_fiche_titre($langs->trans("SEO"),'',''); + +print ''; +print ''; +print ''; +print ''; +print "\n"; + +print ''; + +print ''; + +print ''; + +print ''; + +print '
'.$langs->trans("Description").''.$langs->trans("Value").'
'; +print $langs->trans('WEBSITE_PAGEURL'); +print ''; +print '/public/websites/'.$website.'/index.php?page=home'; +print '
'; +print $langs->trans('WEBSITE_TITLE'); +print ''; +print ''; +print '
'; +print $langs->trans('WEBSITE_DESCRIPTION'); +print ''; +print ''; +print '
'; +print $langs->trans('WEBSITE_KEYWORDS'); +print ''; +print ''; +print '
'; + +print '
'; + + +/* + * Editing global variables not related to a specific theme + */ + +print load_fiche_titre($langs->trans("Other"),'',''); + +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; +$doleditor=new DolEditor('WEBSITE_HEADER',$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60); +$doleditor->Create(); + +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; +$doleditor=new DolEditor('WEBSITE_CONTENT',$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60); +$doleditor->Create(); + +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; +$doleditor=new DolEditor('WEBSITE_FOOTER',$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60); +$doleditor->Create(); + +dol_fiche_end(); + +print '
'; + +print '
'; + + + + +llxFooter(); + +$db->close(); diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index 4b5c1d134cb..90ffc7df6fa 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -63,7 +63,7 @@ class modWebsite extends DolibarrModules // Config pages //------------- - $this->config_page_url = array(); + $this->config_page_url = array('website.php'); // Dependancies //------------- diff --git a/htdocs/install/mysql/tables/llx_website_pages.sql b/htdocs/install/mysql/tables/llx_website_pages.sql new file mode 100644 index 00000000000..0a28153f5bf --- /dev/null +++ b/htdocs/install/mysql/tables/llx_website_pages.sql @@ -0,0 +1,29 @@ +-- ======================================================================== +-- Copyright (C) 2016 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ======================================================================== + + +CREATE TABLE llx_website_page +( + rowid integer AUTO_INCREMENT NOT NULL PRIMARY KEY, + pageurl varchar(16) NOT NULL, + title varchar(255), + description varchar(255), + keywords varchar(255), + content text, + tms timestamp +) ENGINE=innodb; diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index fe618aa58c4..5ead485f23a 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -238,3 +238,8 @@ ToExport=Export NewExport=New export ##### External sites ##### ExternalSites=External sites +WebsiteSetup=Setup of module website +WEBSITE_PAGEURL=URL of page +WEBSITE_TITLE=Title +WEBSITE_DESCRIPTION=Description +WEBSITE_KEYWORDS=Keywords diff --git a/htdocs/public/websites/index.php b/htdocs/public/websites/index.php new file mode 100644 index 00000000000..fb3133df7cc --- /dev/null +++ b/htdocs/public/websites/index.php @@ -0,0 +1,31 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/paypal/index.php + * \ingroup core + * \brief A redirect page to an error + * \author Laurent Destailleur + */ + +require '../../master.inc.php'; + +$appli=constant('DOL_APPLICATION_TITLE'); +if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; + +print 'Directory with '.$appli.' websites.
'; +