31if (!defined(
'NOCSRFCHECK')) {
32 define(
'NOCSRFCHECK', 1);
34if (!defined(
'NOTOKENRENEWAL')) {
35 define(
'NOTOKENRENEWAL', 1);
37if (!defined(
'NOREQUIREMENU')) {
38 define(
'NOREQUIREMENU', 1);
42require_once
'../main.inc.php';
52 $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
55$langs->loadLangs(array(
"bookmarks"));
57$right = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'left' :
'right');
58$left = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'right' :
'left');
67 header(
'Cache-Control: max-age='.
GETPOSTINT(
'cache').
', public');
69 header(
'Expires: '.gmdate(
'D, d M Y H:i:s',
dol_now(
'gmt') +
GETPOSTINT(
'cache')).
' GMT');
71 header(
'Pragma: token=public');
74 header(
'Cache-Control: no-cache');
77$title = $langs->trans(
"Bookmarks");
80$head =
'<!-- Bookmarks -->'.
"\n";
83top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
92$hookmanager->initHooks(array(
'bookmarks'));
100 $langs->load(
"admin");
101 $bookmarkList .=
'<br><span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Bookmarks")).
'</span>';
102 $bookmarkList .=
'<br><br>';
105 $sql =
"SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX.
"bookmark";
106 $sql .=
" WHERE (fk_user = ".((int) $user->id).
" OR fk_user is NULL OR fk_user = 0)";
107 $sql .=
" AND entity IN (".getEntity(
'bookmarks').
")";
108 $sql .=
" ORDER BY position";
109 if ($resql = $db->query($sql)) {
110 $bookmarkList =
'<div id="dropdown-bookmarks-list" class="start">';
112 while ((!
getDolGlobalString(
'BOOKMARKS_SHOW_IN_MENU') || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
113 $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).
'" >';
115 $bookmarkList .=
'</a>';
119 $langs->load(
"other");
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" >';
141 dol_print_error($db);
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";
dol_now($mode='gmt')
Return date for now.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.