fix interface: make easier the management of tag links

git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@33 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
mensonge 2008-02-05 13:30:33 +00:00
parent 67b4663c9a
commit 73e20c2ff5
10 changed files with 185 additions and 61 deletions

View file

@ -8,9 +8,9 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Scuttle\n" "Project-Id-Version: Scuttle\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-02-01 17:37+0100\n" "POT-Creation-Date: 2008-02-05 14:06+0100\n"
"PO-Revision-Date: 2008-02-01 17:39+0100\n" "PO-Revision-Date: 2008-02-05 14:09+0100\n"
"Last-Translator: Éric DANÉ <ericdane@free.fr>\n" "Last-Translator: BenjaminHKB <benjamin.huynh-kim-bang@loria.fr>\n"
"Language-Team: fr-FR <toony.sf@chezouam.net>\n" "Language-Team: fr-FR <toony.sf@chezouam.net>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
@ -212,20 +212,20 @@ msgid "Recent Bookmarks"
msgstr "Signets récents" msgstr "Signets récents"
#: ../../../jsScuttle.php:22 #: ../../../jsScuttle.php:22
#: ../../../templates/tag2tagadd.tpl.php:9 #: ../../../templates/tag2tagadd.tpl.php:12
#: ../../../templates/tag2tagdelete.tpl.php:8 #: ../../../templates/tag2tagdelete.tpl.php:13
#: ../../../templates/tagdelete.tpl.php:6 #: ../../../templates/tagdelete.tpl.php:6
msgid "Are you sure?" msgid "Are you sure?"
msgstr "Etes-vous sûr ?" msgstr "Etes-vous sûr ?"
#: ../../../jsScuttle.php:22 #: ../../../jsScuttle.php:22
#: ../../../templates/tag2tagdelete.tpl.php:10 #: ../../../templates/tag2tagdelete.tpl.php:15
#: ../../../templates/tagdelete.tpl.php:8 #: ../../../templates/tagdelete.tpl.php:8
msgid "Yes" msgid "Yes"
msgstr "Oui" msgstr "Oui"
#: ../../../jsScuttle.php:22 #: ../../../jsScuttle.php:22
#: ../../../templates/tag2tagdelete.tpl.php:11 #: ../../../templates/tag2tagdelete.tpl.php:16
#: ../../../templates/tagdelete.tpl.php:9 #: ../../../templates/tagdelete.tpl.php:9
msgid "No" msgid "No"
msgstr "Non" msgstr "Non"
@ -411,27 +411,27 @@ msgstr "Résultats de recherche"
msgid "Permission denied." msgid "Permission denied."
msgstr "Permission non accordée." msgstr "Permission non accordée."
#: ../../../tag2tagadd.php:42 #: ../../../tag2tagadd.php:44
msgid "Tag link created" msgid "Tag link created"
msgstr "Lien entre tags créé." msgstr "Lien entre tags créé."
#: ../../../tag2tagadd.php:45 #: ../../../tag2tagadd.php:47
msgid "Failed to create the link" msgid "Failed to create the link"
msgstr "Impossible de créer le lien" msgstr "Impossible de créer le lien"
#: ../../../tag2tagadd.php:54 #: ../../../tag2tagadd.php:58
msgid "Add Tag Link" msgid "Add Tag Link"
msgstr "Ajout d'un lien entre tags" msgstr "Ajout d'un lien entre tags"
#: ../../../tag2tagdelete.php:40 #: ../../../tag2tagdelete.php:43
msgid "Tag link deleted" msgid "Tag link deleted"
msgstr "Effacement d'un lien entre tags" msgstr "Effacement d'un lien entre tags"
#: ../../../tag2tagdelete.php:43 #: ../../../tag2tagdelete.php:46
msgid "Failed to delete the link" msgid "Failed to delete the link"
msgstr "Impossible d'effacer le lien" msgstr "Impossible d'effacer le lien"
#: ../../../tag2tagdelete.php:53 #: ../../../tag2tagdelete.php:58
msgid "Delete Link Between Tags" msgid "Delete Link Between Tags"
msgstr "Effacer un lien entre tags" msgstr "Effacer un lien entre tags"
@ -855,14 +855,26 @@ msgstr "Enregistrez-vous ici pour créer un compte gratuit %s. Toutes les inform
msgid "Antispam question" msgid "Antispam question"
msgstr "Question antispam" msgstr "Question antispam"
#: ../../../templates/sidebar.block.linked.php:97 #: ../../../templates/sidebar.block.linked.php:35
msgid "Synonyms:"
msgstr "Synonymes :"
#: ../../../templates/sidebar.block.linked.php:96
msgid "Linked Tags" msgid "Linked Tags"
msgstr "Tags structurés" msgstr "Tags structurés"
#: ../../../templates/sidebar.block.linked.php:100 #: ../../../templates/sidebar.block.linked.php:99
msgid "plus" msgid "plus"
msgstr "plus" msgstr "plus"
#: ../../../templates/sidebar.block.linked.php:116
msgid "Add new link"
msgstr "Créer un lien"
#: ../../../templates/sidebar.block.linked.php:117
msgid "Delete link"
msgstr "Supprimer un lien"
#: ../../../templates/sidebar.block.recent.php:15 #: ../../../templates/sidebar.block.recent.php:15
msgid "Recent Tags" msgid "Recent Tags"
msgstr "Tags récents" msgstr "Tags récents"
@ -889,19 +901,29 @@ msgstr "Enlever de la liste des consultés"
msgid "Add to Watchlist" msgid "Add to Watchlist"
msgstr "Ajouter à la liste des consultés" msgstr "Ajouter à la liste des consultés"
#: ../../../templates/tag2tagadd.tpl.php:7 #: ../../../templates/tag2tagadd.tpl.php:6
msgid "Create new link:" msgid "Create new link:"
msgstr "Créer un nouveau lien" msgstr "Créer un nouveau lien"
#: ../../../templates/tag2tagadd.tpl.php:11 #: ../../../templates/tag2tagadd.tpl.php:14
msgid "Create" msgid "Create"
msgstr "Créer" msgstr "Créer"
#: ../../../templates/tag2tagadd.tpl.php:12 #: ../../../templates/tag2tagadd.tpl.php:15
#: ../../../templates/tagrename.tpl.php:25 #: ../../../templates/tagrename.tpl.php:25
msgid "Cancel" msgid "Cancel"
msgstr "Annuler" msgstr "Annuler"
#: ../../../templates/tag2tagadd.tpl.php:26
#: ../../../templates/tag2tagdelete.tpl.php:27
msgid "Existing links:"
msgstr "Liens existants :"
#: ../../../templates/tag2tagadd.tpl.php:44
#: ../../../templates/tag2tagdelete.tpl.php:45
msgid "No links"
msgstr "Pas de liens"
#: ../../../templates/tagrename.tpl.php:12 #: ../../../templates/tagrename.tpl.php:12
msgid "Old" msgid "Old"
msgstr "Ancien" msgstr "Ancien"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-02-01 17:37+0100\n" "POT-Creation-Date: 2008-02-05 14:06+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -193,18 +193,18 @@ msgstr ""
msgid "Recent Bookmarks" msgid "Recent Bookmarks"
msgstr "" msgstr ""
#: ../../../jsScuttle.php:22 ../../../templates/tag2tagadd.tpl.php:9 #: ../../../jsScuttle.php:22 ../../../templates/tag2tagadd.tpl.php:12
#: ../../../templates/tag2tagdelete.tpl.php:8 #: ../../../templates/tag2tagdelete.tpl.php:13
#: ../../../templates/tagdelete.tpl.php:6 #: ../../../templates/tagdelete.tpl.php:6
msgid "Are you sure?" msgid "Are you sure?"
msgstr "" msgstr ""
#: ../../../jsScuttle.php:22 ../../../templates/tag2tagdelete.tpl.php:10 #: ../../../jsScuttle.php:22 ../../../templates/tag2tagdelete.tpl.php:15
#: ../../../templates/tagdelete.tpl.php:8 #: ../../../templates/tagdelete.tpl.php:8
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""
#: ../../../jsScuttle.php:22 ../../../templates/tag2tagdelete.tpl.php:11 #: ../../../jsScuttle.php:22 ../../../templates/tag2tagdelete.tpl.php:16
#: ../../../templates/tagdelete.tpl.php:9 #: ../../../templates/tagdelete.tpl.php:9
msgid "No" msgid "No"
msgstr "" msgstr ""
@ -387,27 +387,27 @@ msgstr ""
msgid "Permission denied." msgid "Permission denied."
msgstr "" msgstr ""
#: ../../../tag2tagadd.php:42 #: ../../../tag2tagadd.php:44
msgid "Tag link created" msgid "Tag link created"
msgstr "" msgstr ""
#: ../../../tag2tagadd.php:45 #: ../../../tag2tagadd.php:47
msgid "Failed to create the link" msgid "Failed to create the link"
msgstr "" msgstr ""
#: ../../../tag2tagadd.php:54 #: ../../../tag2tagadd.php:58
msgid "Add Tag Link" msgid "Add Tag Link"
msgstr "" msgstr ""
#: ../../../tag2tagdelete.php:40 #: ../../../tag2tagdelete.php:43
msgid "Tag link deleted" msgid "Tag link deleted"
msgstr "" msgstr ""
#: ../../../tag2tagdelete.php:43 #: ../../../tag2tagdelete.php:46
msgid "Failed to delete the link" msgid "Failed to delete the link"
msgstr "" msgstr ""
#: ../../../tag2tagdelete.php:53 #: ../../../tag2tagdelete.php:58
msgid "Delete Link Between Tags" msgid "Delete Link Between Tags"
msgstr "" msgstr ""
@ -858,14 +858,26 @@ msgstr ""
msgid "Antispam question" msgid "Antispam question"
msgstr "" msgstr ""
#: ../../../templates/sidebar.block.linked.php:97 #: ../../../templates/sidebar.block.linked.php:35
msgid "Synonyms:"
msgstr ""
#: ../../../templates/sidebar.block.linked.php:96
msgid "Linked Tags" msgid "Linked Tags"
msgstr "" msgstr ""
#: ../../../templates/sidebar.block.linked.php:100 #: ../../../templates/sidebar.block.linked.php:99
msgid "plus" msgid "plus"
msgstr "" msgstr ""
#: ../../../templates/sidebar.block.linked.php:116
msgid "Add new link"
msgstr ""
#: ../../../templates/sidebar.block.linked.php:117
msgid "Delete link"
msgstr ""
#: ../../../templates/sidebar.block.recent.php:15 #: ../../../templates/sidebar.block.recent.php:15
msgid "Recent Tags" msgid "Recent Tags"
msgstr "" msgstr ""
@ -891,19 +903,29 @@ msgstr ""
msgid "Add to Watchlist" msgid "Add to Watchlist"
msgstr "" msgstr ""
#: ../../../templates/tag2tagadd.tpl.php:7 #: ../../../templates/tag2tagadd.tpl.php:6
msgid "Create new link:" msgid "Create new link:"
msgstr "" msgstr ""
#: ../../../templates/tag2tagadd.tpl.php:11 #: ../../../templates/tag2tagadd.tpl.php:14
msgid "Create" msgid "Create"
msgstr "" msgstr ""
#: ../../../templates/tag2tagadd.tpl.php:12 #: ../../../templates/tag2tagadd.tpl.php:15
#: ../../../templates/tagrename.tpl.php:25 #: ../../../templates/tagrename.tpl.php:25
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: ../../../templates/tag2tagadd.tpl.php:26
#: ../../../templates/tag2tagdelete.tpl.php:27
msgid "Existing links:"
msgstr ""
#: ../../../templates/tag2tagadd.tpl.php:44
#: ../../../templates/tag2tagdelete.tpl.php:45
msgid "No links"
msgstr ""
#: ../../../templates/tagrename.tpl.php:12 #: ../../../templates/tagrename.tpl.php:12
msgid "Old" msgid "Old"
msgstr "" msgstr ""

