New: Prepare to code to support jmobile.
This commit is contained in:
parent
aba9fd8fc5
commit
c8bc0a1ec9
@ -104,7 +104,6 @@ clean:
|
|||||||
rm -fr htdocs/includes/jquery/plugins/flot
|
rm -fr htdocs/includes/jquery/plugins/flot
|
||||||
rm -fr htdocs/includes/jquery/plugins/jstree
|
rm -fr htdocs/includes/jquery/plugins/jstree
|
||||||
rm -fr htdocs/includes/jquery/plugins/lightbox
|
rm -fr htdocs/includes/jquery/plugins/lightbox
|
||||||
rm -fr htdocs/includes/jquery/plugins/mobile
|
|
||||||
rm -fr htdocs/includes/jquery/plugins/multiselect
|
rm -fr htdocs/includes/jquery/plugins/multiselect
|
||||||
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF
|
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF
|
||||||
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip
|
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip
|
||||||
|
|||||||
@ -50,7 +50,7 @@ $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// URL http://mydolibarr/core/getmenu_jmobime?mainmenu=mainmenu&leftmenu=leftmenu can be used for tests
|
// URL http://mydolibarr/core/getmenu_jmobile?mainmenu=mainmenu&leftmenu=leftmenu can be used for tests
|
||||||
$arrayofjs=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js');
|
$arrayofjs=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js');
|
||||||
$arrayofcss=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css');
|
$arrayofcss=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css');
|
||||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||||
|
|||||||
@ -647,9 +647,6 @@ if (! defined('NOLOGIN'))
|
|||||||
$conf->css = "/theme/".$conf->theme."/style.css.php";
|
$conf->css = "/theme/".$conf->theme."/style.css.php";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If theme support option like flip-hide left menu and we use a smartphone, we force it
|
|
||||||
if (! empty($conf->global->MAIN_SMARTPHONE_OPTIM) && $conf->browser->phone && $conf->theme == 'eldy') $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT='forced';
|
|
||||||
|
|
||||||
// Set javascript option
|
// Set javascript option
|
||||||
if (! GETPOST('nojs')) // If javascript was not disabled on URL
|
if (! GETPOST('nojs')) // If javascript was not disabled on URL
|
||||||
{
|
{
|
||||||
@ -949,6 +946,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
{
|
{
|
||||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.css" />'."\n";
|
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.css" />'."\n";
|
||||||
}
|
}
|
||||||
|
// jQuery jMobile
|
||||||
|
if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('jmobile'))
|
||||||
|
{
|
||||||
|
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css" />'."\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<!-- Includes CSS for Dolibarr theme -->'."\n";
|
print '<!-- Includes CSS for Dolibarr theme -->'."\n";
|
||||||
@ -969,7 +971,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
}
|
}
|
||||||
$themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'').'&userid='.$user->id.'&entity='.$conf->entity;
|
$themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'').'&userid='.$user->id.'&entity='.$conf->entity;
|
||||||
if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache'];
|
if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache'];
|
||||||
//print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
|
if (GETPOST('dol_hide_topmenu')) $themeparam.='&dol_hide_topmenu=1';
|
||||||
|
if (GETPOST('dol_hide_leftmenu')) $themeparam.='&dol_hide_leftmenu=1';
|
||||||
|
//print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
|
||||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.$themeparam.'">'."\n";
|
print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.$themeparam.'">'."\n";
|
||||||
|
|
||||||
// CSS forced by modules (relative url starting with /)
|
// CSS forced by modules (relative url starting with /)
|
||||||
@ -1005,11 +1009,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
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="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";
|
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="author" title="Dolibarr Development Team" href="http://www.dolibarr.org">'."\n";
|
||||||
|
|
||||||
// Output standard javascript links
|
$ext='.js';
|
||||||
if (! $disablejs && ! empty($conf->use_javascript_ajax))
|
|
||||||
{
|
|
||||||
$ext='.js';
|
|
||||||
|
|
||||||
|
// Output standard javascript links
|
||||||
|
if (! defined('DISABLE_JQUERY') && ! $disablejs && ! empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
// JQuery. Must be before other includes
|
// JQuery. Must be before other includes
|
||||||
print '<!-- Includes JS for JQuery -->'."\n";
|
print '<!-- Includes JS for JQuery -->'."\n";
|
||||||
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min'.$ext.'"></script>'."\n";
|
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min'.$ext.'"></script>'."\n";
|
||||||
@ -1101,6 +1105,21 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
{
|
{
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/js/ui.multiselect.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/js/ui.multiselect.js"></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"></script>'."\n";
|
||||||
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/timepicker.js.php?lang='.$langs->defaultlang.'"></script>'."\n";
|
||||||
|
}
|
||||||
|
// jQuery jMobile
|
||||||
|
if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('jmobile'))
|
||||||
|
{
|
||||||
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js"></script>'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $disablejs && ! empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
// CKEditor
|
// CKEditor
|
||||||
if (! empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor'))
|
if (! empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor'))
|
||||||
{
|
{
|
||||||
@ -1115,11 +1134,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.$pathckeditor.'ckeditor_basic.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.$pathckeditor.'ckeditor_basic.js"></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"></script>'."\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Global js function
|
// Global js function
|
||||||
print '<!-- Includes JS of Dolibarr -->'."\n";
|
print '<!-- Includes JS of Dolibarr -->'."\n";
|
||||||
@ -1128,12 +1142,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
// Add datepicker default options
|
// Add datepicker default options
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/datepicker.js.php?lang='.$langs->defaultlang.'"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/datepicker.js.php?lang='.$langs->defaultlang.'"></script>'."\n";
|
||||||
|
|
||||||
// add timepicker default options
|
|
||||||
if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER'))
|
|
||||||
{
|
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/timepicker.js.php?lang='.$langs->defaultlang.'"></script>'."\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// JS forced by modules (relative url starting with /)
|
// JS forced by modules (relative url starting with /)
|
||||||
if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2'))
|
if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2'))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -356,7 +356,7 @@ td.showDragHandle {
|
|||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|
||||||
div.fiche {
|
div.fiche {
|
||||||
margin-<?php print $left; ?>: <?php print (GETPOST("optioncss") == 'print'?6:((empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?((empty($_SESSION['dol_hide_leftmenu']) && ! GETPOST('dol_hide_leftmenu')) ?'20':'4'):'24')); ?>px;
|
margin-<?php print $left; ?>: <?php print (GETPOST("optioncss") == 'print'?6:((empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?((empty($_SESSION['dol_hide_leftmenu']) && ! GETPOST('dol_hide_leftmenu'))?'20':'4'):'24')); ?>px;
|
||||||
margin-<?php print $right; ?>: <?php print (GETPOST("optioncss") == 'print'?8:(empty($conf->browser->phone)?'12':'6')); ?>px;
|
margin-<?php print $right; ?>: <?php print (GETPOST("optioncss") == 'print'?8:(empty($conf->browser->phone)?'12':'6')); ?>px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user