deblan.tv/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Form/Type/NodeMoveType.php

50 lines
1.2 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(
'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',
'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());
}
}