[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/administrator/components/com_languages/actions/ -> convert.action.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Languages
   5  * @author Mambo Foundation Inc see README.php
   6  * @copyright (C) 2000 - 2009 Mambo Foundation Inc.
   7  * See COPYRIGHT.php for copyright notices and details.
   8  * @license GNU/GPL Version 2, see LICENSE.php
   9  *
  10  * Redistributions of files must retain the above copyright notice.
  11  *
  12  * Mambo is free software; you can redistribute it and/or
  13  * modify it under the terms of the GNU General Public License
  14  * as published by the Free Software Foundation; version 2 of the License.
  15  */
  16  
  17  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  18  class convertAction extends Action
  19  {
  20      function execute(&$controller, &$request)
  21      {
  22  
  23          $from_charset   = mosGetParam($_POST,'charset');
  24          $to_charset     = mosGetParam($_POST,'newcharset');
  25          $lang           = mosGetParam($_POST,'language');
  26          $textdomain = mamboCore::get('rootPath')."/language";
  27  
  28          $language = new mamboLanguage($lang);
  29          $language->load();
  30          $language->charset = $to_charset;
  31          $language->save();
  32          
  33          $configuration =& mamboCore::getMamboCore();
  34          $gettext_admin = new PHPGettextAdmin($configuration->get('mosConfig_locale_use_gettext'));
  35          foreach ($language->files as $arr) { 
  36              $gettext_admin->convert_charset($arr['domain'], $textdomain, $lang, $from_charset, $to_charset);                                    
  37              $gettext_admin->message_format($arr['domain'], $textdomain, $lang);            
  38          }
  39          
  40          #return $controller->redirect('index', 'language');
  41  
  42          $request->set('task', 'edit');
  43          $request->set('act', 'language');
  44          $request->set('lang', $lang);
  45          $controller->view('edit');
  46          #
  47  
  48          /*$admin = new PHPGettextAdmin();
  49          $admin->convert_encoding($catalog, $from, $to);
  50          dump(iconv_get_encoding());*/
  51      }
  52  }
  53  
  54  ?>