egroupware/importexport/setup/default_records.inc.php

37 lines
1.2 KiB
PHP
Raw Normal View History

<?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$
*/
if (!extension_loaded('dom'))
{
echo "<p>Required PHP DOM extension missing, installation of ImportExport definitions aborted.</p>\n";
return; // otherwise we mess up the whole eGroupware install process
}
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
// This sets up $GLOBALS['egw']->accounts and $GLOBALS['egw']->db
$GLOBALS['egw_setup']->setup_account_object();
2007-06-08 00:08:38 +02:00
// step through every source code intstalled app
$egwdir = dir(EGW_INCLUDE_ROOT);
while (false !== ($appdir = $egwdir->read())) {
$defdir = EGW_INCLUDE_ROOT. "/$appdir/importexport/definitions";
if ( !is_dir( $defdir ) ) continue;
// step through each file in defdir of app
$d = dir($defdir);
while (false !== ($entry = $d->read())) {
$file = $defdir. '/'. $entry;
list( $filename, $extension) = explode('.',$entry);
if ( $extension != 'xml' ) continue;
bodefinitions::import( $file );
}
2007-06-08 00:08:38 +02:00
}