Dotclear

Changeset 772:2465bf307591 for inc/core


Ignore:
Timestamp:
11/28/11 10:26:03 (14 years ago)
Author:
Dsls <dsls@…>
Branch:
default
Message:

Added new method getURLFor in urlhandler
2 new behaviors :

  • publicGetURLFor
  • publicRegisterURL

All changes are backward compatibles, news plugins will be encouraged
to use new urlhandler method for public URLs generation

Location:
inc/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.rs.extensions.php

    r270 r772  
    188188     public static function getCategoryURL($rs) 
    189189     { 
    190           return $rs->core->blog->url.$rs->core->url->getBase('category').'/'. 
    191           html::sanitizeURL($rs->cat_url); 
     190          return $rs->core->url->getURLFor('category',html::sanitizeURL($rs->cat_url)); 
    192191     } 
    193192      
     
    395394     public static function getTrackbackLink($rs) 
    396395     { 
    397           return $rs->core->blog->url.$rs->core->url->getBase('trackback').'/'.$rs->post_id; 
     396          return $rs->core->url->getURLFor('trackback',$rs->post_id); 
    398397     } 
    399398      
     
    778777          $url = date('Y/m',strtotime($rs->dt)); 
    779778           
    780           return $core->blog->url.$core->url->getBase('archive').'/'.$url; 
     779          return $core->url->getURLFor('archive',$url); 
    781780     } 
    782781      
  • inc/core/class.dc.xmlrpc.php

    r696 r772  
    694694                    'description' => $rs->cat_title, 
    695695                    'categoryName' => $rs->cat_url, 
    696                     'htmlUrl' => $this->core->blog->url.$this->core->url->getBase('category').'/'.$rs->cat_url, 
    697                     'rssUrl' => $this->core->blog->url.$this->core->url->getBase('feed').'/category/'.$rs->cat_url.'/rss2' 
     696                    'htmlUrl' => $this->core->url->getURLFor('category',$rs->cat_url), 
     697                    'rssUrl' => $this->core->url->getURLFor('feed','category/'.$rs->cat_url.'/rss2') 
    698698               ); 
    699699                
     
    10721072           
    10731073          $res = array(); 
    1074           $url   = $this->core->blog->url.$this->core->url->getBase('tag').'/%s'; 
    1075           $f_url = $this->core->blog->url.$this->core->url->getBase('tag_feed').'/%s'; 
     1074          $url   = $this->core->url->getURLFor('tag','%s'); 
     1075          $f_url = $this->core->url->getURLFor('tag_feed','%s'); 
    10761076          while ($tags->fetch()) 
    10771077          { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map