Ticket #715 (closed defect: invalid)
Masking / Removing classes from the list provided by a Dynamical CSS file
| Reported by: | sgougeon | Owned by: | gogo |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Plugin_DynamicCSS | Version: | trunk |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The dropdown menu as well as the stylist (whenever it is activated) present the WHOLE list of classes defined into the Dynamical CSS file declared through the pageStyleSheets or the stylistLoadStylesheet config parameters. There is presently no proper way to select some specific classes from the full available list.
So, I have written in PHP a filter feeding the xinha_config.pageStyle parameter. However, this trick requires that the xinha_my_config.js file where xinha_config.pageStyle is PHP-defined must be PHP-interpreted. Therefore, xinha_my_config.js MUST be declared into the calling script as an inclusion :
<script type="text/javascript"><?php include("xinha_my_config.js);?></script>
; while a simple reference
<script type="text/javascript" src="xinha_my_config.js"></script>
would be smarter but IS NOT PHP-processed.
This ticket aims to encourage proper support for such a feature.
Here is the filter for interested people working with PHP :
IN the CALLING SCRIPT : $CSSfilename?='my_CSS_file.css'; $CSSclasses?='.class1,.class2,...'; // Classes to be selected from $CSS[filename]
IN xinha_my_config.js : xinha_config.pageStyle='<? $tmp=implode("|",explode(",",str_replace(".","\.",$CSSclasses?))); preg_match_all("(?:$tmp)\s*\{[^}]+?\}",file_get_contents($CSSfilename?),$tmp); echo implode("\\n'+\n'",$tmp[0]);?>';
sgougeon (a) univ-lemans.fr (Sam) would be glad to read you about any proper development of this feature.
