Skip to content

Commit

Permalink
Put syntax modes in a table layout, sort numbers in rowspans. Impleme…
Browse files Browse the repository at this point in the history
…nts FS#2516
  • Loading branch information
Klap-in committed Oct 14, 2013
1 parent 850f3dd commit a27c9d6
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions lib/plugins/info/syntax.php
Expand Up @@ -215,11 +215,36 @@ function _syntaxtypes_xhtml(){
*/
function _syntaxmodes_xhtml(){
$modes = p_get_parsermodes();

$compactmodes = array();
foreach($modes as $mode){
$compactmodes[$mode['sort']][] = $mode['mode'];
}
$doc = '';
$doc .= '<div class="table"><table class="inline"><tbody>';

foreach($compactmodes as $sort => $modes){
$rowspan = '';
if(count($modes) > 1) {
$rowspan = ' rowspan="'.count($modes).'"';
}

foreach ($modes as $mode){
$doc .= $mode['mode'].' ('.$mode['sort'].'), ';
foreach($modes as $index => $mode) {
$doc .= '<tr>';
$doc .= '<td class="leftalign">';
$doc .= $mode;
$doc .= '</td>';

if($index === 0) {
$doc .= '<td class="rightalign" '.$rowspan.'>';
$doc .= $sort;
$doc .= '</td>';
}
$doc .= '</tr>';
}
}

$doc .= '</tbody></table></div>';
return $doc;
}

Expand Down

0 comments on commit a27c9d6

Please sign in to comment.