View file

@ -16,7 +16,8 @@ class Tag2TagService {
} }
function addLinkedTags($tag1, $tag2, $relationType, $uId) { function addLinkedTags($tag1, $tag2, $relationType, $uId) {
if($tag1 == $tag2) { if($tag1 == $tag2 || strlen($tag1) == 0 || strlen($tag2) == 0
|| ($relationType != ">" && $relationType != "=")) {
return false; return false;
} }
$values = array('tag1' => $tag1, 'tag2' => $tag2, 'relationType'=> $relationType, 'uId'=> $uId); $values = array('tag1' => $tag1, 'tag2' => $tag2, 'relationType'=> $relationType, 'uId'=> $uId);
@ -196,7 +197,21 @@ class Tag2TagService {
return $this->db->sql_numrows($this->db->sql_query($query)) > 0; return $this->db->sql_numrows($this->db->sql_query($query)) > 0;
} }
function getLinks($uId) {
$query = "SELECT tag1, tag2, relationType, uId FROM `". $this->getTableName() ."`";
$query.= " WHERE 1=1";
if($uId > 0) {
$query.= " AND uId = '".$uId."'";
}
return $this->db->sql_fetchrowset($this->db->sql_query($query));
}
function removeLinkedTags($tag1, $tag2, $relationType, $uId) { function removeLinkedTags($tag1, $tag2, $relationType, $uId) {
if($tag1 == $tag2 || strlen($tag1) == 0 || strlen($tag2) == 0
|| ($relationType != ">" && $relationType != "=")) {
return false;
}
$query = 'DELETE FROM '. $this->getTableName(); $query = 'DELETE FROM '. $this->getTableName();
$query.= ' WHERE tag1 = "'. $tag1 .'"'; $query.= ' WHERE tag1 = "'. $tag1 .'"';
$query.= ' AND tag2 = "'. $tag2 .'"'; $query.= ' AND tag2 = "'. $tag2 .'"';

View file

@ -34,11 +34,13 @@ if($logged_on_user == null) {
} }
list ($url, $tag) = explode('/', $_SERVER['PATH_INFO']); list ($url, $tag1) = explode('/', $_SERVER['PATH_INFO']);
if ($_POST['confirm']) { if ($_POST['confirm']) {
$newTag = $_POST['newTag']; $tag1 = $_POST['tag1'];
if ($tag2tagservice->addLinkedTags($tag, $newTag, '>', $userservice->getCurrentUserId())) { $linkType = $_POST['linkType'];
$tag2 = $_POST['tag2'];
if ($tag2tagservice->addLinkedTags($tag1, $tag2, $linkType, $userservice->getCurrentUserId())) {
$tplVars['msg'] = T_('Tag link created'); $tplVars['msg'] = T_('Tag link created');
header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')])); header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')]));
} else { } else {
@ -50,9 +52,11 @@ if ($_POST['confirm']) {
header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] .'/'. $tags)); header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] .'/'. $tags));
} }
$tplVars['tag'] = $tag; $tplVars['links'] = $tag2tagservice->getLinks($userservice->getCurrentUserId());
$tplVars['subtitle'] = T_('Add Tag Link') .': '. $tag;
$tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] .'/'. $tag; $tplVars['tag1'] = $tag1;
$tplVars['subtitle'] = T_('Add Tag Link') .': '. $tag1;
$tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] .'/'. $tag1;
$tplVars['referrer'] = $_SERVER['HTTP_REFERER']; $tplVars['referrer'] = $_SERVER['HTTP_REFERER'];
$templateservice->loadTemplate('tag2tagadd.tpl', $tplVars); $templateservice->loadTemplate('tag2tagadd.tpl', $tplVars);
?> ?>

