示例#1
0
 /**
  * Prints out translated and untranslated strings.
  *
  * @return  string  HTML markup for language debug
  *
  * @since   1.0
  */
 protected function renderLanguageStrings()
 {
     $html = array();
     $items = g11n::get('processedItems');
     $html[] = '<table class="table table-hover table-condensed">';
     $html[] = '<tr>';
     $html[] = '<th>' . g11n3t('String') . '</th><th>' . g11n3t('File (line)') . '</th><th></th>';
     $html[] = '</tr>';
     $tableFormat = new TableFormat();
     $i = 0;
     foreach ($items as $string => $item) {
         $color = '-' == $item->status ? '#ffb2b2;' : '#e5ff99;';
         $html[] = '<tr>';
         $html[] = '<td style="border-left: 7px solid ' . $color . '">' . htmlentities($string) . '</td>';
         $html[] = '<td>' . str_replace(JPATH_ROOT, 'ROOT', $item->file) . ' (' . $item->line . ')</td>';
         $html[] = '<td><span class="btn btn-mini" onclick="$(\'#langStringTrace' . $i . '\').slideToggle();">Trace</span></td>';
         $html[] = '</tr>';
         $html[] = '<tr><td colspan="4" id="langStringTrace' . $i . '" style="display: none;">' . $tableFormat->fromTrace($item->trace) . '</td></tr>';
         $i++;
     }
     $html[] = '</table>';
     return implode("\n", $html);
 }