deblan.tv/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Form/Type/NodeMoveType.php
2015-03-02 21:57:49 +01:00

52 lines
1.3 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace Trinity\Bundle\ContentManagerBundle\Form\Type;
use Symfony\Component\Form\FormBuilderInterface;
class NodeMoveType extends NodeType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add(
'position',
'hidden',
array(
// 'property_path' => false,
'mapped' => false,
'data' => 'after',
)
);
$builder->add(
'reference',
'model',
array(
'class' => 'Trinity\Bundle\ContentManagerBundle\Model\Node',
'query' => \Trinity\Bundle\ContentManagerBundle\Model\NodeQuery::getReferences($builder->getData()),
'property' => 'levelRender',
// 'property_path' => false,
'mapped' => false,
'required' => true,
)
);
}
public static function getPositions()
{
return array(
'above' => 'Above',
'after' => 'After',
'before' => 'Before',
);
}
public static function validatorPositions()
{
return array_keys(self::getPositions());
}
}