2006-11-10 16:30:01 +01:00
|
|
|
<?php
|
2007-06-08 00:08:38 +02:00
|
|
|
/**
|
|
|
|
* eGroupWare - importexport
|
|
|
|
*
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @package importexport
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @author Cornelius Weiss <nelius@cwtech.de>
|
|
|
|
* @version $Id$
|
|
|
|
*/
|
2006-11-10 16:30:01 +01:00
|
|
|
|
2007-06-08 00:08:38 +02:00
|
|
|
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.bodefinitions.inc.php');
|
2007-06-21 17:09:51 +02:00
|
|
|
require_once(EGW_INCLUDE_ROOT. '/phpgwapi/inc/class.accounts.inc.php');
|
|
|
|
require_once(EGW_INCLUDE_ROOT. '/phpgwapi/inc/class.translation.inc.php');
|
|
|
|
|
|
|
|
// some globals we need
|
|
|
|
if ( !is_object($GLOBALS['egw']->accounts) ) $GLOBALS['egw']->accounts = new accounts();
|
|
|
|
if ( !is_object($GLOBALS['egw']->translation) ) $GLOBALS['egw']->translation = new translation();
|
|
|
|
if ( !is_object($GLOBALS['egw']->db)) $GLOBALS['egw']->db = $GLOBALS['egw_setup']->db;
|
2007-06-08 00:08:38 +02:00
|
|
|
|
|
|
|
// apps, whose definitions should be installed automatically
|
2007-06-21 17:09:51 +02:00
|
|
|
// i don't know how to ask setup which apps are / ore are going to be installed.
|
2007-06-08 00:08:38 +02:00
|
|
|
$appnames = array (
|
|
|
|
'addressbook',
|
|
|
|
);
|
2006-11-10 16:30:01 +01:00
|
|
|
|
2007-06-08 00:08:38 +02:00
|
|
|
foreach ($appnames as $appname) {
|
|
|
|
$defdir = EGW_INCLUDE_ROOT. "/$appname/importexport/definitions";
|
|
|
|
if(!is_dir($defdir)) continue;
|
|
|
|
$d = dir($defdir);
|
|
|
|
|
|
|
|
// step through each file in appdir
|
|
|
|
while (false !== ($entry = $d->read())) {
|
2007-06-21 17:09:51 +02:00
|
|
|
$file = $defdir. '/'. $entry;
|
2007-06-08 00:08:38 +02:00
|
|
|
list( $filename, $extension) = explode('.',$entry);
|
|
|
|
if ( $extension != 'xml' ) continue;
|
|
|
|
bodefinitions::import( $file );
|
|
|
|
}
|
|
|
|
}
|