Setting languages view and route
This commit is contained in:
@@ -535,6 +535,14 @@
|
|||||||
<default key="_controller">Thelia\Controller\Admin\MailingSystemController::defaultAction</default>
|
<default key="_controller">Thelia\Controller\Admin\MailingSystemController::defaultAction</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
|
<!-- end mailing system management -->
|
||||||
|
|
||||||
|
<!-- languages system management -->
|
||||||
|
|
||||||
|
<route id="admin.configuration.languages.default" path="/admin/configuration/languages">
|
||||||
|
<default key="_controller">Thelia\Controller\Admin\LanguageController::defaultAction</default>
|
||||||
|
</route>
|
||||||
|
|
||||||
<!-- end mailing system management -->
|
<!-- end mailing system management -->
|
||||||
|
|
||||||
<!-- The default route, to display a template -->
|
<!-- The default route, to display a template -->
|
||||||
|
|||||||
39
core/lib/Thelia/Controller/Admin/LanguageController.php
Normal file
39
core/lib/Thelia/Controller/Admin/LanguageController.php
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
/*************************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* Thelia */
|
||||||
|
/* */
|
||||||
|
/* Copyright (c) OpenStudio */
|
||||||
|
/* email : info@thelia.net */
|
||||||
|
/* web : http://www.thelia.net */
|
||||||
|
/* */
|
||||||
|
/* This program is free software; you can redistribute it and/or modify */
|
||||||
|
/* it under the terms of the GNU General Public License as published by */
|
||||||
|
/* the Free Software Foundation; either version 3 of the License */
|
||||||
|
/* */
|
||||||
|
/* This program is distributed in the hope that it will be useful, */
|
||||||
|
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||||
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||||
|
/* GNU General Public License for more details. */
|
||||||
|
/* */
|
||||||
|
/* You should have received a copy of the GNU General Public License */
|
||||||
|
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
/* */
|
||||||
|
/*************************************************************************************/
|
||||||
|
|
||||||
|
namespace Thelia\Controller\Admin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class LanguageController
|
||||||
|
* @package Thelia\Controller\Admin
|
||||||
|
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||||
|
*/
|
||||||
|
class LanguageController extends BaseAdminController
|
||||||
|
{
|
||||||
|
public function defaultAction()
|
||||||
|
{
|
||||||
|
if (null !== $response = $this->checkAuth("admin.configuration.languages.view")) return $response;
|
||||||
|
return $this->render("languages");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
224
templates/admin/default/languages.html
Normal file
224
templates/admin/default/languages.html
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
{extends file="admin-layout.tpl"}
|
||||||
|
|
||||||
|
{block name="page-title"}{intl l='Thelia Languages'}{/block}
|
||||||
|
|
||||||
|
{block name="check-permissions"}admin.configuration.languages.view{/block}
|
||||||
|
|
||||||
|
{block name="main-content"}
|
||||||
|
<div class="languages">
|
||||||
|
|
||||||
|
<div id="wrapper" class="container">
|
||||||
|
|
||||||
|
<ul class="breadcrumb">
|
||||||
|
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||||
|
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
|
||||||
|
<li><a href="{url path='/admin/configuration/languages'}">{intl l="Languages"}</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{module_include location='languages_top'}
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="general-block-decorator">
|
||||||
|
|
||||||
|
<form action="" method="">
|
||||||
|
|
||||||
|
<table class="table table-striped table-condensed table-left-aligned">
|
||||||
|
<caption>
|
||||||
|
{intl l="Languages management"}
|
||||||
|
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.languages.create"}
|
||||||
|
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new language'}" href="#creation_dialog" data-toggle="modal">
|
||||||
|
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||||
|
</a>
|
||||||
|
{/loop}
|
||||||
|
|
||||||
|
</caption>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{intl l="Language name"}</th>
|
||||||
|
<th>{intl l="ISO 639 Code"}</th>
|
||||||
|
<th>{intl l="Default"}</th>
|
||||||
|
<th>{intl l="Actions"}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><input type="text" class="form-control" name="" value="France"></td>
|
||||||
|
<td><input type="text" class="form-control" name="" value="fr"></td>
|
||||||
|
<td>
|
||||||
|
<div class="make-switch switch-small switch-radio" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||||
|
<input type="radio" name="" checked>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="btn-group">
|
||||||
|
<a href="#delete_dialog" data-toggle="modal" class="btn btn-default btn-xs" title="{intl l="Delete this language"}"><span class="glyphicon glyphicon-trash"></span></a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><input type="text" class="form-control" name="" value="English"></td>
|
||||||
|
<td><input type="text" class="form-control" name="" value="en"></td>
|
||||||
|
<td>
|
||||||
|
<div class="make-switch switch-small switch-radio" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||||
|
<input type="radio" name="">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="btn-group">
|
||||||
|
<a href="#delete_dialog" data-toggle="modal" class="btn btn-default btn-xs" title="{intl l="Delete this language"}"><span class="glyphicon glyphicon-trash"></span></a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><input type="text" class="form-control" name="" value="Spanish"></td>
|
||||||
|
<td><input type="text" class="form-control" name="" value="es"></td>
|
||||||
|
<td>
|
||||||
|
<div class="make-switch switch-small switch-radio" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||||
|
<input type="radio" name="">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="btn-group">
|
||||||
|
<a href="#delete_dialog" data-toggle="modal" class="btn btn-default btn-xs" title="{intl l="Delete this language"}"><span class="glyphicon glyphicon-trash"></span></a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4">
|
||||||
|
<button type="submit" class="btn btn-default btn-primary pull-right"><span class="glyphicon glyphicon-check"></span> {intl l="Save"}</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="general-block-decorator">
|
||||||
|
|
||||||
|
<div class="title title-without-tabs">{intl l="Parameters"}</div>
|
||||||
|
|
||||||
|
<form action="" method="post">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="" class="label-control">{intl l="If a translation is missing or incomplete :"}</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<select name="" id="" data-toggle="selectpicker">
|
||||||
|
<option value="">Replace by the default language</option>
|
||||||
|
<option value="">Strictly use the requested language</option>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="general-block-decorator clearfix">
|
||||||
|
|
||||||
|
<div class="title title-without-tabs">{intl l="Association language/URL"}</div>
|
||||||
|
|
||||||
|
<form action="" method="post">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="" class="label-control"><input type="radio" name="" checked> {intl l="Using a same domain for all languages"}</label>
|
||||||
|
<input type="url" class="form-control" name="" placeholder="http://www.domain.com">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="" class="label-control"><input type="radio" name=""> {intl l="Using a domain or subdomain for each language"}</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="table table-striped table-condensed table-left-aligned">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>{intl l="France"}</th>
|
||||||
|
<td><input type="text" class="form-control" name="" placeholder="http://www.domain.com" readonly></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{intl l="English"}</th>
|
||||||
|
<td><input type="text" class="form-control" name="" placeholder="http://www.domain.com" readonly></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{intl l="Spanish"}</th>
|
||||||
|
<td><input type="text" class="form-control" name="" placeholder="http://www.domain.com" readonly></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<button type="submit" disabled class="btn btn-default btn-primary pull-right"><span class="glyphicon glyphicon-check"></span> {intl l="Save"}</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{module_include location='languages_bottom'}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{* Delete confirmation dialog *}
|
||||||
|
|
||||||
|
{capture "delete_dialog"}
|
||||||
|
<input type="hidden" name="message_id" id="message_delete_id" value="" />
|
||||||
|
|
||||||
|
{module_include location='languages_delete_form'}
|
||||||
|
|
||||||
|
{/capture}
|
||||||
|
|
||||||
|
{include
|
||||||
|
file = "includes/generic-confirm-dialog.html"
|
||||||
|
|
||||||
|
dialog_id = "delete_dialog"
|
||||||
|
dialog_title = {intl l="Delete language"}
|
||||||
|
dialog_message = {intl l="Do you really want to delete this language ?"}
|
||||||
|
|
||||||
|
form_action = {url path='/admin/configuration/languages/delete'}
|
||||||
|
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||||
|
}
|
||||||
|
|
||||||
|
{/block}
|
||||||
|
|
||||||
|
{block name="javascript-initialization"}
|
||||||
|
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
|
||||||
|
<script src="{$asset_url}"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Toogle switch on input radio
|
||||||
|
$('.switch-radio').on('switch-change', function () {
|
||||||
|
$('.switch-radio').bootstrapSwitch('toggleRadioState');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{/javascripts}
|
||||||
|
|
||||||
|
{javascripts file='assets/js/main.js'}
|
||||||
|
<script src="{$asset_url}"></script>
|
||||||
|
{/javascripts}
|
||||||
|
|
||||||
|
{javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
|
||||||
|
<script src="{$asset_url}"></script>
|
||||||
|
{/javascripts}
|
||||||
|
{/block}
|
||||||
Reference in New Issue
Block a user