--- temp\sifr3.inc.orig 2009-08-01 19:45:16.000000000 -0400 +++ plugins\sifr3.inc 2009-11-09 03:10:57.750000000 -0500 @@ -31,7 +31,7 @@ function sifr3_render_info() { 'url' => 'http://novemberborn.net/sifr3', 'dependencies' => array('sifr.js', 'sifr.css'), 'file_masks' => array('.+\.swf'), - 'properties' => array('font', 'color', 'linkcolor', 'hovercolor', 'backgroundcolor', 'letterspacing', 'wmode', 'texttransform', 'fontsize', 'fontweight', 'fontstyle', 'marginleft', 'marginright', 'textalign', 'textindent', 'display', 'opacity', 'leading', 'kerning', 'cursor', 'underline'), + 'properties' => array('font', 'color', 'linkcolor', 'hovercolor', 'backgroundcolor', 'letterspacing', 'wmode', 'texttransform', 'fontsize', 'fontweight', 'fontstyle', 'marginleft', 'marginright', 'textalign', 'textindent', 'display', 'opacity', 'leading', 'kerning', 'cursor', 'underline', 'other_rules'), ); } @@ -303,6 +303,20 @@ function sifr3_render_rule(&$form, $edit '#default_value' => $edit['underline'], '#return_value' => 1, ); + $form['other'] = array( + '#type' => 'fieldset', + '#title' => t('Other Rules'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['other']['other_rules'] = array( + '#type' => 'textfield', + '#title' => t('Other rules'), + '#size' => 110, + '#maxlength' => 500, + '#default_value' => $edit['other_rules'], + '#description' => t('Write other rules you want to target inside this selector, i.e. em'), + ); } /** @@ -364,6 +378,37 @@ function sifr3_render_render_rule_js($ru 'text-decoration' => ($rule['underline'] ? 'underline' : 'none'), ), ); + + $other_rules = explode('|', $rule['other_rules']); // split rules by ; possibly change to , if makes more sense + + foreach($other_rules as $other_rule) { + //echo '
RULE[
'. $other_rule . ']

'; + //$translate = array("\n" => "", "\t" => "", "\r" => ""); + $other_rule = trim($other_rule); //cleaning up rules + + $pattern = '/(.+){(.+)}/'; + $replacement = ''; + if( preg_match($pattern, $other_rule, $class_matches) ){ + $selector = trim($class_matches[1]); + $sPattern = array('/\s+/m', '/ ,/'); + $sReplace = array(' ', ','); + $selector = preg_replace( $sPattern, $sReplace, $selector ); + + $css_rules = $class_matches[2]; + //echo 'selector[
'. $selector .'
]
[
'. $css_rules .'
]

'; + + $pattern = '/\s*([a-zA-Z-]+?)\s*:\s*[\'"]?(.+?)[\'"]?\s*;/'; // [\'"] + $replacement = ''; + if( $num = preg_match_all($pattern, $css_rules, $css_rule_matches) ){ + $keys = $css_rule_matches[1]; + $values = $css_rule_matches[2]; + foreach($keys as $index =>$key_str) { + //echo '
'.$key_str .'
'. $values[$index] .'

'; + $css[$selector][trim($key_str)] = trim($values[$index]); + }//foreach + }//if + }//if + }//for return array('font' => $font_path, 'selector' => $rule['selector'], 'css' => $css, 'wmode' => $rule['wmode']); }