View of /mambo/branches/4.6/administrator/components/com_languages/actions/save.action.php
Parent Directory
|
Revision Log
Revision 298 -
(download)
(annotate)
Fri Feb 17 03:00:30 2006 UTC (7 years, 3 months ago) by csouza
File size: 1176 byte(s)
Fri Feb 17 03:00:30 2006 UTC (7 years, 3 months ago) by csouza
File size: 1176 byte(s)
updated com_languages
<?php
class saveAction extends Action
{
function execute(&$controller, &$request)
{
$root = mamboCore::get('rootPath');
$lang = mosGetParam($_POST, 'id', 'english');
$langfile = $root.DIRECTORY_SEPARATOR.'language'.DIRECTORY_SEPARATOR.$lang.'.xml';
$p = xml_parser_create();
xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($p, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($p, file_get_contents($langfile), $arr);
xml_parser_free($p);
foreach($arr as $key => $value)
{
if ($value['tag'] == 'name') {
$arr[$key]['value'] = $_POST['name'];
}
if ($value['tag'] == 'param') {
foreach ($_POST as $k => $v) {
if ($k == $value['attributes']['name'])
echo $arr[$key]['attributes']['default'] = $v;
}
}
}
$xml = XMLUtils::array_to_xml($arr);
$fp = fopen($langfile, 'w+');
fwrite($fp, $xml);
fclose($fp);
return $controller->redirect();
}
}
?>| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