View file

@ -36,7 +36,10 @@ if($logged_on_user == null) {
list ($url, $tag1, $tag2) = explode('/', $_SERVER['PATH_INFO']); list ($url, $tag1, $tag2) = explode('/', $_SERVER['PATH_INFO']);
if ($_POST['confirm']) { if ($_POST['confirm']) {
if ($tag2tagservice->removeLinkedTags($_POST['tag1'], $_POST['tag2'], '>', $userservice->getCurrentUserId())) { $tag = $_POST['tag1'];
$linkType = $_POST['linkType'];
$newTag = $_POST['tag2'];
if ($tag2tagservice->removeLinkedTags($_POST['tag1'], $_POST['tag2'], $linkType, $userservice->getCurrentUserId())) {
$tplVars['msg'] = T_('Tag link deleted'); $tplVars['msg'] = T_('Tag link deleted');
header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')])); header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')]));
} else { } else {
@ -48,6 +51,8 @@ if ($_POST['confirm']) {
header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] .'/'. $tags)); header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] .'/'. $tags));
} }
$tplVars['links'] = $tag2tagservice->getLinks($userservice->getCurrentUserId());
$tplVars['tag1'] = $tag1; $tplVars['tag1'] = $tag1;
$tplVars['tag2'] = $tag2; $tplVars['tag2'] = $tag2;
$tplVars['subtitle'] = T_('Delete Link Between Tags') .': '. $tag1.' > '.$tag2; $tplVars['subtitle'] = T_('Delete Link Between Tags') .': '. $tag1.' > '.$tag2;

