Location: PHPKode > projects > O - OpenSource GroupWare > osgw/config/upgrade_languages.php
<?php
/**************************************************************************
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   @Authors:	Ryan Thompson(hide@address.com)
***************************************************************************/
$service['no_session'] = TRUE;
require('../config.inc.php');


$languages = $lang->get_supported_languages();
if(isset($_GET['pl']))
{
	$services[] = $_GET['service'];
} elseif(isset($_GET['al']))
{
	$sql = "SELECT location FROM o_services";
	$db->query($sql);
	while($db->fetch_results())
	{
		$services[] = $db->record['location'];
	}
	$services[] = 'osgw';
} else {
	$services = $O->get_services();
	//During configuration we treat the engine as a service also.
	$services[] = 'osgw';
} 


foreach($languages AS $lang)
{


	foreach($services AS $location)
	{

		include("{$O->dir}/$location/data.php");
	
		//if(!$fp = fopen("{$O->dir}/$location/config/text/$lang", 'r'))
		if(!$fp = fopen("{$O->dir}/$location/config/text/$lang", 'r'))
		{		
			$error->debug('php', $php_errormsg);
		} else {	
			while(!feof($fp))
			{
				$setup->text_search(fgets($fp, 2048),$service['code'] , $lang);
			}
			fclose($fp);
		}
	}
}

//To save on code we're using this to install and upgrade plugins from administrator
if(isset($_GET['al']))
{
	$O->redirect('/admin/language_manager.php');
} else {
	$O->redirect('/config/upgrade_data.php');
}
Return current item: O - OpenSource GroupWare