ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

Utils.php (2420B)


      1 <?php
      2 
      3 namespace Materialis\Utils;
      4 
      5 class Utils
      6 {
      7 
      8     // http://php.net/manual/ro/function.array-merge-recursive.php#102379
      9     public static function mergeArrays($Arr1, $Arr2)
     10     {
     11         foreach ($Arr2 as $key => $Value) {
     12             if (array_key_exists($key, $Arr1) && is_array($Value)) {
     13                 $Arr1[$key] = self::mergeArrays($Arr1[$key], $Arr2[$key]);
     14             } else {
     15                 $Arr1[$key] = $Value;
     16             }
     17         }
     18 
     19         return $Arr1;
     20     }
     21 
     22 
     23     public static function getAllowCssProperties()
     24     {
     25         return apply_filters('safe_style_css', array(
     26             'background',
     27             'background-color',
     28 
     29             'border',
     30             'border-width',
     31             'border-color',
     32             'border-style',
     33             'border-right',
     34             'border-right-color',
     35             'border-right-style',
     36             'border-right-width',
     37             'border-bottom',
     38             'border-bottom-color',
     39             'border-bottom-style',
     40             'border-bottom-width',
     41             'border-left',
     42             'border-left-color',
     43             'border-left-style',
     44             'border-left-width',
     45             'border-top',
     46             'border-top-color',
     47             'border-top-style',
     48             'border-top-width',
     49 
     50             'border-spacing',
     51             'border-collapse',
     52             'caption-side',
     53 
     54             'color',
     55             'font',
     56             'font-family',
     57             'font-size',
     58             'font-style',
     59             'font-variant',
     60             'font-weight',
     61             'letter-spacing',
     62             'line-height',
     63             'text-decoration',
     64             'text-indent',
     65             'text-align',
     66             'text-transform',
     67 
     68             'height',
     69             'min-height',
     70             'max-height',
     71 
     72             'width',
     73             'min-width',
     74             'max-width',
     75 
     76             'margin',
     77             'margin-right',
     78             'margin-bottom',
     79             'margin-left',
     80             'margin-top',
     81 
     82             'padding',
     83             'padding-right',
     84             'padding-bottom',
     85             'padding-left',
     86             'padding-top',
     87 
     88             'clear',
     89             'cursor',
     90             'direction',
     91             'float',
     92             'overflow',
     93             'vertical-align',
     94             'list-style-type',
     95         ));
     96     }
     97 }