twAdminPlugin based on sfAdminDashPlugin
Overview
I had to create nice backend for my Thunderwolf Project and here is result.
This plugin is based on sfAdminDashPlugin created by Kevin Bond. Like him I had to create a menu to access all the various modules.
This plugin automates the process by using a configuration files.
Optional Requirements:
twCorePlugin
Base plugin for all Thunderwolf Plugins
sfGuardPlugin
The Best plugin for authentication
Installation
Install plugin:
symfony plugin:install twAdminPlugin -s alpha
symfony cache:clear
Create backend or admin app if not exists:
symfony generate:app backend
Next use prepared skeleton:
replace or merge /apps/backend/config/app.yml with /plugins/twAdminPlugin/data/skeleton/apps/backend/config/app.yml
Remember to change fragments connecting this app.yml with sfGuardPlugin if you don't use it
replace or merge /apps/backend/config/routing.yml with /plugins/twAdminPlugin/data/skeleton/apps/backend/config/routing.yml
merge /apps/backend/config/settings.yml with /plugins/twAdminPlugin/data/skeleton/apps/backend/config/settings.yml
replace /apps/backend/templates/layout.php with /plugins/twAdminPlugin/data/skeleton/apps/backend/templates/layout.php
If you use sfGuardPlugin:
Be shure that you made all installations for sfGuardPlugin
copy folders from /plugins/twAdminPlugin/data/skeleton/apps/backend/modules/ to /apps/backend/modules/
replace or merge files in /plugins/sfGuardPlugin with files in /plugins/twAdminPlugin/data/skeleton/plugins/sfGuardPlugin (better look in admin section)
If you don't have own favicon.ico you can use this preoared for Thunderwolf:
- Just copy /plugins/twAdminPlugin/data/skeleton/web/favicon.ico to your /web folder
Publish the plugin's assets:
plugin:publish-assets
If the modules are admin generator modules, deactivate the default admin generator theme in each module's generator.yml by creating a css property. You can either point the css property to a real stylesheet or just use a placeholder.
generator:
class: sfPropelGenerator
param:
model_class: Article
theme: twadmin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: article
with_propel_route: 1
css: nothing #setting the css to a placeholder
config:
actions: ~
fields: ~
list: ~
filter: ~
form: ~
edit: ~
new: ~
The plugin's app.yml file looks like the following:
all:
tw_admin:
login_route: @sf_guard_signin
logout_route: @sf_guard_signout
default_module: administration
default_category: info
default_subcategory: false
master_section:
administration:
label: Administracja
url: @homepage
credentials: [superadmin]
menu:
administration:
categories:
info:
label: Informacje
url: @homepage
credentials: [admin]
users:
label: Users
url: @sf_guard_user
credentials: [admin]
permissions:
label: Permissions
url: @sf_guard_permission
credentials: [superadmin]
groups:
label: Groups
url: @sf_guard_group
credentials: [superadmin]
TODO
- Theme for Propel1.5 admin generator
- CSS and design for sfAssetsLibraryPlugin
This plugin graphics and HTML design is sponsored by ARUKOMP company.
All graphics are licensed under a Creative Commons Attribution 3.0 Unported License
