Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: million12/M12.Foundation
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.1
Choose a base ref
...
head repository: million12/M12.Foundation
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 10 commits
  • 33 files changed
  • 1 contributor

Commits on Sep 2, 2016

  1. Copy the full SHA
    13e4299 View commit details
  2. Copy the full SHA
    10f958f View commit details
  3. NodeTypePostprocessor: remove redundant multiple option for SelectB…

    …oxEditor
    
    For `array` type `multiple=true` is set by default and therefore
    this line is redundant.
    ryzy committed Sep 2, 2016
    Copy the full SHA
    74b58f6 View commit details

Commits on Sep 4, 2016

  1. Copy the full SHA
    d22f7b9 View commit details

Commits on Sep 6, 2016

  1. Fix: Content inside BlockGrid and Orbit is editable

    If you inserted e.g. container inside BlockGrid or Orbit, and added
    more content elements inside that container, these content elements
    were not editable or not working correctly (e.g. saving didn't work).
    The reason for that was that the whole `TYPO3.Neos:Content` prototype,
    when inside BlockGridItem or OrbitItem, had ContentElementWrapping
    removed.
    
    Resolves #56
    ryzy committed Sep 6, 2016
    Copy the full SHA
    90b1b8c View commit details
  2. Revert "NodeTypePostprocessor: remove redundant multiple option for…

    … SelectBoxEditor"
    
    This reverts commit 74b58f6.
    ryzy committed Sep 6, 2016
    Copy the full SHA
    4c9cb37 View commit details
  3. Copy the full SHA
    a883566 View commit details
  4. Add allowEmpty to type=array properties

    Not sure if it's essential, but according to the doc it should be
    specified.
    
    Related 74b58f6.
    Related 4c9cb37
    ryzy committed Sep 6, 2016
    Copy the full SHA
    b096b07 View commit details
  5. Copy the full SHA
    2bc86d3 View commit details
  6. Copy the full SHA
    3b03285 View commit details
Showing with 895 additions and 830 deletions.
  1. +66 −62 Classes/M12/Foundation/DataSource/FontIconDataSource.php
  2. +9 −5 Classes/M12/Foundation/Eel/SpacingHelper.php
  3. +21 −19 Classes/M12/Foundation/Fluid/Core/ViewHelper/TagBuilderAspect.php
  4. +307 −283 Classes/M12/Foundation/Node/NodeConfigurator.php
  5. +178 −165 Classes/M12/Foundation/NodeTypePostprocessor/AbstractGridNodeTypePostprocessor.php
  6. +9 −8 Classes/M12/Foundation/NodeTypePostprocessor/BlockGridNodeTypePostprocessor.php
  7. +8 −7 Classes/M12/Foundation/NodeTypePostprocessor/GenericHelpersPostprocesor.php
  8. +9 −8 Classes/M12/Foundation/NodeTypePostprocessor/GridColumnNodeTypePostprocessor.php
  9. +8 −7 Classes/M12/Foundation/NodeTypePostprocessor/GridRowNodeTypePostprocessor.php
  10. +14 −11 Classes/M12/Foundation/Package.php
  11. +62 −55 Classes/M12/Foundation/TypoScript/MenuImplementation.php
  12. +14 −12 Classes/M12/Foundation/TypoScript/ValueOptionsListImplementation.php
  13. +112 −101 Classes/M12/Foundation/TypoScriptObjects/AttributesImplementation.php
  14. +22 −20 Classes/M12/Foundation/ViewHelpers/ContentElementEditableViewHelperAspect.php
  15. +12 −12 Configuration/NodeTypes.Abstracts.yaml
  16. +1 −2 Configuration/NodeTypes.Accordion.yaml
  17. +1 −1 Configuration/NodeTypes.Alert.yaml
  18. +5 −5 Configuration/NodeTypes.ButtonsAndLinks.yaml
  19. +1 −1 Configuration/NodeTypes.Dropdown.yaml
  20. +2 −2 Configuration/NodeTypes.FontIcon.yaml
  21. +4 −4 Configuration/NodeTypes.Form.yaml
  22. +2 −2 Configuration/NodeTypes.Navigation.yaml
  23. +1 −2 Configuration/NodeTypes.Neos.Content.yaml
  24. +2 −2 Configuration/NodeTypes.Neos.Documents.yaml
  25. +1 −4 Configuration/NodeTypes.Orbit.yaml
  26. +1 −1 Configuration/NodeTypes.Panel.yaml
  27. +3 −3 Configuration/NodeTypes.RevealModal.yaml
  28. +2 −2 Configuration/NodeTypes.Video.yaml
  29. +5 −5 Configuration/NodeTypes.yaml
  30. +4 −2 Resources/Private/TypoScript/Prototypes/Accordion.ts2
  31. +4 −7 Resources/Private/TypoScript/Prototypes/BlockGrid.ts2
  32. +4 −8 Resources/Private/TypoScript/Prototypes/Orbit.ts2
  33. +1 −2 circle.yml
128 changes: 66 additions & 62 deletions Classes/M12/Foundation/DataSource/FontIconDataSource.php
Original file line number Diff line number Diff line change
@@ -10,73 +10,77 @@
* in M12.Foundation:AbstractFontIcon node type
* with list of all available icon names.
*/
class FontIconDataSource extends AbstractDataSource {
class FontIconDataSource extends AbstractDataSource
{

/**
* @var string
*/
static protected $identifier = 'font-icon-list';
/**
* @var string
*/
static protected $identifier = 'font-icon-list';

/**
* Path to file containing list of available FontAwesome icons
*
* @var string
*/
static protected $iconsListFilePath = 'resource://M12.Foundation/Private/Misc/font-icon-list.scss';
/**
* Path to file containing list of available FontAwesome icons
*
* @var string
*/
static protected $iconsListFilePath = 'resource://M12.Foundation/Private/Misc/font-icon-list.scss';

/**
* @var CacheManager
*/
protected $cacheManager;
/**
* @var CacheManager
*/
protected $cacheManager;

/**
* @param CacheManager $cacheManager
* @return void
*/
public function injectCacheManager(CacheManager $cacheManager) {
$this->cacheManager = $cacheManager;
}
/**
* @param CacheManager $cacheManager
* @return void
*/
public function injectCacheManager(CacheManager $cacheManager)
{
$this->cacheManager = $cacheManager;
}

/**
* Get icons list, compiled from FontAwesome variables list
*
* @param NodeInterface $node The node that is currently edited (optional)
* @param array $arguments Additional arguments (key / value)
* @return array JSON serializable data
*/
public function getData(NodeInterface $node = NULL, array $arguments) {
$data = [];

foreach ($this->parseListOfIcons() as $iconName) {
$data['fa-'.$iconName] = [
'label' => $iconName,
'icon' => 'fa fa-' . $iconName,
];
}

return $data;
}
/**
* Get icons list, compiled from FontAwesome variables list
*
* @param NodeInterface $node The node that is currently edited (optional)
* @param array $arguments Additional arguments (key / value)
* @return array JSON serializable data
*/
public function getData(NodeInterface $node = null, array $arguments)
{
$data = [];

/**
* Parse list of icons and get pure icon names.
*
* @return array
*/
protected function parseListOfIcons() {
$cache = $this->cacheManager->getCache('Default');
$cacheId = 'FontIconDataSource_parseListOfIcons';

if (!($icons = $cache->get($cacheId))) {
$icons = [];
foreach (file(self::$iconsListFilePath) as $content) {
if (preg_match('#fa-var-([-_a-z0-9]+):#i', $content, $match)) {
$icons[] = $match[1];
}
}
foreach ($this->parseListOfIcons() as $iconName) {
$data['fa-' . $iconName] = [
'label' => $iconName,
'icon' => 'fa fa-' . $iconName,
];
}

$cache->set($cacheId, $icons, [], 0);
}

return $icons;
}
return $data;
}

/**
* Parse list of icons and get pure icon names.
*
* @return array
*/
protected function parseListOfIcons()
{
$cache = $this->cacheManager->getCache('Default');
$cacheId = 'FontIconDataSource_parseListOfIcons';

if (!($icons = $cache->get($cacheId))) {
$icons = [];
foreach (file(self::$iconsListFilePath) as $content) {
if (preg_match('#fa-var-([-_a-z0-9]+):#i', $content, $match)) {
$icons[] = $match[1];
}
}

$cache->set($cacheId, $icons, [], 0);
}

return $icons;
}
}
14 changes: 9 additions & 5 deletions Classes/M12/Foundation/Eel/SpacingHelper.php
Original file line number Diff line number Diff line change
@@ -6,9 +6,10 @@
use TYPO3\Eel\ProtectedContextAwareInterface;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;

class SpacingHelper implements ProtectedContextAwareInterface {
class SpacingHelper implements ProtectedContextAwareInterface
{

const DEFAULT_UNIT = 'px';
const DEFAULT_UNIT = 'px';

const PROPERTY_MAPPING = [
'marginTop' => 'margin-top',
@@ -23,16 +24,18 @@ class SpacingHelper implements ProtectedContextAwareInterface {
* @param NodeInterface $node
* @return string
*/
public function generateCss(NodeInterface $node) {
public function generateCss(NodeInterface $node)
{
$css = '';

foreach (self::PROPERTY_MAPPING as $key => $cssProperty) {
// Get value, also check for `0` values using strlen()
if (($value = $node->getProperty($key)) || strlen($value)) {
// if numeric value is provided, add default unit (e.g. px)
// but don't add it to zero values
if ($value && is_numeric($value))
if ($value && is_numeric($value)) {
$value .= self::DEFAULT_UNIT;
}

$css .= "$cssProperty:$value;";
}
@@ -47,7 +50,8 @@ public function generateCss(NodeInterface $node) {
* @param string $methodName
* @return boolean
*/
public function allowsCallOfMethod($methodName) {
public function allowsCallOfMethod($methodName)
{
return true;
}
}
40 changes: 21 additions & 19 deletions Classes/M12/Foundation/Fluid/Core/ViewHelper/TagBuilderAspect.php
Original file line number Diff line number Diff line change
@@ -24,24 +24,26 @@
*
* @Flow\Aspect
*/
class TagBuilderAspect {
class TagBuilderAspect
{

/**
* This changes how TagBuilder->addAttribute() method works.
* When attribute's value is NULL or FALSE, it does *unset* the value.
* Otherwise addAttribute() method is called as usually.
*
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint
* @Flow\Around("method(TYPO3\Fluid\Core\ViewHelper\TagBuilder->addAttribute())")
* @return void
*/
public function catchAddAttribute(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint) {
if (NULL === $joinPoint->getMethodArgument('attributeValue') || FALSE === $joinPoint->getMethodArgument('attributeValue')) {
/** @var \TYPO3\Fluid\Core\ViewHelper\TagBuilder $tagBuilder */
$tagBuilder = $joinPoint->getProxy();
$tagBuilder->removeAttribute($joinPoint->getMethodArgument('attributeName'));
} else {
$joinPoint->getAdviceChain()->proceed($joinPoint);
}
}
/**
* This changes how TagBuilder->addAttribute() method works.
* When attribute's value is NULL or FALSE, it does *unset* the value.
* Otherwise addAttribute() method is called as usually.
*
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint
* @Flow\Around("method(TYPO3\Fluid\Core\ViewHelper\TagBuilder->addAttribute())")
* @return void
*/
public function catchAddAttribute(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
{
if (null === $joinPoint->getMethodArgument('attributeValue') || false === $joinPoint->getMethodArgument('attributeValue')) {
/** @var \TYPO3\Fluid\Core\ViewHelper\TagBuilder $tagBuilder */
$tagBuilder = $joinPoint->getProxy();
$tagBuilder->removeAttribute($joinPoint->getMethodArgument('attributeName'));
} else {
$joinPoint->getAdviceChain()->proceed($joinPoint);
}
}
}
Loading