New Feature: PLA icons and CSS can now be themeble

This commit is contained in:
Deon George 2009-07-08 16:14:50 +10:00
parent b4653e84a2
commit 7273ad292b
121 changed files with 96 additions and 88 deletions

View File

@ -565,7 +565,7 @@ span.hint {
/* Login Box */ /* Login Box */
#login { #login {
background: url('../images/uid.png') no-repeat 0 1px; background: url('../../images/default/uid.png') no-repeat 0 1px;
background-color: #FAFAFF; background-color: #FAFAFF;
color: #000000; color: #000000;
padding-left: 17px; padding-left: 17px;
@ -582,7 +582,7 @@ span.hint {
} }
#password { #password {
background: url('../images/key.png') no-repeat 0 1px; background: url('../../images/default/key.png') no-repeat 0 1px;
background-color: #FAFAFF; background-color: #FAFAFF;
color: #000000; color: #000000;
padding-left: 17px; padding-left: 17px;

View File

Before

Width:  |  Height:  |  Size: 528 B

After

Width:  |  Height:  |  Size: 528 B

View File

Before

Width:  |  Height:  |  Size: 928 B

After

Width:  |  Height:  |  Size: 928 B

View File

Before

Width:  |  Height:  |  Size: 278 B

After

Width:  |  Height:  |  Size: 278 B

View File

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 478 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 342 B

After

Width:  |  Height:  |  Size: 342 B

View File

Before

Width:  |  Height:  |  Size: 662 B

After

Width:  |  Height:  |  Size: 662 B

View File

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 707 B

View File

Before

Width:  |  Height:  |  Size: 340 B

After

Width:  |  Height:  |  Size: 340 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 661 B

View File

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 500 B

View File

Before

Width:  |  Height:  |  Size: 692 B

After

Width:  |  Height:  |  Size: 692 B

View File

Before

Width:  |  Height:  |  Size: 856 B

After

Width:  |  Height:  |  Size: 856 B

View File

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 364 B

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 796 B

After

Width:  |  Height:  |  Size: 796 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 440 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 738 B

After

Width:  |  Height:  |  Size: 738 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 844 B

After

Width:  |  Height:  |  Size: 844 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 966 B

After

Width:  |  Height:  |  Size: 966 B

View File

Before

Width:  |  Height:  |  Size: 510 B

After

Width:  |  Height:  |  Size: 510 B

View File

Before

Width:  |  Height:  |  Size: 692 B

After

Width:  |  Height:  |  Size: 692 B

View File

Before

Width:  |  Height:  |  Size: 519 B

After

Width:  |  Height:  |  Size: 519 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 733 B

View File

Before

Width:  |  Height:  |  Size: 751 B

After

Width:  |  Height:  |  Size: 751 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 829 B

After

Width:  |  Height:  |  Size: 829 B

View File

Before

Width:  |  Height:  |  Size: 899 B

After

Width:  |  Height:  |  Size: 899 B

View File

Before

Width:  |  Height:  |  Size: 993 B

After

Width:  |  Height:  |  Size: 993 B

View File

Before

Width:  |  Height:  |  Size: 938 B

After

Width:  |  Height:  |  Size: 938 B

View File

Before

Width:  |  Height:  |  Size: 98 B

After

Width:  |  Height:  |  Size: 98 B

View File

Before

Width:  |  Height:  |  Size: 483 B

After

Width:  |  Height:  |  Size: 483 B

View File

Before

Width:  |  Height:  |  Size: 408 B

After

Width:  |  Height:  |  Size: 408 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 243 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 971 B

After

Width:  |  Height:  |  Size: 971 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 730 B

View File

Before

Width:  |  Height:  |  Size: 878 B

After

Width:  |  Height:  |  Size: 878 B

View File

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 572 B

View File

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 102 B

View File

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 438 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 785 B

After

Width:  |  Height:  |  Size: 785 B

View File

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 418 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 637 B

View File

Before

Width:  |  Height:  |  Size: 658 B

After

Width:  |  Height:  |  Size: 658 B

View File

Before

Width:  |  Height:  |  Size: 514 B

After

Width:  |  Height:  |  Size: 514 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 818 B

After

Width:  |  Height:  |  Size: 818 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 852 B

View File

Before

Width:  |  Height:  |  Size: 700 B

After

Width:  |  Height:  |  Size: 700 B

View File

Before

Width:  |  Height:  |  Size: 851 B

After

Width:  |  Height:  |  Size: 851 B

View File

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 661 B

View File

Before

Width:  |  Height:  |  Size: 798 B

After

Width:  |  Height:  |  Size: 798 B

View File

Before

Width:  |  Height:  |  Size: 503 B

After

Width:  |  Height:  |  Size: 503 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 678 B

View File

Before

Width:  |  Height:  |  Size: 654 B

After

Width:  |  Height:  |  Size: 654 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 924 B

After

Width:  |  Height:  |  Size: 924 B

