deblan.tv/vendor/trinity/src/Trinity/.svn/pristine/d7/d707d3afc2bd2261102cdcab62624337de889b07.svn-base
2015-03-02 21:57:49 +01:00

56 lines
1.3 KiB
Plaintext
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\EditorialBlockBundle\Form\Type;
use Propel\PropelBundle\Form\BaseAbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class EditorialBlockType extends BaseAbstractType
{
protected $options = array(
'data_class' => 'Trinity\Bundle\EditorialBlockBundle\Model\EditorialBlock',
'name' => 'editorialblock',
);
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('name');
$builder->add(
'content',
'textarea',
array(
'attr' => array(
'class' => 'tinymce',
'data-theme' => 'advanced',
)
)
);
$builder->add(
'action',
'choice',
array(
'required' => false,
'choices' => $this->getActions(),
)
);
}
public function getActions()
{
$actions = array();
if (is_array($this->getOption('actions'))) {
foreach ($this->getOption('actions') as $action) {
$actions[$action['action']] = $action['title'];
}
}
return $actions;
}
}