View file

@ -23,8 +23,16 @@ function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode
$synonymTags = $tag2tagservice->getAllLinkedTags($tag, '=', $uId); $synonymTags = $tag2tagservice->getAllLinkedTags($tag, '=', $uId);
$synonymTags = is_array($synonymTags)?$synonymTags:array($synonymTags); $synonymTags = is_array($synonymTags)?$synonymTags:array($synonymTags);
sort($synonymTags); sort($synonymTags);
$synonymList = '';
foreach($synonymTags as $synonymTag) { foreach($synonymTags as $synonymTag) {
$output.= ", ".$synonymTag; //$output.= ", ".$synonymTag;
$synonymList.= $synonymTag.' ';
}
if(count($synonymTags)>0) {
$output.= ', '.$synonymTags[0];
}
if(count($synonymTags)>1) {
$output.= '<span title="'.T_('Synonyms:').' '.$synonymList.'">, etc</span>';
} }
if($editingMode) { if($editingMode) {
@ -81,15 +89,6 @@ if ($currenttag) {
} }
} }
if(count($explodedTags) > 0) {
$displayLinkedZone = false;
foreach($explodedTags as $explodedTag) {
if($tag2tagservice->getLinkedTags($explodedTag, '>', $userid) || $tag2tagservice->getLinkedTags($explodedTag, '>', $userid, true) || $tag2tagservice->getLinkedTags($explodedTag, '=', $userid)) {
$displayLinkedZone = true;
break;
}
}
if ($displayLinkedZone) {
?> ?>
<h2> <h2>
@ -111,6 +110,14 @@ if(count($explodedTags) > 0) {
} else { } else {
$editingMode = false; $editingMode = false;
} }
if($editingMode) {
echo '<tr><td></td><td>';
echo ' (<a href="'. createURL('tag2tagadd','') .'" rel="tag">'.T_('Add new link').'</a>) ';
echo ' (<a href="'. createURL('tag2tagdelete','') .'" rel="tag">'.T_('Delete link').'</a>)';
echo '</td></tr>';
}
$stopList = array(); $stopList = array();
foreach($explodedTags as $explodedTag) { foreach($explodedTags as $explodedTag) {
if(!in_array($explodedTag, $stopList)) { if(!in_array($explodedTag, $stopList)) {
@ -135,8 +142,3 @@ if(count($explodedTags) > 0) {
?> ?>
</table> </table>
</div> </div>
<?php
}
}
?>

View file

@ -3,9 +3,12 @@ $this->includeTemplate($GLOBALS['top_include']);
?> ?>
<form action="<?= $formaction ?>" method="post"> <form action="<?= $formaction ?>" method="post">
<input type="hidden" name="tag" value="<?php echo $tag ?>" />
<p><?php echo T_('Create new link:')?></p> <p><?php echo T_('Create new link:')?></p>
<p><?php echo $tag ?> > <input type="text" name="newTag" /></p> <p>
<input type="text" name="tag1" value="<?php echo $tag1 ?>"/>
<input type="text" name="linkType" value=">" size="1" maxlength="1"/>
<input type="text" name="tag2" />
</p>
<!--p><?php echo T_('Are you sure?'); ?></p--> <!--p><?php echo T_('Are you sure?'); ?></p-->
<p> <p>
<input type="submit" name="confirm" value="<?php echo T_('Create'); ?>" /> <input type="submit" name="confirm" value="<?php echo T_('Create'); ?>" />
@ -19,5 +22,27 @@ $this->includeTemplate($GLOBALS['top_include']);
</form> </form>
<?php <?php
if(count($links)>0) {
echo T_("Existing links:");
foreach($links as $link) {
echo '<span style="white-space:nowrap;margin-left:25px;">';
if($link['tag1'] == $tag1 || $link['tag1'] == $tag2) {
$textTag1 = '<b>'.$tag1.'</b>';
} else {
$textTag1 = $link['tag1'];
}
if($link['tag2'] == $tag1 || $link['tag2'] == $tag2) {
$textTag2 = '<b>'.$tag2.'</b>';
} else {
$textTag2 = $link['tag2'];
}
echo $textTag1.' '.$link['relationType'].' '.$textTag2;
echo "</span> ";
}
} else {
echo T_('No links');
}
$this->includeTemplate($GLOBALS['bottom_include']); $this->includeTemplate($GLOBALS['bottom_include']);
?> ?>

View file

@ -3,8 +3,13 @@ $this->includeTemplate($GLOBALS['top_include']);
?> ?>
<form action="<?= $formaction ?>" method="post"> <form action="<?= $formaction ?>" method="post">
<input type="hidden" name="tag1" value="<?php echo $tag1 ?>" /> <!--input type="hidden" name="tag1" value="<?php echo $tag1 ?>" />
<input type="hidden" name="tag2" value="<?php echo $tag2 ?>" /> <input type="hidden" name="tag2" value="<?php echo $tag2 ?>" /-->
<p>
<input type="text" name="tag1" value="<?php echo $tag1 ?>"/>
<input type="text" name="linkType" value=">" size="1" maxlength="1"/>
<input type="text" name="tag2" value="<?php echo $tag2 ?>"/>
</p>
<p><?php echo T_('Are you sure?'); ?></p> <p><?php echo T_('Are you sure?'); ?></p>
<p> <p>
<input type="submit" name="confirm" value="<?php echo T_('Yes'); ?>" /> <input type="submit" name="confirm" value="<?php echo T_('Yes'); ?>" />
@ -18,5 +23,27 @@ $this->includeTemplate($GLOBALS['top_include']);
</form> </form>
<?php <?php
if(count($links)>0) {
echo T_("Existing links:");
foreach($links as $link) {
echo '<span style="white-space:nowrap;margin-left:25px;">';
if($link['tag1'] == $tag1 || $link['tag1'] == $tag2) {
$textTag1 = '<b>'.$tag1.'</b>';
} else {
$textTag1 = $link['tag1'];
}
if($link['tag2'] == $tag1 || $link['tag2'] == $tag2) {
$textTag2 = '<b>'.$tag2.'</b>';
} else {
$textTag2 = $link['tag2'];
}
echo $textTag1.' '.$link['relationType'].' '.$textTag2;
echo "</span> ";
}
} else {
echo T_('No links');
}
$this->includeTemplate($GLOBALS['bottom_include']); $this->includeTemplate($GLOBALS['bottom_include']);
?> ?>

View file

@ -44,6 +44,8 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
// basic test // basic test
$links = $tts->getLinks(1);
$allLinkedTags = $tts->getAllLinkedTags('e', '>', 1, true); // as flat list $allLinkedTags = $tts->getAllLinkedTags('e', '>', 1, true); // as flat list
$this->assertEquals(array(), $allLinkedTags); $this->assertEquals(array(), $allLinkedTags);