View File

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 382 B

View File

Before

Width:  |  Height:  |  Size: 773 B

After

Width:  |  Height:  |  Size: 773 B

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -404,7 +404,7 @@ class Attribute {
} }
public function getIcon() { public function getIcon() {
return $this->icon; return $this->icon ? sprintf('%s/%s',IMGDIR,$this->icon) : '';
} }
public function getHint() { public function getHint() {

View File

@ -892,7 +892,7 @@ class Template extends xmlTemplate {
* Get template icon * Get template icon
*/ */
public function getIcon() { public function getIcon() {
return isset($this->icon) ? $this->icon : ''; return isset($this->icon) ? sprintf('%s/%s',IMGDIR,$this->icon) : '';
} }
/** /**

View File

@ -1821,9 +1821,7 @@ function fillRec(id,value) {
$this->draw('UrlValueIcon',$attribute,$val); $this->draw('UrlValueIcon',$attribute,$val);
else { else {
$icon = $attribute->getIcon(); if ($icon = $attribute->getIcon())
if ($icon)
printf('<img src="%s" alt="Icon" align="top" />&nbsp;',$icon); printf('<img src="%s" alt="Icon" align="top" />&nbsp;',$icon);
} }
} }

View File

@ -160,6 +160,17 @@ error_reporting(E_ALL);
# Start our session. # Start our session.
app_session_start(); 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 # Initialise the hooks
require_once LIBDIR.'hooks.php'; require_once LIBDIR.'hooks.php';

View File

@ -191,6 +191,10 @@ class Config {
'desc'=>'Style sheet to use', 'desc'=>'Style sheet to use',
'default'=>'style.css'); 'default'=>'style.css');
$this->default->appearance['theme'] = array(
'desc'=>'Which theme to use',
'default'=>'default');
/** Tree display /** Tree display
* An array of format strings used to display enties in the * An array of format strings used to display enties in the
* tree viewer (left-hand side). The first format string that * tree viewer (left-hand side). The first format string that

View File

@ -22,8 +22,6 @@ define('QUERYDIR',sprintf('%s/',realpath(LIBDIR.'../queries/')));
define('TMPLDIR',sprintf('%s/',realpath(LIBDIR.'../templates/'))); define('TMPLDIR',sprintf('%s/',realpath(LIBDIR.'../templates/')));
define('DOCDIR',sprintf('%s/',realpath(LIBDIR.'../doc/'))); define('DOCDIR',sprintf('%s/',realpath(LIBDIR.'../doc/')));
define('HOOKSDIR',sprintf('%s/',realpath(LIBDIR.'../hooks/'))); define('HOOKSDIR',sprintf('%s/',realpath(LIBDIR.'../hooks/')));
define('CSSDIR','css/');
define('IMGDIR','images/');
define('JSDIR','js/'); define('JSDIR','js/');
/** /**
@ -1616,9 +1614,9 @@ function get_icon($server_id,$dn,$object_classes=array()) {
$cval = explode('=',$tmp[0],2); $cval = explode('=',$tmp[0],2);
$cval = isset($cval[1]) ? $cval[1] : false; $cval = isset($cval[1]) ? $cval[1] : false;
if ($cval && false === strpos($cval,'..') && 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 else
return 'country.png'; return 'country.png';

View File

@ -31,15 +31,21 @@ class page {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED) if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with [%s]',129,__FILE__,__LINE__,__METHOD__,$index); debug_log('Entered with [%s]',129,__FILE__,__LINE__,__METHOD__,$index);
$this->index = $index;
# To be defined in a configuration file. # To be defined in a configuration file.
$this->_app['title'] = app_name(); $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. # Default Values for configurable items.
$this->_default['stylecss'] = CSSDIR.'style.css'; $this->_default['sysmsg']['error'] = IMGDIR.'/error-big.png';
$this->_default['logo'] = IMGDIR.'logo-small.png'; $this->_default['sysmsg']['warn'] = IMGDIR.'/warn-big.png';
$this->_default['sysmsg']['error'] = IMGDIR.'error-big.png'; $this->_default['sysmsg']['info'] = IMGDIR.'/info-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. # Capture any output so far (in case we send some headers below) - there shouldnt be any output anyway.
$preOutput = ''; $preOutput = '';
@ -75,15 +81,6 @@ class page {
$this->_pageheader[] .= "\n"; $this->_pageheader[] .= "\n";
$this->_pageheader[] .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="auto" lang="auto" dir="ltr">'."\n"; $this->_pageheader[] .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="auto" lang="auto" dir="ltr">'."\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 */ /* Add to the HTML Header */

View File

@ -7,7 +7,7 @@
</bases> </bases>
<filter><![CDATA[(&(|(objectClass=sambaAccount)(objectClass=sambaSamAccount))(objectClass=posixAccount)(!(uid=*$)))]]></filter> <filter><![CDATA[(&(|(objectClass=sambaAccount)(objectClass=sambaSamAccount))(objectClass=posixAccount)(!(uid=*$)))]]></filter>
<description>Samba Users</description> <description>Samba Users</description>
<icon>images/user.png</icon> <icon>user.png</icon>
<scope>sub</scope> <scope>sub</scope>
<visible>1</visible> <visible>1</visible>

View File

@ -7,7 +7,7 @@
</bases> </bases>
<filter><![CDATA[(&(objectClass=posixAccount)(uid=*))]]></filter> <filter><![CDATA[(&(objectClass=posixAccount)(uid=*))]]></filter>
<description>User List</description> <description>User List</description>
<icon>images/user.png</icon> <icon>user.png</icon>
<scope>sub</scope> <scope>sub</scope>
<visible>1</visible> <visible>1</visible>

View File

@ -5,7 +5,7 @@
<template> <template>
<askcontainer>1</askcontainer> <askcontainer>1</askcontainer>
<description>New LDAP Alias</description> <description>New LDAP Alias</description>
<icon>images/go.png</icon> <icon>go.png</icon>
<invalid>0</invalid> <invalid>0</invalid>
<rdn>uid</rdn> <rdn>uid</rdn>
<!--<regexp>^ou=People,o=.*,</regexp>--> <!--<regexp>^ou=People,o=.*,</regexp>-->

View File

@ -4,7 +4,7 @@
<template> <template>
<askcontainer>1</askcontainer> <askcontainer>1</askcontainer>
<description>New Courier Mail Account</description> <description>New Courier Mail Account</description>
<icon>images/mail_account.png</icon> <icon>mail_account.png</icon>
<invalid>0</invalid> <invalid>0</invalid>
<rdn>cn</rdn> <rdn>cn</rdn>
<!--<regexp>^ou=People,o=.*,</regexp>--> <!--<regexp>^ou=People,o=.*,</regexp>-->
@ -39,7 +39,7 @@
</attribute> </attribute>
<attribute id="uid"> <attribute id="uid">
<display>User ID</display> <display>User ID</display>
<icon>images/uid.png</icon> <icon>uid.png</icon>
<!--<onchange>=autoFill(homeDirectory;/home/users/%uid%)</onchange>--> <!--<onchange>=autoFill(homeDirectory;/home/users/%uid%)</onchange>-->
<onchange>=autoFill(homeDirectory;/home/users/%gidNumber|0-0/T%/%uid|3-%)</onchange> <onchange>=autoFill(homeDirectory;/home/users/%gidNumber|0-0/T%/%uid|3-%)</onchange>
<order>4</order> <order>4</order>
@ -47,7 +47,7 @@
</attribute> </attribute>
<attribute id="uidNumber"> <attribute id="uidNumber">
<display>UID Number</display> <display>UID Number</display>
<icon>images/terminal.png</icon> <icon>terminal.png</icon>
<order>6</order> <order>6</order>
<page>1</page> <page>1</page>
<readonly>1</readonly> <readonly>1</readonly>
@ -69,7 +69,7 @@
</attribute> </attribute>
<attribute id="mail"> <attribute id="mail">
<display>Email</display> <display>Email</display>
<icon>images/mail.png</icon> <icon>mail.png</icon>
<order>9</order> <order>9</order>
<page>1</page> <page>1</page>
</attribute> </attribute>
@ -80,7 +80,7 @@
</attribute> </attribute>
<attribute id="userPassword"> <attribute id="userPassword">
<display>Password</display> <display>Password</display>
<icon>images/lock.png</icon> <icon>lock.png</icon>
<order>11</order> <order>11</order>
<page>1</page> <page>1</page>
<post>=php.PasswordEncrypt(%enc%;%userPassword%)</post> <post>=php.PasswordEncrypt(%enc%;%userPassword%)</post>

View File

@ -4,7 +4,7 @@
<template> <template>
<askcontainer>1</askcontainer> <askcontainer>1</askcontainer>
<description>New Courier Mail Alias</description> <description>New Courier Mail Alias</description>
<icon>images/mail_alias.png</icon> <icon>mail_alias.png</icon>
<invalid>0</invalid> <invalid>0</invalid>
<rdn>cn</rdn> <rdn>cn</rdn>
<!--<regexp>^ou=People,o=.*,</regexp>--> <!--<regexp>^ou=People,o=.*,</regexp>-->

View File

@ -4,7 +4,7 @@
<template> <template>
<askcontainer>1</askcontainer> <askcontainer>1</askcontainer>
<description>New DNS Entry</description> <description>New DNS Entry</description>
<icon>images/dc.png</icon> <icon>dc.png</icon>
<invalid>0</invalid> <invalid>0</invalid>
<rdn>dc</rdn> <rdn>dc</rdn>
<!--<regexp>^ou=People,o=.*,</regexp>--> <!--<regexp>^ou=People,o=.*,</regexp>-->

Some files were not shown because too many files have changed in this diff Show More