only show template set that contain a setup.inc.php

This commit is contained in:
Pim Snel 2005-06-29 21:06:52 +00:00
parent cd27f2cca3
commit 014aa6ca67

View File

@ -746,16 +746,15 @@
$d = dir(EGW_SERVER_ROOT . '/phpgwapi/templates'); $d = dir(EGW_SERVER_ROOT . '/phpgwapi/templates');
while ($entry=$d->read()) while ($entry=$d->read())
{ {
if ($entry != 'CVS' && $entry != '.' && $entry != '..' if ($entry != '..' && is_file(EGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry .'/setup/setup.inc.php')
&& $entry != 'phpgw_website' )
&& is_dir(EGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry))
{ {
$list[$entry]['name'] = $entry; $list[$entry]['name'] = $entry;
$f = EGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry . '/details.inc.php'; $f = EGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry . '/setup/setup.inc.php';
if (file_exists ($f)) if (file_exists ($f))
{ {
include($f); include($f);
$list[$entry]['title'] = 'Use '.$GLOBALS['egw_info']['template'][$entry]['title'].'interface'; $list[$entry]['title'] = $GLOBALS['egw_info']['template'][$entry]['title'];
} }
else else
{ {
@ -763,6 +762,9 @@
} }
} }
} }
//_debug_array($GLOBALS['egw_info'][template]);
//die();
$d->close(); $d->close();
ksort($list); ksort($list);
return $list; return $list;