Dotclear

Changeset 3461:f63faff232da


Ignore:
Timestamp:
12/19/16 17:25:23 (9 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add urls attribute to tpl:CategoryIf, closes #2228

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/public/class.dc.template.php

    r3426 r3461  
    963963     <!ATTLIST tpl:CategoryIf 
    964964     url       CDATA     #IMPLIED  -- category has given url 
     965     urls CDATA     #IMPLIED  -- category has one of given urls 
    965966     has_entries    (0|1)     #IMPLIED  -- post is the first post from list (value : 1) or not (value : 0) 
    966967     has_description     (0|1)     #IMPLIED  -- category has description (value : 1) or not (value : 0) 
     
    979980               } else { 
    980981                    $if[] = '($_ctx->categories->cat_url == "'.$url.'")'; 
     982               } 
     983          } 
     984 
     985          if (isset($attr['urls'])) { 
     986               $urls = explode(',',addslashes(trim($attr['urls']))); 
     987               if (is_array($urls) && count($urls)) { 
     988                    foreach ($urls as $url) { 
     989                         if (substr($url,0,1) == '!') { 
     990                              $url = substr($url,1); 
     991                              $if[] = '($_ctx->categories->cat_url != "'.$url.'")'; 
     992                         } else { 
     993                              $if[] = '($_ctx->categories->cat_url == "'.$url.'")'; 
     994                         } 
     995                    } 
    981996               } 
    982997          } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map