31if (!defined(
'NOCSRFCHECK')) {
32 define(
'NOCSRFCHECK', 1);
34if (!defined(
'NOTOKENRENEWAL')) {
35 define(
'NOTOKENRENEWAL', 1);
38if (!defined(
'NOREQUIREMENU')) {
39 define(
'NOREQUIREMENU', 1);
43require_once
'../main.inc.php';
53 $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
56$langs->loadLangs(array(
"bookmarks"));
58$right = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'left' :
'right');
59$left = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'right' :
'left');
67if (empty($dolibarr_nocache) &&
GETPOSTINT(
'cache')) {
68 header(
'Cache-Control: max-age='.
GETPOSTINT(
'cache').
', public');
70 header(
'Expires: '.gmdate(
'D, d M Y H:i:s',
dol_now(
'gmt') +
GETPOSTINT(
'cache')).
' GMT');
72 header(
'Pragma: token=public');
75 header(
'Cache-Control: no-cache');
78$title = $langs->trans(
"Bookmarks");
81$head =
'<!-- Bookmarks -->'.
"\n";
84top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
93$hookmanager->initHooks(array(
'bookmarks'));
100if (!isModEnabled(
'bookmark')) {
101 $langs->load(
"admin");
102 $bookmarkList .=
'<br><span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Bookmarks")).
'</span>';
103 $bookmarkList .=
'<br><br>';
106 $sql =
"SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX.
"bookmark";
107 $sql .=
" WHERE (fk_user = ".((int) $user->id).
" OR fk_user is NULL OR fk_user = 0)";
108 $sql .=
" AND entity IN (".getEntity(
'bookmarks').
")";
109 $sql .=
" ORDER BY position";
110 if ($resql = $db->query($sql)) {
111 $bookmarkList =
'<div id="dropdown-bookmarks-list" class="start">';
113 while ((!
getDolGlobalString(
'BOOKMARKS_SHOW_IN_MENU') || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
114 $bookmarkList .=
'<a class="dropdown-item bookmark-item'.(strpos($obj->url,
'http') === 0 ?
' bookmark-item-external' :
'').
'" id="bookmark-item-'.$obj->rowid.
'" data-id="'.$obj->rowid.
'" '.($obj->target == 1 ?
' target="_blank" rel="noopener noreferrer"' :
'').
' href="'.
dol_escape_htmltag($obj->url).
'" >';
116 $bookmarkList .=
'</a>';
120 $bookmarkList .=
'<br><div class="opacitymedium center">'.$langs->trans(
"NoBookmarks").
'</div>';
121 $bookmarkList .=
'<br><br>';
125 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.
'/bookmarks/list.php'),
'', $user->hasRight(
'bookmark',
'creer'));
128 $bookmarkList .=
'<br>';
129 $bookmarkList .=
'<a class="top-menu-dropdown-link" title="'.$langs->trans(
'EditBookmarks').
'" href="'.DOL_URL_ROOT.
'/bookmarks/list.php" >';
130 $bookmarkList .=
img_picto(
'',
'bookmark',
'class="paddingright"').$langs->trans(
'EditBookmarks').
'</a>';
131 $bookmarkList .=
'<br>';
132 $bookmarkList .=
'<br>';
134 $bookmarkList .=
'<center>'.$newcardbutton.
'</center>';
136 $bookmarkList .=
'</div>';
139 $searchForm .=
'<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans(
'Bookmarks').
'" autocomplete="off" >';
146$parameters = array(
'bookmarks'=>$bookmarkList);
147$reshook = $hookmanager->executeHooks(
'printBookmarks', $parameters);
148if (empty($reshook)) {
149 $bookmarkList .= $hookmanager->resPrint;
151 $bookmarkList = $hookmanager->resPrint;
156print
"<!-- Begin Bookmarks list -->\n";
157print
'<div class="center"><div class="center" style="padding: 30px;">';
158print
'<style>.menu_titre { padding-top: 7px; }</style>';
159print
'<div id="blockvmenusearch" class="tagtable center searchpage">'.
"\n";
163print
"\n<!-- End SearchForm -->\n";
166print
'</body></html>'.
"\n";
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_now($mode='auto')
Return date for now.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.