Dotclear

Changeset 782:01efbf050a8a for plugins


Ignore:
Timestamp:
12/06/11 11:43:14 (14 years ago)
Author:
Dsls <dsls@…>
Branch:
formfilters
Parents:
781:b509ac00bf4a (diff), 779:58c45f1b96e5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged last default changes with formfilter branch

Location:
plugins
Files:
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • plugins/aboutConfig/index.php

    r589 r782  
    132132<div id="local" class="multi-part" title="<?php echo __('blog settings'); ?>"> 
    133133 
    134 <?php  
     134<?php 
    135135$table_header = '<table class="settings" id="%s"><caption>%s</caption>'. 
    136136'<thead>'. 
     
    146146 
    147147$settings = array(); 
     148 
    148149foreach ($core->blog->settings->dumpNamespaces() as $ns => $namespace) { 
    149150     foreach ($namespace->dumpSettings() as $k => $v) { 
  • plugins/aboutConfig/index.php

    r457 r782  
    44# This file is part of Dotclear 2. 
    55# 
    6 # Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear 
     6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1212if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    1313 
     14# Local navigation 
     15if (!empty($_POST['gs_nav'])) { 
     16     http::redirect($p_url.$_POST['gs_nav']); 
     17     exit; 
     18} 
     19if (!empty($_POST['ls_nav'])) { 
     20     http::redirect($p_url.$_POST['ls_nav']); 
     21     exit; 
     22} 
     23 
    1424# Local settings update 
    1525if (!empty($_POST['s']) && is_array($_POST['s'])) 
     
    7686     return 
    7787     '<tr>'. 
    78      '<td><label for="s_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></td>'. 
    79      '<th scope="row">'.$field.'</th>'. 
     88     '<td scope="raw"><label for="s_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></td>'. 
     89     '<td>'.$field.'</td>'. 
    8090     '<td>'.$s['type'].'</td>'. 
    8191     '<td>'.html::escapeHTML($s['label']).'</td>'. 
     
    8898  <?php echo dcPage::jsPageTabs($part); ?> 
    8999  <style type="text/css"> 
    90   .ns-name { background: #dfdfdf; color: #333; padding-top: 0.3em; padding-bottom: 0.3em; font-size: 1.1em; } 
     100  table.settings { border: 1px solid #999; margin-bottom: 2em; } 
     101  table.settings th { background: #f5f5f5; color: #444; padding-top: 0.3em; padding-bottom: 0.3em; } 
     102  p.anchor-nav {float: right; } 
    91103  </style> 
     104     <script type="text/javascript"> 
     105     //<![CDATA[ 
     106     $(function() { 
     107          $("#gs_submit").hide(); 
     108          $("#ls_submit").hide(); 
     109          $("#gs_nav").change(function() { 
     110               window.location = $("#gs_nav option:selected").val(); 
     111          }) 
     112          $("#ls_nav").change(function() { 
     113               window.location = $("#ls_nav option:selected").val(); 
     114          }) 
     115     }); 
     116     //]]> 
     117     </script> 
    92118</head> 
    93119 
     
    102128} 
    103129?> 
    104 <h2><?php echo html::escapeHTML($core->blog->name); ?> &rsaquo; about:config</h2> 
     130<h2><?php echo html::escapeHTML($core->blog->name); ?> &rsaquo; <span class="page-title">about:config</span></h2> 
    105131 
    106132<div id="local" class="multi-part" title="<?php echo __('blog settings'); ?>"> 
    107 <form action="plugin.php" method="post"> 
    108 <table> 
    109 <caption><?php echo __('Local blog settings list'); ?></caption> 
    110 <thead> 
    111 <tr> 
    112   <th scope="col" class="nowrap">Setting ID</th> 
    113   <th scope="col"><?php echo __('Value'); ?></th> 
    114   <th scope="col"><?php echo __('Type'); ?></th> 
    115   <th scope="col" class="maximal"><?php echo __('Description'); ?></th> 
    116 </tr> 
    117 </thead> 
    118 <tbody> 
    119 <?php 
     133 
     134<?php 
     135$table_header = '<table class="settings" id="%s"><caption>%s</caption>'. 
     136'<thead>'. 
     137'<tr>'."\n". 
     138'  <th class="nowrap">Setting ID</th>'."\n". 
     139'  <th>'.__('Value').'</th>'."\n". 
     140'  <th>'.__('Type').'</th>'."\n". 
     141'  <th class="maximalx">'.__('Description').'</th>'."\n". 
     142'</tr>'."\n". 
     143'</thead>'."\n". 
     144'<tbody>'; 
     145$table_footer = '</tbody></table>'; 
     146 
    120147$settings = array(); 
    121148 
     
    125152     } 
    126153} 
    127  
    128154ksort($settings); 
    129  
     155if (count($settings) > 0) { 
     156     $ns_combo = array(); 
     157     foreach ($settings as $ns => $s) { 
     158          $ns_combo[$ns] = '#l_'.$ns; 
     159     } 
     160     echo  
     161          '<form action="plugin.php" method="post">'. 
     162          '<p class="anchor-nav">'. 
     163          '<label for="ls_nav" class="classic">'.__('Goto:').'</label> '.form::combo('ls_nav',$ns_combo). 
     164          ' <input type="submit" value="'.__('Ok').'" id="ls_submit" />'. 
     165          '<input type="hidden" name="p" value="aboutConfig" />'. 
     166          $core->formNonce().'</p></form>'; 
     167} 
     168?> 
     169 
     170<form action="plugin.php" method="post"> 
     171 
     172<?php 
    130173foreach ($settings as $ns => $s) 
    131174{ 
    132175     ksort($s); 
    133      echo '<tr><th scope="row" colspan="4" class="ns-name">namespace: <strong>'.$ns.'</strong></th></tr>'; 
    134       
     176     echo sprintf($table_header,'l_'.$ns,$ns); 
    135177     foreach ($s as $k => $v) 
    136178     { 
    137179          echo settingLine($k,$v,$ns,'s',!$v['global']); 
    138180     } 
    139 } 
    140 ?> 
    141 </tbody> 
    142 </table> 
     181     echo $table_footer; 
     182} 
     183?> 
     184 
    143185<p><input type="submit" value="<?php echo __('Save'); ?>" /> 
    144186<input type="hidden" name="p" value="aboutConfig" /> 
     
    148190 
    149191<div id="global" class="multi-part" title="<?php echo __('global settings'); ?>"> 
    150 <form action="plugin.php" method="post"> 
    151 <table> 
    152 <caption><?php echo __('Global blog settings list'); ?></caption> 
    153 <thead> 
    154 <tr> 
    155   <th scope="col" class="nowrap">Setting ID</th> 
    156   <th scope="col"><?php echo __('Value'); ?></th> 
    157   <th scope="col"><?php echo __('Type'); ?></th> 
    158   <th scope="col" class="maximal"><?php echo __('Description'); ?></th> 
    159 </tr> 
    160 </thead> 
    161 <tbody> 
     192 
    162193<?php 
    163194$settings = array(); 
     
    171202ksort($settings); 
    172203 
     204if (count($settings) > 0) { 
     205     $ns_combo = array(); 
     206     foreach ($settings as $ns => $s) { 
     207          $ns_combo[$ns] = '#g_'.$ns; 
     208     } 
     209     echo  
     210          '<form action="plugin.php" method="post">'. 
     211          '<p class="anchor-nav">'. 
     212          '<label for="gs_nav" class="classic">'.__('Goto:').'</label> '.form::combo('gs_nav',$ns_combo). 
     213          ' <input type="submit" value="'.__('Ok').'" id="gs_submit" />'. 
     214          '<input type="hidden" name="p" value="aboutConfig" />'. 
     215          $core->formNonce().'</p></form>'; 
     216} 
     217?> 
     218 
     219<form action="plugin.php" method="post"> 
     220 
     221<?php 
    173222foreach ($settings as $ns => $s) 
    174223{ 
    175224     ksort($s); 
    176      echo '<tr><th scope="row" colspan="4" class="ns-name">namespace: <strong>'.$ns.'</strong></th></tr>'; 
    177       
     225     echo sprintf($table_header,'g_'.$ns,$ns); 
    178226     foreach ($s as $k => $v) 
    179227     { 
    180228          echo settingLine($k,$v,$ns,'gs',false); 
    181229     } 
    182 } 
    183 ?> 
    184 </tbody> 
    185 </table> 
     230     echo $table_footer; 
     231} 
     232?> 
     233 
    186234<p><input type="submit" value="<?php echo __('Save'); ?>" /> 
    187235<input type="hidden" name="p" value="aboutConfig" /> 
  • plugins/antispam/filters/class.dc.filter.ip.php

    r780 r782  
    44# This file is part of Antispam, a plugin for Dotclear 2. 
    55# 
    6 # Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear 
     6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    123123          '<div class="multi-part" id="tab_'.$type.'" title="'.$title.'">'. 
    124124 
    125           '<form action="'.html::escapeURL($url).'" method="post">'. 
    126           '<fieldset><legend>'.__('Add an IP address').'</legend><p>'. 
     125          '<form action="'.html::escapeURL($url).'" method="post" class="fieldset">'. 
    127126          form::hidden(array('ip_type'),$type). 
    128           '<label class="classic" for="addip_'.$type.'">'.__('Add an IP address').' '. 
     127          '<label class="classic" for="addip_'.$type.'">'.__('Add an IP address: ').' '. 
    129128          form::field(array('addip', 'addip_'.$type),18,255). 
    130129          '</label>'; 
     
    136135          $res .= 
    137136          $core->formNonce(). 
    138           '<input type="submit" value="'.__('Add').'"/></p>'. 
    139           '</fieldset></form>'; 
     137          '</p>'. 
     138          '<p><input type="submit" value="'.__('Add').'"/></p>'. 
     139          '</form>'; 
    140140 
    141141          $rs = $this->getRules($type); 
     
    149149               $res .= 
    150150               '<form action="'.html::escapeURL($url).'" method="post">'. 
    151                '<fieldset><legend>' . __('IP list') . '</legend>'. 
     151               '<h3>' . __('IP list') . '</h3>'. 
    152152               '<div style="'.$this->style_list.'">'; 
    153153 
     
    167167 
    168168                    $res .= 
    169                     '<p style="'.$p_style.'"><label class="classic">'. 
    170                     form::checkbox(array('delip[]'),$rs->rule_id,false,'','',$disabled_ip, 'title="'.html::escapeHTML($pattern).'"').' '. 
     169                    '<p style="'.$p_style.'"><label class="classic" for="'.$type.'-ip-'.$rs->rule_id.'">'. 
     170                    form::checkbox(array('delip[]',$type.'-ip-'.$rs->rule_id),$rs->rule_id,false,'','',$disabled_ip).' '. 
    171171                    html::escapeHTML($pattern). 
    172172                    '</label></p>'; 
     
    178178               form::hidden(array('ip_type'),$type). 
    179179               '</p>'. 
    180                '</fieldset></form>'; 
     180               '</form>'; 
    181181          } 
    182182 
  • plugins/antispam/index.php

    r776 r782  
    121121{ 
    122122     echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.$page_name.'</span></h2>'; 
    123  
    124123     # Information 
    125124     $spam_count = dcAntispam::countSpam($core); 
     
    232231</body> 
    233232</html> 
     233 
  • plugins/antispam/index.php

    r457 r782  
    44# This file is part of Antispam, a plugin for Dotclear 2. 
    55# 
    6 # Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear 
     6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    110110<body> 
    111111<?php 
    112 echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.$page_name.'</h2>'; 
    113112 
    114113if ($filter_gui !== false) 
    115114{ 
    116      echo '<p><a href="'.$p_url.'">'.__('Return to filters').'</a></p>'; 
    117      printf('<h3>'.__('%s configuration').'</h3>',$filter->name); 
     115     echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <a href="'.$p_url.'">'.$page_name.'</a>'. 
     116          ' &rsaquo; <span class="page-title">'.sprintf(__('%s configuration'),$filter->name).'</span></h2>'; 
    118117 
    119118     echo $filter_gui; 
     
    121120else 
    122121{ 
     122     echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.$page_name.'</span></h2>'; 
    123123     # Information 
    124124     $spam_count = dcAntispam::countSpam($core); 
     
    127127 
    128128     echo 
    129      '<form action="'.$p_url.'" method="post">'. 
    130      '<fieldset><legend>'.__('Information').'</legend>'; 
     129     '<form action="'.$p_url.'" method="post" class="fieldset">'. 
     130     '<h3>'.__('Information').'</h3>'; 
    131131 
    132132     if (!empty($_GET['del'])) { 
     
    150150     } 
    151151     if ($moderationTTL != null && $moderationTTL >=0) { 
    152           echo '<p>'.sprintf(__('All spam comments older than %s day(s) will be automatically deleted.'), $moderationTTL).'</p>'; 
    153      } 
    154      echo '</fieldset></form>'; 
     152          echo '<p>'.sprintf(__('All spam comments older than %s day(s) will be automatically deleted.'), $moderationTTL).' '. 
     153          __('You can modify this duration in '). 
     154          '<a href="blog_pref.php"> '.__('Blog preferences').'</a></p>'; 
     155     } 
     156     echo '</form>'; 
    155157 
    156158 
    157159     # Filters 
    158160     echo 
    159      '<form action="'.$p_url.'" method="post">'. 
    160      '<fieldset><legend>'.__('Available spam filters').'</legend>'; 
     161     '<form action="'.$p_url.'" method="post" class="fieldset">'; 
    161162 
    162163     if (!empty($_GET['upd'])) { 
     
    166167     echo 
    167168     '<table class="dragable">'. 
    168      '<caption>'.__('Antispan filters list').'</caption>'. 
     169     '<caption>'.__('Available spam filters').'</caption>'. 
    169170     '<thead><tr>'. 
    170      '<th scope="col">'.__('Order').'</th>'. 
    171      '<th scope="col">'.__('Active').'</th>'. 
    172      '<th scope="col">'.__('Auto Del.').'</th>'. 
    173      '<th scope="col" class="nowrap">'.__('Filter name').'</th>'. 
    174      '<th scope="col" colspan="2">'.__('Description').'</th>'. 
     171     '<th>'.__('Order').'</th>'. 
     172     '<th>'.__('Active').'</th>'. 
     173     '<th>'.__('Auto Del.').'</th>'. 
     174     '<th class="nowrap">'.__('Filter name').'</th>'. 
     175     '<th colspan="2">'.__('Description').'</th>'. 
    175176     '</tr></thead>'. 
    176177     '<tbody id="filters-list" >'; 
     
    192193          '<td class="nowrap">'.form::checkbox(array('filters_active[]'),$fid,$f->active, '', '', false, 'title="'.__('Active').'"').'</td>'. 
    193194          '<td class="nowrap">'.form::checkbox(array('filters_auto_del[]'),$fid,$f->auto_delete, '', '', false, 'title="'.__('Auto Del.').'"').'</td>'. 
    194           '<th scope="row" class="nowrap">'.$f->name.'</th>'. 
     195          '<td class="nowrap" scope="raw">'.$f->name.'</td>'. 
    195196          '<td class="maximal">'.$f->description.'</td>'. 
    196197          '<td class="status">'.$gui_link.'</td>'. 
     
    203204     $core->formNonce(). 
    204205     '<input type="submit" name="filters_upd" value="'.__('Save').'" /></p>'. 
    205      '</fieldset></form>'; 
     206     '</form>'; 
    206207 
    207208 
     
    209210     if (DC_ADMIN_URL) 
    210211     { 
    211           $ham_feed = $core->blog->url.$core->url->getBase('hamfeed').'/'.$code = dcAntispam::getUserCode($core); 
    212           $spam_feed = $core->blog->url.$core->url->getBase('spamfeed').'/'.$code = dcAntispam::getUserCode($core); 
     212          $ham_feed = $core->blog->url.$core->url->getURLFor( 
     213               'hamfeed', 
     214               $code = dcAntispam::getUserCode($core) 
     215          ); 
     216          $spam_feed = $core->blog->url.$core->url->getURLFor( 
     217               'spamfeed', 
     218               $code = dcAntispam::getUserCode($core) 
     219          ); 
    213220 
    214221          echo 
    215           '<fieldset><legend>'.__('Syndication').'</legend>'. 
     222          '<h3>'.__('Syndication').'</h3>'. 
    216223          '<ul class="spaminfo">'. 
    217224          '<li class="feed"><a href="'.$spam_feed.'">'.__('Junk comments RSS feed').'</a></li>'. 
    218225          '<li class="feed"><a href="'.$ham_feed.'">'.__('Published comments RSS feed').'</a></li>'. 
    219           '</ul>'. 
    220           '</fieldset>'; 
     226          '</ul>'; 
    221227     } 
    222228} 
  • plugins/blogroll/index.php

    r717 r782  
    242242<form action="plugin.php" method="post" id="links-form"> 
    243243<table class="maximal dragable"> 
     244<caption><?php echo __('Links list'); ?></caption> 
    244245<thead> 
    245246<tr> 
    246   <th colspan="3"><?php echo __('Title'); ?></th> 
    247   <th><?php echo __('Description'); ?></th> 
    248   <th><?php echo __('URL'); ?></th> 
    249   <th><?php echo __('Lang'); ?></th> 
     247  <th scope="col" colspan="3"><?php echo __('Title'); ?></th> 
     248  <th scope="col"><?php echo __('Description'); ?></th> 
     249  <th scope="col"><?php echo __('URL'); ?></th> 
     250  <th scope="col"><?php echo __('Lang'); ?></th> 
    250251</tr> 
    251252</thead> 
     
    265266     { 
    266267          echo 
    267           '<td colspan="5"><strong><a href="'.$p_url.'&amp;edit=1&amp;id='.$rs->link_id.'">'. 
    268           html::escapeHTML($rs->link_desc).'</a></strong></td>'; 
     268          '<th scope="row" colspan="5"><strong><a href="'.$p_url.'&amp;edit=1&amp;id='.$rs->link_id.'">'. 
     269          html::escapeHTML($rs->link_desc).'</a></strong></th>'; 
    269270     } 
    270271     else 
    271272     { 
    272273          echo 
    273           '<td><a href="'.$p_url.'&amp;edit=1&amp;id='.$rs->link_id.'">'. 
    274           html::escapeHTML($rs->link_title).'</a></td>'. 
     274          '<th scope="row"><a href="'.$p_url.'&amp;edit=1&amp;id='.$rs->link_id.'">'. 
     275          html::escapeHTML($rs->link_title).'</a></th>'. 
    275276          '<td>'.html::escapeHTML($rs->link_desc).'</td>'. 
    276277          '<td>'.html::escapeHTML($rs->link_href).'</td>'. 
  • plugins/blogroll/index.php

    r457 r782  
    44# This file is part of Dotclear 2. 
    55# 
    6 # Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear 
     6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    163163<html> 
    164164<head> 
    165   <title>Blogroll</title> 
     165  <title><?php echo __('Blogroll'); ?></title> 
    166166  <?php echo dcPage::jsToolMan(); ?> 
    167167  <?php echo dcPage::jsConfirmClose('links-form','add-link-form','add-category-form'); ?> 
     
    215215 
    216216<body> 
    217 <h2><?php echo html::escapeHTML($core->blog->name); ?> &rsaquo; Blogroll</h2> 
     217<h2><?php echo html::escapeHTML($core->blog->name); ?> &rsaquo; <span class="page-title"><?php echo __('Blogroll'); ?></span></h2> 
    218218 
    219219<?php 
     
    312312'<fieldset class="two-cols"><legend>'.__('Add a new link').'</legend>'. 
    313313'<p class="col"><label for="link_title" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').' '. 
    314 form::field('link_title',30,255,$link_title,'',2). 
     314form::field('link_title',30,255,$link_title). 
    315315'</label></p>'. 
    316316 
    317317'<p class="col"><label for="link_href" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('URL:').' '. 
    318 form::field('link_href',30,255,$link_href,'',3). 
     318form::field('link_href',30,255,$link_href). 
    319319'</label></p>'. 
    320320 
    321321'<p class="col"><label for="link_desc">'.__('Description:').' '. 
    322 form::field('link_desc',30,255,$link_desc,'',4). 
     322form::field('link_desc',30,255,$link_desc). 
    323323'</label></p>'. 
    324324 
    325325'<p class="col"><label for="link_lang">'.__('Language:').' '. 
    326 form::field('link_lang',5,5,$link_lang,'',5). 
     326form::field('link_lang',5,5,$link_lang). 
    327327'</label></p>'. 
    328328'<p>'.form::hidden(array('p'),'blogroll'). 
    329329$core->formNonce(). 
    330 '<input type="submit" name="add_link" value="'.__('Save').'" tabindex="6" /></p>'. 
     330'<input type="submit" name="add_link" value="'.__('Save').'" /></p>'. 
    331331'</fieldset>'. 
    332332'</form>'. 
     
    338338'<fieldset><legend>'.__('Add a new category').'</legend>'. 
    339339'<p><label for="cat_title" class=" classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').' '. 
    340 form::field('cat_title',30,255,$cat_title,'',7).'</label> '. 
     340form::field('cat_title',30,255,$cat_title).'</label> '. 
    341341form::hidden(array('p'),'blogroll'). 
    342342$core->formNonce(). 
    343 '<input type="submit" name="add_cat" value="'.__('Save').'" tabindex="8" /></p>'. 
     343'<input type="submit" name="add_cat" value="'.__('Save').'" /></p>'. 
    344344'</fieldset>'. 
    345345'</form>'. 
     
    356356     '<p>'.form::hidden(array('p'),'blogroll'). 
    357357     $core->formNonce(). 
    358      '<input type="submit" name="import_links" value="'.__('import').'" tabindex="10" /></p>'. 
     358     '<input type="submit" name="import_links" value="'.__('Import').'" /></p>'. 
    359359     '</fieldset>'. 
    360360     '</form>'; 
     
    399399          form::hidden(array('p'),'blogroll'). 
    400400          $core->formNonce(). 
    401           '<input type="submit" name="cancel_import" value="'.__('cancel').'" tabindex="10" />&nbsp;'. 
    402           '<input type="submit" name="import_links_do" value="'.__('import').'" tabindex="11" /></p>'. 
     401          '<input type="submit" name="cancel_import" value="'.__('Cancel').'" />&nbsp;'. 
     402          '<input type="submit" name="import_links_do" value="'.__('Import').'" /></p>'. 
    403403          '</div>'; 
    404404     } 
  • plugins/pages/list.php

    r578 r782  
    1515/* Pager class 
    1616-------------------------------------------------------- */ 
    17 class adminPageList extends adminGenericList 
     17class adminPageList extends adminPostList 
    1818{ 
    19      public function display($page,$nb_per_page,$enclose_block='') 
     19     public function setColumns() 
    2020     { 
    21           if ($this->rs->isEmpty()) 
    22           { 
    23                echo '<p><strong>'.__('No page').'</strong></p>'; 
    24           } 
    25           else 
    26           { 
    27                $pager = new pager($page,$this->rs_count,$nb_per_page,10); 
    28                $pager->html_prev = $this->html_prev; 
    29                $pager->html_next = $this->html_next; 
    30                $pager->var_page = 'page'; 
    31                 
    32                $html_block = 
    33                '<table class="clear"><tr>'. 
    34                '<th colspan="2">'.__('Title').'</th>'. 
    35                '<th>'.__('Date').'</th>'. 
    36                '<th>'.__('Author').'</th>'. 
    37                '<th>'.__('Comments').'</th>'. 
    38                '<th>'.__('Trackbacks').'</th>'. 
    39                '<th>'.__('Status').'</th>'. 
    40                '</tr>%s</table>'; 
    41                 
    42                if ($enclose_block) { 
    43                     $html_block = sprintf($enclose_block,$html_block); 
    44                } 
    45                 
    46                echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    47                 
    48                $blocks = explode('%s',$html_block); 
    49                 
    50                echo $blocks[0]; 
    51                 
    52                while ($this->rs->fetch()) 
    53                { 
    54                     echo $this->postLine(); 
    55                } 
    56                 
    57                echo $blocks[1]; 
    58                 
    59                echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    60           } 
     21          $this->addColumn('title',__('Title'),array('adminPostList','getTitle'),' class="maximal"',false); 
     22          $this->addColumn('date',__('Date'),array('adminPostList','getDate')); 
     23          $this->addColumn('author',__('Author'),array('adminPostList','getAuthor')); 
     24          $this->addColumn('comment',__('Comments'),array('adminPostList','getComments')); 
     25          $this->addColumn('trackback',__('Trackbacks'),array('adminPostList','getTrackbacks')); 
     26          $this->addColumn('status',__('Status'),array('adminPostList','getStatus')); 
    6127     } 
    6228      
    63      private function postLine() 
     29     protected function getDefaultCaption() 
    6430     { 
    65           $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
    66           switch ($this->rs->post_status) { 
    67                case 1: 
    68                     $img_status = sprintf($img,__('published'),'check-on.png'); 
    69                     break; 
    70                case 0: 
    71                     $img_status = sprintf($img,__('unpublished'),'check-off.png'); 
    72                     break; 
    73                case -1: 
    74                     $img_status = sprintf($img,__('scheduled'),'scheduled.png'); 
    75                     break; 
    76                case -2: 
    77                     $img_status = sprintf($img,__('pending'),'check-wrn.png'); 
    78                     break; 
    79           } 
    80            
    81           $protected = ''; 
    82           if ($this->rs->post_password) { 
    83                $protected = sprintf($img,__('protected'),'locker.png'); 
    84           } 
    85            
    86           $selected = ''; 
    87           if ($this->rs->post_selected) { 
    88                $selected = sprintf($img,__('selected'),'selected.png'); 
    89           } 
    90            
    91           $attach = ''; 
    92           $nb_media = $this->rs->countMedia(); 
    93           if ($nb_media > 0) { 
    94                $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments'); 
    95                $attach = sprintf($img,sprintf($attach_str,$nb_media),'attach.png'); 
    96           } 
    97            
    98           $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 
    99           ' id="p'.$this->rs->post_id.'">'; 
    100            
    101           $res .= 
    102           '<td class="nowrap">'. 
    103           form::checkbox(array('entries[]'),$this->rs->post_id,'','','',!$this->rs->isEditable(),'title="'.__('select this page').'"').'</td>'. 
    104           '<td class="maximal"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'. 
    105           html::escapeHTML($this->rs->post_title).'</a></td>'. 
    106           '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 
    107            
    108           '<td class="nowrap">'.$this->rs->user_id.'</td>'. 
    109           '<td class="nowrap">'.$this->rs->nb_comment.'</td>'. 
    110           '<td class="nowrap">'.$this->rs->nb_trackback.'</td>'. 
    111           '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 
    112           '</tr>'; 
    113            
    114           return $res; 
     31          return __('Pages list'); 
    11532     } 
    11633} 
  • plugins/pages/list.php

    r457 r782  
    44# This file is part of Dotclear 2. 
    55# 
    6 # Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear 
     6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    6464     $combo_action[__('publish')] = 'publish'; 
    6565     $combo_action[__('unpublish')] = 'unpublish'; 
     66     $combo_action[__('schedule')] = 'schedule'; 
    6667     $combo_action[__('mark as pending')] = 'pending'; 
    6768} 
     
    9394<body> 
    9495<?php 
    95 echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Pages').'</h2>'. 
     96echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Pages').'</span></h2>'. 
    9697'<p class="top-add"><a class="button add" href="'.$p_url.'&amp;act=page">'.__('New page').'</a></p>'; 
    9798 
  • plugins/tags/_admin.php

    r776 r782  
    137137           
    138138          return  
    139           '<script type="text/javascript" src="index.php?pf=tags/js/jquery.autocomplete.js"></script>'. 
    140           '<script type="text/javascript" src="index.php?pf=tags/js/posts_actions.js"></script>'. 
    141139          '<script type="text/javascript">'."\n". 
    142140          "//<![CDATA[\n". 
     
    153151          "\n//]]>\n". 
    154152          "</script>\n". 
     153          '<script type="text/javascript" src="index.php?pf=tags/js/posts_actions.js"></script>'. 
     154          dcPage::jqueryUI(). 
    155155          '<link rel="stylesheet" type="text/css" href="index.php?pf=tags/style.css" />'; 
    156156     } 
     
    172172               try 
    173173               { 
    174  
    175174                    $meta =& $GLOBALS['core']->meta; 
    176175                    $tags = $meta->splitMetaValues($_POST['new_tags']); 
  • plugins/tags/_admin.php

    r756 r782  
    44# This file is part of Dotclear 2. 
    55# 
    6 # Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear 
     6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    3131 
    3232$core->addBehavior('adminPreferencesForm',array('tagsBehaviors','adminUserForm')); 
    33 $core->addBehavior('adminUserForm',array('tagsBehaviors','adminUserForm')); 
     33// $core->addBehavior('adminUserForm',array('tagsBehaviors','adminUserForm')); 
    3434 
    3535$core->addBehavior('adminBeforeUserCreate',array('tagsBehaviors','setTagListFormat')); 
     
    4545     public static function dashboardFavs($core,$favs) 
    4646     { 
    47           $favs['tags'] = new ArrayObject(array('tags',__('Tags'),'plugin.php?p=tags&amp;m=tags', 
     47          $favs['tags'] = new ArrayObject(array('tags','Tags','plugin.php?p=tags&amp;m=tags', 
    4848               'index.php?pf=tags/icon.png','index.php?pf=tags/icon-big.png', 
    4949               'usage,contentadmin',null,null)); 
     
    6363           
    6464           
    65           $tag_url = html::stripHostURL($GLOBALS['core']->blog->url.$GLOBALS['core']->url->getBase('tag')); 
     65          $tag_url = html::stripHostURL($GLOBALS['core']->blog->url.$GLOBALS['core']->url->getURLFor('tag')); 
    6666          $res['url'] = $tag_url.'/'.rawurlencode(dcMeta::sanitizeMetaID($url)); 
    6767          $res['content'] = $content; 
     
    8282          echo 
    8383          '<h3><label for="post_tags">'.__('Tags:').'</label></h3>'. 
    84           '<div class="p" id="tags-edit">'.form::textarea('post_tags',20,3,$value,'maximal',3).'</div>'; 
     84          '<div class="p" id="tags-edit">'.form::textarea('post_tags',20,3,$value,'maximal').'</div>'; 
    8585     } 
    8686      
     
    102102     public static function postHeaders() 
    103103     { 
    104           $tag_url = $GLOBALS['core']->blog->url.$GLOBALS['core']->url->getBase('tag'); 
    105            
    106           $opts = $GLOBALS['core']->auth->getOptions(); 
     104          $tag_url = $GLOBALS['core']->blog->url.$GLOBALS['core']->url->getURLFor('tag'); 
     105           
     106          $opts = $GLOBALS['core']->blog->url.$GLOBALS['core']->auth->getOptions(); 
    107107          $type = isset($opts['tag_list_format']) ? $opts['tag_list_format'] : 'more'; 
    108108           
    109109          return  
    110           dcPage::jqueryUI(). 
     110          '<script type="text/javascript" src="index.php?pf=tags/js/jquery.autocomplete.js"></script>'. 
    111111          '<script type="text/javascript" src="index.php?pf=tags/js/post.js"></script>'. 
    112112          '<script type="text/javascript">'."\n". 
     
    131131     public static function postsActionsHeaders() 
    132132     { 
    133           $tag_url = $GLOBALS['core']->blog->url.$GLOBALS['core']->url->getBase('tag'); 
     133          $tag_url = $GLOBALS['core']->blog->url.$GLOBALS['core']->url->getURLFor('tag'); 
    134134           
    135135          $opts = $GLOBALS['core']->auth->getOptions(); 
     
    222222     } 
    223223      
    224      public static function adminPostsActionsContent($core,$action,$hidden_fields) 
     224     public static function adminPostsActionsContent($core,$action,$hidden_fields,$form_uri="posts_actions.php") 
    225225     { 
    226226          if ($action == 'tags') 
    227227          { 
    228228               echo 
    229                '<h2>'.__('Add tags to entries').'</h2>'. 
    230                '<form action="posts_actions.php" method="post">'. 
     229               '<h2 class="page-title">'.__('Add tags to entries').'</h2>'. 
     230               '<form action="'.$form_uri.'" method="post">'. 
    231231               '<div><label for="new_tags" class="area">'.__('Tags to add:').'</label> '. 
    232232               form::textarea('new_tags',60,3). 
     
    257257               } 
    258258                
    259                echo '<h2>'.__('Remove selected tags from entries').'</h2>'; 
     259               echo '<h2 class="page-title">'.__('Remove selected tags from entries').'</h2>'; 
    260260                
    261261               if (empty($tags)) { 
     
    267267                
    268268               echo 
    269                '<form action="posts_actions.php" method="post">'. 
     269               '<form action="'.$form_uri.'" method="post">'. 
    270270               '<fieldset><legend>'.__('Following tags have been found in selected entries:').'</legend>'; 
    271271                
  • plugins/tags/tags.php

    r711 r782  
    4343               $col = 1; 
    4444          } 
    45           $cols[$col] .= '<tr class="tagLetter"><td colspan="2"><span>'.$letter.'</span></td></tr>'; 
     45          $cols[$col] .= '<tr class="tagLetter"><th scope="row" colspan="2"><span>'.$letter.'</span></th></tr>'; 
    4646     } 
    4747      
    4848     $cols[$col] .= 
    4949     '<tr class="line">'. 
    50           '<td class="maximal"><a href="'.$p_url. 
    51           '&amp;m=tag_posts&amp;tag='.rawurlencode($tags->meta_id).'">'.$tags->meta_id.'</a></td>'. 
     50          '<th scope="row" class="maximal"><a href="'.$p_url. 
     51          '&amp;m=tag_posts&amp;tag='.rawurlencode($tags->meta_id).'">'.$tags->meta_id.'</a></th>'. 
    5252          '<td class="nowrap"><strong>'.$tags->count.'</strong> '. 
    5353          (($tags->count==1) ? __('entry') : __('entries')).'</td>'. 
     
    5757} 
    5858 
    59 $table = '<div class="col"><table class="tags">%s</table></div>'; 
     59$table = 
     60'<div class="col"><table class="tags"><caption>'. 
     61__('Tags list'). 
     62'</caption><tbody>%s</tbody></table></div>'; 
    6063 
    6164if ($cols[0]) 
  • plugins/tags/tags.php

    r457 r782  
    44# This file is part of Dotclear 2. 
    55# 
    6 # Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear 
     6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1515<html> 
    1616<head> 
    17   <title>Tags</title> 
     17  <title><?php echo __('Tags'); ?></title> 
    1818  <link rel="stylesheet" type="text/css" href="index.php?pf=tags/style.css" /> 
    1919</head> 
     
    2121<body> 
    2222<h2><?php echo html::escapeHTML($core->blog->name); ?> &rsaquo; 
    23 <?php echo __('Tags'); ?></h2> 
     23<span class="page-title"><?php echo __('Tags'); ?></span></h2> 
    2424 
    2525<?php 
  • plugins/userPref/index.php

    r589 r782  
    128128<div id="local" class="multi-part" title="<?php echo __('user preferences'); ?>"> 
    129129 
    130 <?php  
     130<?php 
    131131$table_header = '<table class="prefs" id="%s"><caption>%s</caption>'. 
    132132'<thead>'. 
     
    142142 
    143143$prefs = array(); 
     144 
    144145foreach ($core->auth->user_prefs->dumpWorkspaces() as $ws => $workspace) { 
    145146     foreach ($workspace->dumpPrefs() as $k => $v) { 
  • plugins/userPref/index.php

    r457 r782  
    44# This file is part of Dotclear 2. 
    55# 
    6 # Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear 
     6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 
    77# Licensed under the GPL version 2.0 license. 
    88# See LICENSE file or 
     
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    1212if (!defined('DC_CONTEXT_ADMIN')) { return; } 
     13 
     14# Local navigation 
     15if (!empty($_POST['gp_nav'])) { 
     16     http::redirect($p_url.$_POST['gp_nav']); 
     17     exit; 
     18} 
     19if (!empty($_POST['lp_nav'])) { 
     20     http::redirect($p_url.$_POST['lp_nav']); 
     21     exit; 
     22} 
    1323 
    1424# Local prefs update 
     
    7282     return 
    7383     '<tr>'. 
    74      '<th scope="row"><label for="s_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></th>'. 
     84     '<td scope="raw"><label for="s_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></td>'. 
    7585     '<td>'.$field.'</td>'. 
    7686     '<td>'.$s['type'].'</td>'. 
     
    8494  <?php echo dcPage::jsPageTabs($part); ?> 
    8595  <style type="text/css"> 
    86   .ws-name { background: #ccc; color: #000; padding-top: 0.3em; padding-bottom: 0.3em; font-size: 1.1em; } 
     96     table.prefs { border: 1px solid #999; margin-bottom: 2em; } 
     97     table.prefs th { background: #f5f5f5; color: #444; padding-top: 0.3em; padding-bottom: 0.3em; } 
     98     p.anchor-nav {float: right; } 
    8799  </style> 
     100     <script type="text/javascript"> 
     101     //<![CDATA[ 
     102     $(function() { 
     103          $("#gp_submit").hide(); 
     104          $("#lp_submit").hide(); 
     105          $("#gp_nav").change(function() { 
     106               window.location = $("#gp_nav option:selected").val(); 
     107          }) 
     108          $("#lp_nav").change(function() { 
     109               window.location = $("#lp_nav option:selected").val(); 
     110          }) 
     111     }); 
     112     //]]> 
     113     </script> 
    88114</head> 
    89115 
     
    98124} 
    99125?> 
    100 <h2><?php echo html::escapeHTML($core->auth->userID()); ?> &rsaquo; user:preferences</h2> 
     126<h2><?php echo html::escapeHTML($core->auth->userID()); ?> &rsaquo; <span class="page-title">user:preferences</span></h2> 
    101127 
    102128<div id="local" class="multi-part" title="<?php echo __('user preferences'); ?>"> 
    103 <form action="plugin.php" method="post"> 
    104 <table> 
    105 <caption><?php echo __('Local user preferences list'); ?></caption> 
    106 <thead> 
    107 <tr> 
    108   <th scope="col" class="nowrap">Pref ID</th> 
    109   <th scope="col"><?php echo __('Value'); ?></th> 
    110   <th scope="col"><?php echo __('Type'); ?></th> 
    111   <th scope="col" class="maximal"><?php echo __('Description'); ?></th> 
    112 </tr> 
    113 </thead> 
    114 <tbody> 
    115 <?php 
     129 
     130<?php 
     131$table_header = '<table class="prefs" id="%s"><caption>%s</caption>'. 
     132'<thead>'. 
     133'<tr>'."\n". 
     134'  <th class="nowrap">Setting ID</th>'."\n". 
     135'  <th>'.__('Value').'</th>'."\n". 
     136'  <th>'.__('Type').'</th>'."\n". 
     137'  <th class="maximalx">'.__('Description').'</th>'."\n". 
     138'</tr>'."\n". 
     139'</thead>'."\n". 
     140'<tbody>'; 
     141$table_footer = '</tbody></table>'; 
     142 
    116143$prefs = array(); 
    117144 
     
    121148     } 
    122149} 
    123  
    124150ksort($prefs); 
    125  
     151if (count($prefs) > 0) { 
     152     $ws_combo = array(); 
     153     foreach ($prefs as $ws => $s) { 
     154          $ws_combo[$ws] = '#l_'.$ws; 
     155     } 
     156     echo  
     157          '<form action="plugin.php" method="post">'. 
     158          '<p class="anchor-nav">'. 
     159          '<label for="lp_nav" class="classic">'.__('Goto:').'</label> '.form::combo('lp_nav',$ws_combo). 
     160          ' <input type="submit" value="'.__('Ok').'" id="lp_submit" />'. 
     161          '<input type="hidden" name="p" value="aboutConfig" />'. 
     162          $core->formNonce().'</p></form>'; 
     163} 
     164?> 
     165 
     166<form action="plugin.php" method="post"> 
     167 
     168<?php 
    126169foreach ($prefs as $ws => $s) 
    127170{ 
    128171     ksort($s); 
    129      echo '<tr><th scope="row" colspan="4" class="ws-name">workspace: <strong>'.$ws.'</strong></th></tr>'; 
    130       
     172     echo sprintf($table_header,'l_'.$ws,$ws); 
    131173     foreach ($s as $k => $v) 
    132174     { 
    133175          echo prefLine($k,$v,$ws,'s',!$v['global']); 
    134176     } 
    135 } 
    136 ?> 
    137 </tbody> 
    138 </table> 
     177     echo $table_footer; 
     178} 
     179?> 
     180 
    139181<p><input type="submit" value="<?php echo __('Save'); ?>" /> 
    140182<input type="hidden" name="p" value="userPref" /> 
     
    144186 
    145187<div id="global" class="multi-part" title="<?php echo __('global preferences'); ?>"> 
    146 <form action="plugin.php" method="post"> 
    147 <table> 
    148 <caption><?php echo __('Global user preferences list'); ?></caption> 
    149 <thead> 
    150 <tr> 
    151   <th scope="col" class="nowrap">Pref ID</th> 
    152   <th scope="col"><?php echo __('Value'); ?></th> 
    153   <th scope="col"><?php echo __('Type'); ?></th> 
    154   <th scope="col" class="maximal"><?php echo __('Description'); ?></th> 
    155 </tr> 
    156 </thead> 
    157 <tbody> 
     188 
    158189<?php 
    159190$prefs = array(); 
     
    167198ksort($prefs); 
    168199 
     200if (count($prefs) > 0) { 
     201     $ws_combo = array(); 
     202     foreach ($prefs as $ws => $s) { 
     203          $ws_combo[$ws] = '#g_'.$ws; 
     204     } 
     205     echo  
     206          '<form action="plugin.php" method="post">'. 
     207          '<p class="anchor-nav">'. 
     208          '<label for="gp_nav" class="classic">'.__('Goto:').'</label> '.form::combo('gp_nav',$ws_combo). 
     209          ' <input type="submit" value="'.__('Ok').'" id="gp_submit" />'. 
     210          '<input type="hidden" name="p" value="aboutConfig" />'. 
     211          $core->formNonce().'</p></form>'; 
     212} 
     213?> 
     214 
     215<form action="plugin.php" method="post"> 
     216 
     217<?php 
    169218foreach ($prefs as $ws => $s) 
    170219{ 
    171220     ksort($s); 
    172      echo '<tr><th scope="row" colspan="4" class="ws-name">workspace: <strong>'.$ws.'</strong></th></tr>'; 
    173       
     221     echo sprintf($table_header,'g_'.$ws,$ws); 
    174222     foreach ($s as $k => $v) 
    175223     { 
    176224          echo prefLine($k,$v,$ws,'gs',false); 
    177225     } 
    178 } 
    179 ?> 
    180 </tbody> 
    181 </table> 
     226     echo $table_footer; 
     227} 
     228?> 
     229 
    182230<p><input type="submit" value="<?php echo __('Save'); ?>" /> 
    183231<input type="hidden" name="p" value="userPref" /> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map