@@ -11,40 +11,40 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $yamlFormats = TinyMCEConfig::config()->get('formats'); |
| 13 | 13 | |
| 14 | - if (! isset($yamlFormats[$identifier])) { |
|
| 15 | - user_error('no editor formats for ' . $identifier); |
|
| 16 | - return []; |
|
| 14 | + if ( ! isset($yamlFormats[ $identifier ])) { |
|
| 15 | + user_error('no editor formats for '.$identifier); |
|
| 16 | + return [ ]; |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - $parsedFormats = []; |
|
| 19 | + $parsedFormats = [ ]; |
|
| 20 | 20 | |
| 21 | - foreach ($yamlFormats[$identifier] as $sectionTitle => $sectionFormats) { |
|
| 22 | - $formats = []; |
|
| 21 | + foreach ($yamlFormats[ $identifier ] as $sectionTitle => $sectionFormats) { |
|
| 22 | + $formats = [ ]; |
|
| 23 | 23 | $sort = 100; |
| 24 | 24 | |
| 25 | 25 | foreach ($sectionFormats as $sTitle => $sFormat) { |
| 26 | - if (isset($sFormat['disabled']) && $sFormat['disabled']) { |
|
| 26 | + if (isset($sFormat[ 'disabled' ]) && $sFormat[ 'disabled' ]) { |
|
| 27 | 27 | continue; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $title = $sTitle; |
| 31 | 31 | |
| 32 | - if (isset($sFormat['title'])) { |
|
| 33 | - $title = $sFormat['title']; |
|
| 32 | + if (isset($sFormat[ 'title' ])) { |
|
| 33 | + $title = $sFormat[ 'title' ]; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (! isset($sFormat['sort'])) { |
|
| 37 | - $sFormat['sort'] = $sort; |
|
| 36 | + if ( ! isset($sFormat[ 'sort' ])) { |
|
| 37 | + $sFormat[ 'sort' ] = $sort; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $formats[] = ['title' => $title] + $sFormat; |
|
| 40 | + $formats[ ] = [ 'title' => $title ] + $sFormat; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - usort($formats, function ($x, $y) { |
|
| 44 | - return $x['sort'] <=> $y['sort']; |
|
| 43 | + usort($formats, function($x, $y) { |
|
| 44 | + return $x[ 'sort' ] <=> $y[ 'sort' ]; |
|
| 45 | 45 | }); |
| 46 | 46 | |
| 47 | - $parsedFormats[] = [ |
|
| 47 | + $parsedFormats[ ] = [ |
|
| 48 | 48 | 'title' => $sectionTitle, |
| 49 | 49 | 'items' => $formats, |
| 50 | 50 | ]; |