array('label'=>'Couleur de fond','type'=>'color'), 'border-color' => array('label'=>'Couleur de bordure','type'=>'color'), 'background-image'=>array('label'=>'Image de fond','type'=>'image'), 'color'=>array('label'=>'Couleur de texte','type'=>'color'), 'font-size'=>array('label'=>'Taille de texte','type'=>'size'), 'font-family'=>array('label'=>'Police','type'=>'font'), ); preg_match_all('$/\*::([^\*]*)\*/ [\n\r\s\t]*([#.]?[^\{]*){([^\}]*) }$iUs', $themeStream , $matches,PREG_SET_ORDER); $css = array(); foreach ($matches as $match) { preg_match_all('$(.*):(.*);$iU', $match[3] , $contentMatches,PREG_SET_ORDER); $properties = array(); foreach($contentMatches as $contentMatch){ $property = array( 'instruction' => trim($contentMatch[1]), 'value' => trim($contentMatch[2]), 'id' => base64_encode($match[2].'-'.trim($contentMatch[1])), ); if(!isset($types[$property['instruction']])) continue; $property['type'] = $types[$property['instruction']]['type']; $property['description'] = $types[$property['instruction']]['label']; $properties[] = $property; } if(count($properties)==0) continue; if(!isset($css[trim($match[1])])) $css[trim($match[1])] = array(); $css[trim($match[1])][] = array( 'comment' => trim($match[1]), 'signature' => trim($match[2]), 'content' => $properties ); } ?>
'; break; case 'image': $property['value'] = str_replace(array("url","'",'"',"(",")"),'',$property['value']); $property['value'] = str_replace(array("../"),'',$property['value']); $attributes['value'] = 'value="'.$property['value'].'"'; //$attributes['data-type'] = 'data-type="image"'; $input = ''; break; case 'font': $property['value'] = str_replace(array("'",'"'),'',$property['value']); $attributes['value'] = 'value="'.$property['value'].'"'; $input = ''; break; default: $input = ''; break; } echo $input; ?> |