Fixed functions.inc.php being included instead of the apps functions.inc.php file

This commit is contained in:
jengo 2001-02-06 14:11:44 +00:00
parent b161971275
commit 58bb2a282f
2 changed files with 27 additions and 26 deletions

View File

@ -333,25 +333,27 @@
}
}
function get_inc_dir($appname = ""){
global $phpgw_info;
if (! $appname){
$appname = $phpgw_info["flags"]["currentapp"];
}
if ($appname == "home" || $appname == "logout" || $appname == "login") {
$appname = "phpgwapi";
}
function get_inc_dir($appname = "")
{
global $phpgw_info;
$incdir = PHPGW_INCLUDE_ROOT . "/" . $appname . "/inc";
$incdir_default = PHPGW_SERVER_ROOT . "/" . $appname . "/inc";
if (! $appname){
$appname = $phpgw_info["flags"]["currentapp"];
}
if ($appname == "home" || $appname == "logout" || $appname == "login") {
$appname = "phpgwapi";
}
if (is_dir ($incdir)){
return $incdir;
}elseif (is_dir ($incdir_default)){
return $incdir_default;
}else{
return False;
}
$incdir = PHPGW_INCLUDE_ROOT . "/" . $appname . "/inc";
$incdir_default = PHPGW_SERVER_ROOT . "/" . $appname . "/inc";
if (is_dir ($incdir)) {
return $incdir;
} elseif (is_dir ($incdir_default)) {
return $incdir_default;
} else {
return False;
}
}
function list_themes()
@ -486,7 +488,7 @@
$phpgw_info["navbar"][$permission[0]]["title"] = $phpgw_info["apps"][$permission[0]]["title"];
$phpgw_info["navbar"][$permission[0]]["url"] = $phpgw->link($phpgw_info["server"]["webserver_url"]
. "/" . $permission[0] . "/index.php");
$icon_file = $phpgw_info["server"]["server_root"]."/".$permission[0] . "/templates/". $phpgw_info["server"]["template_set"]. "/images/navbar.gif";
$icon_file = PHPGW_SERVER_ROOT . "/".$permission[0] . "/templates/". $phpgw_info["server"]["template_set"]. "/images/navbar.gif";
if (file_exists($icon_file)){
$phpgw_info["navbar"][$permission[0]]["icon"] = $phpgw_info["server"]["webserver_url"] . "/"
. $permission[0] . "/templates/" . $phpgw_info["server"]["template_set"] . "/images/navbar.gif";

View File

@ -364,13 +364,12 @@
* Load the app include files if the exists *
\*************************************************************************/
/* Then the include file */
if (!preg_match ("/phpgwapi/i", $phpgw_info["server"]["app_inc"]) && file_exists ($phpgw_info["server"]["app_inc"]."/functions.inc.php")){
include(PHPGW_API_INC."/functions.inc.php");
if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) && file_exists(PHPGW_APP_INC."/functions.inc.php")){
include(PHPGW_APP_INC . "/functions.inc.php");
}
if (!$phpgw_info["flags"]["noheader"] &&
!$phpgw_info["flags"]["noappheader"] &&
file_exists ($phpgw_info["server"]["app_inc"]."/header.inc.php")) {
include(PHPGW_API_INC."/header.inc.php");
if (!$phpgw_info["flags"]["noheader"] && ! $phpgw_info["flags"]["noappheader"] &&
file_exists(PHPGW_APP_INC . "/header.inc.php")) {
include(PHPGW_APP_INC . "/header.inc.php");
}
}
error_reporting(7);