Dotclear

Changeset 457:e2c2754452b1 for plugins


Ignore:
Timestamp:
06/30/11 19:38:28 (14 years ago)
Author:
Tomtom33 <tbouron@…>
Branch:
formfilters
Message:

Fixed tables in admin pages - step 2, closes #1068,#1069

Location:
plugins
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • plugins/aboutConfig/index.php

    r220 r457  
    7777     '<tr>'. 
    7878     '<td><label for="s_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></td>'. 
    79      '<td>'.$field.'</td>'. 
     79     '<th scope="row">'.$field.'</th>'. 
    8080     '<td>'.$s['type'].'</td>'. 
    8181     '<td>'.html::escapeHTML($s['label']).'</td>'. 
     
    107107<form action="plugin.php" method="post"> 
    108108<table> 
     109<caption><?php echo __('Local blog settings list'); ?></caption> 
     110<thead> 
    109111<tr> 
    110   <th class="nowrap">Setting ID</th> 
    111   <th><?php echo __('Value'); ?></th> 
    112   <th><?php echo __('Type'); ?></th> 
    113   <th class="maximal"><?php echo __('Description'); ?></th> 
     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> 
    114116</tr> 
     117</thead> 
     118<tbody> 
    115119<?php 
    116120$settings = array(); 
     
    127131{ 
    128132     ksort($s); 
    129      echo '<tr><td colspan="4" class="ns-name">namespace: <strong>'.$ns.'</strong></td></tr>'; 
     133     echo '<tr><th scope="row" colspan="4" class="ns-name">namespace: <strong>'.$ns.'</strong></th></tr>'; 
    130134      
    131135     foreach ($s as $k => $v) 
     
    135139} 
    136140?> 
     141</tbody> 
    137142</table> 
    138143<p><input type="submit" value="<?php echo __('Save'); ?>" /> 
     
    145150<form action="plugin.php" method="post"> 
    146151<table> 
     152<caption><?php echo __('Global blog settings list'); ?></caption> 
     153<thead> 
    147154<tr> 
    148   <th class="nowrap">Setting ID</th> 
    149   <th><?php echo __('Value'); ?></th> 
    150   <th><?php echo __('Type'); ?></th> 
    151   <th class="maximal"><?php echo __('Description'); ?></th> 
     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> 
    152159</tr> 
     160</thead> 
     161<tbody> 
    153162<?php 
    154163$settings = array(); 
     
    165174{ 
    166175     ksort($s); 
    167      echo '<tr><td colspan="4" class="ns-name">namespace: <strong>'.$ns.'</strong></td></tr>'; 
     176     echo '<tr><th scope="row" colspan="4" class="ns-name">namespace: <strong>'.$ns.'</strong></th></tr>'; 
    168177      
    169178     foreach ($s as $k => $v) 
     
    173182} 
    174183?> 
     184</tbody> 
    175185</table> 
    176186<p><input type="submit" value="<?php echo __('Save'); ?>" /> 
  • plugins/antispam/index.php

    r223 r457  
    166166     echo 
    167167     '<table class="dragable">'. 
     168     '<caption>'.__('Antispan filters list').'</caption>'. 
    168169     '<thead><tr>'. 
    169      '<th>'.__('Order').'</th>'. 
    170      '<th>'.__('Active').'</th>'. 
    171      '<th>'.__('Auto Del.').'</th>'. 
    172      '<th class="nowrap">'.__('Filter name').'</th>'. 
    173      '<th colspan="2">'.__('Description').'</th>'. 
     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>'. 
    174175     '</tr></thead>'. 
    175176     '<tbody id="filters-list" >'; 
     
    191192          '<td class="nowrap">'.form::checkbox(array('filters_active[]'),$fid,$f->active, '', '', false, 'title="'.__('Active').'"').'</td>'. 
    192193          '<td class="nowrap">'.form::checkbox(array('filters_auto_del[]'),$fid,$f->auto_delete, '', '', false, 'title="'.__('Auto Del.').'"').'</td>'. 
    193           '<td class="nowrap">'.$f->name.'</td>'. 
     194          '<th scope="row" class="nowrap">'.$f->name.'</th>'. 
    194195          '<td class="maximal">'.$f->description.'</td>'. 
    195196          '<td class="status">'.$gui_link.'</td>'. 
  • plugins/blogroll/index.php

    r218 r457  
    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/pages/list.php

    r198 r457  
    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/tags/tags.php

    r0 r457  
    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/userPref/index.php

    r220 r457  
    7272     return 
    7373     '<tr>'. 
    74      '<td><label for="s_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></td>'. 
     74     '<th scope="row"><label for="s_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></th>'. 
    7575     '<td>'.$field.'</td>'. 
    7676     '<td>'.$s['type'].'</td>'. 
     
    8484  <?php echo dcPage::jsPageTabs($part); ?> 
    8585  <style type="text/css"> 
    86   .ns-name { background: #ccc; color: #000; padding-top: 0.3em; padding-bottom: 0.3em; font-size: 1.1em; } 
     86  .ws-name { background: #ccc; color: #000; padding-top: 0.3em; padding-bottom: 0.3em; font-size: 1.1em; } 
    8787  </style> 
    8888</head> 
     
    103103<form action="plugin.php" method="post"> 
    104104<table> 
     105<caption><?php echo __('Local user preferences list'); ?></caption> 
     106<thead> 
    105107<tr> 
    106   <th class="nowrap">Pref ID</th> 
    107   <th><?php echo __('Value'); ?></th> 
    108   <th><?php echo __('Type'); ?></th> 
    109   <th class="maximal"><?php echo __('Description'); ?></th> 
     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> 
    110112</tr> 
     113</thead> 
     114<tbody> 
    111115<?php 
    112116$prefs = array(); 
     
    123127{ 
    124128     ksort($s); 
    125      echo '<tr><td colspan="4" class="ws-name">workspace: <strong>'.$ws.'</strong></td></tr>'; 
     129     echo '<tr><th scope="row" colspan="4" class="ws-name">workspace: <strong>'.$ws.'</strong></th></tr>'; 
    126130      
    127131     foreach ($s as $k => $v) 
     
    131135} 
    132136?> 
     137</tbody> 
    133138</table> 
    134139<p><input type="submit" value="<?php echo __('Save'); ?>" /> 
     
    141146<form action="plugin.php" method="post"> 
    142147<table> 
     148<caption><?php echo __('Global user preferences list'); ?></caption> 
     149<thead> 
    143150<tr> 
    144   <th class="nowrap">Pref ID</th> 
    145   <th><?php echo __('Value'); ?></th> 
    146   <th><?php echo __('Type'); ?></th> 
    147   <th class="maximal"><?php echo __('Description'); ?></th> 
     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> 
    148155</tr> 
     156</thead> 
     157<tbody> 
    149158<?php 
    150159$prefs = array(); 
     
    161170{ 
    162171     ksort($s); 
    163      echo '<tr><td colspan="4" class="ws-name">workspace: <strong>'.$ws.'</strong></td></tr>'; 
     172     echo '<tr><th scope="row" colspan="4" class="ws-name">workspace: <strong>'.$ws.'</strong></th></tr>'; 
    164173      
    165174     foreach ($s as $k => $v) 
     
    169178} 
    170179?> 
     180</tbody> 
    171181</table> 
    172182<p><input type="submit" value="<?php echo __('Save'); ?>" /> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map