Dotclear


Ignore:
Timestamp:
12/16/14 11:46:03 (11 years ago)
Author:
Dsls
Branch:
default
Children:
2850:aacd042b1035, 2877:ae86da118440
Message:

Deprecated $core->adminurl->decode, use $core->adminurl->get instead (with urlencode set to false)

Added dcPage::getPF to shortcut plugin file inclusion

Location:
inc/admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.dc.adminurl.php

    r2822 r2849  
    7171      * @param  string $name      URL Name 
    7272      * @param  array  $params    query string parameters, given as an associative array 
     73      * @param  boolean $urlencode set to true if url may not be encoded 
    7374      * @param  string $separator separator to use between QS parameters 
    7475      * @return string            the forged url 
    7576      */ 
    76      public function get($name,$params=array(),$separator='&') 
     77     public function get($name,$params=array(),$urlencode=true,$separator='&') 
    7778     { 
    7879          if (!isset($this->urls[$name])) { 
    7980               throw new exception ('Unknown URL handler for '.$name); 
     81          } 
     82          // compatibility check for old behavior 
     83          if (!is_bool($urlencode)) { 
     84               $separator=$urlencode; 
     85               $urlencode = true; 
    8086          } 
    8187          $url = $this->urls[$name]; 
     
    8591               $u .= '?'.http_build_query($p,'',$separator); 
    8692          } 
    87           return $u; 
     93          return $urlencode?$u:urldecode($u); 
    8894     } 
    8995 
    9096     /** 
    9197      * retrieves a URL (decoded — useful for echoing) given its name, and optional parameters 
     98      * 
     99      * @deprecated should use get(...,true,...) instead 
    92100      * 
    93101      * @param  string $name      URL Name 
     
    98106     public function decode($name,$params=array(),$separator='&') 
    99107     { 
    100           return urldecode($this->get($name,$params,$separator)); 
     108          return urldecode($this->get($name,$params,false,$separator)); 
    101109     } 
    102110 
  • inc/admin/lib.dc.page.php

    r2817 r2849  
    925925          '<script type="text/javascript" src="js/meta-editor.js"></script>'; 
    926926     } 
     927 
     928     public static function getPF($file) { 
     929          return $GLOBALS['core']->adminurl->get('load.plugin.file',array('pf' => $file),false); 
     930     } 
    927931} 
  • inc/admin/lib.moduleslist.php

    r2817 r2849  
    621621                         '<img alt="%1$s" title="%1$s" src="%2$s" />', 
    622622                         html::escapeHTML($id), file_exists($module['root'].'/icon.png') ? 
    623                          $this->core->adminurl->decode('load.plugin.file',array('pf' => $id.'/icon.png')) : 'images/module.png' 
     623                         dcPage::getPF($id.'/icon.png') : 'images/module.png' 
    624624                    ).'</td>'; 
    625625               } 
  • inc/admin/lib.pager.php

    r2817 r2849  
    214214     { 
    215215          if ($this->core->auth->check('categories',$this->core->blog->id)) { 
    216                $cat_link = '<a href="'.$this->core->adminurl->decode('admin.category',array('id' => '%s')).'">%s</a>'; 
     216               $cat_link = '<a href="'.$this->core->adminurl->get('admin.category',array('id' => '%s'),false).'">%s</a>'; 
    217217          } else { 
    218218               $cat_link = '%2$s'; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map