/**
  * generates output for general informations
  *
  * Structure of $infos:
  * $infos[$langKey]['origin'] == (array) language origins (relTypo3File)
  * $infos[$langKey]['meta'] == (array) meta informations (only default needed)
  * $infos[$langKey]['type'] == (string) location type (translated string)
  * $infos[$langKey]['type2'] == (string) language type (merged|l10n|splitted)
  * $infos[$langKey]['numTranslated'] == (integer) translated constants
  * $infos[$langKey]['numUntranslated'] == (integer) untranslated constants
  * $infos[$langKey]['numUnknown'] == (integer) unknown constants
  * $infos[$langKey]['email'] == (boolean) mailIt pre selection
  *
  * @param array see above
  * @param string reference language
  * @param integer amount of rows in textarea
  * @param boolean set to true if you want some special options (splitting dialog, meta edit)
  * @return string output (HTML code)
  */
 public static function outputGeneral($infos, $refLang, $textAreaRows, $flagSpecial = false)
 {
     $summary = $GLOBALS['LANG']->getLL('table.fileInfo');
     $content = '<table id="tx-lfeditor-table" summary="' . $summary . '">';
     // table header
     $content .= '<thead><tr>';
     $content .= '<th class="bgColor5">' . $GLOBALS['LANG']->getLL('lang.shortcut') . '</th>';
     $content .= '<th class="bgColor5">' . $GLOBALS['LANG']->getLL('lang.state') . '</th>';
     $content .= '<th class="bgColor5">' . $GLOBALS['LANG']->getLL('ext.type') . '</th>';
     $content .= '<th class="bgColor5">' . $GLOBALS['LANG']->getLL('lang.origin') . '</th>';
     if ($flagSpecial) {
         $content .= '<th id="tx-lfeditor-table-markup4"><img src="../res/images/mail.gif" alt="' . $GLOBALS['LANG']->getLL('function.backupMgr.delete') . '" /></th>';
         $char = substr($GLOBALS['LANG']->getLL('function.general.split.splitNormal'), 0, 1);
         $content .= '<th id="tx-lfeditor-table-markup1">' . strtoupper($char) . '</th>';
         $char = substr($GLOBALS['LANG']->getLL('function.general.split.splitL10n'), 0, 1);
         $content .= '<th id="tx-lfeditor-table-markup2">' . strtoupper($char) . '</th>';
         $char = substr($GLOBALS['LANG']->getLL('function.general.split.merge'), 0, 1);
         $content .= '<th id="tx-lfeditor-table-markup3">' . strtoupper($char) . '</th>';
     }
     $content .= '</tr></thead>';
     // table data
     $content .= '<tbody>';
     foreach ($infos as $langKey => $info) {
         // language shortcut
         $content .= '<tr><td class="bgColor4"><a href="#" title="' . $langKey . '" ' . 'onclick="submitRedirectForm(\'language\',\'' . $langKey . '\');">' . $langKey . '</a></td>';
         // state and constant information
         $constInfo = '(<span class="tx-lfeditor-goodMarkup">' . $info['numTranslated'] . '</span>-<span class="tx-lfeditor-specialMarkup">' . $info['numUnknown'] . '</span>-<span class="tx-lfeditor-badMarkup">' . $info['numUntranslated'] . '</span>)';
         if ($info['numTranslated'] >= $infos[$refLang]['numTranslated']) {
             $content .= '<td class="bgColor4"><span class="tx-lfeditor-goodMarkup">' . $GLOBALS['LANG']->getLL('lang.complete') . '</span><br />' . $constInfo . '</td>';
         } else {
             $content .= '<td class="bgColor4"><span class="tx-lfeditor-badMarkup">' . $GLOBALS['LANG']->getLL('lang.incomplete') . '</span><br />' . $constInfo . '</td>';
         }
         // type and origin
         $content .= '<td class="bgColor4">' . $info['type'] . '</td>';
         $content .= '<td class="bgColor4">' . $info['origin'] . '</td>';
         // zip mail, merge, normal split and l10n split options
         if ($flagSpecial) {
             // pre selection
             $checked = '';
             if ($info['email']) {
                 $checked = 'checked="checked"';
             }
             $set = '-';
             if ($langKey == 'default' || $info['type2'] != 'merged') {
                 $set = '<input type="checkbox" ' . $checked . ' name="mailIt[' . $langKey . ']" value="1" />';
             }
             $content .= '<td class="bgColor4">' . $set . '</td>';
             $set = '-';
             if ($langKey != 'default' && $info['type2'] != 'splitted') {
                 $set = '<input type="radio" name="langModes[' . $langKey . ']" value="1" />';
             }
             $content .= '<td class="bgColor4">' . $set . '</td>';
             $set = '-';
             if ($langKey != 'default' && $info['type2'] != 'l10n') {
                 $set = '<input type="radio" name="langModes[' . $langKey . ']" value="2" />';
             }
             $content .= '<td class="bgColor4">' . $set . '</td>';
             $set = '-';
             if ($langKey != 'default' && $info['type2'] != 'merged') {
                 $set = '<input type="radio" name="langModes[' . $langKey . ']" value="3" />';
             }
             $content .= '<td class="bgColor4">' . $set . '</td>';
         }
         $content .= '</tr>';
     }
     $content .= '</tbody></table>';
     // generate meta handling fieldset dialog
     $header = $GLOBALS['LANG']->getLL('function.general.metaInfo.metaInfo');
     $content .= '<fieldset class="tx-lfeditor-fieldset bgColor5 tx-lfeditor-fleft">';
     $content .= '<legend class="bgColor3">' . $header . '</legend>';
     // type and csh table
     $header = $GLOBALS['LANG']->getLL('function.general.metaInfo.type');
     $content .= '<fieldset class="bgColor4"> <legend class="bgColor3">' . $header . '</legend>';
     $content .= '<select id="metaType" name="meta[type]" onchange="metaTypeCheck();">';
     $options = array('', 'module', 'database', 'CSH');
     foreach ($options as $option) {
         $selected = '';
         if ($option == $infos['default']['meta']['type']) {
             $selected = 'selected="selected"';
         }
         $content .= '<option value="' . $option . '" ' . $selected . '>' . (empty($option) ? '--' : $option) . '</option>';
     }
     $content .= '</select>';
     $content .= $GLOBALS['LANG']->getLL('function.general.metaInfo.cshTable') . '&nbsp;';
     $disabled = $infos['default']['meta']['type'] == 'CSH' ? '' : 'disabled="disabled"';
     $content .= '<input type="text" ' . $disabled . ' id="metaCSHTable" name="meta[csh_table]"' . 'value="' . $infos['default']['meta']['csh_table'] . '" />';
     $content .= '</fieldset>';
     // author
     $header = $GLOBALS['LANG']->getLL('function.general.metaInfo.author');
     $content .= '<fieldset class="bgColor4"> <legend class="bgColor3">' . $header . '</legend>';
     $label = $GLOBALS['LANG']->getLL('function.general.metaInfo.author.name');
     $value = $infos['default']['meta']['authorName'];
     $content .= '<label for="name" class="tx-lfeditor-label">' . $label . '</label>';
     $content .= '<input type="text" id="name" class="tx-lfeditor-input" ' . 'name="meta[authorName]" value="' . $value . '" />';
     $label = $GLOBALS['LANG']->getLL('function.general.metaInfo.author.email');
     $value = $infos['default']['meta']['authorEmail'];
     $content .= '<label for="email" class="tx-lfeditor-label">' . $label . '</label>';
     $content .= '<input type="text" id="email" class="tx-lfeditor-input" ' . 'name="meta[authorEmail]" value="' . $value . '" />';
     $content .= '</fieldset>';
     // description
     $header = $GLOBALS['LANG']->getLL('function.general.metaInfo.desc');
     $content .= '<fieldset class="bgColor4"> <legend class="bgColor3">' . $header . '</legend>';
     $desc = $infos['default']['meta']['description'];
     $content .= '<textarea class="tx-lfeditor-textarea ' . ($GLOBALS['PMKTEXTAREA'] ? 'enable-tab' : '') . '" rows="' . $textAreaRows . '" ' . 'name="meta[description]">' . preg_replace('/<br.*>/U', "\n", $desc) . '</textarea>';
     $content .= '</fieldset> </fieldset>';
     // options dialog
     $header = $GLOBALS['LANG']->getLL('function.general.options');
     $content .= '<fieldset class="tx-lfeditor-fieldset bgColor5 tx-lfeditor-fright">';
     $content .= '<legend class="bgColor3">' . $header . '</legend>';
     // split/merge options
     if ($flagSpecial) {
         $content .= '<fieldset class="bgColor4"> <legend class="bgColor3">' . $GLOBALS['LANG']->getLL('function.general.split.split') . '</legend>';
         $value = $GLOBALS['LANG']->getLL('function.general.split.splitNormal');
         $content .= '<p> <input type="radio" name="splitFile" id="splitNormal" value="1" /> ' . '<label for="splitNormal">' . $value . '</label></p>';
         $value = $GLOBALS['LANG']->getLL('function.general.split.splitL10n');
         $content .= '<p> <input type="radio" name="splitFile" id="splitL10n" value="2" /> ' . '<label for="splitL10n">' . $value . '</label></p>';
         $value = $GLOBALS['LANG']->getLL('function.general.split.merge');
         $content .= '<p> <input type="radio" name="splitFile" id="merge" value="3" /> ' . '<label for="merge">' . $value . '</label></p>';
         $content .= '</fieldset>';
     }
     // transform options
     $header = $GLOBALS['LANG']->getLL('function.general.transform.transform');
     $content .= '<fieldset class="bgColor4"><legend class="bgColor3">' . $header . '</legend>';
     $value = $GLOBALS['LANG']->getLL('function.general.transform.xml');
     $content .= '<p> <input type="radio" name="transFile" id="xml" value="xml" /> ' . '<label for="xml">' . $value . '</label></p>';
     $value = $GLOBALS['LANG']->getLL('function.general.transform.php');
     $content .= '<p> <input type="radio" name="transFile" id="php" value="php" /> ' . '<label for="php">' . $value . '</label></p>';
     $content .= '</fieldset> </fieldset>';
     // submit and reset
     $buttons = array('submit' => array('css' => 'tx-lfeditor-buttonSubmit', 'value' => $GLOBALS['LANG']->getLL('button.save'), 'type' => 'submit'), 'reset' => array('css' => 'tx-lfeditor-buttonReset', 'value' => $GLOBALS['LANG']->getLL('button.reset'), 'type' => 'reset'));
     $content .= tx_lfeditor_mod1_template::outputAddButtons($buttons);
     // hidden fields
     $content .= '<input type="hidden" name="submitted" value="1" />';
     $content .= '<input type="hidden" name="language" value="" />';
     return $content;
 }