Changeset 1606


Ignore:
Timestamp:
Nov 14, 2006, 3:53:24 AM (17 years ago)
Author:
rvelices
Message:

feature 479: when more than 3 tags selected, be able to remove one tag
from the multiple tags

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_html.inc.php

    r1586 r1606  
    611611    5 );
    612612}
     613
     614/* returns the title to be displayed above thumbnails on tag page
     615 */
     616function get_tags_content_title()
     617{
     618  global $page;
     619  $title = count($page['tags']) > 1 ? l10n('Tags') : l10n('Tag');
     620  $title.= ' ';
     621
     622  for ($i=0; $i<count($page['tags']); $i++)
     623  {
     624    $title.= $i>0 ? ' + ' : '';
     625
     626    $title.=
     627      '<a href="'
     628      .make_index_url(
     629        array(
     630          'tags' => array( $page['tags'][$i] )
     631          )
     632        )
     633      .'" title="'
     634      .l10n('See pictures linked to this tag only')
     635      .'">'
     636      .$page['tags'][$i]['name']
     637      .'</a>';
     638
     639    if ( count($page['tags'])>2 )
     640    {
     641      $other_tags = $page['tags'];
     642      unset ( $other_tags[$i] );
     643      $title.=
     644        '<a href="'
     645        .make_index_url(
     646          array(
     647            'tags' => $other_tags
     648            )
     649          )
     650        .'" style="border:none;" title="'
     651        .l10n('remove this tag')
     652        .'"><img src="'
     653        .get_root_url().get_themeconf('icon_dir').'/remove_s.png'
     654        .'" alt="x" style="vertical-align:bottom;" class="button"/>'
     655        .'</a>';
     656    }
     657
     658  }
     659  return $title;
     660}
    613661?>
  • trunk/include/section_init.inc.php

    r1604 r1606  
    194194  $result = pwg_query($query);
    195195  $tag_infos = array();
    196   while ($row = mysql_fetch_array($result))
     196  while ($row = mysql_fetch_assoc($result))
    197197  {
    198198    $tag_infos[ $row['id'] ] = $row;
     
    411411    }
    412412
    413     $title = count($page['tags']) > 1 ? l10n('Tags') : l10n('Tag');
    414     $title.= ' ';
    415 
    416     $tag_num = 1;
    417     foreach ($page['tag_ids'] as $tag_id)
    418     {
    419       $title.=
    420         ($tag_num++ > 1 ? ' + ' : '')
    421         .'<a href="'
    422         .make_index_url(
    423           array(
    424             'tags' => array(
    425               array(
    426                 'id' => $tag_id,
    427                 'url_name' => $tag_infos[$tag_id]['url_name'],
    428                 ),
    429               )
    430             )
    431           )
    432         .'">'
    433         .$tag_infos[$tag_id]['name']
    434         .'</a>';
    435     }
     413    $title = get_tags_content_title();
    436414
    437415    $page = array_merge(
  • trunk/language/en_UK.iso-8859-1/common.lang.php

    r1361 r1606  
    544544$lang['register_title'] = 'Registration';
    545545$lang['remember_me'] = 'Auto login';
     546$lang['remove this tag'] = 'remove this tag from the list';
    546547$lang['representative'] = 'representative';
    547548$lang['reset'] = 'Reset';
  • trunk/language/fr_FR.iso-8859-1/common.lang.php

    r1439 r1606  
    543543$lang['register_title'] = 'Enregistrement';
    544544$lang['remember_me'] = 'Connexion auto';
     545$lang['remove this tag'] = 'enlever ce tag de la liste';
    545546$lang['representative'] = 'représentant';
    546547$lang['reset'] = 'Annuler';
Note: See TracChangeset for help on using the changeset viewer.