diff --git a/htdocs/css/style.css b/htdocs/css/default/style.css similarity index 99% rename from htdocs/css/style.css rename to htdocs/css/default/style.css index 5346313..ea5868d 100644 --- a/htdocs/css/style.css +++ b/htdocs/css/default/style.css @@ -565,7 +565,7 @@ span.hint { /* Login Box */ #login { - background: url('../images/uid.png') no-repeat 0 1px; + background: url('../../images/default/uid.png') no-repeat 0 1px; background-color: #FAFAFF; color: #000000; padding-left: 17px; @@ -582,7 +582,7 @@ span.hint { } #password { - background: url('../images/key.png') no-repeat 0 1px; + background: url('../../images/default/key.png') no-repeat 0 1px; background-color: #FAFAFF; color: #000000; padding-left: 17px; diff --git a/htdocs/images/add.png b/htdocs/images/default/add.png similarity index 100% rename from htdocs/images/add.png rename to htdocs/images/default/add.png diff --git a/htdocs/images/bug-big.png b/htdocs/images/default/bug-big.png similarity index 100% rename from htdocs/images/bug-big.png rename to htdocs/images/default/bug-big.png diff --git a/htdocs/images/bug.png b/htdocs/images/default/bug.png similarity index 100% rename from htdocs/images/bug.png rename to htdocs/images/default/bug.png diff --git a/htdocs/images/calendar.png b/htdocs/images/default/calendar.png similarity index 100% rename from htdocs/images/calendar.png rename to htdocs/images/default/calendar.png diff --git a/htdocs/images/catalog.png b/htdocs/images/default/catalog.png similarity index 100% rename from htdocs/images/catalog.png rename to htdocs/images/default/catalog.png diff --git a/htdocs/images/children.png b/htdocs/images/default/children.png similarity index 100% rename from htdocs/images/children.png rename to htdocs/images/default/children.png diff --git a/htdocs/images/compare.png b/htdocs/images/default/compare.png similarity index 100% rename from htdocs/images/compare.png rename to htdocs/images/default/compare.png diff --git a/htdocs/images/country.png b/htdocs/images/default/country.png similarity index 100% rename from htdocs/images/country.png rename to htdocs/images/default/country.png diff --git a/htdocs/images/cut.png b/htdocs/images/default/cut.png similarity index 100% rename from htdocs/images/cut.png rename to htdocs/images/default/cut.png diff --git a/htdocs/images/dc.png b/htdocs/images/default/dc.png similarity index 100% rename from htdocs/images/dc.png rename to htdocs/images/default/dc.png diff --git a/htdocs/images/debug-cache.png b/htdocs/images/default/debug-cache.png similarity index 100% rename from htdocs/images/debug-cache.png rename to htdocs/images/default/debug-cache.png diff --git a/htdocs/images/device.png b/htdocs/images/default/device.png similarity index 100% rename from htdocs/images/device.png rename to htdocs/images/default/device.png diff --git a/htdocs/images/disabled.png b/htdocs/images/default/disabled.png similarity index 100% rename from htdocs/images/disabled.png rename to htdocs/images/default/disabled.png diff --git a/htdocs/images/document.png b/htdocs/images/default/document.png similarity index 100% rename from htdocs/images/document.png rename to htdocs/images/default/document.png diff --git a/htdocs/images/door.png b/htdocs/images/default/door.png similarity index 100% rename from htdocs/images/door.png rename to htdocs/images/default/door.png diff --git a/htdocs/images/error-big.png b/htdocs/images/default/error-big.png similarity index 100% rename from htdocs/images/error-big.png rename to htdocs/images/default/error-big.png diff --git a/htdocs/images/error.png b/htdocs/images/default/error.png similarity index 100% rename from htdocs/images/error.png rename to htdocs/images/default/error.png diff --git a/htdocs/images/export.png b/htdocs/images/default/export.png similarity index 100% rename from htdocs/images/export.png rename to htdocs/images/default/export.png diff --git a/htdocs/images/files.png b/htdocs/images/default/files.png similarity index 100% rename from htdocs/images/files.png rename to htdocs/images/default/files.png diff --git a/htdocs/images/find.png b/htdocs/images/default/find.png similarity index 100% rename from htdocs/images/find.png rename to htdocs/images/default/find.png diff --git a/htdocs/images/folder.png b/htdocs/images/default/folder.png similarity index 100% rename from htdocs/images/folder.png rename to htdocs/images/default/folder.png diff --git a/htdocs/images/go.png b/htdocs/images/default/go.png similarity index 100% rename from htdocs/images/go.png rename to htdocs/images/default/go.png diff --git a/htdocs/images/hard-drive.png b/htdocs/images/default/hard-drive.png similarity index 100% rename from htdocs/images/hard-drive.png rename to htdocs/images/default/hard-drive.png diff --git a/htdocs/images/help-big.png b/htdocs/images/default/help-big.png similarity index 100% rename from htdocs/images/help-big.png rename to htdocs/images/default/help-big.png diff --git a/htdocs/images/help.png b/htdocs/images/default/help.png similarity index 100% rename from htdocs/images/help.png rename to htdocs/images/default/help.png diff --git a/htdocs/images/home-big.png b/htdocs/images/default/home-big.png similarity index 100% rename from htdocs/images/home-big.png rename to htdocs/images/default/home-big.png diff --git a/htdocs/images/home.png b/htdocs/images/default/home.png similarity index 100% rename from htdocs/images/home.png rename to htdocs/images/default/home.png diff --git a/htdocs/images/host.png b/htdocs/images/default/host.png similarity index 100% rename from htdocs/images/host.png rename to htdocs/images/default/host.png diff --git a/htdocs/images/import.png b/htdocs/images/default/import.png similarity index 100% rename from htdocs/images/import.png rename to htdocs/images/default/import.png diff --git a/htdocs/images/index.php b/htdocs/images/default/index.php similarity index 100% rename from htdocs/images/index.php rename to htdocs/images/default/index.php diff --git a/htdocs/images/info-big.png b/htdocs/images/default/info-big.png similarity index 100% rename from htdocs/images/info-big.png rename to htdocs/images/default/info-big.png diff --git a/htdocs/images/info.png b/htdocs/images/default/info.png similarity index 100% rename from htdocs/images/info.png rename to htdocs/images/default/info.png diff --git a/htdocs/images/invalid.png b/htdocs/images/default/invalid.png similarity index 100% rename from htdocs/images/invalid.png rename to htdocs/images/default/invalid.png diff --git a/htdocs/images/key.png b/htdocs/images/default/key.png similarity index 100% rename from htdocs/images/key.png rename to htdocs/images/default/key.png diff --git a/htdocs/images/ldap-server.png b/htdocs/images/default/ldap-server.png similarity index 100% rename from htdocs/images/ldap-server.png rename to htdocs/images/default/ldap-server.png diff --git a/htdocs/images/light-big.png b/htdocs/images/default/light-big.png similarity index 100% rename from htdocs/images/light-big.png rename to htdocs/images/default/light-big.png diff --git a/htdocs/images/light.png b/htdocs/images/default/light.png similarity index 100% rename from htdocs/images/light.png rename to htdocs/images/default/light.png diff --git a/htdocs/images/locality.png b/htdocs/images/default/locality.png similarity index 100% rename from htdocs/images/locality.png rename to htdocs/images/default/locality.png diff --git a/htdocs/images/lock.png b/htdocs/images/default/lock.png similarity index 100% rename from htdocs/images/lock.png rename to htdocs/images/default/lock.png diff --git a/htdocs/images/logo-small.png b/htdocs/images/default/logo-small.png similarity index 100% rename from htdocs/images/logo-small.png rename to htdocs/images/default/logo-small.png diff --git a/htdocs/images/logo.png b/htdocs/images/default/logo.png similarity index 100% rename from htdocs/images/logo.png rename to htdocs/images/default/logo.png diff --git a/htdocs/images/logout.png b/htdocs/images/default/logout.png similarity index 100% rename from htdocs/images/logout.png rename to htdocs/images/default/logout.png diff --git a/htdocs/images/mail.png b/htdocs/images/default/mail.png similarity index 100% rename from htdocs/images/mail.png rename to htdocs/images/default/mail.png diff --git a/htdocs/images/mail_account.png b/htdocs/images/default/mail_account.png similarity index 100% rename from htdocs/images/mail_account.png rename to htdocs/images/default/mail_account.png diff --git a/htdocs/images/mail_alias.png b/htdocs/images/default/mail_alias.png similarity index 100% rename from htdocs/images/mail_alias.png rename to htdocs/images/default/mail_alias.png diff --git a/htdocs/images/minus.png b/htdocs/images/default/minus.png similarity index 100% rename from htdocs/images/minus.png rename to htdocs/images/default/minus.png diff --git a/htdocs/images/move.png b/htdocs/images/default/move.png similarity index 100% rename from htdocs/images/move.png rename to htdocs/images/default/move.png diff --git a/htdocs/images/n.png b/htdocs/images/default/n.png similarity index 100% rename from htdocs/images/n.png rename to htdocs/images/default/n.png diff --git a/htdocs/images/network.png b/htdocs/images/default/network.png similarity index 100% rename from htdocs/images/network.png rename to htdocs/images/default/network.png diff --git a/htdocs/images/nogo.png b/htdocs/images/default/nogo.png similarity index 100% rename from htdocs/images/nogo.png rename to htdocs/images/default/nogo.png diff --git a/htdocs/images/nt_machine.png b/htdocs/images/default/nt_machine.png similarity index 100% rename from htdocs/images/nt_machine.png rename to htdocs/images/default/nt_machine.png diff --git a/htdocs/images/nt_user.png b/htdocs/images/default/nt_user.png similarity index 100% rename from htdocs/images/nt_user.png rename to htdocs/images/default/nt_user.png diff --git a/htdocs/images/o.png b/htdocs/images/default/o.png similarity index 100% rename from htdocs/images/o.png rename to htdocs/images/default/o.png diff --git a/htdocs/images/object.png b/htdocs/images/default/object.png similarity index 100% rename from htdocs/images/object.png rename to htdocs/images/default/object.png diff --git a/htdocs/images/ou.png b/htdocs/images/default/ou.png similarity index 100% rename from htdocs/images/ou.png rename to htdocs/images/default/ou.png diff --git a/htdocs/images/paypal-donate.png b/htdocs/images/default/paypal-donate.png similarity index 100% rename from htdocs/images/paypal-donate.png rename to htdocs/images/default/paypal-donate.png diff --git a/htdocs/images/phone.png b/htdocs/images/default/phone.png similarity index 100% rename from htdocs/images/phone.png rename to htdocs/images/default/phone.png diff --git a/htdocs/images/photo.png b/htdocs/images/default/photo.png similarity index 100% rename from htdocs/images/photo.png rename to htdocs/images/default/photo.png diff --git a/htdocs/images/plus.png b/htdocs/images/default/plus.png similarity index 100% rename from htdocs/images/plus.png rename to htdocs/images/default/plus.png diff --git a/htdocs/images/process.png b/htdocs/images/default/process.png similarity index 100% rename from htdocs/images/process.png rename to htdocs/images/default/process.png diff --git a/htdocs/images/refresh-big.png b/htdocs/images/default/refresh-big.png similarity index 100% rename from htdocs/images/refresh-big.png rename to htdocs/images/default/refresh-big.png diff --git a/htdocs/images/refresh.png b/htdocs/images/default/refresh.png similarity index 100% rename from htdocs/images/refresh.png rename to htdocs/images/default/refresh.png diff --git a/htdocs/images/rename.png b/htdocs/images/default/rename.png similarity index 100% rename from htdocs/images/rename.png rename to htdocs/images/default/rename.png diff --git a/htdocs/images/request-feature.png b/htdocs/images/default/request-feature.png similarity index 100% rename from htdocs/images/request-feature.png rename to htdocs/images/default/request-feature.png diff --git a/htdocs/images/rfc.png b/htdocs/images/default/rfc.png similarity index 100% rename from htdocs/images/rfc.png rename to htdocs/images/default/rfc.png diff --git a/htdocs/images/save.png b/htdocs/images/default/save.png similarity index 100% rename from htdocs/images/save.png rename to htdocs/images/default/save.png diff --git a/htdocs/images/schema.png b/htdocs/images/default/schema.png similarity index 100% rename from htdocs/images/schema.png rename to htdocs/images/default/schema.png diff --git a/htdocs/images/search.png b/htdocs/images/default/search.png similarity index 100% rename from htdocs/images/search.png rename to htdocs/images/default/search.png diff --git a/htdocs/images/server-settings.png b/htdocs/images/default/server-settings.png similarity index 100% rename from htdocs/images/server-settings.png rename to htdocs/images/default/server-settings.png diff --git a/htdocs/images/server-small.png b/htdocs/images/default/server-small.png similarity index 100% rename from htdocs/images/server-small.png rename to htdocs/images/default/server-small.png diff --git a/htdocs/images/server.png b/htdocs/images/default/server.png similarity index 100% rename from htdocs/images/server.png rename to htdocs/images/default/server.png diff --git a/htdocs/images/smile-big.png b/htdocs/images/default/smile-big.png similarity index 100% rename from htdocs/images/smile-big.png rename to htdocs/images/default/smile-big.png diff --git a/htdocs/images/smile.png b/htdocs/images/default/smile.png similarity index 100% rename from htdocs/images/smile.png rename to htdocs/images/default/smile.png diff --git a/htdocs/images/star.png b/htdocs/images/default/star.png similarity index 100% rename from htdocs/images/star.png rename to htdocs/images/default/star.png diff --git a/htdocs/images/terminal.png b/htdocs/images/default/terminal.png similarity index 100% rename from htdocs/images/terminal.png rename to htdocs/images/default/terminal.png diff --git a/htdocs/images/timeout.png b/htdocs/images/default/timeout.png similarity index 100% rename from htdocs/images/timeout.png rename to htdocs/images/default/timeout.png diff --git a/htdocs/images/tools-no.png b/htdocs/images/default/tools-no.png similarity index 100% rename from htdocs/images/tools-no.png rename to htdocs/images/default/tools-no.png diff --git a/htdocs/images/tools.png b/htdocs/images/default/tools.png similarity index 100% rename from htdocs/images/tools.png rename to htdocs/images/default/tools.png diff --git a/htdocs/images/trash-big.png b/htdocs/images/default/trash-big.png similarity index 100% rename from htdocs/images/trash-big.png rename to htdocs/images/default/trash-big.png diff --git a/htdocs/images/trash.png b/htdocs/images/default/trash.png similarity index 100% rename from htdocs/images/trash.png rename to htdocs/images/default/trash.png diff --git a/htdocs/images/uid.png b/htdocs/images/default/uid.png similarity index 100% rename from htdocs/images/uid.png rename to htdocs/images/default/uid.png diff --git a/htdocs/images/uniquegroup.png b/htdocs/images/default/uniquegroup.png similarity index 100% rename from htdocs/images/uniquegroup.png rename to htdocs/images/default/uniquegroup.png diff --git a/htdocs/images/unknown.png b/htdocs/images/default/unknown.png similarity index 100% rename from htdocs/images/unknown.png rename to htdocs/images/default/unknown.png diff --git a/htdocs/images/up.png b/htdocs/images/default/up.png similarity index 100% rename from htdocs/images/up.png rename to htdocs/images/default/up.png diff --git a/htdocs/images/user.png b/htdocs/images/default/user.png similarity index 100% rename from htdocs/images/user.png rename to htdocs/images/default/user.png diff --git a/htdocs/images/warn-big.png b/htdocs/images/default/warn-big.png similarity index 100% rename from htdocs/images/warn-big.png rename to htdocs/images/default/warn-big.png diff --git a/lib/Attribute.php b/lib/Attribute.php index 03e28dc..292087d 100644 --- a/lib/Attribute.php +++ b/lib/Attribute.php @@ -404,7 +404,7 @@ class Attribute { } public function getIcon() { - return $this->icon; + return $this->icon ? sprintf('%s/%s',IMGDIR,$this->icon) : ''; } public function getHint() { diff --git a/lib/Template.php b/lib/Template.php index 4da50db..6b5c44c 100644 --- a/lib/Template.php +++ b/lib/Template.php @@ -892,7 +892,7 @@ class Template extends xmlTemplate { * Get template icon */ public function getIcon() { - return isset($this->icon) ? $this->icon : ''; + return isset($this->icon) ? sprintf('%s/%s',IMGDIR,$this->icon) : ''; } /** diff --git a/lib/TemplateRender.php b/lib/TemplateRender.php index 0fa6be5..8331247 100644 --- a/lib/TemplateRender.php +++ b/lib/TemplateRender.php @@ -1821,9 +1821,7 @@ function fillRec(id,value) { $this->draw('UrlValueIcon',$attribute,$val); else { - $icon = $attribute->getIcon(); - - if ($icon) + if ($icon = $attribute->getIcon()) printf('Icon ',$icon); } } diff --git a/lib/common.php b/lib/common.php index edf3d85..23e19de 100644 --- a/lib/common.php +++ b/lib/common.php @@ -160,6 +160,17 @@ error_reporting(E_ALL); # Start our session. app_session_start(); +# See if we have a session, we can then get our theme out +$app['theme'] = 'default'; +if (isset($_SESSION[APPCONFIG])) + if (is_dir(realpath(sprintf('images/%s',$_SESSION[APPCONFIG]->getValue('appearance','theme')))) + && is_file(realpath(sprintf('css/%s/%s',$_SESSION[APPCONFIG]->getValue('appearance','theme'),$_SESSION[APPCONFIG]->getValue('appearance','stylesheet'))))) + + $app['theme'] = $_SESSION[APPCONFIG]->getValue('appearance','theme'); + +define('CSSDIR',sprintf('css/%s',$app['theme'])); +define('IMGDIR',sprintf('images/%s',$app['theme'])); + # Initialise the hooks require_once LIBDIR.'hooks.php'; diff --git a/lib/config_default.php b/lib/config_default.php index f179356..44d1295 100644 --- a/lib/config_default.php +++ b/lib/config_default.php @@ -191,6 +191,10 @@ class Config { 'desc'=>'Style sheet to use', 'default'=>'style.css'); + $this->default->appearance['theme'] = array( + 'desc'=>'Which theme to use', + 'default'=>'default'); + /** Tree display * An array of format strings used to display enties in the * tree viewer (left-hand side). The first format string that diff --git a/lib/functions.php b/lib/functions.php index f73a3ee..390da72 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -22,8 +22,6 @@ define('QUERYDIR',sprintf('%s/',realpath(LIBDIR.'../queries/'))); define('TMPLDIR',sprintf('%s/',realpath(LIBDIR.'../templates/'))); define('DOCDIR',sprintf('%s/',realpath(LIBDIR.'../doc/'))); define('HOOKSDIR',sprintf('%s/',realpath(LIBDIR.'../hooks/'))); -define('CSSDIR','css/'); -define('IMGDIR','images/'); define('JSDIR','js/'); /** @@ -1616,9 +1614,9 @@ function get_icon($server_id,$dn,$object_classes=array()) { $cval = explode('=',$tmp[0],2); $cval = isset($cval[1]) ? $cval[1] : false; if ($cval && false === strpos($cval,'..') && - file_exists(realpath(sprintf('%s/countries/%s.png',IMGDIR,strtolower($cval))))) + file_exists(realpath(sprintf('%s/../countries/%s.png',IMGDIR,strtolower($cval))))) - return sprintf('countries/%s.png',strtolower($cval)); + return sprintf('../countries/%s.png',strtolower($cval)); else return 'country.png'; diff --git a/lib/page.php b/lib/page.php index 9d92984..35293da 100644 --- a/lib/page.php +++ b/lib/page.php @@ -31,15 +31,21 @@ class page { if (defined('DEBUG_ENABLED') && DEBUG_ENABLED) debug_log('Entered with [%s]',129,__FILE__,__LINE__,__METHOD__,$index); + $this->index = $index; + # To be defined in a configuration file. $this->_app['title'] = app_name(); + $this->_app['logo'] = IMGDIR.'/logo-small.png'; + + if (! is_null($index)) + $this->_app['urlcss'] = sprintf('%s/%s',CSSDIR,$_SESSION[APPCONFIG]->getValue('appearance','stylesheet')); + else + $this->_app['urlcss'] = sprintf('%s/%s',CSSDIR,'style.css'); # Default Values for configurable items. - $this->_default['stylecss'] = CSSDIR.'style.css'; - $this->_default['logo'] = IMGDIR.'logo-small.png'; - $this->_default['sysmsg']['error'] = IMGDIR.'error-big.png'; - $this->_default['sysmsg']['warn'] = IMGDIR.'warn-big.png'; - $this->_default['sysmsg']['info'] = IMGDIR.'info-big.png'; + $this->_default['sysmsg']['error'] = IMGDIR.'/error-big.png'; + $this->_default['sysmsg']['warn'] = IMGDIR.'/warn-big.png'; + $this->_default['sysmsg']['info'] = IMGDIR.'/info-big.png'; # Capture any output so far (in case we send some headers below) - there shouldnt be any output anyway. $preOutput = ''; @@ -75,15 +81,6 @@ class page { $this->_pageheader[] .= "\n"; $this->_pageheader[] .= ''."\n"; $this->_pageheader[] .= "\n"; - - $this->_app['logo'] = $this->_default['logo']; - - if (! is_null($index)) - $this->_app['urlcss'] = sprintf('%s%s',CSSDIR,$_SESSION[APPCONFIG]->getValue('appearance','stylesheet')); - else - $this->_app['urlcss'] = sprintf('%s%s',CSSDIR,'style.css'); - - $this->index = $index; } /* Add to the HTML Header */ diff --git a/queries/SambaUsers.xml b/queries/SambaUsers.xml index 1130c61..2018a62 100644 --- a/queries/SambaUsers.xml +++ b/queries/SambaUsers.xml @@ -7,7 +7,7 @@ Samba Users -images/user.png +user.png sub 1 diff --git a/queries/UserList.xml b/queries/UserList.xml index c2c9c6c..4b8767e 100644 --- a/queries/UserList.xml +++ b/queries/UserList.xml @@ -7,7 +7,7 @@ User List -images/user.png +user.png sub 1 diff --git a/templates/creation/alias.xml b/templates/creation/alias.xml index eeba0a8..c7f83d6 100644 --- a/templates/creation/alias.xml +++ b/templates/creation/alias.xml @@ -5,7 +5,7 @@