diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c5f819c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.svn +tags diff --git a/src/Deblan/Bundle/BlogBundle/Page/DefaultPage.php b/src/Deblan/Bundle/BlogBundle/Page/DefaultPage.php index 4d6f8c1..65bb827 100644 --- a/src/Deblan/Bundle/BlogBundle/Page/DefaultPage.php +++ b/src/Deblan/Bundle/BlogBundle/Page/DefaultPage.php @@ -6,6 +6,11 @@ use Trinity\Bundle\ContentManagerBundle\Model\Page; class DefaultPage extends Page { + public function __construct($template = 'TrinityContentManagerBundle::default.html.twig') + { + parent::__construct($template); + } + public function getConfiguration() { return $this->configuration diff --git a/src/Deblan/Bundle/LessonBundle/Resources/views/Default/lesson_page.html.twig b/src/Deblan/Bundle/LessonBundle/Resources/views/Default/lesson_page.html.twig index fc31df2..8a7ad3d 100644 --- a/src/Deblan/Bundle/LessonBundle/Resources/views/Default/lesson_page.html.twig +++ b/src/Deblan/Bundle/LessonBundle/Resources/views/Default/lesson_page.html.twig @@ -13,7 +13,7 @@ -
{{ render_block('content1') }}
+
{{ render_block('content1')|transform_url }}
{% endblock %} {% import _self as macros %} @@ -22,7 +22,5 @@ {% endmacro %} {% block aside %} - - {{ parent() }} {% endblock %} diff --git a/vendor/trinity/src/Trinity/Bundle/AdminBundle/Controller/BaseAdminController.php b/vendor/trinity/src/Trinity/Bundle/AdminBundle/Controller/BaseAdminController.php index 8ed1a32..85cf795 100644 --- a/vendor/trinity/src/Trinity/Bundle/AdminBundle/Controller/BaseAdminController.php +++ b/vendor/trinity/src/Trinity/Bundle/AdminBundle/Controller/BaseAdminController.php @@ -104,7 +104,7 @@ class BaseAdminController extends Controller $method = $this->getConfiguration()->getSort(); - $method = $this->getConfiguration()->getRankable() ? 'orderByRank' : $this->configuration->getSort(); + $method = $this->getConfiguration()->getRankable() ? 'orderByRank' : $method; if (!$method) { return false; @@ -558,7 +558,12 @@ class BaseAdminController extends Controller } $form = $this->getConfiguration()->getFormEdit(); - $form = $this->createForm(new $form($this->getConfiguration()->getFormEditOptions()), $object); + + if($this->has($form)){ + $form = $this->createForm($this->get($form)->getName(), $object, $this->getConfiguration()->getFormEditOptions()); + }else { + $form = $this->createForm(new $form($this->getConfiguration()->getFormEditOptions()), $object); + } if ('POST' === $request->getMethod()) { if (false !== $processForm = $this->processForm($form, $object, $request)) { @@ -591,8 +596,14 @@ class BaseAdminController extends Controller { $model = $this->getConfiguration()->getModel(); $object = new $model(); + $form = $this->getConfiguration()->getFormNew(); - $form = $this->createForm(new $form($this->getConfiguration()->getFormNewOptions()), $object); + + if($this->has($form)){ + $form = $this->createForm($this->get($form)->getName(), $object, $this->getConfiguration()->getFormNewOptions()); + }else { + $form = $this->createForm(new $form($this->getConfiguration()->getFormNewOptions()), $object); + } if ('POST' === $request->getMethod()) { if (false !== $processForm = $this->processForm($form, $object, $request)) { @@ -717,7 +728,7 @@ class BaseAdminController extends Controller protected function getFormFilter($new = false) { - $form = $this->getConfiguration()->getFormFilter() ? $this->configuration->getFormFilter() : $this->configuration->getFormNew(); + $form = $this->getConfiguration()->getFormFilter() ? $this->getConfiguration()->getFormFilter() : $this->getConfiguration()->getFormNew(); $form = $this->createForm(new $form($this->getConfiguration()->getFormFilterOptions())); diff --git a/vendor/trinity/src/Trinity/Bundle/AdminBundle/Resources/public/css/style.css b/vendor/trinity/src/Trinity/Bundle/AdminBundle/Resources/public/css/style.css index 504a2bf..6d7fb33 100644 --- a/vendor/trinity/src/Trinity/Bundle/AdminBundle/Resources/public/css/style.css +++ b/vendor/trinity/src/Trinity/Bundle/AdminBundle/Resources/public/css/style.css @@ -1296,7 +1296,7 @@ li.item p { margin-top: 0; } -.tab-content .mce-tinymce.mce-container.mce-panel, +.page-tab-content .mce-tinymce.mce-container.mce-panel, .embeded-form .mce-tinymce.mce-container.mce-panel { margin-left: 157px; } diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Block/CheckboxBlock.php b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Block/CheckboxBlock.php new file mode 100644 index 0000000..700f7bc --- /dev/null +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Block/CheckboxBlock.php @@ -0,0 +1,24 @@ +template === null) { + return $this::DEFAULT_TEMPLATE; + } + + return parent::getTemplate(); + } + + public function getValue() + { + return (bool)parent::getValue(); + } +} diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Command/CacheClearRoutingCommand.php b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Command/CacheClearRoutingCommand.php index 0f80b9b..9dd3b1c 100644 --- a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Command/CacheClearRoutingCommand.php +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Command/CacheClearRoutingCommand.php @@ -39,7 +39,11 @@ EOF $kernel = $this->getContainer()->get('kernel'); - $output->writeln(sprintf('Clearing the cache for the routing %s environment with debug %s', $kernel->getEnvironment(), var_export($kernel->isDebug(), true))); + $output->writeln(sprintf( + 'Clearing the cache for the routing %s environment with debug %s', + $kernel->getEnvironment(), + var_export($kernel->isDebug(), true) + )); $finder = new Finder(); $files = $finder->name('*Url*')->in(sprintf('%s/../', $realCacheDir))->depth('== 1'); diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Configuration/BlockConfiguration.php b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Configuration/BlockConfiguration.php index b5a5d85..8145c24 100644 --- a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Configuration/BlockConfiguration.php +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Configuration/BlockConfiguration.php @@ -12,8 +12,7 @@ class BlockConfiguration { $this->setName($name) ->setType($type) - ->setOptions($options) - ; + ->setOptions($options); } public function setName($name) diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Controller/PageAdminController.php b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Controller/PageAdminController.php index 53d95b0..62d8072 100644 --- a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Controller/PageAdminController.php +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Controller/PageAdminController.php @@ -35,6 +35,8 @@ class PageAdminController extends BaseAdminController protected $navs; + protected $use_nav_name; + public function __construct() { $this->menus = MenuPeer::findMenusWithNodes(); @@ -81,10 +83,17 @@ class PageAdminController extends BaseAdminController */ public function removeAction($object, $token, Request $request) { + $this->use_nav_name = $this->container->getParameter('trinity_content_manager.index_use_nav_name'); + if ($object->getNodeRelatedByNodeId() !== null) { $event = new LuceneEvent(); $event->setObject($object); - $event->setIndex($object->getNodeRelatedByNodeId()->getNav()->getCulture()); + $nav = $object->getNodeRelatedByNodeId()->getNav(); + if($this->use_nav_name){ + $event->setIndex($nav->getName()); + }else { + $event->setIndex($nav->getCulture()); + } $this->get("event_dispatcher")->dispatch( TrinitySearchEvents::LUCENE_REMOVE_INDEX, $event @@ -305,7 +314,7 @@ class PageAdminController extends BaseAdminController protected function processForm(&$form, &$object, Request $request) { - $form->bind($request); + $form->submit($request); if ($form->isValid()) { $this->preSave($object); @@ -421,12 +430,19 @@ class PageAdminController extends BaseAdminController public function postSave($object, $was_new = false) { + $this->use_nav_name = $this->container->getParameter('trinity_content_manager.index_use_nav_name'); + $node = $object->getNodeRelatedByNodeId(); if ($node) { $event = new LuceneEvent(); $event->setObject($object); - $event->setIndex($node->getNav()->getCulture()); + $nav = $node->getNav(); + if($this->use_nav_name){ + $event->setIndex($nav->getName()); + }else { + $event->setIndex($nav->getCulture()); + } $this->get("event_dispatcher")->dispatch( TrinitySearchEvents::LUCENE_UPDATE_INDEX, $event diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/DependencyInjection/Configuration.php b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/DependencyInjection/Configuration.php index 6ed8448..86ab3ac 100644 --- a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/DependencyInjection/Configuration.php +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/DependencyInjection/Configuration.php @@ -23,6 +23,8 @@ class Configuration implements ConfigurationInterface $rootNode->children() ->scalarNode('decorator_strategy')->isRequired()->end() + ->booleanNode('index_use_nav_name')->defaultFalse()->end() + ->arrayNode('ignore_route_patterns') ->defaultValue(array( '(.*)admin(.*)', # ignore admin route, ie route containing 'admin' diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/DependencyInjection/TrinityContentManagerExtension.php b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/DependencyInjection/TrinityContentManagerExtension.php index bfe6c42..8509636 100644 --- a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/DependencyInjection/TrinityContentManagerExtension.php +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/DependencyInjection/TrinityContentManagerExtension.php @@ -33,5 +33,7 @@ class TrinityContentManagerExtension extends Extension ->replaceArgument(1, $config['ignore_route_patterns']) ->replaceArgument(2, $config['ignore_uri_patterns']) ; + + $container->setParameter('trinity_content_manager.index_use_nav_name', $config['index_use_nav_name']); } } diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Form/Type/BlockCheckBoxType.php b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Form/Type/BlockCheckBoxType.php new file mode 100644 index 0000000..e27d76d --- /dev/null +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Form/Type/BlockCheckBoxType.php @@ -0,0 +1,43 @@ + 'Trinity\Bundle\ContentManagerBundle\Block\CheckboxBlock', + ); + + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder->add( + 'value', + 'checkbox', + array( + 'required' => false, + ) + ); + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults($this->options); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'checkbox_block'; + } +} diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Model/NodeQuery.php b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Model/NodeQuery.php index 8f750bb..739cafd 100644 --- a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Model/NodeQuery.php +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Model/NodeQuery.php @@ -10,10 +10,10 @@ class NodeQuery extends BaseNodeQuery public static function getReferences(Node $node) { return self::create() - ->where(sprintf('%s <> ?', NodePeer::ID), $node->getId()) - ->where(sprintf('%s <> 1', NodePeer::TREE_LEFT)) - ->orderByTreeLeft() - ; + ->filterById($node->getId(), \Criteria::NOT_EQUAL) + ->filterByTreeLeft(1, \Criteria::NOT_EQUAL) + ->filterByNavId($node->getNavId()) + ->orderByTreeLeft(); } /** diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Model/Page.php b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Model/Page.php index 1be5f62..3491056 100644 --- a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Model/Page.php +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Model/Page.php @@ -121,8 +121,8 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface $block->save(); } } elseif ($this->getConfiguration()) { - foreach ($this->getConfiguration()->getBlocks() as $block_configuration) { - $this->getBlock($block_configuration->getName())->save($con); + foreach ($this->getConfiguration()->getBlocks() as $blockConfiguration) { + $this->getBlock($blockConfiguration->getName())->save($con); } } @@ -137,7 +137,23 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface $qBlock = BlockQuery::create()->filterByName($name)->filterByPageId($this->getId())->findOne(); - $block = $qBlock ? $qBlock : $this->getNewBlock($name, $this->getId()); + if ($qBlock) { + if (!$this->getConfiguration()->getBlock($name)) { + $block = $qBlock; + } else { + $type = $this->getConfiguration()->getBlock($name)->getType(); + $form = new $type(); + $formModel = $form->getOption('data_class') ? $form->getOption('data_class') : null; + + if (null !== $formModel && !$qBlock instanceof $formModel) { + $block = $this->getNewBlock($name, $this->getId()); + } else { + $block = $qBlock; + } + } + } else { + $block = $this->getNewBlock($name, $this->getId()); + } if (!$this->hasBlock($block->getName())) { $this->setBlock($block); @@ -180,11 +196,13 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface { $type = $this->getConfiguration()->getBlock($name)->getType(); - $form = new $type(); - $form_model = $form->getOption('data_class') ? $form->getOption('data_class') : 'Block'; + $form = new $type(); + $formModel = $form->getOption('data_class') ? $form->getOption('data_class') : 'Trinity\Bundle\ContentManagerBundle\Model\Block'; - $block = new $form_model(); - $block->setname($name); + $block = new $formModel(); + $block + ->setname($name) + ->setClassKey($formModel); if (null !== $pageId) { $block->setPageId($pageId); @@ -241,7 +259,7 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface */ public function getIndexKey() { - return 'cms_page_'.$this->getId(); + return 'cms_page_' . $this->getId(); } /** @@ -260,15 +278,15 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface } $document = new Document(); - $nav = $this->getNode()->getNav(); + $nav = $this->getNode()->getNav(); - if ($nav->getCulture() != $locale) { + if ($nav->getCulture() != $locale && $nav->getName() != $locale) { return null; } - $document->addField(Field::keyword('pk', 'cms_page_'.$this->getId())); + $document->addField(Field::keyword('pk', 'cms_page_' . $this->getId())); $document->addField(Field::keyword('model', 'Page')); - $document->addField(Field::keyword('nav', 'nav_'.$nav->getId())); + $document->addField(Field::keyword('nav', 'nav_' . $nav->getId())); $document->addField($this->generateField('meta_title', $this->getSeoTitle(), 3)); $document->addField($this->generateField('meta_description', $this->getMetaDescription(), 3)); @@ -278,8 +296,8 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface $blocksConfiguration = $this->getConfiguration()->getBlocks(); foreach ($this->getBlocks() as $block) { - if (array_key_exists($block->getName(), $blocksConfiguration) && $block->getClassKey( - ) == 'Trinity\Bundle\ContentManagerBundle\Block\TextBlock' + if (array_key_exists($block->getName(), + $blocksConfiguration) && $block->getClassKey() == 'Trinity\Bundle\ContentManagerBundle\Block\TextBlock' ) { switch ($block->getName()) { case 'title': @@ -298,7 +316,7 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface $document->addField($this->generateField('excerpt', $block->getValue(), 2)); break; default: - $content .= $block->getValue().' '; + $content .= $block->getValue() . ' '; break; } } @@ -372,7 +390,7 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface public function getMetaWords() { if ($class = $this->getDataModel()) { - $model = new $class(); + $model = new $class(); $this->addMetaWordsByMap($model->getPeer()->getTableMap()); @@ -387,7 +405,7 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface public function addMetaWord($word) { - $word = '%'.trim($word, '%').'%'; + $word = '%' . trim($word, '%') . '%'; if (!in_array($word, $this->metaWords)) { $this->metaWords[] = $word; @@ -406,7 +424,9 @@ class Page extends BasePage implements SeoPageInterface, IndexableInterface continue; } - if (array_key_exists('uploadable', $behaviors) && preg_match('`.*' . $column->getName() . '.*`', $behaviors['uploadable']['fields'])) { + if (array_key_exists('uploadable', $behaviors) && preg_match('`.*' . $column->getName() . '.*`', + $behaviors['uploadable']['fields']) + ) { continue; } diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/config/cms_schema.xml b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/config/cms_schema.xml index 66db38f..c0664cb 100644 --- a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/config/cms_schema.xml +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/config/cms_schema.xml @@ -2,6 +2,10 @@ + + + + @@ -17,6 +21,10 @@
+ + + + @@ -64,6 +72,10 @@
+ + + + @@ -94,6 +106,10 @@
+ + + + @@ -113,6 +129,10 @@
+ + + + @@ -128,5 +148,4 @@
-
diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/views/Block/block_checkbox.html.twig b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/views/Block/block_checkbox.html.twig new file mode 100644 index 0000000..d16ef0c --- /dev/null +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/views/Block/block_checkbox.html.twig @@ -0,0 +1 @@ +{{ block.value ? "1" : "0" }} \ No newline at end of file diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/views/PageAdmin/edit.html.twig b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/views/PageAdmin/edit.html.twig index 63c7f64..3fbb096 100644 --- a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/views/PageAdmin/edit.html.twig +++ b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Resources/views/PageAdmin/edit.html.twig @@ -142,7 +142,7 @@ {% endif %} -
+
diff --git a/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Twig/Extension/.PageExtension.php.swp b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Twig/Extension/.PageExtension.php.swp new file mode 100644 index 0000000..00ba589 Binary files /dev/null and b/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Twig/Extension/.PageExtension.php.swp differ diff --git a/vendor/trinity/src/Trinity/Bundle/UserBundle/Configuration/UserCrudConfiguration.php b/vendor/trinity/src/Trinity/Bundle/UserBundle/Configuration/UserCrudConfiguration.php index 7ee359c..59c4e0f 100644 --- a/vendor/trinity/src/Trinity/Bundle/UserBundle/Configuration/UserCrudConfiguration.php +++ b/vendor/trinity/src/Trinity/Bundle/UserBundle/Configuration/UserCrudConfiguration.php @@ -15,9 +15,11 @@ class UserCrudConfiguration extends \Trinity\Bundle\AdminBundle\Configuration\Cr ->setRoutePrefix('FOSUserBundleUserAdmin') ->setFormNamespace('Trinity\\Bundle\\UserBundle\\Form\\Type') - ->setFormEdit('UserType') + ->setFormEdit('trinity.user.form.type', false) + ->setFormNew('trinity.user.form.type', false) ->setFormFilter('UserFilterType') - ->setFormNew('UserType') + + ->setRedirectIfOneResult(false) ->setFieldsets(array( ' ' => array( diff --git a/vendor/trinity/src/Trinity/Bundle/UserBundle/Controller/UserAdminController.php b/vendor/trinity/src/Trinity/Bundle/UserBundle/Controller/UserAdminController.php index 5dad674..49fc75c 100644 --- a/vendor/trinity/src/Trinity/Bundle/UserBundle/Controller/UserAdminController.php +++ b/vendor/trinity/src/Trinity/Bundle/UserBundle/Controller/UserAdminController.php @@ -40,8 +40,8 @@ class UserAdminController extends BaseAdminController */ public function newAction(Request $request) { - $this->configuration->setFormNewOptions(array('roles' => $this->container->getParameter('trinity_user.roles'))); - $this->configuration->setFormFilterOptions(array('roles' => $this->container->getParameter('trinity_user.roles'))); + $this->getConfiguration()->setFormNewOptions(array('roles' => $this->container->getParameter('trinity_user.roles'))); + $this->getConfiguration()->setFormFilterOptions(array('roles' => $this->container->getParameter('trinity_user.roles'))); return parent::newAction($request); } @@ -53,8 +53,8 @@ class UserAdminController extends BaseAdminController */ public function editAction($object, Request $request) { - $this->configuration->setFormEditOptions(array('roles' => $this->container->getParameter('trinity_user.roles'))); - $this->configuration->setFormFilterOptions(array('roles' => $this->container->getParameter('trinity_user.roles'))); + $this->getConfiguration()->setFormEditOptions(array('roles' => $this->container->getParameter('trinity_user.roles'))); + $this->getConfiguration()->setFormFilterOptions(array('roles' => $this->container->getParameter('trinity_user.roles'))); return parent::editAction($object, $request); } @@ -147,4 +147,26 @@ class UserAdminController extends BaseAdminController { $this->get('fos_user.user_manager')->updateUser($object); } + + /** + * @return mixed + * @throws \LogicException + */ + public function getConfiguration() + { + // DI first + if($this->has('trinity.user.crud.configuration')){ + $this->configuration = $this->get('trinity.user.crud.configuration'); + } + + if (empty($this->configuration)) { + throw new \LogicException('You must specify a crud configuration.'); + } + + if (null === $this->configuration->getStorageNamespace()) { + $this->configuration->setStorageNamespace(get_class($this)); + } + + return $this->configuration; + } } diff --git a/vendor/trinity/src/Trinity/Bundle/UserBundle/Form/Type/UserType.php b/vendor/trinity/src/Trinity/Bundle/UserBundle/Form/Type/UserType.php index 577db9d..9869fc7 100644 --- a/vendor/trinity/src/Trinity/Bundle/UserBundle/Form/Type/UserType.php +++ b/vendor/trinity/src/Trinity/Bundle/UserBundle/Form/Type/UserType.php @@ -79,16 +79,20 @@ class UserType extends BaseAbstractType 'validation_groups' => 'Profile', 'data_class' => 'FOS\UserBundle\Propel\User', 'cascade_validation' => true, + 'roles' => array() ) ); + + parent::setDefaultOptions($resolver); } /** * {@inheritdoc} + * Name must be the same as the service alias for tag form */ public function getName() { - return 'user'; + return 'trinity_user_admin_form'; } public static function getRoles() diff --git a/vendor/trinity/src/Trinity/Bundle/UserBundle/Resources/config/services.xml b/vendor/trinity/src/Trinity/Bundle/UserBundle/Resources/config/services.xml index 8adc510..826e374 100644 --- a/vendor/trinity/src/Trinity/Bundle/UserBundle/Resources/config/services.xml +++ b/vendor/trinity/src/Trinity/Bundle/UserBundle/Resources/config/services.xml @@ -11,6 +11,7 @@ Trinity\Bundle\UserBundle\Handler\AuthenticationSuccessHandler Trinity\Bundle\UserBundle\Handler\AuthenticationFailureHandler Trinity\Bundle\UserBundle\Form\Type\MyProfileType + Trinity\Bundle\UserBundle\Form\Type\UserType Trinity\Bundle\UserBundle\User\UserRegister Trinity\Bundle\UserBundle\User\UserLog @@ -47,5 +48,9 @@ %fos_user.model.user.class% + + + + diff --git a/vendor/trinity/src/Trinity/Component/Propel/UploadableBehavior.php b/vendor/trinity/src/Trinity/Component/Propel/UploadableBehavior.php index 852309e..3aebdad 100644 --- a/vendor/trinity/src/Trinity/Component/Propel/UploadableBehavior.php +++ b/vendor/trinity/src/Trinity/Component/Propel/UploadableBehavior.php @@ -32,8 +32,8 @@ class UploadableBehavior extends \Behavior protected function generateConfiguration() { - $this->fields = array_map('trim', explode(',', $this->getParameter('fields'))); - $path = array_map('trim', explode(',', $this->getParameter('paths'))); + $this->fields = array_map('trim', explode(',', $this->getParameter('fields'))); + $path = array_map('trim', explode(',', $this->getParameter('paths'))); if(count($this->fields) != count($path)) { throw new InvalidArgumentException(sprintf( @@ -63,8 +63,6 @@ class UploadableBehavior extends \Behavior return isset($this->dirs[$field]) ? $this->dirs[$field] : null; } - - public function modifyTable() { $this->generateConfiguration();