Dotclear

Changeset 3118:5c671c6fae8a


Ignore:
Timestamp:
10/18/15 17:28:13 (10 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Children:
3126:19af5f62e940, 3129:6f41108168cf
Message:

Add class depending on status for posts, pages and comments, fixes #2135

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.pager.php

    r3089 r3118  
    232232 
    233233          $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
     234          $sts_class = ''; 
    234235          switch ($this->rs->post_status) { 
    235236               case 1: 
    236237                    $img_status = sprintf($img,__('Published'),'check-on.png'); 
     238                    $sts_class = 'sts-online'; 
    237239                    break; 
    238240               case 0: 
    239241                    $img_status = sprintf($img,__('Unpublished'),'check-off.png'); 
     242                    $sts_class = 'sts-offline'; 
    240243                    break; 
    241244               case -1: 
    242245                    $img_status = sprintf($img,__('Scheduled'),'scheduled.png'); 
     246                    $sts_class = 'sts-scheduled'; 
    243247                    break; 
    244248               case -2: 
    245249                    $img_status = sprintf($img,__('Pending'),'check-wrn.png'); 
     250                    $sts_class = 'sts-pending'; 
    246251                    break; 
    247252          } 
     
    264269          } 
    265270 
    266           $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 
     271          $res = '<tr class="line '.($this->rs->post_status != 1 ? 'offline ' : '').$sts_class.'"'. 
    267272          ' id="p'.$this->rs->post_id.'">'; 
    268273 
     
    342347     { 
    343348          $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
     349          $sts_class = ''; 
    344350          switch ($this->rs->post_status) { 
    345351               case 1: 
    346352                    $img_status = sprintf($img,__('Published'),'check-on.png'); 
     353                    $sts_class = 'sts-online'; 
    347354                    break; 
    348355               case 0: 
    349356                    $img_status = sprintf($img,__('Unpublished'),'check-off.png'); 
     357                    $sts_class = 'sts-offline'; 
    350358                    break; 
    351359               case -1: 
    352360                    $img_status = sprintf($img,__('Scheduled'),'scheduled.png'); 
     361                    $sts_class = 'sts-scheduled'; 
    353362                    break; 
    354363               case -2: 
    355364                    $img_status = sprintf($img,__('Pending'),'check-wrn.png'); 
     365                    $sts_class = 'sts-pending'; 
    356366                    break; 
    357367          } 
     
    374384          } 
    375385 
    376           $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 
     386          $res = '<tr class="line '.($this->rs->post_status != 1 ? 'offline ' : '').$sts_class.'"'. 
    377387          ' id="p'.$this->rs->post_id.'">'; 
    378388 
     
    507517 
    508518          $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
     519          $sts_class = ''; 
    509520          switch ($this->rs->comment_status) { 
    510521               case 1: 
    511522                    $img_status = sprintf($img,__('Published'),'check-on.png'); 
     523                    $sts_class = 'sts-online'; 
    512524                    break; 
    513525               case 0: 
    514526                    $img_status = sprintf($img,__('Unpublished'),'check-off.png'); 
     527                    $sts_class = 'sts-offline'; 
    515528                    break; 
    516529               case -1: 
    517530                    $img_status = sprintf($img,__('Pending'),'check-wrn.png'); 
     531                    $sts_class = 'sts-pending'; 
    518532                    break; 
    519533               case -2: 
    520534                    $img_status = sprintf($img,__('Junk'),'junk.png'); 
     535                    $sts_class = 'sts-junk'; 
    521536                    break; 
    522537          } 
     
    530545               html::escapeHTML($this->rs->comment_author)); 
    531546 
    532           $res = '<tr class="line'.($this->rs->comment_status != 1 ? ' offline' : '').'"'. 
     547          $res = '<tr class="line '.($this->rs->comment_status != 1 ? 'offline ' : '').$sts_class.'"'. 
    533548          ' id="c'.$this->rs->comment_id.'">'; 
    534549 
  • plugins/pages/class.listpage.php

    r3089 r3118  
    7777     { 
    7878          $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
     79          $sts_class = ''; 
    7980          switch ($this->rs->post_status) { 
    8081               case 1: 
    8182                    $img_status = sprintf($img,__('Published'),'check-on.png'); 
     83                    $sts_class = 'sts-online'; 
    8284                    break; 
    8385               case 0: 
    8486                    $img_status = sprintf($img,__('Unpublished'),'check-off.png'); 
     87                    $sts_class = 'sts-offline'; 
    8588                    break; 
    8689               case -1: 
    8790                    $img_status = sprintf($img,__('Scheduled'),'scheduled.png'); 
     91                    $sts_class = 'sts-scheduled'; 
    8892                    break; 
    8993               case -2: 
    9094                    $img_status = sprintf($img,__('Pending'),'check-wrn.png'); 
     95                    $sts_class = 'sts-pending'; 
    9196                    break; 
    9297          } 
     
    109114          } 
    110115 
    111           $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 
     116          $res = '<tr class="line '.($this->rs->post_status != 1 ? 'offline ' : '').$sts_class.'"'. 
    112117          ' id="p'.$this->rs->post_id.'">'; 
    113118 
Note: See TracChangeset for help on using the changeset viewer.

Sites map