62 global $user, $langs,
$conf;
63 $langs->load(
"boxes");
67 $this->info_box_head = array(
68 'text' => $langs->trans(
"BoxMyLastBookmarks", $max),
69 'sublink' => DOL_URL_ROOT.
'/bookmarks/list.php',
71 if ($user->hasRight(
"bookmark",
"creer")) {
72 $this->info_box_head[
'subpicto'] =
'bookmark';
73 $this->info_box_head[
'subtext'] = $langs->trans(
"BookmarksManagement");
75 $this->info_box_head[
'subpicto'] =
'bookmark';
76 $this->info_box_head[
'subtext'] = $langs->trans(
"ListOfBookmark");
79 if ($user->hasRight(
'bookmark',
'lire')) {
80 $sql =
"SELECT b.title, b.url, b.target, b.favicon";
81 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bookmark as b";
82 $sql .=
" WHERE fk_user = ".((int) $user->id);
83 $sql .=
" AND b.entity = ".$conf->entity;
84 $sql .= $this->db->order(
"position",
"ASC");
85 $sql .= $this->db->plimit($max, 0);
87 $result = $this->db->query($sql);
89 $num = $this->db->num_rows($result);
93 while ($line < $num) {
94 $objp = $this->db->fetch_object($result);
96 $this->info_box_contents[$line][0] = array(
97 'td' =>
'class="left" width="16"',
98 'logo' => $this->boximg,
100 'tooltip' => $objp->title,
101 'target' => $objp->target ?
'newtab' :
'',
103 $this->info_box_contents[$line][1] = array(
105 'text' => $objp->title,
107 'tooltip' => $objp->title,
108 'target' => $objp->target ?
'newtab' :
'',
126 $this->db->free($result);
128 $this->info_box_contents[0][0] = array(
131 'text' => ($this->db->error().
' sql='.$sql),
135 $this->info_box_contents[0][0] = array(
136 'td' =>
'class="nohover left"',
137 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>'