@@ -50,7 +50,7 class AdminController < ApplicationController | |||
|
50 | 50 | end |
|
51 | 51 | |
|
52 | 52 | def plugins |
|
53 | @plugins = Redmine::Plugin.registered_plugins | |
|
53 | @plugins = Redmine::Plugin.registered_plugins.values.sort | |
|
54 | 54 | end |
|
55 | 55 | |
|
56 | 56 | # Loads the default configuration |
@@ -2,13 +2,13 | |||
|
2 | 2 | |
|
3 | 3 | <% if @plugins.any? %> |
|
4 | 4 | <table class="list"> |
|
5 |
<% @plugins |
|
|
5 | <% @plugins.each do |plugin| %> | |
|
6 | 6 | <tr class="<%= cycle('odd', 'even') %>"> |
|
7 |
<td><%=h |
|
|
8 |
<td><%=h |
|
|
9 |
<td><%=h |
|
|
10 |
<td><%=h |
|
|
11 |
<td><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin. |
|
|
7 | <td><%=h plugin.name %></td> | |
|
8 | <td><%=h plugin.description %></td> | |
|
9 | <td><%=h plugin.author %></td> | |
|
10 | <td><%=h plugin.version %></td> | |
|
11 | <td><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %></td> | |
|
12 | 12 | </tr> |
|
13 | 13 | <% end %> |
|
14 | 14 | </table> |
@@ -56,12 +56,21 module Redmine #:nodoc: | |||
|
56 | 56 | end |
|
57 | 57 | end |
|
58 | 58 | def_field :name, :description, :author, :version, :settings |
|
59 | ||
|
59 | attr_reader :id | |
|
60 | ||
|
60 | 61 | # Plugin constructor |
|
61 |
def self.register( |
|
|
62 | p = new | |
|
62 | def self.register(id, &block) | |
|
63 | p = new(id) | |
|
63 | 64 | p.instance_eval(&block) |
|
64 |
Plugin.registered_plugins[ |
|
|
65 | Plugin.registered_plugins[id] = p | |
|
66 | end | |
|
67 | ||
|
68 | def initialize(id) | |
|
69 | @id = id.to_sym | |
|
70 | end | |
|
71 | ||
|
72 | def <=>(plugin) | |
|
73 | self.id.to_s <=> plugin.id.to_s | |
|
65 | 74 | end |
|
66 | 75 | |
|
67 | 76 | # Adds an item to the given +menu+. |
General Comments 0
You need to be logged in to leave comments.
Login now