From bed67a87bb6b22894129b94a43b4bbb3f5bbca01 Mon Sep 17 00:00:00 2001 From: Cyrille de Lambert Date: Thu, 18 Aug 2011 23:16:07 +0000 Subject: [PATCH] init_ihm.php can be set in each theme for specifics init --- htdocs/admin/ihm.php | 7 +++++-- htdocs/main.inc.php | 14 ++++++-------- htdocs/theme/bureau2crea/init_ihm.php | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 htdocs/theme/bureau2crea/init_ihm.php diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index fd528ef7fb5..43af479890c 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/ihm.php * \brief Page to setup GUI display options - * \version $Id: ihm.php,v 1.131 2011/08/10 23:48:09 eldy Exp $ + * \version $Id: ihm.php,v 1.132 2011/08/18 23:17:23 cdelambert Exp $ */ require("../main.inc.php"); @@ -67,6 +67,9 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update') dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); + if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/init_ihm.php')){ + include_once (DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/init_ihm.php'); + } dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity); @@ -406,5 +409,5 @@ else // Show $db->close(); -llxFooter('$Date: 2011/08/10 23:48:09 $ - $Revision: 1.131 $'); +llxFooter('$Date: 2011/08/18 23:17:23 $ - $Revision: 1.132 $'); ?> diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7c045e9d446..da32bbc8ff8 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -25,7 +25,7 @@ * \file htdocs/main.inc.php * \ingroup core * \brief File that defines environment for Dolibarr pages only (variables not required by scripts) - * \version $Id: main.inc.php,v 1.764 2011/08/18 21:09:48 eldy Exp $ + * \version $Id: main.inc.php,v 1.765 2011/08/18 23:17:23 cdelambert Exp $ */ @ini_set('memory_limit', '64M'); // This may be useless if memory is hard limited by your PHP @@ -843,14 +843,12 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs // Displays meta print ''."\n"; // Evite indexation par robots print ''."\n"; - if (! empty($conf->global->MAIN_USEFAVICON_THEME) && file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/favicon.ico')) - { - print ''."\n"; - } - else - { - print ''."\n"; + if (!empty($conf->global->MAIN_FAVICON_THEME) ){ + $favicon=$conf->global->MAIN_FAVICON_THEME; + }else{ + $favicon=DOL_URL_ROOT.'/favicon.ico'; } + print ''."\n";; // Displays title $appli='Dolibarr'; if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; diff --git a/htdocs/theme/bureau2crea/init_ihm.php b/htdocs/theme/bureau2crea/init_ihm.php new file mode 100644 index 00000000000..b96d0243306 --- /dev/null +++ b/htdocs/theme/bureau2crea/init_ihm.php @@ -0,0 +1,19 @@ + + * + * 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 2 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 . + */ + +dolibarr_set_const($db, "MAIN_FAVICON_THEME", DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/favicon.ico','chaine',0,'',$conf->entity); +dolibarr_set_const($db, "MAIN_JS_ON_PAYMENT", 1,'chaine',0,'',$conf->entity); \ No newline at end of file