For a project i am working on we have a user listing that uses the new
admin generator functionality. We previously used the 1.0 admin
generator and decided to upgrade.
This application has different permission levels (company owners &
general system owners). To avoid copying functionality we want use the
same "user listing" (admin generated) action for those only with
different criteria. For this we are overriding the buildCriteria
method. This is a piece of cake.
Now, how can we distanciate the 2 different list views ? To explain :
- Normal User Listing (for company owner) : /user
- Admin User Listing (for system admins) : /user?view=admin
Now the problem is the generated templates (_pagination.php &
_list_th_tabular.php) do not pass this parameter when paging or
changing sorting.
There should be a simple way to avoid this ?
I already tried manually overriding the different templates, but every
change in generator.yml would mean you'd have to update/rewrite those
templates.
Just do the modifications in your own admin generator theme... So you won't have to overwrite every _pagination.php & _list_th_tabular.php of your admin gen modules.
++ COil
________________________________
De : DigitalBase <i...@digitalbase.eu>
À : symfony users <symfony-users@googlegroups.com>
Envoyé le : Jeudi, 6 Novembre 2008, 18h36mn 48s
Objet : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View
For a project i am working on we have a user listing that uses the new
admin generator functionality. We previously used the 1.0 admin
generator and decided to upgrade.
This application has different permission levels (company owners &
general system owners). To avoid copying functionality we want use the
same "user listing" (admin generated) action for those only with
different criteria. For this we are overriding the buildCriteria
method. This is a piece of cake.
Now, how can we distanciate the 2 different list views ? To explain :
- Normal User Listing (for company owner) : /user
- Admin User Listing (for system admins) : /user?view=admin
Now the problem is the generated templates (_pagination.php &
_list_th_tabular.php) do not pass this parameter when paging or
changing sorting.
There should be a simple way to avoid this ?
I already tried manually overriding the different templates, but every
change in generator.yml would mean you'd have to update/rewrite those
templates.
On Nov 6, 11:08 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> Just do the modifications in your own admin generator theme... So you won't have to overwrite every _pagination.php & _list_th_tabular.php of your admin gen modules.
> ++ COil
C0il.
I tried this, and i do not seem to manage.
What i found in documentation :
[quote]
If you want to tweak the admin generator to create your own theme, or
to bundle your extensions in a plugin, you will find that it is much
more easier now:
* You don't need to copy all the files of the default theme to
create a new one. Just copy the files you need to override.
[/quote]
[quote]
The generator templates are cut into small parts that can be
overridden independently, and the actions can also be changed one by
one.
However, if you want to override those for several modules in the same
way, you should probably create a reusable theme. A theme is a sub-set
of templates and actions that can be used by an administration module
if specified in the theme value at the beginning of generator.yml.
With the default theme, symfony uses the files defined in
$sf_symfony_lib_dir/plugins/sfPropelPlugin/data/generator/
sfPropelModule/admin/.
The theme files must be located in a project tree structure, in a data/
generator/sfPropelModule/[theme_name]/ directory, and you can
bootstrap a new theme by copying the files you want to override from
the default theme (located in $sf_symfony_lib_dir/plugins/
sfPropelPlugin/data/generator/sfPropelModule/admin/ directory):
[/quote]
So what i did :
I created a plugin and activated it (plugins/
tmpPropelGeneratorThemePlugin). Then i created the directory structure
from the instructions (above). See screenshot : http://www.shareapic.com/public/view/29772 Now i just copied the indexSuccess and added some various "blabla" in
the template to check if the template is used.
[?php use_helper('I18N', 'Date') ?] [?php include_partial('profile/
assets') ?]
[?php echo
Fatal error: Call to a member function getValue() on a non-object in /
home/gnelisse/projects_local/trackmypeople/webroot/lib/core/lib/
generator/sfModelGenerator.class.php on line 284
If anyone can help me I will write a wiki tutorial on overriding the
admin generator as the one on the wiki is outdated.
________________________________
De : DigitalBase <i...@digitalbase.eu>
À : symfony users <symfony-users@googlegroups.com>
Envoyé le : Vendredi, 7 Novembre 2008, 10h04mn 41s
Objet : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View
On Nov 6, 11:08 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> Just do the modifications in your own admin generator theme... So you won't have to overwrite every _pagination.php & _list_th_tabular.php of your admin gen modules.
> ++ COil
C0il.
I tried this, and i do not seem to manage.
What i found in documentation :
[quote]
If you want to tweak the admin generator to create your own theme, or
to bundle your extensions in a plugin, you will find that it is much
more easier now:
* You don't need to copy all the files of the default theme to
create a new one. Just copy the files you need to override.
[/quote]
[quote]
The generator templates are cut into small parts that can be
overridden independently, and the actions can also be changed one by
one.
However, if you want to override those for several modules in the same
way, you should probably create a reusable theme. A theme is a sub-set
of templates and actions that can be used by an administration module
if specified in the theme value at the beginning of generator.yml.
With the default theme, symfony uses the files defined in
$sf_symfony_lib_dir/plugins/sfPropelPlugin/data/generator/
sfPropelModule/admin/.
The theme files must be located in a project tree structure, in a data/
generator/sfPropelModule/[theme_name]/ directory, and you can
bootstrap a new theme by copying the files you want to override from
the default theme (located in $sf_symfony_lib_dir/plugins/
sfPropelPlugin/data/generator/sfPropelModule/admin/ directory):
[/quote]
So what i did :
I created a plugin and activated it (plugins/
tmpPropelGeneratorThemePlugin). Then i created the directory structure
from the instructions (above). See screenshot : http://www.shareapic.com/public/view/29772 Now i just copied the indexSuccess and added some various "blabla" in
the template to check if the template is used.
[?php use_helper('I18N', 'Date') ?] [?php include_partial('profile/
assets') ?]
[?php echo
Fatal error: Call to a member function getValue() on a non-object in /
home/gnelisse/projects_local/trackmypeople/webroot/lib/core/lib/
generator/sfModelGenerator.class.php on line 284
If anyone can help me I will write a wiki tutorial on overriding the
admin generator as the one on the wiki is outdated.
I did try/read this post (a long time ago). That post is a 1.0
tutorial and clearly not what i am trying to achieve.
I want to override only the templates i want to change, instead of
copy pasting the entire admin generator theme.
[quote]
The generator templates are cut into small parts that can be
overridden independently, and the actions can also be changed one by
one.
[/quote]
Discussion subject changed to "Re : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View" by Loïc Vernet
This exactly what you want to achieve, modify the admin generator so you don't have to ovveride the partials in all you admin-gen modules.
I tagged this tutorial as a sf 1.0 tutorial, as the batch feature is already in the 1.1 and 1.2.
Read the comments, this tutorial just work well. And you will also be able to extend a 1.1 or 1.2 admin gen in the same way
(not tested in 1.2 but it should be quiet the same ?)
++ See you tomorrow on IRC, i can help.
________________________________
De : DigitalBase <i...@digitalbase.eu>
À : symfony users <symfony-users@googlegroups.com>
Envoyé le : Vendredi, 7 Novembre 2008, 21h06mn 53s
Objet : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View
On Nov 7, 9:01 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
I did try/read this post (a long time ago). That post is a 1.0
tutorial and clearly not what i am trying to achieve.
I want to override only the templates i want to change, instead of
copy pasting the entire admin generator theme.
[quote]
The generator templates are cut into small parts that can be
overridden independently, and the actions can also be changed one by
one.
[/quote]
On Nov 7, 9:29 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> Did you read the tutorial ?
> This exactly what you want to achieve, modify the admin generator so you don't have to ovveride the partials in all you admin-gen modules.
> I tagged this tutorial as a sf 1.0 tutorial, as the batch feature is already in the 1.1 and 1.2.
> Read the comments, this tutorial just work well. And you will also be able to extend a 1.1 or 1.2 admin gen in the same way
> (not tested in 1.2 but it should be quiet the same ?)
> ++ See you tomorrow on IRC, i can help.
Again, no this tutorial is not what i am trying to achieve. I do not
want to copy the entire admin generator skeleton & templates as they
will still change in the upcoming versions 1.2 & 1.3...
I just want to create an admin generator theme with ONLY the templates
_paginator.php en _list_th_header (or whatever that is called).
Symfony needs to use the other partials/components from the default
admin generator, same for the actions etc...
enerator:
class: sfPropelAdminGenerator
param:
model_class: Question
theme: myAdminTheme # myadmin theme is in a specific plugin
________________________________
De : DigitalBase <i...@digitalbase.eu>
À : symfony users <symfony-users@googlegroups.com>
Envoyé le : Vendredi, 7 Novembre 2008, 10h04mn 41s
Objet : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View
On Nov 6, 11:08 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> Just do the modifications in your own admin generator theme... So you won't have to overwrite every _pagination.php & _list_th_tabular.php of your admin gen modules.
> ++ COil
C0il.
I tried this, and i do not seem to manage.
What i found in documentation :
[quote]
If you want to tweak the admin generator to create your own theme, or
to bundle your extensions in a plugin, you will find that it is much
more easier now:
* You don't need to copy all the files of the default theme to
create a new one. Just copy the files you need to override.
[/quote]
[quote]
The generator templates are cut into small parts that can be
overridden independently, and the actions can also be changed one by
one.
However, if you want to override those for several modules in the same
way, you should probably create a reusable theme. A theme is a sub-set
of templates and actions that can be used by an administration module
if specified in the theme value at the beginning of generator.yml.
With the default theme, symfony uses the files defined in
$sf_symfony_lib_dir/plugins/sfPropelPlugin/data/generator/
sfPropelModule/admin/.
The theme files must be located in a project tree structure, in a data/
generator/sfPropelModule/[theme_name]/ directory, and you can
bootstrap a new theme by copying the files you want to override from
the default theme (located in $sf_symfony_lib_dir/plugins/
sfPropelPlugin/data/generator/sfPropelModule/admin/ directory):
[/quote]
So what i did :
I created a plugin and activated it (plugins/
tmpPropelGeneratorThemePlugin). Then i created the directory structure
from the instructions (above). See screenshot : http://www.shareapic.com/public/view/29772 Now i just copied the indexSuccess and added some various "blabla" in
the template to check if the template is used.
[?php use_helper('I18N', 'Date') ?] [?php include_partial('profile/
assets') ?]
[?php echo
Fatal error: Call to a member function getValue() on a non-object in /
home/gnelisse/projects_local/trackmypeople/webroot/lib/core/lib/
generator/sfModelGenerator.class.php on line 284
If anyone can help me I will write a wiki tutorial on overriding the
admin generator as the one on the wiki is outdated.
Discussion subject changed to "Re : [symfony-users] Re: Re : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View" by Loïc Vernet
You can't because the 1.3 admin-gen could be totally different....
But i suppose you coul't make symbolic link in your plugin to the default admin-gen theme to achieve that. :)
________________________________
De : DigitalBase <i...@digitalbase.eu>
À : symfony users <symfony-users@googlegroups.com>
Envoyé le : Vendredi, 7 Novembre 2008, 21h32mn 21s
Objet : [symfony-users] Re: Re : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View
On Nov 7, 9:29 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> Did you read the tutorial ?
> This exactly what you want to achieve, modify the admin generator so you don't have to ovveride the partials in all you admin-gen modules.
> I tagged this tutorial as a sf 1.0 tutorial, as the batch feature is already in the 1.1 and 1.2.
> Read the comments, this tutorial just work well. And you will also be able to extend a 1.1 or 1.2 admin gen in the same way
> (not tested in 1.2 but it should be quiet the same ?)
> ++ See you tomorrow on IRC, i can help.
Again, no this tutorial is not what i am trying to achieve. I do not
want to copy the entire admin generator skeleton & templates as they
will still change in the upcoming versions 1.2 & 1.3...
I just want to create an admin generator theme with ONLY the templates
_paginator.php en _list_th_header (or whatever that is called).
Symfony needs to use the other partials/components from the default
admin generator, same for the actions etc...
The one i am trying 1.2BET1 already includes the 'new' admin
generator. In the blog of Fabien he writes :
If you want to tweak the admin generator to create your own theme, or
to bundle your extensions in a plugin, you will find that it is much
more easier now:
* You don't need to copy all the files of the default theme to
create a new one. Just copy the files you need to override.
This is exactly what i am trying todo. I do appreciate your help, but
i have created many 1.0 & 1.1 admin generator themes without a
problem. This problem is different.
On Nov 7, 9:40 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> You can't because the 1.3 admin-gen could be totally different....
> But i suppose you coul't make symbolic link in your plugin to the default admin-gen theme to achieve that. :)
> ________________________________
> De : DigitalBase <i...@digitalbase.eu>
> À : symfony users <symfony-users@googlegroups.com>
> Envoyé le : Vendredi, 7 Novembre 2008, 21h32mn 21s
> Objet : [symfony-users] Re: Re : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View
> On Nov 7, 9:29 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> > Did you read the tutorial ?
> > This exactly what you want to achieve, modify the admin generator so you don't have to ovveride the partials in all you admin-gen modules.
> > I tagged this tutorial as a sf 1.0 tutorial, as the batch feature is already in the 1.1 and 1.2.
> > Read the comments, this tutorial just work well. And you will also be able to extend a 1.1 or 1.2 admin gen in the same way
> > (not tested in 1.2 but it should be quiet the same ?)
> > ++ See you tomorrow on IRC, i can help.
> Again, no this tutorial is not what i am trying to achieve. I do not
> want to copy the entire admin generator skeleton & templates as they
> will still change in the upcoming versions 1.2 & 1.3...
> I just want to create an admin generator theme with ONLY the templates
> _paginator.php en _list_th_header (or whatever that is called).
> Symfony needs to use the other partials/components from the default
> admin generator, same for the actions etc...
________________________________
De : DigitalBase <i...@digitalbase.eu>
À : symfony users <symfony-users@googlegroups.com>
Envoyé le : Vendredi, 7 Novembre 2008, 21h45mn 15s
Objet : [symfony-users] Re: Re : [symfony-users] Re: Re : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View
The one i am trying 1.2BET1 already includes the 'new' admin
generator. In the blog of Fabien he writes :
If you want to tweak the admin generator to create your own theme, or
to bundle your extensions in a plugin, you will find that it is much
more easier now:
* You don't need to copy all the files of the default theme to
create a new one. Just copy the files you need to override.
This is exactly what i am trying todo. I do appreciate your help, but
i have created many 1.0 & 1.1 admin generator themes without a
problem. This problem is different.
On Nov 7, 9:40 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> You can't because the 1.3 admin-gen could be totally different....
> But i suppose you coul't make symbolic link in your plugin to the default admin-gen theme to achieve that. :)
> ________________________________
> De : DigitalBase <i...@digitalbase.eu>
> À : symfony users <symfony-users@googlegroups.com>
> Envoyé le : Vendredi, 7 Novembre 2008, 21h32mn 21s
> Objet : [symfony-users] Re: Re : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View
> On Nov 7, 9:29 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> > Did you read the tutorial ?
> > This exactly what you want to achieve, modify the admin generator so you don't have to ovveride the partials in all you admin-gen modules.
> > I tagged this tutorial as a sf 1.0 tutorial, as the batch feature is already in the 1.1 and 1.2.
> > Read the comments, this tutorial just work well. And you will also be able to extend a 1.1 or 1.2 admin gen in the same way
> > (not tested in 1.2 but it should be quiet the same ?)
> > ++ See you tomorrow on IRC, i can help.
> Again, no this tutorial is not what i am trying to achieve. I do not
> want to copy the entire admin generator skeleton & templates as they
> will still change in the upcoming versions 1.2 & 1.3...
> I just want to create an admin generator theme with ONLY the templates
> _paginator.php en _list_th_header (or whatever that is called).
> Symfony needs to use the other partials/components from the default
> admin generator, same for the actions etc...
> ________________________________
> De : DigitalBase <i...@digitalbase.eu>
> À : symfony users <symfony-users@googlegroups.com>
> Envoyé le : Vendredi, 7 Novembre 2008, 21h45mn 15s
> Objet : [symfony-users] Re: Re : [symfony-users] Re: Re : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View
> The one i am trying 1.2BET1 already includes the 'new' admin
> generator. In the blog of Fabien he writes :
> If you want to tweak the admin generator to create your own theme, or
> to bundle your extensions in a plugin, you will find that it is much
> more easier now:
> * You don't need to copy all the files of the default theme to
> create a new one. Just copy the files you need to override.
> This is exactly what i am trying todo. I do appreciate your help, but
> i have created many 1.0 & 1.1 admin generator themes without a
> problem. This problem is different.
> On Nov 7, 9:40 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> > You can't because the 1.3 admin-gen could be totally different....
> > But i suppose you coul't make symbolic link in your plugin to the default admin-gen theme to achieve that. :)
> > ________________________________
> > De : DigitalBase <i...@digitalbase.eu>
> > À : symfony users <symfony-users@googlegroups.com>
> > Envoyé le : Vendredi, 7 Novembre 2008, 21h32mn 21s
> > Objet : [symfony-users] Re: Re : [symfony-users] Re: Re : [symfony-users] Admin Gen 1.2 - Customise Baseurl or Pass parameters to List View
> > On Nov 7, 9:29 pm, Loïc Vernet <qrf_c...@yahoo.fr> wrote:
> > > Did you read the tutorial ?
> > > This exactly what you want to achieve, modify the admin generator so you don't have to ovveride the partials in all you admin-gen modules.
> > > I tagged this tutorial as a sf 1.0 tutorial, as the batch feature is already in the 1.1 and 1.2.
> > > Read the comments, this tutorial just work well. And you will also be able to extend a 1.1 or 1.2 admin gen in the same way
> > > (not tested in 1.2 but it should be quiet the same ?)
> > > ++ See you tomorrow on IRC, i can help.
> > Again, no this tutorial is not what i am trying to achieve. I do not
> > want to copy the entire admin generator skeleton & templates as they
> > will still change in the upcoming versions 1.2 & 1.3...
> > I just want to create an admin generator theme with ONLY the templates
> > _paginator.php en _list_th_header (or whatever that is called).
> > Symfony needs to use the other partials/components from the default
> > admin generator, same for the actions etc...
Hope this help if I understood your question correctly. Please let us
know.
In the generated actions class of the new admin gen in sf 1.2, the
executeFilter(sfWebRequest $request) function does not merged
parameter with the existing filters. Thus from an author index page,
if you create an action to link from an author directly to its list of
articles (i.e. http://..//backend_dev.php/articles/filter?author_id=1,
you are redirected to your articles index page but nothing is
filtered.
To achieve my gooal I have overwrited the executeFilter method by
modifying the line :
$this->setFilters($this->filters->getValues()) to $this->setFilters
(array_merge($this->filters->getValues(), $request->getParameterHolder
()->getAll()));
=> I have tested both with sfpropelplugin and sfdoctrineplugin. It
also populates your filter form.
Note that I opened a ticket for it (please visit :
http://trac.symfony-project.org/ticket/4871) but I do not know if it
will be included in the generator regarding Fabiens' answer.