create new resources

This commit is contained in:
Manuel Raynaud
2014-04-24 14:28:52 +02:00
parent bca1330d0d
commit dbe641ad84
7 changed files with 101 additions and 6 deletions

View File

@@ -549,6 +549,10 @@
<!-- Routes to the Config (system variables) controller -->
<route id="admin.configuration.inedx" path="/admin/configuration">
<default key="_controller">Thelia\Controller\Admin\ConfigurationController::indexAction</default>
</route>
<route id="admin.configuration.variables.default" path="/admin/configuration/variables">
<default key="_controller">Thelia\Controller\Admin\ConfigController::defaultAction</default>
</route>
@@ -1150,6 +1154,12 @@
<default key="_controller">Thelia\Controller\Admin\TranslationsController::updateAction</default>
</route>
<!-- export management -->
<route id="export.customer.newsletter" path="/admin/export/customer/newsletter">
<default key="_controller">Thelia\Controller\Admin\ExportController::customerNewsletterAction</default>
</route>
<!-- The default route, to display a template -->
<route id="admin.processTemplate" path="/admin/{template}">

View File

@@ -0,0 +1,45 @@
<?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;
use Thelia\Core\Security\AccessManager;
use Thelia\Core\Security\Resource\AdminResources;
/**
* Class ConfigurationController
* @package Thelia\Controller\Admin
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class ConfigurationController extends BaseAdminController
{
public function indexAction()
{
if (null !== $response = $this->checkAuth([AdminResources::CONFIG], [], [AccessManager::VIEW])) {
return $response;
}
return $this->render('configuration');
}
}

View File

@@ -100,4 +100,8 @@ final class AdminResources
const TRANSLATIONS = "admin.configuration.translations";
const UPDATE = "admin.configuration.update";
const EXPORT = "admin.export";
const TOOLS = "admin.tools";
}

View File

@@ -1277,7 +1277,9 @@ INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES
(29, 'admin.configuration.admin-logs', NOW(), NOW()),
(30, 'admin.configuration.system-logs', NOW(), NOW()),
(31, 'admin.configuration.advanced', NOW(), NOW()),
(32, 'admin.configuration.translations', NOW(), NOW());
(32, 'admin.configuration.translations', NOW(), NOW()),
(33, 'admin.export', NOW(), NOW()),
(34, 'admin.tools', NOW(), NOW());
/**
generated with command : php Thelia thelia:generate-resources --output sql-i18n
@@ -1347,6 +1349,10 @@ INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES
(31, 'fr_FR', 'Configuration avancée'),
(32, 'en_US', 'Translations'),
(32, 'fr_FR', 'Traductions');
(33, 'en_US', 'Back-office export management'),
(33, 'fr_FR', 'gestion des exports'),
(34, 'en_US', 'Tools panel'),
(34, 'fr_FR', 'Outils');
INSERT INTO `message` (`id`, `name`, `secured`, `text_layout_file_name`, `text_template_file_name`, `html_layout_file_name`, `html_template_file_name`, `created_at`, `updated_at`) VALUES

View File

@@ -12,6 +12,7 @@ ALTER TABLE `module` ADD INDEX `idx_module_activate` (`activate`);
SELECT @max := MAX(`id`) FROM `resource`;
SET @max := @max+1;
INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES
(@max, 'admin.configuration.store', NOW(), NOW());
@@ -48,6 +49,15 @@ INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES
SET @max := @max+1;
INSERT INTO `resource` (`id`, `code`, `created_at`, `updated_at`) VALUES
(@max, 'admin.export', NOW(), NOW());
INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES
(@max, 'en_US', 'Back-office export management'),
(@max, 'fr_FR', 'gestion des exports');
SET @max := @max+1;
INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES
(@max, 'admin.configuration.advanced', NOW(), NOW());
@@ -64,4 +74,15 @@ INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES
(@max, 'en_US', 'Translations'),
(@max, 'fr_FR', 'Traductions');
SET @max := @max+1;
INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES
(@max, 'admin.tools', NOW(), NOW());
INSERT INTO resource_i18n (`id`, `locale`, `title`) VALUES
(@max, 'en_US', 'Tools panel'),
(@max, 'fr_FR', 'Outils');
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -880,6 +880,7 @@ return array(
'To remove a value from the combination, select it and click "remove"' => 'Afin de supprimer une valeur de la combinaison, sélectionnez la et cliquez sur "Enlever"',
'To use features or attributes on this product, please select a product template. You can define product templates in the <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">configuration section</a> of the administration.' => 'Pour utiliser les déclinaisons et les caractéristiques sur ce produit, choisissez un tempplate produit. Vous pouvez gérer les templates de produit dans <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">la section configuration</a> de l\'administration.',
'Today' => 'Aujourd\'hui',
'Tools' => 'Outils',
'Top level' => 'Niveau 1',
'Top level Contents' => 'Contenus de niveau 1',
'Top level Products' => 'Produits mis en avant',

View File

@@ -193,20 +193,28 @@
</li>
{/loop}
{loop name="menu-auth-tools" type="auth" role="ADMIN" resource="admin.tools" access="VIEW"}
<li class="{if $admin_current_location == 'home'}active{/if}" id="home_menu">
<a href="{url path='/admin/tools'}">{intl l="Tools"}</a>
</li>
{/loop}
{loop name="menu-auth-modules" type="auth" role="ADMIN" resource="admin.module" access="VIEW"}
<li class="{if $admin_current_location == 'modules'}active{/if}" id="modules_menu">
<a href="{url path='/admin/modules'}">{intl l="Modules"}</a>
</li>
{/loop}
{loop name="menu-auth-config" type="auth" role="ADMIN" resource="admin.configuration" access="VIEW"}
<li class="{if $admin_current_location == 'configuration'}active{/if}" id="config_menu">
<a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a>
</li>
{/loop}
{loop name="menu-auth-modules" type="auth" role="ADMIN" resource="admin.module" access="VIEW"}
<li class="{if $admin_current_location == 'modules'}active{/if}" id="modules_menu">
<a href="{url path='/admin/modules'}">{intl l="Modules"}</a>
</li>
{module_include location='in_top_menu_items'}
{/loop}
</ul>
{loop name="top-bar-search" type="auth" role="ADMIN" resource="admin.search" access="VIEW"}