Dotclear

Changeset 2661:86631ca0a3c4 for plugins


Ignore:
Timestamp:
02/14/14 14:05:41 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add tag-current class (if necessary) in tags widget, fixes #1908

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/tags/_public.php

    r2607 r2661  
    234234     public static function tagsWidget($w) 
    235235     { 
    236           global $core; 
     236          global $core, $_ctx; 
    237237 
    238238          if (($w->homeonly == 1 && $core->url->type != 'default') || 
     
    271271          '<ul>'; 
    272272 
     273          if ($core->url->type == 'post' && $_ctx->posts instanceof record) { 
     274               $_ctx->meta = $core->meta->getMetaRecordset($_ctx->posts->post_meta,'tag'); 
     275          } 
    273276          while ($rs->fetch()) 
    274277          { 
     278               $class = ''; 
     279               if ($core->url->type == 'post' && $_ctx->posts instanceof record) { 
     280                    while ($_ctx->meta->fetch()) { 
     281                         if ($_ctx->meta->meta_id == $rs->meta_id) { 
     282                              $class = ' class="tag-current"'; 
     283                              break; 
     284                         } 
     285                    } 
     286               } 
    275287               $res .= 
    276                '<li><a href="'.$core->blog->url.$core->url->getURLFor('tag',rawurlencode($rs->meta_id)).'" '. 
     288               '<li'.$class.'><a href="'.$core->blog->url.$core->url->getURLFor('tag',rawurlencode($rs->meta_id)).'" '. 
    277289               'class="tag'.$rs->roundpercent.'">'. 
    278290               $rs->meta_id.'</a> </li>'; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map