commit please

Антон Нехороших anton@valuehost.ru
Wed, 17 Oct 2001 11:13:59 +0400


Hi

commit please

new: change charset in message for russian language
fix: IMP_MIME_Viewer_text for russian language



*** imp/lib/IMP.php     Wed Oct 17 10:42:02 2001
--- imp/lib/IMP.my      Tue Oct 16 16:57:19 2001
***************
*** 741,752 ****
  
          /* Convert Cyrillic character sets. */
          if (stristr($registry->getCharset(), 'windows-1251')) {
!             if (stristr($mime->charset, 'koi8-r')) {
                  $msg = convert_cyr_string($msg, 'k', 'w');
              }
          }
          if (stristr($registry->getCharset(), 'koi8-r')) {
!             if (stristr($mime->charset, 'windows-1251')) {
                  $msg = convert_cyr_string($msg, 'w', 'k');
              }
          }
--- 741,768 ----
  
          /* Convert Cyrillic character sets. */
          if (stristr($registry->getCharset(), 'windows-1251')) {
!           if (Horde::getFormData("sce")=='koi') {
!                 $msg = convert_cyr_string($msg, 'k', 'w');
!           } else if (Horde::getFormData("sce")=='iso') {
!                 $msg = convert_cyr_string($msg, 'i', 'w');
!           } else if (Horde::getFormData("sce")=='mac') {
!                 $msg = convert_cyr_string($msg, 'm', 'w');
!           } else if (Horde::getFormData("sce")=='dos') {
!                 $msg = convert_cyr_string($msg, 'a', 'w');
!           } else if (stristr($mime->charset, 'koi8-r')) {
                  $msg = convert_cyr_string($msg, 'k', 'w');
              }
          }
          if (stristr($registry->getCharset(), 'koi8-r')) {
!           if (Horde::getFormData("sce")=='win') {
!                 $msg = convert_cyr_string($msg, 'w', 'k');
!           } else if (Horde::getFormData("sce")=='iso') {
!                 $msg = convert_cyr_string($msg, 'i', 'k');
!           } else if (Horde::getFormData("sce")=='mac') {
!                 $msg = convert_cyr_string($msg, 'm', 'k');
!           } else if (Horde::getFormData("sce")=='dos') {
!                 $msg = convert_cyr_string($msg, 'a', 'k');
!           } else if (stristr($mime->charset, 'windows-1251')) {
                  $msg = convert_cyr_string($msg, 'w', 'k');
              }
          }
*** imp/templates/message/navbar.inc    Wed Oct 17 10:42:02 2001
--- imp/templates/message/navbar.my     Tue Oct 16 17:00:42 2001
***************
*** 35,38 ****
  <?= Horde::img('next-grey.gif', 'width="12" height="13" alt=""') ?>
  <?php endif; ?>
  </td>
! </tr></table>
--- 35,52 ----
  <?= Horde::img('next-grey.gif', 'width="12" height="13" alt=""') ?>
  <?php endif; ?>
  </td>
! </tr>
! <? if (eregi("^ru_",Lang::select(true))) { ?>
! <tr class="control">
! <td align="rigth" colspan=2>
! <?= _("Select charset:") ?>
!  <?= Horde::link(Horde::url("message.php?index=${form_index}&array_index=" . $HTTP_GET_VARS['array_index']),_('select charset AUTO'),'widget').'AUTO</a>' ?>
!  | <?= Horde::link(Horde::url("message.php?index=${form_index}&array_index=" . $HTTP_GET_VARS['array_index']."&sce=win"),_('select charset WIN'),'widget').'WIN</a>' ?>
!  | <?= Horde::link(Horde::url("message.php?index=${form_index}&array_index=" . $HTTP_GET_VARS['array_index']."&sce=koi"),_('select charset KKOI'),'widget').'KOI</a>' ?>
!  | <?= Horde::link(Horde::url("message.php?index=${form_index}&array_index=" . $HTTP_GET_VARS['array_index']."&sce=dos"),_('select charset DOS'),'widget').'DOS</a>' ?>
!  | <?= Horde::link(Horde::url("message.php?index=${form_index}&array_index=" . $HTTP_GET_VARS['array_index']."&sce=iso"),_('select charset ISO'),'widget').'ISO</a>' ?>
!  | <?= Horde::link(Horde::url("message.php?index=${form_index}&array_index=" . $HTTP_GET_VARS['array_index']."&sce=mac"),_('select charset MAC'),'widget').'MAC</a>' ?>
! </td>
! </tr>
! <? } ?>
! </table>
*** imp/lib/MIME/Viewer/text.php        Wed Oct 17 10:42:02 2001
--- imp/lib/MIME/Viewer/text.my Mon Oct  8 11:35:25 2001
***************
*** 25,33 ****
          include_once HORDE_BASE . '/lib/Text.php';
          
          $text = $this->mime_part->getContents();
-         if (strtolower($mime->charset) == 'windows-1251') {
-             $text = convert_cyr_string($text, 'w', 'k');
-         }
      
          $text = str_replace('</A>', '</a>', $text); // make sure that the original message doesn't contain any capital </A> tags, so we can assume we generated them
          $text = str_replace('<A', '<a', $text);     // ditto for open <A> tags
--- 25,30 ----