This commit is contained in:
ceb 2002-09-27 17:39:49 +00:00
parent b13c5e40e8
commit d0d21f42be

View File

@ -1,29 +1,29 @@
<?php <?php
/**************************************************************************\ /**************************************************************************\
* phpGroupWare API - Commononly used functions * * phpGroupWare API - Commononly used functions *
* This file written by Dan Kuykendall <seek3r@phpgroupware.org> * * Written by Dan Kuykendall <seek3r@phpgroupware.org> *
* and Joseph Engo <jengo@phpgroupware.org> * * and Joseph Engo <jengo@phpgroupware.org> *
* and Mark Peters <skeeter@phpgroupware.org> * * and Mark Peters <skeeter@phpgroupware.org> *
* Commononly used functions by phpGroupWare developers * * and Bettina Gille [ceb@phpgroupware.org] *
* Copyright (C) 2000, 2001 Dan Kuykendall * * Commononly used functions by phpGroupWare developers *
* -------------------------------------------------------------------------* * Copyright (C) 2000 - 2002 Dan Kuykendall *
* This library is part of the phpGroupWare API * * ------------------------------------------------------------------------ *
* http://www.phpgroupware.org/api * * This library is part of the phpGroupWare API *
* ------------------------------------------------------------------------ * * http://www.phpgroupware.org/api *
* This library is free software; you can redistribute it and/or modify it * * ------------------------------------------------------------------------ *
* under the terms of the GNU Lesser General Public License as published by * * This library is free software; you can redistribute it and/or modify it *
* the Free Software Foundation; either version 2.1 of the License, * * under the terms of the GNU Lesser General Public License as published by *
* or any later version. * * the Free Software Foundation; either version 2.1 of the License, *
* This library is distributed in the hope that it will be useful, but * * or any later version. *
* WITHOUT ANY WARRANTY; without even the implied warranty of * * This library is distributed in the hope that it will be useful, but *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * WITHOUT ANY WARRANTY; without even the implied warranty of *
* See the GNU Lesser General Public License for more details. * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* You should have received a copy of the GNU Lesser General Public License * * See the GNU Lesser General Public License for more details. *
* along with this library; if not, write to the Free Software Foundation, * * You should have received a copy of the GNU Lesser General Public License *
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * along with this library; if not, write to the Free Software Foundation, *
\**************************************************************************/ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
\**************************************************************************/
/* $Id$ */ /* $Id$ */
$d1 = strtolower(@substr(PHPGW_API_INC,0,3)); $d1 = strtolower(@substr(PHPGW_API_INC,0,3));
$d2 = strtolower(@substr(PHPGW_SERVER_ROOT,0,3)); $d2 = strtolower(@substr(PHPGW_SERVER_ROOT,0,3));
@ -632,7 +632,7 @@
@function list_themes @function list_themes
@abstract list themes available @abstract list themes available
*/ */
function list_themes() /*function list_themes()
{ {
$dh = opendir(PHPGW_SERVER_ROOT . '/phpgwapi/themes'); $dh = opendir(PHPGW_SERVER_ROOT . '/phpgwapi/themes');
while ($file = readdir($dh)) while ($file = readdir($dh))
@ -645,6 +645,23 @@
//$dh->close(); //$dh->close();
reset ($list); reset ($list);
return $list; return $list;
} */
function list_themes()
{
$tpl_dir = $this->get_tpl_dir('phpgwapi');
$dh = opendir($tpl_dir . SEP . 'css');
while ($file = readdir($dh))
{
if (eregi("\.css$", $file))
{
$list[] = substr($file,0,strpos($file,'.'));
}
}
closedir($dh);
reset ($list);
return $list;
} }
/*! /*!
@ -1319,7 +1336,7 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info'
$css_file = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP . 'templates' . SEP . $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] $css_file = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP . 'templates' . SEP . $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']
. SEP . 'css' . SEP . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.css'; . SEP . 'css' . SEP . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.css';
} }
elseif(@file_exists(PHPGW_SERVER_ROOT . SEP . 'phpgwapi' . SEP . 'templates' . SEP . 'idsociety' . SEP . 'css' . SEP . 'submarine.css')) elseif(@file_exists(PHPGW_SERVER_ROOT . SEP . 'phpgwapi' . SEP . 'templates' . SEP . $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] . SEP . 'css' . SEP . 'submarine.css'))
{ {
$css_file = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP . 'templates' . SEP . 'idsociety' . SEP . 'css' . SEP . 'submarine.css'; $css_file = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP . 'templates' . SEP . 'idsociety' . SEP . 'css' . SEP . 'submarine.css';
} }