clean top menu xxx
This commit is contained in:
parent
eb525769be
commit
acef3fb169
@ -24,16 +24,11 @@
|
|||||||
/**
|
/**
|
||||||
* Add area with bookmarks in menu
|
* Add area with bookmarks in menu
|
||||||
*
|
*
|
||||||
* @param DoliDb $aDb Database handler
|
|
||||||
* @param Translate $aLangs Object lang
|
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function printBookmarksList($aDb, $aLangs)
|
function printBookmarksList()
|
||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user, $db, $langs;
|
||||||
|
|
||||||
$db = $aDb;
|
|
||||||
$langs = $aLangs;
|
|
||||||
|
|
||||||
$ret = '<div class="menu_top"></div>'."\n";
|
$ret = '<div class="menu_top"></div>'."\n";
|
||||||
|
|
||||||
@ -155,16 +150,11 @@ function printBookmarksList($aDb, $aLangs)
|
|||||||
/**
|
/**
|
||||||
* Add area with bookmarks in top menu
|
* Add area with bookmarks in top menu
|
||||||
*
|
*
|
||||||
* @param DoliDb $aDb Database handler
|
|
||||||
* @param Translate $aLangs Object lang
|
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function printDropdownBookmarksList($aDb, $aLangs)
|
function printDropdownBookmarksList()
|
||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user, $db, $langs;
|
||||||
|
|
||||||
$db = $aDb;
|
|
||||||
$langs = $aLangs;
|
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
||||||
if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5;
|
if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5;
|
||||||
@ -271,7 +261,7 @@ function printDropdownBookmarksList($aDb, $aLangs)
|
|||||||
|
|
||||||
var filter = $(this).val(), count = 0;
|
var filter = $(this).val(), count = 0;
|
||||||
$("#dropdown-bookmarks-list .bookmark-item").each(function () {
|
$("#dropdown-bookmarks-list .bookmark-item").each(function () {
|
||||||
|
|
||||||
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
|
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
|
||||||
$(this).addClass("hidden-search-result");
|
$(this).addClass("hidden-search-result");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1625,16 +1625,16 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||||||
|
|
||||||
if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)){
|
if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)){
|
||||||
// Add search dropdown
|
// Add search dropdown
|
||||||
$toprightmenu.= top_menu_search($user, $langs);
|
$toprightmenu.= top_menu_search();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN)) {
|
if (!empty($conf->global->MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN)) {
|
||||||
// Add bookmark dropdown
|
// Add bookmark dropdown
|
||||||
$toprightmenu .= top_menu_bookmark($user, $langs);
|
$toprightmenu .= top_menu_bookmark();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add user dropdown
|
// Add user dropdown
|
||||||
$toprightmenu.= top_menu_user($user, $langs);
|
$toprightmenu.= top_menu_user();
|
||||||
|
|
||||||
$toprightmenu.='</div></div>';
|
$toprightmenu.='</div></div>';
|
||||||
|
|
||||||
@ -1747,11 +1747,9 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||||||
/**
|
/**
|
||||||
* Build the tooltip on user login
|
* Build the tooltip on user login
|
||||||
*
|
*
|
||||||
* @param user $user User object
|
|
||||||
* @param Translate $langs Language object
|
|
||||||
* @return string HTML content
|
* @return string HTML content
|
||||||
*/
|
*/
|
||||||
function top_menu_user(User $user, Translate $langs)
|
function top_menu_user()
|
||||||
{
|
{
|
||||||
global $langs, $conf, $db, $hookmanager, $user;
|
global $langs, $conf, $db, $hookmanager, $user;
|
||||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||||
@ -1916,15 +1914,13 @@ function top_menu_user(User $user, Translate $langs)
|
|||||||
/**
|
/**
|
||||||
* Build the tooltip on top menu bookmark
|
* Build the tooltip on top menu bookmark
|
||||||
*
|
*
|
||||||
* @param user $user User object
|
|
||||||
* @param Translate $langs Language object
|
|
||||||
* @return string HTML content
|
* @return string HTML content
|
||||||
*/
|
*/
|
||||||
function top_menu_bookmark(User $user, Translate $langs)
|
function top_menu_bookmark()
|
||||||
{
|
{
|
||||||
global $langs, $conf, $db, $hookmanager, $user;
|
global $langs, $conf, $db, $user;
|
||||||
global $menumanager;
|
|
||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
// Define $bookmarks
|
// Define $bookmarks
|
||||||
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
|
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
|
||||||
@ -1938,7 +1934,7 @@ function top_menu_bookmark(User $user, Translate $langs)
|
|||||||
<i class="fa fa-star" ></i>
|
<i class="fa fa-star" ></i>
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
'.printDropdownBookmarksList($db, $langs).'
|
'.printDropdownBookmarksList().'
|
||||||
</div>
|
</div>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
@ -1984,15 +1980,13 @@ function top_menu_bookmark(User $user, Translate $langs)
|
|||||||
/**
|
/**
|
||||||
* Build the tooltip on top menu tsearch
|
* Build the tooltip on top menu tsearch
|
||||||
*
|
*
|
||||||
* @param user $user User object
|
|
||||||
* @param Translate $langs Language object
|
|
||||||
* @return string HTML content
|
* @return string HTML content
|
||||||
*/
|
*/
|
||||||
function top_menu_search(User $user, Translate $langs)
|
function top_menu_search()
|
||||||
{
|
{
|
||||||
global $langs, $conf, $db, $hookmanager, $user;
|
global $langs, $conf, $db, $user;
|
||||||
global $menumanager;
|
|
||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
$usedbyinclude=1;
|
$usedbyinclude=1;
|
||||||
$arrayresult=null;
|
$arrayresult=null;
|
||||||
@ -2003,7 +1997,7 @@ function top_menu_search(User $user, Translate $langs)
|
|||||||
// Menu with all bookmarks
|
// Menu with all bookmarks
|
||||||
foreach ($arrayresult as $keyItem => $item)
|
foreach ($arrayresult as $keyItem => $item)
|
||||||
{
|
{
|
||||||
if(empty($defaultAction)){
|
if (empty($defaultAction)) {
|
||||||
$defaultAction= $item['url'];
|
$defaultAction= $item['url'];
|
||||||
}
|
}
|
||||||
$buttonList.='<button class="dropdown-item global-search-item" data-target="'.dol_escape_htmltag($item['url']).'" >';
|
$buttonList.='<button class="dropdown-item global-search-item" data-target="'.dol_escape_htmltag($item['url']).'" >';
|
||||||
@ -2187,7 +2181,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php';
|
||||||
$langs->load("bookmarks");
|
$langs->load("bookmarks");
|
||||||
|
|
||||||
$bookmarks=printBookmarksList($db, $langs);
|
$bookmarks=printBookmarksList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Left column
|
// Left column
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user