/** * Show header for demo * * @param string $title Title * @param string $head Head string * @return void */ function llxHeaderVierge($title, $head = "") { global $user, $conf, $langs; top_httphead(); top_htmlhead($head,$title); print '<body style="margin: 20px;">'."\n"; }
} if (!defined('NOREQUIREHTML')) { define('NOREQUIREHTML', '1'); } if (!defined('NOREQUIREAJAX')) { define('NOREQUIREAJAX', '1'); } if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } if (!defined('NOREQUIRETRAN')) { define('NOREQUIRETRAN', '1'); } require '../../main.inc.php'; /* * View */ // Ajout directives pour resoudre bug IE //header('Cache-Control: Public, must-revalidate'); //header('Pragma: public'); //top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header. top_httphead(); //print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n"; // Registering the location of boxes if (isset($_GET['action']) && !empty($_GET['action'])) { if ($_GET['action'] == 'getrandompassword' && $user->admin) { require_once DOL_DOCUMENT_ROOT . "/core/lib/security2.lib.php"; $generic = $_GET['generic']; echo getRandomPassword($generic); } }
/** * Ouput html header of a page. * This code is also duplicated into security2.lib.php::dol_loginfunction * * @param string $head Optionnal head lines * @param string $title HTML title * @param int $disablejs More content into html header * @param int $disablehead More content into html header * @param array $arrayofjs Array of complementary js files * @param array $arrayofcss Array of complementary css files * @return void */ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') { global $user, $conf, $langs, $db; top_httphead(); if (empty($conf->css)) $conf->css = '/theme/eldy/style.css.php'; // If not defined, eldy by default ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <?php if (!empty($conf->global->MAIN_USE_CACHE_MANIFEST)) print '<html manifest="cache.manifest">' . "\n"; else print '<html>' . "\n"; if (empty($disablehead)) { ?> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="robots" content="noindex,nofollow" /> <meta name="author" content="Speedealing Development Team" /> <?php // Displays title $appli = 'Speedealing'; if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_APPLICATION_TITLE; if ($title) print '<title>' . $appli . ' - ' . $title . '</title>'; else print "<title>" . $appli . "</title>"; print "\n"; ?> <base href="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . DOL_URL_ROOT . '/'; ?>" /> <link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/> <?php print '<!-- Includes for JQuery (Ajax library) -->' . "\n"; //$jquerytheme = 'smoothness'; //if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; //else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/tipTip.css" />'."\n"; // Tooltip print '<link rel="stylesheet" type="text/css" href="includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css" />' . "\n"; // JNotify //print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/lightbox/css/jquery.lightbox-0.5.css" media="screen" />'."\n"; // Lightbox // jQuery fileupload print '<link rel="stylesheet" type="text/css" href="includes/jquery/plugins/fileupload/css/jquery.fileupload-ui.css" />' . "\n"; // jQuery datatables //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css" />'."\n"; //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/media/css/jquery.dataTables_jui.css" />'."\n"; print '<link rel="stylesheet" type="text/css" href="includes/jquery/plugins/datatables/extras/ColReorder/media/css/ColReorder.css" />' . "\n"; //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/ColVis/media/css/ColVis.css" />'."\n"; //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/ColVis/media/css/ColVisAlt.css" />'."\n"; //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/TableTools/media/css/TableTools.css" />'."\n"; print '<link rel="stylesheet" type="text/css" href="includes/jquery/plugins/datatables/extras/AutoFill/media/css/AutoFill.css" />' . "\n"; // jQuery multiselect //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/css/ui.multiselect.css" />'."\n"; print '<link rel="stylesheet" type="text/css" href="includes/jquery/plugins/wysiwyg/css/jquery.wysiwyg.css" />' . "\n"; // jQuery taghandler print '<link rel="stylesheet" href="includes/jquery/plugins/tagHandler/css/jquery.taghandler.css" media="all" />' . "\n"; print '<!-- Includes for Speedealing, modules or specific pages-->' . "\n"; // Output style sheets (optioncss='print' or '') $themepath = dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR) ? '' : $conf->global->MAIN_FORCETHEMEDIR) . $conf->css, 1); $themeparam = '?lang=' . $langs->defaultlang . '&theme=' . $conf->theme . (GETPOST('optioncss') ? '&optioncss=' . GETPOST('optioncss', 'alpha', 1) : ''); if (!empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache=' . $_SESSION['dol_resetcache']; //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; print '<link rel="stylesheet" type="text/css" title="default" href="' . $themepath . $themeparam . '">' . "\n"; // CSS forced by modules (relative url starting with /) if (is_array($conf->css_modules)) { foreach ($conf->css_modules as $key => $cssfile) { // cssfile is an absolute path print '<link rel="stylesheet" type="text/css" title="default" href="' . dol_buildpath($cssfile, 1); // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used. if (!preg_match('/\.css$/i', $cssfile)) print $themeparam; print '"><!-- Added by module ' . $key . '-->' . "\n"; } } // CSS forced by page in top_htmlhead call (relative url starting with /) if (is_array($arrayofcss)) { foreach ($arrayofcss as $cssfile) { print '<link rel="stylesheet" type="text/css" title="default" href="' . dol_buildpath($cssfile, 1); // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters and browser cache is not used. if (!preg_match('/\.css$/i', $cssfile)) print $themeparam; print '"><!-- Added by page -->' . "\n"; } } if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="top" title="' . $langs->trans("Home") . '" href="' . (DOL_URL_ROOT ? DOL_URL_ROOT : '/') . '">' . "\n"; if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1">' . "\n"; if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="author" title="Speedealing Development Team" href="http://www.speedealing.com">' . "\n"; // Output standard javascript links $ext = '.js'; if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) { $ext = '.jgz'; } // mini='_mini', ext='.gz' // JQuery. Must be before other includes print '<!-- Includes JS for JQuery -->' . "\n"; print '<script type="text/javascript" src="includes/jquery/js/jquery-latest.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/js/jquery-ui-latest.custom.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/tablednd/jquery.tablednd_0_5' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/tiptip/jquery.tipTip.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/lightbox/js/jquery.lightbox-0.5.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/globalize/lib/globalize.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/globalize/lib/cultures/globalize.cultures.js"></script>' . "\n"; // jQuery Layout print '<script type="text/javascript" src="includes/jquery/plugins/layout/jquery.layout-latest' . $ext . '"></script>' . "\n"; // jQuery jnotify print '<script type="text/javascript" src="includes/jquery/plugins/jnotify/jquery.jnotify.min.js"></script>' . "\n"; print '<script type="text/javascript" src="core/js/jnotify.js"></script>' . "\n"; if (!defined('NOLOGIN')) { // Flot print '<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="includes/jquery/plugins/flot/excanvas.min.js"></script><![endif]-->' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/flot/jquery.flot.min.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/flot/jquery.flot.pie.min.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/flot/jquery.flot.stack.min.js"></script>' . "\n"; // jQuery jeditable print '<script type="text/javascript" src="includes/jquery/plugins/jeditable/jquery.jeditable.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/jeditable/jquery.jeditable.wysiwyg.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/wysiwyg/jquery.wysiwyg.js"></script>' . "\n"; print '<script type="text/javascript">' . "\n"; //print 'var urlSaveInPlace = \'http://www.example.com/save.php\';'."\n"; print 'var urlSaveInPlace = \'core/ajax/saveinplace.php\';' . "\n"; print 'var urlLoadInPlace = \'core/ajax/loadinplace.php\';' . "\n"; print 'var tooltipInPlace = \'' . $langs->transnoentities('ClickToEdit') . '\';' . "\n"; print 'var placeholderInPlace = \'' . $langs->trans('ClickToEdit') . '\';' . "\n"; print 'var cancelInPlace = \'' . $langs->trans('Cancel') . '\';' . "\n"; print 'var submitInPlace = \'' . $langs->trans('Ok') . '\';' . "\n"; print 'var indicatorInPlace = \'<img src="' . "theme/" . $conf->theme . "/img/working.gif" . '">\';' . "\n"; print 'var ckeditorConfig = \'' . dol_buildpath('/theme/' . $conf->theme . '/ckeditor/config.js', 1) . '\';' . "\n"; print '</script>' . "\n"; print '<script type="text/javascript" src="core/js/editinplace.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js"></script>' . "\n"; // jQuery File Upload print '<script type="text/javascript" src="includes/jquery/plugins/template/tmpl.min.js"></script>' . "\n"; //print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.iframe-transport.js"></script>'."\n"; print '<script type="text/javascript" src="includes/jquery/plugins/fileupload/js/jquery.fileupload.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/fileupload/js/jquery.fileupload-fp.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/fileupload/js/jquery.fileupload-ui.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/fileupload/js/jquery.fileupload-jui.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/lib/chosen/chosen.jquery.min.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/js/jquery.inputmask.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/js/jquery.inputmask.extentions.js"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/spinner/ui.spinner.min.js"></script>' . "\n"; print '<script src="includes/jquery/plugins/tagHandler/js/jquery.taghandler.min.js"></script>' . "\n"; } // jQuery DataTables print '<script type="text/javascript" src="includes/jquery/plugins/datatables/media/js/jquery.dataTables.min' . $ext . '"></script>' . "\n"; //print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/js/dataTables.plugins.js"></script>'; print '<script type="text/javascript" src="includes/jquery/plugins/datatables/extras/ColReorder/media/js/ColReorder.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/datatables/extras/ColVis/media/js/ColVis.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/datatables/extras/TableTools/media/js/TableTools.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/datatables/extras/AutoFill/media/js/AutoFill.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="includes/jquery/plugins/datatables/extras/AjaxReload/media/js/fnReloadAjax.js"></script>' . "\n"; //print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/js/initXHR'.$ext.'"></script>'."\n"; //print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/js/searchColumns'.$ext.'"></script>'."\n"; //print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/js/ZeroClipboard'.$ext.'"></script>'."\n"; // jQuery Multiselect print '<script type="text/javascript" src="includes/jquery/plugins/multiselect/js/ui.multiselect.js"></script>' . "\n"; // CKEditor print '<script type="text/javascript">var CKEDITOR_BASEPATH = \'' . DOL_URL_ROOT . '/includes/ckeditor/\';</script>' . "\n"; print '<script type="text/javascript" src="includes/ckeditor/ckeditor_basic.js"></script>' . "\n"; // BEGIN THEME //print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/lib/jQueryUI/jquery-ui-1.8.18.custom.min.js"></script>'; print '<script type="text/javascript" src="includes/js/s_scripts.js"></script>'; print '<script type="text/javascript" src="includes/js/jquery.ui.extend.js"></script>'; print '<script type="text/javascript" src="includes/jquery/plugins/qtip2/jquery.qtip.min.js"></script>'; //print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/lib/jQplot/jquery.jqplot.min.js"></script>'; //print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/lib/jQplot/jqplot.plugins.js"></script>'; print '<script type="text/javascript" src="includes/lib/fullcalendar/fullcalendar.min.js"></script>'; print '<script type="text/javascript" src="includes/lib/stepy/js/jquery.stepy.min.js"></script>'; print '<script type="text/javascript" src="includes/lib/validate/jquery.validate.min.js"></script>'; print '<script type="text/javascript" src="includes/lib/validate/localization/messages_' . substr($langs->getDefaultLang(), 0, 2) . '.js"></script>'; //localization for validation plugin //print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/js/jquery.list.min.js"></script>'; print '<script type="text/javascript" src="includes/js/pertho.js"></script>'; print '<script type="text/javascript" src="includes/js/jquery.rwd-table.js"></script>'; // END THEME if (!defined('NOLOGIN')) { // Global js function print '<!-- Includes JS of Speedealing -->' . "\n"; print '<script type="text/javascript" src="core/js/lib_head.js"></script>' . "\n"; } // Add datepicker default options //print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/core/js/datepicker.js.php?lang=' . $langs->defaultlang . '"></script>' . "\n"; print'<!-- Foundation framework -->'; print '<link rel="stylesheet" href="theme/pertho_sample/foundation/stylesheets/foundation.css">'; print '<!-- jquery UI -->'; print '<link rel="stylesheet" href="theme/pertho_sample/lib/jQueryUI/css/Aristo/Aristo.css" media="all" />'; print '<!-- jQplot (charts) -->'; print '<link rel="stylesheet" href="theme/pertho_sample/lib/jQplot/jquery.jqplot.css" media="all" />'; print '<!-- fancybox -->'; print '<link rel="stylesheet" href="theme/pertho_sample/lib/fancybox/jquery.fancybox-1.3.4.css" media="all" />'; print '<!-- fullcalendar -->'; print '<link rel="stylesheet" href="theme/pertho_sample/lib/fullcalendar/fullcalendar.css" media="all" />'; print '<!-- tooltips -->'; print '<link rel="stylesheet" href="theme/pertho_sample/lib/qtip2/jquery.qtip.min.css" />'; print '<!-- chosen (select element extended) -->'; print '<link rel="stylesheet" href="theme/pertho_sample/lib/chosen/chosen.css" media="all" />'; print '<!-- datatables -->'; print '<link rel="stylesheet" href="theme/pertho_sample/lib/datatables/css/demo_table_jui.css" media="all" />'; print '<!-- main styles -->'; print '<link rel="stylesheet" href="theme/eldy/style.css" />'; print '<!-- Google fonts -->'; //print '<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet" />'; print '<style type="text/css" media="screen, print"> @font-face { font-family: "Open Sans Condensed"; font-style: normal; font-weight: 300; src: url("theme/pertho_sample/lib/google/OpenSans-CondensedLight.woff") format("woff"), url("http://themes.googleusercontent.com/static/fonts/opensanscondensed/v6/gk5FxslNkTTHtojXrkp-xF1YPouZEKgzpqZW9wN-3Ek.woff") format("woff"); } </style>'; print '<style type="text/css" media="screen, print"> @font-face { font-family: "Terminal Dosis"; font-style: normal; font-weight: 400; src: url("theme/pertho_sample/lib/google/Dosis-Regular.woff") format("woff"), url("http://themes.googleusercontent.com/static/fonts/terminaldosis/v5/_IcvjW_kWHsIHjjUsLbdpFGxLvFzKVP0OsRYGzgS_zk.woff") format("woff"); } </style>'; print '<!-- Favicons and the like (avoid using transparent .png) -->'; print '<link rel="apple-touch-icon-precomposed" href="icon.png" />'; print '<!--[if lt IE 9]>'; print '<link rel="stylesheet" href="foundation/stylesheets/ie.css">'; print '<script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>'; print '<script src="lib/jQplot/excanvas.min.js"></script>'; print '<![endif]-->'; // For new theme print '<script> $(document).ready(function() { prth_common.init(); }); </script>'; // Output module javascript if (is_array($arrayofjs)) { print '<!-- Includes JS specific to page -->' . "\n"; foreach ($arrayofjs as $jsfile) { if (preg_match('/^http/i', $jsfile)) { print '<script type="text/javascript" src="' . $jsfile . '"></script>' . "\n"; } else { if (!preg_match('/^\//', $jsfile)) $jsfile = '/' . $jsfile; // For backward compatibility print '<script type="text/javascript" src="' . dol_buildpath($jsfile, 1) . '"></script>' . "\n"; } } } if (!empty($head)) print $head . "\n"; if (!empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER . "\n"; ?> </head> <?php } $conf->headerdone = 1; // To tell header was output }
/** * Ouput html header of a page. * This code is also duplicated into security2.lib.php::dol_loginfunction * * @param string $head Optionnal head lines * @param string $title HTML title * @param int $disablejs More content into html header * @param int $disablehead More content into html header * @param array $arrayofjs Array of complementary js files * @param array $arrayofcss Array of complementary css files * @return void */ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') { global $user, $conf, $langs, $db; top_httphead(); if (empty($conf->css)) { $conf->css = '/theme/eldy/style.css.php'; } // If not defined, eldy by default if (empty($conf->global->MAIN_ACTIVATE_HTML5)) { $doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; } else { $doctype = '<!doctype html>'; // Html5 - Developement - Only available on Eldy template } print $doctype . "\n"; if (!empty($conf->global->MAIN_USE_CACHE_MANIFEST)) { print '<html lang="' . substr($langs->defaultlang, 0, 2) . '" manifest="' . DOL_URL_ROOT . '/cache.manifest">' . "\n"; } else { print '<html lang="' . substr($langs->defaultlang, 0, 2) . '">' . "\n"; } //print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">'."\n"; if (empty($disablehead)) { print "<head>\n"; if (GETPOST('dol_basehref')) { print '<base href="' . dol_escape_htmltag(GETPOST('dol_basehref')) . '">' . "\n"; } // Displays meta print '<meta name="robots" content="noindex,nofollow">' . "\n"; // Do not index print '<meta name="viewport" content="width=device-width, initial-scale=1">'; // Scale for mobile device print '<meta name="author" content="Dolibarr Development Team">' . "\n"; if (!empty($conf->global->MAIN_ACTIVATE_HTML5)) { print '<meta name="viewport" content="width=device-width, initial-scale=1.0">' . "\n"; } // Needed for Responsive Web Design $favicon = dol_buildpath('/theme/' . $conf->theme . '/img/favicon.ico', 1); if (!empty($conf->global->MAIN_FAVICON_URL)) { $favicon = $conf->global->MAIN_FAVICON_URL; } print '<link rel="shortcut icon" type="image/x-icon" href="' . $favicon . '"/>' . "\n"; if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { print '<link rel="top" title="' . $langs->trans("Home") . '" href="' . (DOL_URL_ROOT ? DOL_URL_ROOT : '/') . '">' . "\n"; } if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { print '<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1">' . "\n"; } if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { print '<link rel="author" title="Dolibarr Development Team" href="http://www.dolibarr.org">' . "\n"; } // Displays title $appli = 'Dolibarr'; if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { $appli = $conf->global->MAIN_APPLICATION_TITLE; } if ($title && !empty($conf->global->MAIN_HTML_TITLE) && preg_match('/noapp/', $conf->global->MAIN_HTML_TITLE)) { print '<title>' . dol_htmlentities($title) . '</title>'; } if ($title) { print '<title>' . dol_htmlentities($appli . ' - ' . $title) . '</title>'; } else { print "<title>" . dol_htmlentities($appli) . "</title>"; } print "\n"; $ext = ''; if (!empty($conf->dol_use_jmobile)) { $ext = 'version=' . urlencode(DOL_VERSION); } if (GETPOST('version')) { $ext = 'version=' . GETPOST('version', 'int'); } // usefull to force no cache on css/js if (!defined('DISABLE_JQUERY') && !$disablejs && $conf->use_javascript_ajax) { print '<!-- Includes CSS for JQuery (Ajax library) -->' . "\n"; $jquerytheme = 'smoothness'; if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) { $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; } if (constant('JS_JQUERY_UI')) { print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; } else { print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; } // JQuery print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/tiptip/tipTip.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // Tooltip print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // JNotify /*if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) || (defined('REQUIRE_JQUERY_FILEUPLOAD') && constant('REQUIRE_JQUERY_FILEUPLOAD'))) // jQuery fileupload { print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/css/jquery.fileupload-ui.css'.($ext?'?'.$ext:'').'">'."\n"; }*/ if (!empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES')) { //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/css/jquery.dataTables.css'.($ext?'?'.$ext:'').'">'."\n"; print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/datatables/media/css/jquery.dataTables.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/datatables/extensions/ColVis/css/dataTables.colVis.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/datatables/extensions/TableTools/css/dataTables.tableTools.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; } if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/' . $tmpplugin . '/' . $tmpplugin . '.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; } // jQuery Timepicker if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) { print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; } // jQuery jMobile if (!empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || !empty($conf->dol_use_jmobile)) { print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; } } print '<!-- Includes CSS for Dolibarr theme -->' . "\n"; // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' //$themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1); $themepath = dol_buildpath($conf->css, 1); $themesubdir = ''; if (!empty($conf->modules_parts['theme'])) { foreach ($conf->modules_parts['theme'] as $reldir) { if (file_exists(dol_buildpath($reldir . $conf->css, 0))) { $themepath = dol_buildpath($reldir . $conf->css, 1); $themesubdir = $reldir; break; } } } $themeparam = '?lang=' . $langs->defaultlang . '&theme=' . $conf->theme . (GETPOST('optioncss') ? '&optioncss=' . GETPOST('optioncss', 'alpha', 1) : '') . '&userid=' . $user->id . '&entity=' . $conf->entity; $themeparam .= $ext ? '&' . $ext : ''; if (!empty($_SESSION['dol_resetcache'])) { $themeparam .= '&dol_resetcache=' . $_SESSION['dol_resetcache']; } if (GETPOST('dol_hide_topmenu')) { $themeparam .= '&dol_hide_topmenu=' . GETPOST('dol_hide_topmenu', 'int'); } if (GETPOST('dol_hide_leftmenu')) { $themeparam .= '&dol_hide_leftmenu=' . GETPOST('dol_hide_leftmenu', 'int'); } if (GETPOST('dol_optimize_smallscreen')) { $themeparam .= '&dol_optimize_smallscreen=' . GETPOST('dol_optimize_smallscreen', 'int'); } if (GETPOST('dol_no_mouse_hover')) { $themeparam .= '&dol_no_mouse_hover=' . GETPOST('dol_no_mouse_hover', 'int'); } if (GETPOST('dol_use_jmobile')) { $themeparam .= '&dol_use_jmobile=' . GETPOST('dol_use_jmobile', 'int'); $conf->dol_use_jmobile = GETPOST('dol_use_jmobile', 'int'); } //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n"; if (!empty($conf->global->MAIN_FIX_FLASH_ON_CHROME)) { print '<!-- Includes CSS that does not exists as workaround of flash bug of chrome -->' . "\n" . '<link rel="stylesheet" type="text/css" href="filethatdoesnotexiststosolvechromeflashbug">' . "\n"; } // CSS forced by modules (relative url starting with /) if (!empty($conf->modules_parts['css'])) { $arraycss = (array) $conf->modules_parts['css']; foreach ($arraycss as $modcss => $filescss) { $filescss = (array) $filescss; // To be sure filecss is an array foreach ($filescss as $cssfile) { if (empty($cssfile)) { dol_syslog("Warning: module " . $modcss . " declared a css path file into its descriptor that is empty.", LOG_WARNING); } // cssfile is a relative path print '<!-- Includes CSS added by module ' . $modcss . ' -->' . "\n" . '<link rel="stylesheet" type="text/css" href="' . dol_buildpath($cssfile, 1); // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used. if (!preg_match('/\\.css$/i', $cssfile)) { print $themeparam; } print '">' . "\n"; } } } // CSS forced by page in top_htmlhead call (relative url starting with /) if (is_array($arrayofcss)) { foreach ($arrayofcss as $cssfile) { print '<!-- Includes CSS added by page -->' . "\n" . '<link rel="stylesheet" type="text/css" title="default" href="' . dol_buildpath($cssfile, 1); // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters and browser cache is not used. if (!preg_match('/\\.css$/i', $cssfile)) { print $themeparam; } print '">' . "\n"; } } // Output standard javascript links if (!defined('DISABLE_JQUERY') && !$disablejs && !empty($conf->use_javascript_ajax)) { // JQuery. Must be before other includes print '<!-- Includes JS for JQuery -->' . "\n"; if (constant('JS_JQUERY')) { print '<script type="text/javascript" src="' . JS_JQUERY . 'jquery.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } else { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } if (constant('JS_JQUERY_UI')) { print '<script type="text/javascript" src="' . JS_JQUERY_UI . 'jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } else { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/tablednd/jquery.tablednd.0.6.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/tiptip/jquery.tipTip.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; // jQuery Layout if (empty($conf->dol_use_jmobile) && !empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) || defined('REQUIRE_JQUERY_LAYOUT')) { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/layout/jquery.layout.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } // jQuery jnotify if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/jnotify/jquery.jnotify.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/core/js/jnotify.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } // jQuery blockUI if (!empty($conf->global->MAIN_USE_JQUERY_BLOCKUI) || defined('REQUIRE_JQUERY_BLOCKUI')) { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/blockUI/jquery.blockUI.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript">' . "\n"; print 'var indicatorBlockUI = \'' . DOL_URL_ROOT . "/theme/" . $conf->theme . "/img/working2.gif" . '\';' . "\n"; print '</script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/core/js/blockUI.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } // Flot if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT)) { if (constant('JS_JQUERY_FLOT')) { print '<script type="text/javascript" src="' . JS_JQUERY_FLOT . 'jquery.flot.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . JS_JQUERY_FLOT . 'jquery.flot.pie.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . JS_JQUERY_FLOT . 'jquery.flot.stack.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } else { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/flot/jquery.flot.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/flot/jquery.flot.pie.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/flot/jquery.flot.stack.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } } // jQuery jeditable if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/jeditable/jquery.jeditable.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript">' . "\n"; print 'var urlSaveInPlace = \'' . DOL_URL_ROOT . '/core/ajax/saveinplace.php\';' . "\n"; print 'var urlLoadInPlace = \'' . DOL_URL_ROOT . '/core/ajax/loadinplace.php\';' . "\n"; print 'var tooltipInPlace = \'' . $langs->transnoentities('ClickToEdit') . '\';' . "\n"; print 'var placeholderInPlace = \'' . $langs->trans('ClickToEdit') . '\';' . "\n"; print 'var cancelInPlace = \'' . $langs->trans('Cancel') . '\';' . "\n"; print 'var submitInPlace = \'' . $langs->trans('Ok') . '\';' . "\n"; print 'var indicatorInPlace = \'<img src="' . DOL_URL_ROOT . "/theme/" . $conf->theme . "/img/working.gif" . '">\';' . "\n"; print '</script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/core/js/editinplace.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } // jQuery File Upload /* if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) || (defined('REQUIRE_JQUERY_FILEUPLOAD') && constant('REQUIRE_JQUERY_FILEUPLOAD'))) { print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/template/tmpl.min'.$ext.'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.iframe-transport'.$ext.'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload'.$ext.'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-fp'.$ext.'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-ui'.$ext.'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-jui'.$ext.'"></script>'."\n"; print '<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->'."\n"; print '<!--[if gte IE 8]><script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/cors/jquery.xdr-transport'.$ext.'"></script><![endif]-->'."\n"; }*/ // jQuery DataTables if (!empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES')) { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/datatables/media/js/jquery.dataTables.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/datatables/extensions/ColVis/js/dataTables.colVis.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } // jQuery Timepicker if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/core/js/timepicker.js.php?lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; } if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/' . $tmpplugin . '/' . $tmpplugin . '.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } // jQuery jMobile if (!empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || !empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0) { // We must force not using ajax because cache of jquery does not load js of other pages. // This also increase seriously speed onto mobile device where complex js code is very slow and memory very low. // Note: dol_use_jmobile=1 use jmobile without ajax, dol_use_jmobile=2 use jmobile with ajax if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 2 && $conf->dol_use_jmobile != 3) { print '<script type="text/javascript"> $(document).bind("mobileinit", function(){ $.extend( $.mobile , { autoInitializePage : true, /* We need this to run jmobile */ /* loadingMessage : \'xxxxx\', */ touchOverflowEnabled : true, defaultPageTransition : \'none\', defaultDialogTransition : \'none\', ajaxEnabled : false /* old param was ajaxFormsEnabled and ajaxLinksEnabled */ }); }); </script>'; } if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } } } if (!$disablejs && !empty($conf->use_javascript_ajax)) { // CKEditor if (!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor')) { print '<!-- Includes JS for CKEditor -->' . "\n"; $pathckeditor = DOL_URL_ROOT . '/includes/ckeditor/'; $jsckeditor = 'ckeditor.js'; if (constant('JS_CKEDITOR')) { $pathckeditor = constant('JS_CKEDITOR'); } print '<script type="text/javascript">'; print 'var CKEDITOR_BASEPATH = \'' . $pathckeditor . '\';' . "\n"; print 'var ckeditorConfig = \'' . dol_buildpath($themesubdir . '/theme/' . $conf->theme . '/ckeditor/config.js', 1) . '\';' . "\n"; // $themesubdir='' in standard usage print 'var ckeditorFilebrowserBrowseUrl = \'' . DOL_URL_ROOT . '/core/filemanagerdol/browser/default/browser.php?Connector=' . DOL_URL_ROOT . '/core/filemanagerdol/connectors/php/connector.php\';' . "\n"; print 'var ckeditorFilebrowserImageBrowseUrl = \'' . DOL_URL_ROOT . '/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector=' . DOL_URL_ROOT . '/core/filemanagerdol/connectors/php/connector.php\';' . "\n"; print '</script>' . "\n"; print '<script type="text/javascript" src="' . $pathckeditor . $jsckeditor . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; } // Global js function print '<!-- Includes JS of Dolibarr -->' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/core/js/lib_head.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; // Add datepicker default options print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/core/js/datepicker.js.php?lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; // JS forced by modules (relative url starting with /) if (!empty($conf->modules_parts['js'])) { $arrayjs = (array) $conf->modules_parts['js']; foreach ($arrayjs as $modjs => $filesjs) { $filesjs = (array) $filesjs; // To be sure filejs is an array foreach ($filesjs as $jsfile) { // jsfile is a relative path print '<!-- Include JS added by module ' . $modjs . '-->' . "\n" . '<script type="text/javascript" src="' . dol_buildpath($jsfile, 1) . '"></script>' . "\n"; } } } // JS forced by page in top_htmlhead (relative url starting with /) if (is_array($arrayofjs)) { print '<!-- Includes JS added by page -->' . "\n"; foreach ($arrayofjs as $jsfile) { if (preg_match('/^http/i', $jsfile)) { print '<script type="text/javascript" src="' . $jsfile . '"></script>' . "\n"; } else { if (!preg_match('/^\\//', $jsfile)) { $jsfile = '/' . $jsfile; } // For backward compatibility print '<script type="text/javascript" src="' . dol_buildpath($jsfile, 1) . '"></script>' . "\n"; } } } } if (!empty($head)) { print $head . "\n"; } if (!empty($conf->global->MAIN_HTML_HEADER)) { print $conf->global->MAIN_HTML_HEADER . "\n"; } print "</head>\n\n"; } $conf->headerdone = 1; // To tell header was output }
/** * Show HTML header * @param head Optionnal head lines * @param title Web page title * @param disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax) * @param disablehead Do not output head section * @param arrayofjs Array of js files to add in header * @param arrayofcss Array of css files to add in header */ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') { global $user, $conf, $langs, $db; top_httphead(); if (empty($conf->css)) { $conf->css = '/theme/eldy/style.css.php'; } // If not defined, eldy by default print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; //print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">'; //print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; //print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; //print '<!DOCTYPE html>'; print "\n"; print "<html>\n"; //print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">'."\n"; if (empty($disablehead)) { print "<head>\n"; print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . $conf->file->character_set_client . "\">\n"; // Displays meta print '<meta name="robots" content="noindex,nofollow">' . "\n"; // Evite indexation par robots print '<meta name="author" content="Dolibarr Development Team">' . "\n"; print '<link rel="shortcut icon" type="image/x-icon" href="' . DOL_URL_ROOT . '/favicon.ico">' . "\n"; // Displays title $appli = 'Dolibarr'; if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { $appli = $conf->global->MAIN_APPLICATION_TITLE; } if ($title) { print '<title>' . $appli . ' - ' . $title . '</title>'; } else { print "<title>" . $appli . "</title>"; } print "\n"; if (!defined('DISABLE_JQUERY')) { print '<!-- Includes for JQuery (Ajax library) -->' . "\n"; $jquerytheme = 'smoothness'; if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) { $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; } print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui-latest.custom.css" />' . "\n"; // JQuery print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/tiptip/tipTip.css" />' . "\n"; // Tooltip print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css" />' . "\n"; // JNotify //print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/lightbox/css/jquery.lightbox-0.5.css" media="screen" />'."\n"; // Lightbox if (!empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)) { print '<link rel="stylesheet" href="' . DOL_URL_ROOT . '/includes/jquery/plugins/fileupload/jquery.fileupload-ui.css" type="text/css" />' . "\n"; } } print '<!-- Includes for Dolibarr, modules or specific pages-->' . "\n"; // Output style sheets (optioncss='print' or '') $themepath = dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR) ? '' : $conf->global->MAIN_FORCETHEMEDIR) . $conf->css, 1); //print 'themepath='.$themepath;exit; print '<link rel="stylesheet" type="text/css" title="default" href="' . $themepath . '?lang=' . $langs->defaultlang . '&theme=' . $conf->theme . (GETPOST('optioncss') ? '&optioncss=' . GETPOST('optioncss', 'alpha', 1) : '') . '">' . "\n"; // CSS forced by modules (relative url starting with /) if (is_array($conf->css_modules)) { foreach ($conf->css_modules as $cssfile) { // cssfile is an absolute path print '<link rel="stylesheet" type="text/css" title="default" href="' . dol_buildpath($cssfile, 1); // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters and browser cache is not used. if (!preg_match('/\\.css$/i', $cssfile)) { print '?lang=' . $langs->defaultlang . '&theme=' . $conf->theme . (GETPOST('optioncss') ? '&optioncss=' . GETPOST('optioncss', 'alpha', 1) : ''); } print '">' . "\n"; } } // CSS forced by page in top_htmlhead call (relative url starting with /) if (is_array($arrayofcss)) { foreach ($arrayofcss as $cssfile) { print '<link rel="stylesheet" type="text/css" title="default" href="' . dol_buildpath($cssfile, 1); // We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters and browser cache is not used. if (!preg_match('/\\.css$/i', $cssfile)) { print '?lang=' . $langs->defaultlang . '&theme=' . $conf->theme . (GETPOST('optioncss') ? '&optioncss=' . GETPOST('optioncss', 'alpha', 1) : ''); } print '">' . "\n"; } } if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { print '<link rel="top" title="' . $langs->trans("Home") . '" href="' . (DOL_URL_ROOT ? DOL_URL_ROOT : '/') . '">' . "\n"; } if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { print '<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1">' . "\n"; } if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { print '<link rel="author" title="Dolibarr Development Team" href="http://www.dolibarr.org">' . "\n"; } // Output standard javascript links if (!$disablejs && $conf->use_javascript_ajax) { // Other external js require_once DOL_DOCUMENT_ROOT . '/lib/ajax.lib.php'; $ext = '.js'; if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && $conf->global->MAIN_OPTIMIZE_SPEED & 0x1) { $ext = '.jgz'; } // mini='_mini', ext='.gz' // JQuery. Must be before other includes print '<!-- Includes JS for JQuery -->' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-latest.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui-latest.custom.min' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/tablednd/jquery.tablednd_0_5' . $ext . '"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/tiptip/jquery.tipTip.min' . $ext . '"></script>' . "\n"; //print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/lightbox/js/jquery.lightbox-0.5.min'.$ext.'"></script>'."\n"; // jQuery Layout if (!empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) || defined('REQUIRE_JQUERY_LAYOUT')) { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/layout/jquery.layout-latest' . $ext . '"></script>' . "\n"; } // jQuery jnotify if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY)) { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/jnotify/jquery.jnotify.min.js"></script>' . "\n"; } // Flot print '<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/flot/excanvas.min.js"></script><![endif]-->' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/flot/jquery.flot.min.js"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/flot/jquery.flot.pie.min.js"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/flot/jquery.flot.stack.min.js"></script>' . "\n"; // CKEditor if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_EDITORNAME) && $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') { print '<!-- Includes JS for CKEditor -->' . "\n"; print '<script type="text/javascript">var CKEDITOR_BASEPATH = \'' . DOL_URL_ROOT . '/includes/ckeditor/\';</script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/ckeditor/ckeditor_basic.js"></script>' . "\n"; } // File Upload if (!empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)) { print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/fileupload/jquery.tmpl.min.js"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/fileupload/jquery.iframe-transport.js"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/fileupload/jquery.fileupload.js"></script>' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/includes/jquery/plugins/fileupload/jquery.fileupload-ui.js"></script>' . "\n"; } // Global js function print '<!-- Includes JS of Dolibarr -->' . "\n"; print '<script type="text/javascript" src="' . DOL_URL_ROOT . '/lib/lib_head.js"></script>' . "\n"; } // Output module javascript if (is_array($arrayofjs)) { print '<!-- Includes JS specific to page -->' . "\n"; foreach ($arrayofjs as $jsfile) { if (preg_match('/^http/i', $jsfile)) { print '<script type="text/javascript" src="' . $jsfile . '"></script>' . "\n"; } else { if (!preg_match('/^\\//', $jsfile)) { $jsfile = '/' . $jsfile; } // For backward compatibility print '<script type="text/javascript" src="' . dol_buildpath($jsfile, 1) . '"></script>' . "\n"; } } } // Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) print '<script type="text/javascript">' . "\n"; $tradMonths = array($langs->trans("January"), $langs->trans("February"), $langs->trans("March"), $langs->trans("April"), $langs->trans("May"), $langs->trans("June"), $langs->trans("July"), $langs->trans("August"), $langs->trans("September"), $langs->trans("October"), $langs->trans("November"), $langs->trans("December")); print 'var tradMonths = ' . json_encode($tradMonths) . ';' . "\n"; // Define tradMonthsMin javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) $tradMonthsMin = array($langs->trans("JanuaryMin"), $langs->trans("FebruaryMin"), $langs->trans("MarchMin"), $langs->trans("AprilMin"), $langs->trans("MayMin"), $langs->trans("JuneMin"), $langs->trans("JulyMin"), $langs->trans("AugustMin"), $langs->trans("SeptemberMin"), $langs->trans("OctoberMin"), $langs->trans("NovemberMin"), $langs->trans("DecemberMin")); print 'var tradMonthsMin = ' . json_encode($tradMonthsMin) . ';' . "\n"; // Define tradDays javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) $tradDays = array($langs->trans("Monday"), $langs->trans("Tuesday"), $langs->trans("Wednesday"), $langs->trans("Thursday"), $langs->trans("Friday"), $langs->trans("Saturday"), $langs->trans("Sunday")); print 'var tradDays = ' . json_encode($tradDays) . ';' . "\n"; // Define tradDaysMin javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) $tradDaysMin = array($langs->trans("MondayMin"), $langs->trans("TuesdayMin"), $langs->trans("WednesdayMin"), $langs->trans("ThursdayMin"), $langs->trans("FridayMin"), $langs->trans("SaturdayMin"), $langs->trans("SundayMin")); print 'var tradDaysMin = ' . json_encode($tradDaysMin) . ';' . "\n"; print '</script>' . "\n"; if (!empty($head)) { print $head . "\n"; } if (!empty($conf->global->MAIN_HTML_HEADER)) { print $conf->global->MAIN_HTML_HEADER . "\n"; } print "</head>\n\n"; } $conf->headerdone = 1; // To tell header was output }