diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/sidebar.block.linked.php | 32 | ||||
| -rw-r--r-- | templates/tag2tagadd.tpl.php | 29 | ||||
| -rw-r--r-- | templates/tag2tagdelete.tpl.php | 31 | 
3 files changed, 73 insertions, 19 deletions
| diff --git a/templates/sidebar.block.linked.php b/templates/sidebar.block.linked.php index 401d0d7..1643272 100644 --- a/templates/sidebar.block.linked.php +++ b/templates/sidebar.block.linked.php @@ -23,8 +23,16 @@ function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode      $synonymTags = $tag2tagservice->getAllLinkedTags($tag, '=', $uId);      $synonymTags = is_array($synonymTags)?$synonymTags:array($synonymTags);      sort($synonymTags); +    $synonymList = '';      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) { @@ -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> @@ -111,6 +110,14 @@ if(count($explodedTags) > 0) {  	} else {  	    $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();  	foreach($explodedTags as $explodedTag) {  	    if(!in_array($explodedTag, $stopList)) { @@ -135,8 +142,3 @@ if(count($explodedTags) > 0) {      ?>      </table>  </div> - -<?php -    } -} -?> diff --git a/templates/tag2tagadd.tpl.php b/templates/tag2tagadd.tpl.php index 109eea7..cb86a37 100644 --- a/templates/tag2tagadd.tpl.php +++ b/templates/tag2tagadd.tpl.php @@ -3,9 +3,12 @@ $this->includeTemplate($GLOBALS['top_include']);  ?>  <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 $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>      <input type="submit" name="confirm" value="<?php echo T_('Create'); ?>" /> @@ -19,5 +22,27 @@ $this->includeTemplate($GLOBALS['top_include']);  </form>  <?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']);   ?> diff --git a/templates/tag2tagdelete.tpl.php b/templates/tag2tagdelete.tpl.php index 9a276d1..2f0715b 100644 --- a/templates/tag2tagdelete.tpl.php +++ b/templates/tag2tagdelete.tpl.php @@ -3,8 +3,13 @@ $this->includeTemplate($GLOBALS['top_include']);  ?>  <form action="<?= $formaction ?>" method="post"> -<input type="hidden" name="tag1" value="<?php echo $tag1 ?>" /> -<input type="hidden" name="tag2" value="<?php echo $tag2 ?>" /> +<!--input type="hidden" name="tag1" value="<?php echo $tag1 ?>" /> +<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>      <input type="submit" name="confirm" value="<?php echo T_('Yes'); ?>" /> @@ -18,5 +23,27 @@ $this->includeTemplate($GLOBALS['top_include']);  </form>  <?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']);   ?> | 
