Annotation of /mambo/branches/4.6/administrator/components/com_languages/actions/default.action.php
Parent Directory
|
Revision Log
Revision 403 - (view) (download)
| 1 : | csouza | 403 | <?php |
| 2 : | class defaultAction extends Action | ||
| 3 : | { | ||
| 4 : | function execute(&$controller, &$request) | ||
| 5 : | { | ||
| 6 : | $lang = mosGetParam( $_REQUEST, 'lang' ); | ||
| 7 : | $root = mamboCore::get('rootPath'); | ||
| 8 : | $fp = fopen("../configuration.php","r"); | ||
| 9 : | $config = ""; | ||
| 10 : | $session =& $request->session(); | ||
| 11 : | |||
| 12 : | |||
| 13 : | while(!feof($fp)){ | ||
| 14 : | $buffer = fgets($fp,4096); | ||
| 15 : | if (strstr($buffer,"\$mosConfig_lang =")){ | ||
| 16 : | $config .= "\$mosConfig_lang = \"{$lang}\";\n"; | ||
| 17 : | } else { | ||
| 18 : | $config .= $buffer; | ||
| 19 : | } | ||
| 20 : | } | ||
| 21 : | fclose($fp); | ||
| 22 : | if ($fp = fopen("../configuration.php","w")){ | ||
| 23 : | fputs($fp, $config, strlen($config)); | ||
| 24 : | fclose($fp); | ||
| 25 : | $session['mosmsg'] = T_('Default Language succesfully updated!'); | ||
| 26 : | } else { | ||
| 27 : | $session['mosmsg'] = T_('Error! Make sure that configuration.php is writeable.'); | ||
| 28 : | } | ||
| 29 : | return $controller->redirect(); | ||
| 30 : | } | ||
| 31 : | } | ||
| 32 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

