Exemplo n.º 1
0
 function ShowMessages()
 {
     global $aMessages, $sLangID;
     LoadBuiltinLanguage();
     $s_def_lang = $sLangID;
     $a_def_mesgs = $aMessages;
     LoadLanguageFile();
     $s_active_lang = $sLangID;
     $a_active_mesgs = $aMessages;
     $a_list = get_defined_constants();
     echo "<table border=\"1\" cellpadding=\"10\" width=\"95%\">\n";
     echo "<tr>\n";
     echo "<th>\n";
     echo "Message Number";
     echo "</th>\n";
     echo "<th>\n";
     echo "{$s_def_lang}";
     echo "</th>\n";
     echo "<th>\n";
     echo "{$s_active_lang}";
     echo "</th>\n";
     echo "</tr>\n";
     foreach ($a_list as $s_name => $i_value) {
         if (substr($s_name, 0, 4) == "MSG_") {
             echo "<tr>\n";
             echo "<td valign=\"top\">\n";
             echo "{$s_name} ({$i_value})";
             echo "</td>\n";
             echo "<td valign=\"top\">\n";
             $aMessages = $a_def_mesgs;
             $s_def_msg = GetMessage((int) $i_value, array(), true, true);
             echo nl2br(htmlentities($s_def_msg));
             echo "</td>\n";
             echo "<td valign=\"top\">\n";
             $aMessages = $a_active_mesgs;
             $s_act_msg = GetMessage((int) $i_value, array(), true, true);
             if ($s_def_msg == $s_act_msg) {
                 echo "<i>identical</i>\n";
             } else {
                 echo nl2br(htmlentities($s_act_msg));
             }
             echo "</td>\n";
             echo "</tr>\n";
         }
     }
     echo "</table>\n";
 }
 function ShowMessages()
 {
     global $aMessages, $sLangID, $bShowMesgNumbers, $aGetVars, $sHTMLCharSet;
     //
     // force message numbers on unless "mnums=no"
     //
     if (isset($aGetVars["mnums"]) && $aGetVars["mnums"] == "no") {
         $bShowMesgNumbers = false;
     } else {
         $bShowMesgNumbers = true;
     }
     LoadBuiltinLanguage();
     $s_def_lang = $sLangID;
     $a_def_mesgs = $aMessages;
     LoadLanguageFile();
     $s_active_lang = $sLangID;
     $a_active_mesgs = $aMessages;
     $a_list = get_defined_constants();
     echo "<html>\n";
     echo "<head>\n";
     if (isset($sHTMLCharSet) && $sHTMLCharSet !== "") {
         echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset={$sHTMLCharSet}\">\n";
     }
     echo "</head>\n";
     echo "<body>\n";
     echo "<table border=\"1\" cellpadding=\"10\" width=\"95%\">\n";
     echo "<tr>\n";
     echo "<th>\n";
     echo "Message Number";
     echo "</th>\n";
     echo "<th>\n";
     echo "{$s_def_lang}";
     echo "</th>\n";
     echo "<th>\n";
     echo "{$s_active_lang}";
     echo "</th>\n";
     echo "</tr>\n";
     foreach ($a_list as $s_name => $i_value) {
         if (substr($s_name, 0, 4) == "MSG_") {
             //
             // some PHP constants begin with MSG_, so we try to skip them too
             //
             switch ($s_name) {
                 case "MSG_IPC_NOWAIT":
                 case "MSG_EAGAIN":
                 case "MSG_ENOMSG":
                 case "MSG_NOERROR":
                 case "MSG_EXCEPT":
                 case "MSG_OOB":
                 case "MSG_PEEK":
                 case "MSG_DONTROUTE":
                 case "MSG_EOR":
                     continue 2;
             }
             if ($i_value >= 256) {
                 continue;
             }
             echo "<tr>\n";
             echo "<td valign=\"top\">\n";
             echo "{$s_name} ({$i_value})";
             echo "</td>\n";
             echo "<td valign=\"top\">\n";
             $aMessages = $a_def_mesgs;
             $s_def_msg = GetMessage((int) $i_value, array(), true, true);
             echo nl2br(htmlentities($s_def_msg));
             // English - don't need FixedHTMLEntities
             echo "</td>\n";
             echo "<td valign=\"top\">\n";
             $aMessages = $a_active_mesgs;
             $s_act_msg = GetMessage((int) $i_value, array(), true, true);
             if ($s_def_msg == $s_act_msg) {
                 echo "<i>identical</i>\n";
             } else {
                 echo nl2br(FixedHTMLEntities($s_act_msg));
             }
             echo "</td>\n";
             echo "</tr>\n";
         }
     }
     echo "</table>\n";
     echo "</body>\n";
     echo "</html>\n";
 }
Exemplo n.º 3
0
 function ShowMessages()
 {
     global $aMessages, $sLangID, $bShowMesgNumbers, $aGetVars, $sHTMLCharSet;
     //
     // force message numbers on unless "mnums=no"
     //
     if (isset($aGetVars["mnums"]) && $aGetVars["mnums"] == "no") {
         $bShowMesgNumbers = false;
     } else {
         $bShowMesgNumbers = true;
     }
     LoadBuiltinLanguage();
     $s_def_lang = $sLangID;
     $a_def_mesgs = $aMessages;
     LoadLanguageFile();
     $s_active_lang = $sLangID;
     $a_active_mesgs = $aMessages;
     $a_list = get_defined_constants();
     echo "<html>\n";
     echo "<head>\n";
     if (isset($sHTMLCharSet) && $sHTMLCharSet !== "") {
         echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset={$sHTMLCharSet}\">\n";
     }
     echo "</head>\n";
     echo "<body>\n";
     echo "<table border=\"1\" cellpadding=\"10\" width=\"95%\">\n";
     echo "<tr>\n";
     echo "<th>\n";
     echo "Message Number";
     echo "</th>\n";
     echo "<th>\n";
     echo "{$s_def_lang}";
     echo "</th>\n";
     echo "<th>\n";
     echo "{$s_active_lang}";
     echo "</th>\n";
     echo "</tr>\n";
     foreach ($a_list as $s_name => $i_value) {
         if (substr($s_name, 0, 4) == "MSG_") {
             echo "<tr>\n";
             echo "<td valign=\"top\">\n";
             echo "{$s_name} ({$i_value})";
             echo "</td>\n";
             echo "<td valign=\"top\">\n";
             $aMessages = $a_def_mesgs;
             $s_def_msg = GetMessage((int) $i_value, array(), true, true);
             echo nl2br(htmlentities($s_def_msg));
             echo "</td>\n";
             echo "<td valign=\"top\">\n";
             $aMessages = $a_active_mesgs;
             $s_act_msg = GetMessage((int) $i_value, array(), true, true);
             if ($s_def_msg == $s_act_msg) {
                 echo "<i>identical</i>\n";
             } elseif (isset($sHTMLCharSet) && $sHTMLCharSet != "") {
                 //
                 // unfortunately, htmlentities get some characters
                 // wrong and converts them even when the
                 // charset is provided
                 //
                 echo nl2br(htmlspecialchars($s_act_msg, ENT_COMPAT, $sHTMLCharSet));
             } else {
                 echo nl2br(htmlentities($s_act_msg));
             }
             echo "</td>\n";
             echo "</tr>\n";
         }
     }
     echo "</table>\n";
     echo "</body>\n";
     echo "</html>\n";
 }