Dotclear


Ignore:
Timestamp:
03/08/18 17:58:39 (8 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Code formatting (PSR-2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/tags/tags.php

    r3057 r3730  
    1010# 
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    12 if (!defined('DC_CONTEXT_ADMIN')) { return; } 
     12if (!defined('DC_CONTEXT_ADMIN')) {return;} 
    1313 
    1414?> 
     
    1616<head> 
    1717  <title><?php echo __('Tags'); ?></title> 
    18   <?php echo dcPage::cssLoad(dcPage::getPF('tags/style.css'));?> 
     18  <?php echo dcPage::cssLoad(dcPage::getPF('tags/style.css')); ?> 
    1919</head> 
    2020 
     
    2222<?php 
    2323echo dcPage::breadcrumb( 
    24      array( 
    25           html::escapeHTML($core->blog->name) => '', 
    26           __('Tags') => '' 
    27      )). 
    28      dcPage::notices(); 
     24    array( 
     25        html::escapeHTML($core->blog->name) => '', 
     26        __('Tags')                          => '' 
     27    )) . 
     28dcPage::notices(); 
    2929?> 
    3030 
     
    3333$tags = $core->meta->getMetadata(array('meta_type' => 'tag')); 
    3434$tags = $core->meta->computeMetaStats($tags); 
    35 $tags->sort('meta_id_lower','asc'); 
     35$tags->sort('meta_id_lower', 'asc'); 
    3636 
    3737$last_letter = null; 
    38 $cols = array('',''); 
    39 $col = 0; 
    40 while ($tags->fetch()) 
    41 { 
    42      $letter = mb_strtoupper(mb_substr($tags->meta_id_lower,0,1)); 
     38$cols        = array('', ''); 
     39$col         = 0; 
     40while ($tags->fetch()) { 
     41    $letter = mb_strtoupper(mb_substr($tags->meta_id_lower, 0, 1)); 
    4342 
    44      if ($last_letter != $letter) { 
    45           if ($tags->index() >= round($tags->count()/2)) { 
    46                $col = 1; 
    47           } 
    48           $cols[$col] .= '<tr class="tagLetter"><td colspan="2"><span>'.$letter.'</span></td></tr>'; 
    49      } 
     43    if ($last_letter != $letter) { 
     44        if ($tags->index() >= round($tags->count() / 2)) { 
     45            $col = 1; 
     46        } 
     47        $cols[$col] .= '<tr class="tagLetter"><td colspan="2"><span>' . $letter . '</span></td></tr>'; 
     48    } 
    5049 
    51      $cols[$col] .= 
    52      '<tr class="line">'. 
    53           '<td class="maximal"><a href="'.$p_url. 
    54           '&amp;m=tag_posts&amp;tag='.rawurlencode($tags->meta_id).'">'.$tags->meta_id.'</a></td>'. 
    55           '<td class="nowrap"><strong>'.$tags->count.'</strong> '. 
    56           (($tags->count==1) ? __('entry') : __('entries')).'</td>'. 
    57      '</tr>'; 
     50    $cols[$col] .= 
     51    '<tr class="line">' . 
     52    '<td class="maximal"><a href="' . $p_url . 
     53    '&amp;m=tag_posts&amp;tag=' . rawurlencode($tags->meta_id) . '">' . $tags->meta_id . '</a></td>' . 
     54    '<td class="nowrap"><strong>' . $tags->count . '</strong> ' . 
     55        (($tags->count == 1) ? __('entry') : __('entries')) . '</td>' . 
     56        '</tr>'; 
    5857 
    59      $last_letter = $letter; 
     58    $last_letter = $letter; 
    6059} 
    6160 
    6261$table = '<div class="col"><table class="tags">%s</table></div>'; 
    6362 
    64 if ($cols[0]) 
    65 { 
    66      echo '<div class="two-cols">'; 
    67      printf($table,$cols[0]); 
    68      if ($cols[1]) { 
    69           printf($table,$cols[1]); 
    70      } 
    71      echo '</div>'; 
    72 } 
    73 else 
    74 { 
    75      echo '<p>'.__('No tags on this blog.').'</p>'; 
     63if ($cols[0]) { 
     64    echo '<div class="two-cols">'; 
     65    printf($table, $cols[0]); 
     66    if ($cols[1]) { 
     67        printf($table, $cols[1]); 
     68    } 
     69    echo '</div>'; 
     70} else { 
     71    echo '<p>' . __('No tags on this blog.') . '</p>'; 
    7672} 
    7773 
Note: See TracChangeset for help on using the changeset viewer.

Sites map