Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

Commit

Permalink
Added management for store routing strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoreram committed Jun 10, 2015
1 parent 7c101e7 commit 7a82afa
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/config/common/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ services:
class: %jms_i18n_routing.locale_choosing_listener.class%
public: false
arguments:
- %jms_i18n_routing.default_locale%
- @elcodi.store_default_language_iso
- @elcodi.languages_iso_array
- @jms_i18n_routing.locale_resolver

jms_i18n_routing.pattern_generation_strategy.default:
class: %jms_i18n_routing.pattern_generation_strategy.class%
arguments:
- %jms_i18n_routing.strategy%
- @elcodi.store_routing_strategy
- @translator
- @elcodi.languages_iso_array
- %kernel.cache_dir%
- %jms_i18n_routing.catalogue%
- %jms_i18n_routing.default_locale%
- @elcodi.store_default_language_iso

#
# Page renderer
Expand Down
10 changes: 10 additions & 0 deletions src/Elcodi/Admin/StoreBundle/Form/Type/StoreSettingsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
namespace Elcodi\Admin\StoreBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

use Elcodi\Component\Core\Factory\Traits\FactoryTrait;
use Elcodi\Component\Store\StoreRoutingStrategy;

/**
* Class StoreSettingsType
Expand Down Expand Up @@ -89,6 +91,14 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('useStock', 'checkbox', [
'required' => false,
])
->add('routingStrategy', 'choice', [
'choice_list' => new ArrayChoiceList([
'admin.store.field.routingStrategy.prefix_except_default' => StoreRoutingStrategy::STRATEGY_PREFIX_EXCEPT_DEFAULT,
'admin.store.field.routingStrategy.prefix' => StoreRoutingStrategy::STRATEGY_PREFIX,
'admin.store.field.routingStrategy.custom' => StoreRoutingStrategy::STRATEGY_CUSTOM,
]),
'required' => true,
])
->add('enabled', 'checkbox', [
'required' => false,
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,28 @@
</div>
</div>
</div>
<div class="grid">

<div class="col-1-3">
<div class="box-none">
<h3 class="fw-n">{{ 'admin.store.section.advanced.title'|trans }}</h3>
<p>{{ 'admin.store.section.advanced.description'|trans }}</p>
</div>
</div>
<div class="col-2-3">
<div class="box">
<ol>
<li>
{{
form_row(form.routingStrategy, {
label: 'admin.store.field.routingStrategy.title',
})
}}
</li>
</ol>
</div>
</div>
</div>

</fieldset>
<div class="grid fixed-bottom animated fade-in-up">
Expand Down

0 comments on commit 7a82afa

Please sign in to comment.