From 869b9be7e9713a1da3670639394f376ad771c5d2 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 25 Jul 2009 18:01:05 +1000 Subject: [PATCH] Fix IMGDIR/CSSDIR when no config.php yet and creating setting to disable remoteurls for sflogo --- lib/config_default.php | 4 ++++ lib/functions.php | 2 +- lib/page.php | 8 +++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/config_default.php b/lib/config_default.php index 44d1295..272ff93 100644 --- a/lib/config_default.php +++ b/lib/config_default.php @@ -107,6 +107,10 @@ class Config { 'desc'=>'Group DN, where membership will exempt the users from readonly attrs', 'default'=>null); + $this->default->appearance['remoteurls'] = array( + 'desc'=>'Whether to include renders for remote URLs', + 'default'=>true); + $this->default->appearance['timezone'] = array( 'desc'=>'Define our timezone, if not defined in php.ini', 'default'=>null); diff --git a/lib/functions.php b/lib/functions.php index a838237..58fb60a 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -2518,7 +2518,7 @@ function get_href($type,$extra_info='') { case 'forum': return sprintf('%s/mailarchive/forum.php?forum_name=%s',$sf,$forum_id); case 'logo': - return sprintf('http://sflogo.sourceforge.net/sflogo.php?group_id=%s&type=8',$group_id); + return isset($_SESSION) && ! $_SESSION[APPCONFIG]->getValue('appearance','remoteurls') ? '' : sprintf('http://sflogo.sourceforge.net/sflogo.php?group_id=%s&type=8',$group_id); case 'sf': return sprintf('%s/projects/phpldapadmin',$sf); case 'web': diff --git a/lib/page.php b/lib/page.php index 35293da..321b963 100644 --- a/lib/page.php +++ b/lib/page.php @@ -31,6 +31,12 @@ class page { if (defined('DEBUG_ENABLED') && DEBUG_ENABLED) debug_log('Entered with [%s]',129,__FILE__,__LINE__,__METHOD__,$index); + # If we done have a configuration, then our IMGDIR and CSS are not defined + if (! defined('IMGDIR')) + define('IMGDIR','images/default'); + if (! defined('CSSDIR')) + define('CSSDIR','css/default'); + $this->index = $index; # To be defined in a configuration file. @@ -324,7 +330,7 @@ class page { printf('%s
%s
%s', isCompress() ? '[C]' : ' ', app_version(), - sprintf('SourceForge.net Logo',get_href('sf'),get_href('logo'))); + get_href('logo') ? sprintf('SourceForge.net Logo',get_href('sf'),get_href('logo')) : ' '); } /**