Fix: compatibility with ecm layout

This commit is contained in:
Regis Houssin 2010-11-02 09:10:43 +00:00
parent baed7507fa
commit aa4b890bfd
2 changed files with 38 additions and 31 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008-2010 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -25,6 +25,8 @@
* \author Laurent Destailleur
*/
if (! defined('REQUIRE_JQUERY_LAYOUT')) define('REQUIRE_JQUERY_LAYOUT','1');
require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php");
@ -290,10 +292,11 @@ if (GETPOST("action") == 'refreshmanual')
/*******************************************************************
* View
********************************************************************/
/*
$morejs=array(
"/includes/jquery/plugins/layout/jquery.layout-latest.js"
);
*/
$morehead="<style type=\"text/css\">
html, body {
width: 100%;
@ -343,7 +346,7 @@ html, body {
});
</SCRIPT>";
llxHeader($morehead,$langs->trans("ECM"),'','','','',$morejs,'',0,0);
llxHeader($morehead,$langs->trans("ECM"),'','','','','','',0,0);
// Ajout rubriques automatiques
$rowspan=0;

View File

@ -863,8 +863,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui-1.8.5.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/tooltip/jquery.tooltip.min'.$ext.'"></script>'."\n";
if ($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)
if ($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";
}
@ -942,9 +942,9 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
// For backward compatibility with old modules
if (empty($conf->headerdone)) top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print '<body id="mainbody">';
if ($conf->use_javascript_ajax)
{
if ($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)
@ -997,7 +997,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
}
</script>';
}
if ($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION)
{
print "\n".'<script type="text/javascript">
@ -1046,8 +1046,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
}
print "\n".'<!-- Start top horizontal menu '.$top_menu.' -->'."\n";
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '<div class="ui-layout-north"> <!-- Begin top layout -->'."\n";
print '<div class="ui-layout-north"> <!-- Begin top layout -->'."\n";
print '<div id="tmenu_tooltip" class="tmenu">'."\n";
@ -1141,9 +1141,13 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
}
print "\n</div>\n<!-- End top horizontal menu -->\n";
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print "</div><!-- End top layout -->\n";
else print '<table width="100%" class="notopnoleftnoright" summary="leftmenutable" id="undertopmenu"><tr>';
print "</div><!-- End top layout -->\n";
if (! $conf->use_javascript_ajax || ! $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)
{
print '<table width="100%" class="notopnoleftnoright" summary="leftmenutable" id="undertopmenu"><tr>';
}
}
@ -1164,9 +1168,10 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
$bookmarks='';
// print '<div class="vmenuplusfiche">'."\n";
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print "\n".'<div class="ui-layout-west"> <!-- Begin left layout -->'."\n";
else print '<td class="vmenu" valign="top">';
print "\n".'<div class="ui-layout-west"> <!-- Begin left layout -->'."\n";
if (! $conf->use_javascript_ajax || ! $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '<td class="vmenu" valign="top">';
print "\n";
@ -1226,7 +1231,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
// Left column
print '<!-- Begin left vertical menu '.$left_menu.' -->'."\n";
print '<div class="vmenu">'."\n";
$menuleft=new MenuLeft($db,$menu_array_before,$menu_array_after);
@ -1310,9 +1315,10 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
print "<!-- End left vertical menu -->\n";
print "\n";
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '</div> <!-- End left layout -->'."\n";
else print '</td>';
if (! $conf->use_javascript_ajax || ! $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '</td>';
print '</div> <!-- End left layout -->'."\n";
print '<!-- End of left column, begin right area -->'."\n";
// print '</div>'."\n";
@ -1325,16 +1331,15 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
function main_area()
{
global $conf, $langs;
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)
{
print '<div id="mainContent"><div class="ui-layout-center"> <!-- begin main layout -->'."\n";
print '<table width="100%" class="notopnoleftnoright" summary="leftmenutable" id="undertopmenu"><tr><td valign="top">'."\n";
}
else print '<td valign="top">'."\n";
print '<div id="mainContent"><div class="ui-layout-center"> <!-- begin main layout -->'."\n";
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '<table width="100%" class="notopnoleftnoright" summary="leftmenutable" id="undertopmenu"><tr>';
print '<td valign="top">'."\n";
print "\n";
print '<div class="fiche"> <!-- begin main area -->'."\n";
if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode",$conf->global->MAIN_ONLY_LOGIN_ALLOWED));
@ -1491,8 +1496,7 @@ if (! function_exists("llxFooter"))
// print "\n".'</div> <!-- end div class="vmenuplusfiche" -->'."\n";
print "\n".'</td></tr></table> <!-- end right area -->'."\n";
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '</div></div> <!-- end main layout -->'."\n";
print '</div></div> <!-- end main layout -->'."\n";
if (! empty($_SERVER['DOL_TUNING']))
{