Extending the admin console

There’s a need to enhance the admin console outside the core product.
Some ideas could be a dashboard/stats page, asset manager, manage
comments, etc… I’m thinking that an extension to the admin console
would basically be a simple Rails controller. There will be a little
DSL for defining plugins and who can access them. The plugin would
either create a tab into the main admin navigation or possibly be a
second level menu item in one of the existing tabs. Once a plugin is
registered it will be accessible via the route
/admin/plugins/. Below is an example of how you would
create a plugin:

init.rb
require ‘dashboard_controller’
require ‘dashboard_helper’

AdminPluginManager.define "dashboard" do
      description %{
            Manage Dashboard
      }
      author "Scott F. Walter"
      version "1.0.0"
    radiant_version_required "0.5"
    role_required "admin"


      add_tab 'The Dashboard', DashboardController, :display_order 

=> 1

    or

    add_to_tab 'dashboard', 'Sub Item', DashboardController, 

:display_order => 1
end

dashboard_controller.rb

class DashboardController < AdminPluginController
      def index
            render :text => 'I am Dashboard.  Hear me roar!'
      end
end

DashboardController.configure_template_root __FILE__

dashboard_helper.rb

module DashboardHelper
end

Let me know what you think! I’m also starting to think about how the
existing forms (page, parts, snippets, layout) can be extended. For
example pages don’t have any tagging/taxonomy assoicated with them.
Wouldn’t be cool if a plugin could be developed that could add a tag
field to the existing forms.

cheers,

scott


What’s an Intel chip doing in a Mac? A whole lor more that it’s ever
done in a PC.

My Digital Life - http://scottwalter.com/blog
Pro:Blog - http://scottwalter.com/problog
Snippets - http://snippets.scottwalter.com

On 11-Jul-2006 18:40 -0700, Scott W. was heard to say:

menu item in one of the existing tabs. Once a plugin is registered it
will be accessible via the route /admin/plugins/.

I have been working on a plugin system before which allows plugins to
add
their own controllers and routes to the system. I like the idea of
making a
plugin’s controller accessible by an automatically generated route based
on the plugin’s/controller’s name. However, we should also allow plugins
to
provide controllers that are supposed to be accessed outside of the
admin
interface and for which you would want to add custom routes. E.g.
/*page/comments, could be a route that invokes a speacial comments
controller.

Oliver

On 11-Jul-2006 18:40 -0700, Scott W. was heard to say:

Let me know what you think! I’m also starting to think about how the
existing forms (page, parts, snippets, layout) can be extended. For
example pages don’t have any tagging/taxonomy assoicated with them.
Wouldn’t be cool if a plugin could be developed that could add a tag
field to the existing forms.

Sorry for replying a second time. I think the easiest thing to do this
is
to allow a plugin to register fields with a certain form and associate
appropriate getter/setter methods with a field. The getter/setter
methods
have to be called in some well defined context, i.e. the page object,
such
that the plugin’s implementation can take care of associating the
addition
values with the page.

Oliver

I actually got that helper callback system working like I had planned
on… I’ve used it to add a textarea for entering trackbacks on the new
and edit pages… I’m going to use it to create a small comment manager
on each page under the main page form after the submit buttons; maybe
ajax style. The number of callbacks is actually surpisingly low… only
about 12 to modify the edit/new forms for pages, snippets, and layouts.
This doesn’t yet include adding new tabs. Anyone interested in seeing
the code?

I think the earlier post about having a special action like
/admin/plugins/:plugin_name is really great because it allows you to add
new functionality easily. It doesn’t however allow you to modify the
existing create/edit forms which is where I suspect a lot of
functionality would want to live for the sake of simplicity. I am
working tonight on extending the controllers with filters in some way,
this might require a call to a special callback chain manager, which is
how I did the other view callbacks.

Josh

Yes can you please post some code so I don’t have to reinvent the wheel.
I would like to test it out to implement functionality such as being
able to add a category to a page.

Thanks in advance. Scott.


What’s an Intel chip doing in a Mac? A whole lor more that it’s ever
done in a PC.

My Digital Life - http://scottwalter.com/blog
Pro:Blog - http://scottwalter.com/problog
Snippets - http://snippets.scottwalter.com

----- Original Message ----
From: Josh F. [email protected]
To: [email protected]
Cc: Scott W. [email protected]
Sent: Wednesday, July 12, 2006 1:36:24 AM
Subject: Re: [Radiant] Extending the admin console

I actually got that helper callback system working like I had planned
on… I’ve used it to add a textarea for entering trackbacks on the new
and edit pages… I’m going to use it to create a small comment manager
on each page under the main page form after the submit buttons; maybe
ajax style. The number of callbacks is actually surpisingly low… only
about 12 to modify the edit/new forms for pages, snippets, and layouts.
This doesn’t yet include adding new tabs. Anyone interested in seeing
the code?

I think the earlier post about having a special action like
/admin/plugins/:plugin_name is really great because it allows you to add
new functionality easily. It doesn’t however allow you to modify the
existing create/edit forms which is where I suspect a lot of
functionality would want to live for the sake of simplicity. I am
working tonight on extending the controllers with filters in some way,
this might require a call to a special callback chain manager, which is
how I did the other view callbacks.

Josh

I would very much like to see your code as well…

On Jul 12, 2006, at 3:38 PM, Scott W. wrote:

Subject: Re: [Radiant] Extending the admin console

Wouldn’t be cool if a plugin could be developed that could add a
have to be called in some well defined context, i.e. the page

http://lists.radiantcms.org/mailman/listinfo/radiant

Jeroen J.
Laika online entertainment