30if (!defined(
'NOCSRFCHECK')) {
31 define(
'NOCSRFCHECK', 1);
33if (!defined(
'NOTOKENRENEWAL')) {
34 define(
'NOTOKENRENEWAL', 1);
37if (!defined(
'NOREQUIREMENU')) {
38 define(
'NOREQUIREMENU', 1);
42require_once
'../main.inc.php';
45 $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
48$langs->loadLangs(array(
"bookmarks"));
50$right = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'left' :
'right');
51$left = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'right' :
'left');
59if (empty($dolibarr_nocache) &&
GETPOSTINT(
'cache')) {
60 header(
'Cache-Control: max-age='.
GETPOSTINT(
'cache').
', public');
62 header(
'Expires: '.gmdate(
'D, d M Y H:i:s',
dol_now(
'gmt') +
GETPOSTINT(
'cache')).
' GMT');
64 header(
'Pragma: token=public');
67 header(
'Cache-Control: no-cache');
70$title = $langs->trans(
"Bookmarks");
73$head =
'<!-- Bookmarks -->'.
"\n";
76top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
85$hookmanager->initHooks(array(
'bookmarks'));
92if (empty($conf->bookmark->enabled)) {
93 $langs->load(
"admin");
94 $bookmarkList .=
'<br><span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Bookmarks")).
'</span>';
95 $bookmarkList .=
'<br><br>';
98 $sql =
"SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX.
"bookmark";
99 $sql .=
" WHERE (fk_user = ".((int) $user->id).
" OR fk_user is NULL OR fk_user = 0)";
100 $sql .=
" AND entity IN (".getEntity(
'bookmarks').
")";
101 $sql .=
" ORDER BY position";
102 if ($resql = $db->query($sql)) {
103 $bookmarkList =
'<div id="dropdown-bookmarks-list" class="start">';
105 while ((!
getDolGlobalString(
'BOOKMARKS_SHOW_IN_MENU') || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
106 $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).
'" >';
108 $bookmarkList .=
'</a>';
112 $bookmarkList .=
'<br><div class="opacitymedium center">'.$langs->trans(
"NoBookmarks").
'</div>';
113 $bookmarkList .=
'<br><br>';
117 $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'));
120 $bookmarkList .=
'<br>';
121 $bookmarkList .=
'<a class="top-menu-dropdown-link" title="'.$langs->trans(
'EditBookmarks').
'" href="'.DOL_URL_ROOT.
'/bookmarks/list.php" >';
122 $bookmarkList .=
img_picto(
'',
'bookmark',
'class="paddingright"').$langs->trans(
'EditBookmarks').
'</a>';
123 $bookmarkList .=
'<br>';
124 $bookmarkList .=
'<br>';
126 $bookmarkList .=
'<center>'.$newcardbutton.
'</center>';
128 $bookmarkList .=
'</div>';
131 $searchForm .=
'<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans(
'Bookmarks').
'" autocomplete="off" >';
138$parameters = array(
'bookmarks'=>$bookmarkList);
139$reshook = $hookmanager->executeHooks(
'printBookmarks', $parameters);
140if (empty($reshook)) {
141 $bookmarkList .= $hookmanager->resPrint;
143 $bookmarkList = $hookmanager->resPrint;
148print
"<!-- Begin Bookmarks list -->\n";
149print
'<div class="center"><div class="center" style="padding: 30px;">';
150print
'<style>.menu_titre { padding-top: 7px; }</style>';
151print
'<div id="blockvmenusearch" class="tagtable center searchpage">'.
"\n";
155print
"\n<!-- End SearchForm -->\n";
158print
'</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 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.