Enhancement in bookmark module

This commit is contained in:
Laurent Destailleur 2009-01-23 16:12:48 +00:00
parent 6254a6a217
commit 69d6ce7467
3 changed files with 26 additions and 25 deletions

View File

@ -43,12 +43,9 @@ function printBookmarksList ($aDb, $aLangs)
$ret.= '<div class="menu_titre">';
$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.='</div>';
// Menu New bookmark
// $ret.= '<div class="menu_contenu">';
$ret.= '</td><td align="right">';
$ret.= '<a class="vsmenu" href="'.DOL_URL_ROOT.'/bookmarks/fiche.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url).'">';
// $ret.= $langs->trans('NewBookmark');
//$ret.=img_picto($langs->trans('AddThisPageToBookmarks'),'edit_add').' ';
$ret.=img_object($langs->trans('AddThisPageToBookmarks'),'bookmark');
$ret.= '</a>';
$ret.= '</td></tr></table>';
@ -57,15 +54,19 @@ function printBookmarksList ($aDb, $aLangs)
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
{
$sql = "SELECT rowid, title, url FROM ".MAIN_DB_PREFIX."bookmark";
if ( $resql = $db->query($sql) ) {
while ( $obj = $db->fetch_object($resql) ) {
if ($resql = $db->query($sql) )
{
$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.=' '.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);
}
}

View File

@ -1,5 +1,5 @@
<?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
* 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* \file htdocs/bookmarks/liste.php
* \brief Page affichage des bookmarks
@ -43,7 +43,7 @@ $pagenext = $page + 1;
/*
* Actions
*/
if ($_GET["action"] == 'delete')
{
$bookmark=new Bookmark($db);
@ -67,7 +67,7 @@ if ($_GET["action"] == 'delete')
llxHeader();
print_fiche_titre($langs->trans("Bookmarks"));
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,";
@ -134,20 +134,20 @@ if ($resql)
print $title;
if ($lieninterne) print "</a>";
print "</td>\n";
// Url
print "<td>";
if (! $lieninterne) print '<a href="'.$obj->url.'"'.($obj->target?' target="newlink"':'').'>';
print $lien;
if (! $lieninterne) print '</a>';
print "</td>\n";
// Target
print '<td align="center">';
if ($obj->target == 0) print $langs->trans("BookmarkTargetReplaceWindowShort");
if ($obj->target == 1) print $langs->trans("BookmarkTargetNewWindowShort");
print "</td>\n";
// 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";
@ -163,7 +163,7 @@ if ($resql)
else
{
print "&nbsp;";
}
}
print "</td>";
print "</tr>\n";
$i++;

View File

@ -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 picto Nom de l'image a afficher (Si pas d'extension, on met '.png')
* \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)
\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 options Attribut supplementaire a la balise img
\param pictoisfullpath If 1, image path is a full path
\return string Retourne tag img
* \brief Show picto (generic function)
* \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 options Attribut supplementaire a la balise img
* \param pictoisfullpath If 1, image path is a full path
* \return string Retourne tag img
*/
function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0)
{