Dotclear


Ignore:
Timestamp:
11/27/14 15:28:36 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Using dcAdminURL, work in progress on plugins…

Location:
plugins/antispam
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • plugins/antispam/_admin.php

    r2566 r2823  
    1616} 
    1717 
    18 $_menu['Plugins']->addItem(__('Antispam'),'plugin.php?p=antispam','index.php?pf=antispam/icon.png', 
    19           preg_match('/plugin.php\?p=antispam(&.*)?$/',$_SERVER['REQUEST_URI']), 
    20           $core->auth->check('admin',$core->blog->id)); 
     18$_menu['Plugins']->addItem(__('Antispam'), 
     19     $core->adminurl->get('admin.plugin.antispam'), 
     20     $core->adminurl->decode('load.plugin.file',array('pf' => 'antispam/icon.png')), 
     21     preg_match('/'.preg_quote($core->adminurl->get('admin.plugin.antispam')).'(&.*)?$/',$_SERVER['REQUEST_URI']), 
     22     $core->auth->check('admin',$core->blog->id)); 
    2123 
    2224$core->addBehavior('coreAfterCommentUpdate',array('dcAntispam','trainFilters')); 
     
    3133     $favs->register('antispam', array( 
    3234          'title' => __('Antispam'), 
    33           'url' => 'plugin.php?p=antispam', 
    34           'small-icon' => 'index.php?pf=antispam/icon.png', 
    35           'large-icon' => 'index.php?pf=antispam/icon-big.png', 
     35          'url' => $core->adminurl->get('admin.plugin.antispam'), 
     36          'small-icon' => $core->adminurl->decode('load.plugin.file',array('pf' => 'antispam/icon.png')), 
     37          'large-icon' => $core->adminurl->decode('load.plugin.file',array('pf' => 'antispam/icon-big.png')), 
    3638          'permissions' => 'admin') 
    3739     ); 
     
    7981          if ($ttl != null && $ttl >=0) { 
    8082               echo '<p>'.sprintf(__('All spam comments older than %s day(s) will be automatically deleted.'), $ttl).' '. 
    81                sprintf(__('You can modify this duration in the %s'),'<a href="blog_pref.php#antispam_moderation_ttl"> '.__('Blog settings').'</a>'). 
     83               sprintf(__('You can modify this duration in the %s'),'<a href="'.$core->adminurl->get('admin.blog.pref'). 
     84                    '#antispam_moderation_ttl"> '.__('Blog settings').'</a>'). 
    8285               '.</p>'; 
    8386          } 
     
    9396          ' '.__('days'). 
    9497          '</label></p>'. 
    95           '<p><a href="plugin.php?p=antispam">'.__('Set spam filters.').'</a></p>'. 
     98          '<p><a href="'.$core->adminurl->get('admin.plugin.antispam').'">'.__('Set spam filters.').'</a></p>'. 
    9699          '</div>'; 
    97100     } 
  • plugins/antispam/inc/class.dc.spamfilter.php

    r2566 r2823  
    4040          } 
    4141 
    42           $this->gui_url = 'plugin.php?p=antispam&f='.get_class($this); 
     42          $this->gui_url = $core->adminurl->decode('admin.plugin.antispam',array('f' => get_class($this))); 
    4343     } 
    4444 
  • plugins/antispam/inc/lib.dc.antispam.php

    r2566 r2823  
    7575          if (($count = self::countSpam($core)) > 0) { 
    7676               $str = ($count > 1) ? __('(including %d spam comments)') : __('(including %d spam comment)'); 
    77                $icons['comments'][0] .= '</span></a> <br /><a href="comments.php?status=-2"><span>'.sprintf($str,$count); 
     77               $icons['comments'][0] .= '</span></a> <br /><a href="'.$core->adminurl->get('admin.comments',array('status' => '-2')).'"><span>'. 
     78                    sprintf($str,$count); 
    7879          } 
    7980     } 
     
    8384          if (($count = self::countSpam($core)) > 0) { 
    8485               $str = ($count > 1) ? __('(including %d spam comments)') : __('(including %d spam comment)'); 
    85                return '</span></a> <br /><a href="comments.php?status=-2"><span>'.sprintf($str,$count); 
     86               return '</span></a> <br /><a href="'.$core->adminurl->get('admin.comments',array('status' => '-2')).'"><span>'. 
     87                    sprintf($str,$count); 
    8688          } else { 
    8789               return ''; 
  • plugins/antispam/index.php

    r2567 r2823  
    118118          dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
    119119          dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    120           dcPage::jsLoad('index.php?pf=antispam/antispam.js'); 
     120          dcPage::jsLoad($core->adminurl->decode('load.plugin.file',array('pf' => 'antispam/antispam.js'))); 
    121121  } 
    122122  ?> 
    123   <link rel="stylesheet" type="text/css" href="index.php?pf=antispam/style.css" /> 
     123  <link rel="stylesheet" type="text/css" href="<?php echo $core->adminurl->decode('load.plugin.file',array('pf' => 'antispam/style.css')); ?>" /> 
    124124</head> 
    125125<body> 
     
    136136          dcPage::notices(); 
    137137 
    138      echo '<p><a href="plugin.php?p=antispam" class="back">'.__('Back to filters list').'</a></p>'; 
     138     echo '<p><a href="'.$p_url.'" class="back">'.__('Back to filters list').'</a></p>'; 
    139139 
    140140     echo $filter_gui; 
     
    164164     echo 
    165165     '<ul class="spaminfo">'. 
    166      '<li class="spamcount"><a href="comments.php?status=-2">'.__('Junk comments:').'</a> '. 
     166     '<li class="spamcount"><a href="'.$core->adminurl->get('admin.comments',array('status' => '-2')).'">'.__('Junk comments:').'</a> '. 
    167167     '<strong>'.$spam_count.'</strong></li>'. 
    168      '<li class="hamcount"><a href="comments.php?status=1">'.__('Published comments:').'</a> '. 
     168     '<li class="hamcount"><a href="'.$core->adminurl->get('admin.comments',array('status' => '1')).'">'.__('Published comments:').'</a> '. 
    169169     $published_count.'</li>'. 
    170170     '</ul>'; 
     
    179179     if ($moderationTTL != null && $moderationTTL >=0) { 
    180180          echo '<p>'.sprintf(__('All spam comments older than %s day(s) will be automatically deleted.'), $moderationTTL).' '. 
    181           sprintf(__('You can modify this duration in the %s'),'<a href="blog_pref.php#antispam_moderation_ttl"> '.__('Blog settings').'</a>'). 
     181          sprintf(__('You can modify this duration in the %s'),'<a href="'.$core->adminurl->get('admin.blog.pref'). 
     182               '#antispam_moderation_ttl"> '.__('Blog settings').'</a>'). 
    182183               '.</p>'; 
    183184     } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map