Since site.config handles enabling of plugins by checking a page name
mask, so plugins can be enabled just for certain pages, i was
wondering if this could not be done for skins as well.

The syntax in site.config would be like for example:

skin: butterfly: main*
skin: business: commerce*

so the name mask gets used as parameter like it is for plugins.

I experimented with the code so this can work. Here is a suggestion:

in engine.php replace ca line 191
if (file_exists("$skinPath/$BOLTskin/skin.php"))
include_once("$skinPath/$BOLTskin/skin.php");
with these lines:

if (!is_array($BOLTconfig['skin'])) $BOLTconfig['skin'] =
array($BOLTconfig['skin'] => '*');
foreach($BOLTconfig['skin'] as $skin => $check) {
        if (BOLTpageCheck($check)) {
                $BOLTskin = $skin;
                if (file_exists("$skinPath/$skin/skin.php"))    
include_once("$skinPath/$skin/skin.php");
        }
}

The first line sets a skin:skinname parameter as an array, after that
the config skin array is checked and the correct skin applied in
accordance to the filemask check.

Seems to work in my limited tests.

I would also relax the syntax for config array a little to allow spaces after :
like
skin: butterfly: main*

At present  no spaces are permitted before 'butterfly'.
for this i added \s* to code line 45:
    preg_match_all('/^(enable([-\w]+)\:?|([-\w]+)\:)\s*(([-\w]+)\:)?(.*?)$/m',
$config, $m);

Cheers,
~Hans

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to