Dotclear

Changeset 456:f55f02550402 for admin


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

Fixed tables in admin pages - step 1, addresses #1068,#1069

Location:
admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • admin/blogs.php

    r158 r456  
    118118      
    119119     # Show blogs 
    120      if ($nb_blog == 0) 
    121      { 
    122           echo '<p><strong>'.__('No blog').'</strong></p>'; 
    123      } 
    124      else 
    125      { 
    126           $pager = new pager($page,$nb_blog,$nb_per_page,10); 
    127           $pager->var_page = 'page'; 
    128            
    129           echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    130            
    131           echo 
    132           '<table class="clear"><tr>'. 
    133           '<th>'.__('Blog name').'</th>'. 
    134           '<th class="nowrap">'.__('Last update').'</th>'. 
    135           '<th class="nowrap">'.__('Entries').'</th>'. 
    136           '<th class="nowrap">'.__('Blog ID').'</th>'. 
    137           '<th>&nbsp;</th>'. 
    138           '<th class="nowrap">'.__('Status').'</th>'. 
    139           '</tr>'; 
    140            
    141           while ($rs->fetch()) { 
    142                echo blogLine($rs); 
    143           } 
    144            
    145           echo '</table>'; 
    146            
    147           echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    148      } 
     120     $blogs_list = new adminBlogList($core,$rs,$nb_blog); 
     121     $blogs_list->display($page,$nb_per_page); 
    149122} 
    150123 
    151124dcPage::close(); 
    152125 
    153 function blogLine($rs) 
    154 { 
    155      global $core; 
    156       
    157      $blog_id = html::escapeHTML($rs->blog_id); 
    158      $edit_link = ''; 
    159       
    160      if ($GLOBALS['core']->auth->isSuperAdmin()) { 
    161           $edit_link =  
    162           '<a href="blog.php?id='.$blog_id.'" '. 
    163           'title="'.sprintf(__('Edit blog %s'),$blog_id).'">'. 
    164           __('edit').'</a>'; 
    165      } 
    166       
    167      $img_status = $rs->blog_status == 1 ? 'check-on' : 'check-off'; 
    168      $txt_status = $GLOBALS['core']->getBlogStatus($rs->blog_status); 
    169      $img_status = sprintf('<img src="images/%1$s.png" alt="%2$s" title="%2$s" />',$img_status,$txt_status); 
    170      $offset = dt::getTimeOffset($core->auth->getInfo('user_tz')); 
    171      $blog_upddt = dt::str(__('%Y-%m-%d %H:%M'),strtotime($rs->blog_upddt) + $offset); 
    172       
    173      return 
    174      '<tr class="line">'. 
    175      '<td class="maximal"><a href="index.php?switchblog='.$rs->blog_id.'" '. 
    176      'title="'.sprintf(__('Switch to blog %s'),$rs->blog_id).'">'. 
    177      html::escapeHTML($rs->blog_name).'</a></td>'. 
    178      '<td class="nowrap">'.$blog_upddt.'</td>'. 
    179      '<td class="nowrap">'.$core->countBlogPosts($rs->blog_id).'</td>'. 
    180      '<td class="nowrap">'.$blog_id.'</td>'. 
    181      '<td>'.$edit_link.'</td>'. 
    182      '<td class="status">'.$img_status.'</td>'. 
    183      '</tr>'; 
    184 } 
    185126?> 
  • admin/langs.php

    r66 r456  
    173173{ 
    174174     echo 
    175      '<table class="clear plugins"><tr>'. 
    176      '<th>'.__('Language').'</th>'. 
    177      '<th class="nowrap">'.__('Action').'</th>'. 
    178      '</tr>'; 
     175     '<table class="clear plugins">'. 
     176     '<thead><tr>'. 
     177     '<th scope="col">'.__('Language').'</th>'. 
     178     '<th scope="col" class="nowrap">'.__('Action').'</th>'. 
     179     '</tr></thead>'. 
     180     '<tbody>'; 
    179181      
    180182     foreach ($locales_content as $k => $v) 
     
    184186          echo 
    185187          '<tr class="line wide">'. 
    186           '<td class="maximal nowrap">('.$k.') '. 
    187           '<strong>'.html::escapeHTML($iso_codes[$k]).'</strong></td>'. 
     188          '<th scope="row" class="maximal nowrap">('.$k.') '. 
     189          '<strong>'.html::escapeHTML($iso_codes[$k]).'</strong></th>'. 
    188190          '<td class="nowrap action">'; 
    189191           
     
    202204          echo '</td></tr>'; 
    203205     } 
    204      echo '</table>'; 
     206     echo 
     207     '</tbody>'. 
     208     '</table>'; 
    205209} 
    206210 
     
    228232     'Proposed languages are based on your version: %s.'),'<strong>'.DC_VERSION.'</strong>').'</p>'. 
    229233     '<p class="field"><label for="pkg_url" class="classic">'.__('Language:').' '. 
    230      form::combo(array('pkg_url'),$dc_langs_combo).'</label></p>'. 
     234     form::combo('pkg_url',$dc_langs_combo).'</label></p>'. 
    231235     '<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '. 
    232236     form::password(array('your_pwd','your_pwd1'),20,255).'</label></p>'. 
  • admin/permissions_blog.php

    r68 r456  
    136136      
    137137     # Show blogs 
    138      if ($nb_blog == 0) 
    139      { 
    140           echo '<p><strong>'.__('No blog').'</strong></p>'; 
    141      } 
    142      else 
    143      { 
    144           $pager = new pager($page,$nb_blog,$nb_per_page,10); 
    145           $pager->var_page = 'page'; 
    146            
    147           echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    148            
    149           echo 
    150           '<form action="permissions.php" method="post" id="form-blogs">'. 
    151           '<table class="clear"><tr>'. 
    152           '<th colspan="2">'.__('Blog ID').'</th>'. 
    153           '<th>'.__('Blog name').'</th>'. 
    154           '<th class="nowrap">'.__('Entries').'</th>'. 
    155           '<th class="nowrap">'.__('Status').'</th>'. 
    156           '</tr>'; 
    157            
    158           while ($rs->fetch()) { 
    159                echo blogLine($rs); 
    160           } 
    161            
    162           echo 
    163           '</table>'. 
    164            
     138     $blogs_list = new adminBlogPermissionsList($core,$rs,$nb_blog); 
     139     $blogs_list->display($page,$nb_per_page,'<form action="permissions.php" method="post" id="form-blogs">'. 
     140          '%s'. 
    165141          '<p class="checkboxes-helpers"></p>'. 
    166            
    167142          '<p><input type="submit" value="'.__('set permissions').'" />'. 
    168143          $hidden_fields. 
    169144          $core->formNonce().'</p>'. 
    170           '</form>'; 
    171            
    172           echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    173      } 
     145          '</form>' 
     146     ); 
    174147} 
    175148 
    176149dcPage::close(); 
    177150 
    178 function blogLine($rs) 
    179 { 
    180      global $core; 
    181       
    182      $img_status = $rs->blog_status == 1 ? 'check-on' : 'check-off'; 
    183      $txt_status = $GLOBALS['core']->getBlogStatus($rs->blog_status); 
    184      $img_status = sprintf('<img src="images/%1$s.png" alt="%2$s" title="%2$s" />',$img_status,$txt_status); 
    185       
    186      return 
    187      '<tr class="line">'. 
    188      '<td class="nowrap">'. 
    189      form::checkbox(array('blog_id[]'),$rs->blog_id,'','','',false,'title="'.__('select').' '.$rs->blog_id.'"').'</td>'. 
    190      '<td class="nowrap">'.$rs->blog_id.'</td>'. 
    191      '<td class="maximal">'.html::escapeHTML($rs->blog_name).'</td>'. 
    192      '<td class="nowrap">'.$core->countBlogPosts($rs->blog_id).'</td>'. 
    193      '<td class="status">'.$img_status.'</td>'. 
    194      '</tr>'; 
    195 } 
    196151?> 
  • admin/plugins.php

    r211 r456  
    227227     echo 
    228228     '<h3>'.__('Activated plugins').'</h3>'. 
    229      '<table class="clear plugins"><tr>'. 
    230      '<th>'.__('Plugin').'</th>'. 
    231      '<th class="nowrap">'.__('Version').'</th>'. 
    232      '<th class="nowrap">'.__('Details').'</th>'. 
    233      '<th class="nowrap">'.__('Action').'</th>'. 
    234      '</tr>'; 
     229     '<table class="clear plugins">'. 
     230     '<caption>'.__('Activated plugin list').'</caption>'. 
     231     '<thead><tr>'. 
     232     '<th scope="col">'.__('Plugin').'</th>'. 
     233     '<th scope="col" class="nowrap">'.__('Version').'</th>'. 
     234     '<th scope="col" class="nowrap">'.__('Details').'</th>'. 
     235     '<th scope="col" class="nowrap">'.__('Action').'</th>'. 
     236     '</tr></thead>'. 
     237     '<tbody>'; 
    235238      
    236239     foreach ($p_available as $k => $v) 
     
    241244          echo 
    242245          '<tr class="line wide">'. 
    243           '<td class="minimal nowrap"><strong>'.html::escapeHTML($k).'</strong></td>'. 
     246          '<th scope="row" class="minimal nowrap"><strong>'.html::escapeHTML($k).'</strong></th>'. 
    244247          '<td class="minimal">'.html::escapeHTML($v['version']).'</td>'. 
    245248          '<td class="maximal"><strong>'.html::escapeHTML($v['name']).'</strong> '. 
     
    265268     } 
    266269     echo 
     270     '</tbody>'. 
    267271     '</table>'; 
    268272} 
     
    274278     echo 
    275279     '<h3>'.__('Deactivated plugins').'</h3>'. 
    276      '<table class="clear plugins"><tr>'. 
    277      '<th>'.__('Plugin').'</th>'. 
    278      '<th class="nowrap">'.__('Action').'</th>'. 
    279      '</tr>'; 
     280     '<table class="clear plugins">'. 
     281     '<caption>'.__('Deactivated plugin list').'</caption>'. 
     282     '<thead><tr>'. 
     283     '<th scope="col">'.__('Plugin').'</th>'. 
     284     '<th scope="col" class="nowrap">'.__('Action').'</th>'. 
     285     '</tr></thead>'. 
     286     '<tbody>'; 
    280287      
    281288     foreach ($p_disabled as $k => $v) 
     
    286293          echo 
    287294          '<tr class="line wide">'. 
    288           '<td class="maximal nowrap"><strong>'.html::escapeHTML($k).'</strong></td>'. 
     295          '<th scope="row" class="maximal nowrap"><strong>'.html::escapeHTML($k).'</strong></th>'. 
    289296          '<td class="nowrap action">'; 
    290297           
     
    308315     } 
    309316     echo 
     317     '</tbody>'. 
    310318     '</table>'; 
    311319} 
  • admin/post.php

    r219 r456  
    608608{ 
    609609     echo 
    610      '<table class="comments-list"><tr>'. 
    611      '<th colspan="2">'.__('Author').'</th>'. 
    612      '<th>'.__('Date').'</th>'. 
    613      '<th class="nowrap">'.__('IP address').'</th>'. 
    614      '<th>'.__('Status').'</th>'. 
    615      '<th>&nbsp;</th>'. 
    616      '</tr>'; 
     610     '<table class="comments-list">'. 
     611     '<caption>'.__('Post comments and trackbacks').'</caption>'. 
     612     '<thead><tr>'. 
     613     '<th scope="col" colspan="2">'.__('Author').'</th>'. 
     614     '<th scope="col">'.__('Date').'</th>'. 
     615     '<th scope="col" class="nowrap">'.__('IP address').'</th>'. 
     616     '<th scope="col">'.__('Status').'</th>'. 
     617     '<th scope="col">&nbsp;</th>'. 
     618     '</tr></thead>'. 
     619     '<tbody>'; 
    617620      
    618621     while($rs->fetch()) 
     
    642645          '<td class="nowrap">'. 
    643646          ($has_action ? form::checkbox(array('comments[]'),$rs->comment_id,'','','',0,'title="'.($tb ? __('select this trackback') : __('select this comment')).'"') : '').'</td>'. 
    644           '<td class="maximal">'.html::escapeHTML($rs->comment_author).'</td>'. 
     647          '<th scope="row" class="maximal">'.html::escapeHTML($rs->comment_author).'</th>'. 
    645648          '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$rs->comment_dt).'</td>'. 
    646649          '<td class="nowrap"><a href="comments.php?ip='.$rs->comment_ip.'">'.$rs->comment_ip.'</a></td>'. 
     
    652655     } 
    653656      
    654      echo '</table>'; 
     657     echo 
     658     '</tbody>'. 
     659     '</table>'; 
    655660} 
    656661 
Note: See TracChangeset for help on using the changeset viewer.

Sites map