Enhancement in bookmark module
This commit is contained in:
parent
6254a6a217
commit
69d6ce7467
@ -43,12 +43,9 @@ function printBookmarksList ($aDb, $aLangs)
|
|||||||
$ret.= '<div class="menu_titre">';
|
$ret.= '<div class="menu_titre">';
|
||||||
$ret.= '<table class="nobordernopadding" width="100%"><tr class="no"><td>';
|
$ret.= '<table class="nobordernopadding" width="100%"><tr class="no"><td>';
|
||||||
$ret.= '<a class="vmenu" href="'.DOL_URL_ROOT.'/bookmarks/liste.php">'.$langs->trans('Bookm').'</a>';
|
$ret.= '<a class="vmenu" href="'.DOL_URL_ROOT.'/bookmarks/liste.php">'.$langs->trans('Bookm').'</a>';
|
||||||
// $ret.='</div>';
|
|
||||||
// Menu New bookmark
|
|
||||||
// $ret.= '<div class="menu_contenu">';
|
|
||||||
$ret.= '</td><td align="right">';
|
$ret.= '</td><td align="right">';
|
||||||
$ret.= '<a class="vsmenu" href="'.DOL_URL_ROOT.'/bookmarks/fiche.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url).'">';
|
$ret.= '<a class="vsmenu" href="'.DOL_URL_ROOT.'/bookmarks/fiche.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url).'">';
|
||||||
// $ret.= $langs->trans('NewBookmark');
|
//$ret.=img_picto($langs->trans('AddThisPageToBookmarks'),'edit_add').' ';
|
||||||
$ret.=img_object($langs->trans('AddThisPageToBookmarks'),'bookmark');
|
$ret.=img_object($langs->trans('AddThisPageToBookmarks'),'bookmark');
|
||||||
$ret.= '</a>';
|
$ret.= '</a>';
|
||||||
$ret.= '</td></tr></table>';
|
$ret.= '</td></tr></table>';
|
||||||
@ -57,15 +54,19 @@ function printBookmarksList ($aDb, $aLangs)
|
|||||||
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
|
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid, title, url FROM ".MAIN_DB_PREFIX."bookmark";
|
$sql = "SELECT rowid, title, url FROM ".MAIN_DB_PREFIX."bookmark";
|
||||||
if ( $resql = $db->query($sql) ) {
|
if ($resql = $db->query($sql) )
|
||||||
while ( $obj = $db->fetch_object($resql) ) {
|
{
|
||||||
|
$i=0;
|
||||||
|
while ($i < $conf->global->BOOKMARKS_SHOW_IN_MENU && $obj = $db->fetch_object($resql))
|
||||||
|
{
|
||||||
$ret.='<div class="menu_contenu"><a class="vsmenu" title="'.$obj->title.'" href="'.$obj->url.'">';
|
$ret.='<div class="menu_contenu"><a class="vsmenu" title="'.$obj->title.'" href="'.$obj->url.'">';
|
||||||
$ret.=' '.img_object($langs->trans("BookmarkThisPage"),'bookmark').' ';
|
$ret.=' '.img_object($langs->trans("BookmarkThisPage"),'bookmark').' ';
|
||||||
$ret.= dolibarr_trunc($obj->title, 30).'</a><br></div>';
|
$ret.= dolibarr_trunc($obj->title, 20).'</a><br></div>';
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
else
|
||||||
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/bookmarks/liste.php
|
* \file htdocs/bookmarks/liste.php
|
||||||
* \brief Page affichage des bookmarks
|
* \brief Page affichage des bookmarks
|
||||||
@ -43,7 +43,7 @@ $pagenext = $page + 1;
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_GET["action"] == 'delete')
|
if ($_GET["action"] == 'delete')
|
||||||
{
|
{
|
||||||
$bookmark=new Bookmark($db);
|
$bookmark=new Bookmark($db);
|
||||||
@ -67,7 +67,7 @@ if ($_GET["action"] == 'delete')
|
|||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("Bookmarks"));
|
print_fiche_titre($langs->trans("Bookmarks"));
|
||||||
|
|
||||||
if ($mesg) print $mesg;
|
if ($mesg) print $mesg;
|
||||||
|
|
||||||
$sql = "SELECT b.fk_soc as rowid, ".$db->pdate("b.dateb")." as dateb, b.rowid as bid, b.fk_user, b.url, b.target, b.title, b.favicon,";
|
$sql = "SELECT b.fk_soc as rowid, ".$db->pdate("b.dateb")." as dateb, b.rowid as bid, b.fk_user, b.url, b.target, b.title, b.favicon,";
|
||||||
@ -134,20 +134,20 @@ if ($resql)
|
|||||||
print $title;
|
print $title;
|
||||||
if ($lieninterne) print "</a>";
|
if ($lieninterne) print "</a>";
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Url
|
// Url
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if (! $lieninterne) print '<a href="'.$obj->url.'"'.($obj->target?' target="newlink"':'').'>';
|
if (! $lieninterne) print '<a href="'.$obj->url.'"'.($obj->target?' target="newlink"':'').'>';
|
||||||
print $lien;
|
print $lien;
|
||||||
if (! $lieninterne) print '</a>';
|
if (! $lieninterne) print '</a>';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Target
|
// Target
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($obj->target == 0) print $langs->trans("BookmarkTargetReplaceWindowShort");
|
if ($obj->target == 0) print $langs->trans("BookmarkTargetReplaceWindowShort");
|
||||||
if ($obj->target == 1) print $langs->trans("BookmarkTargetNewWindowShort");
|
if ($obj->target == 1) print $langs->trans("BookmarkTargetNewWindowShort");
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Author
|
// Author
|
||||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->fk_user.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login."</a></td>\n";
|
print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->fk_user.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login."</a></td>\n";
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ if ($resql)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print " ";
|
print " ";
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -911,7 +911,7 @@ function img_object($alt, $object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Affiche picto (fonction generique)
|
* \brief Show picto (generic function)
|
||||||
* \param alt Texte sur le alt de l'image
|
* \param alt Texte sur le alt de l'image
|
||||||
* \param picto Nom de l'image a afficher (Si pas d'extension, on met '.png')
|
* \param picto Nom de l'image a afficher (Si pas d'extension, on met '.png')
|
||||||
* \param options Attribut supplementaire a la balise img
|
* \param options Attribut supplementaire a la balise img
|
||||||
@ -927,12 +927,12 @@ function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Affiche picto (fonction g<EFBFBD>n<EFBFBD>rique)
|
* \brief Show picto (generic function)
|
||||||
\param alt Texte sur le alt de l'image
|
* \param alt Texte sur le alt de l'image
|
||||||
\param picto Nom de l'image a afficher (Si pas d'extension, on met '.png')
|
* \param picto Nom de l'image a afficher (Si pas d'extension, on met '.png')
|
||||||
\param options Attribut supplementaire a la balise img
|
* \param options Attribut supplementaire a la balise img
|
||||||
\param pictoisfullpath If 1, image path is a full path
|
* \param pictoisfullpath If 1, image path is a full path
|
||||||
\return string Retourne tag img
|
* \return string Retourne tag img
|
||||||
*/
|
*/
|
||||||
function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0)
|
function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user